USB redux


512 posts   Page 6 of 21   1 ... 3, 4, 5, 6, 7, 8, 9 ... 21
by spiliot » Tue Jan 15, 2013 11:18 pm
I hope this is the correct place to post about another USB problem that is probably related to the host driver.

After trying to echo test > /dev/usb/lp0 on a thermal printer connected via USB, the pi hangs immediately. One out of three times of each hang I get a corrupted SD card that I need to rebuild.

On other linux systems I am able to print raw to /dev/usb/lp0 or via cups to usb::/Unknown/Printer (as this is how this printer is identified) to the same printer.

I have tested the setup on three v2 Pi's at hand, having either 2012-12 debian or 2012-09 arch, with or without latest firmware/kernel from rpi-config and even compiled a kernel of my own with USB Print support enabled. Power is coming from a bench PSU and tested with or without a powered hub, all with same results (pi hanging immediately on access to the port).

After enabling dmesg to send kernel debug messages on the console, I can see a never ending queue of messages that read something like (I'm not perfectly sure because the messages run so fast that I had to use a camera on fast shutter to be able to read them!):

Code: Select all
ERROR::handle_hc_chhltd_intr_dma:2131: handle_hc_chhltd_intr_dma: Channel 1, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x000000402, intsts 0x06200001


Image

An HP laser printer identified as /dev/usb/lp0 seems to work fine.

The thermal printer is identified as
Code: Select all
Bus 001 Device 004: ID 0416:5011 Winbond Electronics Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0416 Winbond Electronics Corp.
  idProduct          0x5011
  bcdDevice            2.02
  iManufacturer           1 IEEE-1284 Controlle
  iProduct                2 IEEE-1284 Controlle
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           78
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         7 Printer
      bInterfaceSubClass      1 Printer
      bInterfaceProtocol      1 Unidirectional
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass         7 Printer
      bInterfaceSubClass      1 Printer
      bInterfaceProtocol      2 Bidirectional
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       2
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol    255
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)


I'm hitting an end to my (already minimal) knowledge of debugging and I would appreciate any help to solve this.
Posts: 4
Joined: Tue Jan 15, 2013 10:32 pm
by castalla » Wed Jan 16, 2013 7:17 am
USB + Bluetooth + ethernet ?

Sorry if this is OT.

I'm clutching at straws here after days of experimentation with bluetooth.

Basically, if the bt device is switched off then the Pi crashes/locks up on ethernet.

The only way to avoid this is to issue the command:

Code: Select all
bluez-test-device disconnect [device address]


then switch the device off.

This makes using bt headsets and speakers almost useless.

I suspect it's a usb device issue, and hope somebody here can advise.

I've posted across many bluetooth threads on various forums but gotten no response.
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by castalla » Wed Jan 16, 2013 9:34 am
Concerning the bluetooth network issue (above), here's the dmesg file (I have no idea if this gives any useful info):

-------------------------------------------
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.2.27+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #250 PREEMPT Thu Oct 18 19:03:02 BST 2012
[ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: BCM2708
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] On node 0 totalpages: 61440
[ 0.000000] free_area_init_node: node 0, pgdat c050db28, node_mem_map c05b6000
[ 0.000000] Normal zone: 480 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 60960 pages, LIFO batch:15
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 60960
[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0x4 bcm2708.serial=0x8f9c86fb smsc95xx.macaddr=B8:27:EB:9C:86:FB sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0xf000000 vc_mem.mem_size=0x10000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 rootwait
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Memory: 240MB = 240MB total
[ 0.000000] Memory: 237744k/237744k available, 8016k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xcf800000 - 0xe8000000 ( 392 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xcf000000 ( 240 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc04c0e78 (4836 kB)
[ 0.000000] .init : 0xc04c1000 - 0xc04e0b10 ( 127 kB)
[ 0.000000] .data : 0xc04e2000 - 0xc050e1c0 ( 177 kB)
[ 0.000000] .bss : 0xc050e1e4 - 0xc05b5128 ( 668 kB)
[ 0.000000] NR_IRQS:330
[ 0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4294967ms
[ 0.000000] timer_set_mode: unhandled mode:1
[ 0.000000] timer_set_mode: unhandled mode:3
[ 0.000000] Console: colour dummy device 80x30
[ 0.000000] console [tty1] enabled
[ 0.000941] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[ 0.060149] pid_max: default: 32768 minimum: 301
[ 0.060627] Mount-cache hash table entries: 512
[ 0.061115] Initializing cgroup subsys cpuacct
[ 0.061205] Initializing cgroup subsys devices
[ 0.061240] Initializing cgroup subsys freezer
[ 0.061270] Initializing cgroup subsys blkio
[ 0.061414] CPU: Testing write buffer coherency: ok
[ 0.061767] hw perfevents: enabled with v6 PMU driver, 3 counters available
[ 0.062984] devtmpfs: initialized
[ 0.073404] NET: Registered protocol family 16
[ 0.074098] bcm2708.uart_clock = 0
[ 0.075723] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[ 0.075782] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.075821] mailbox: Broadcom VideoCore Mailbox driver
[ 0.075929] bcm2708_vcio: mailbox at f200b880
[ 0.076033] bcm_power: Broadcom power driver
[ 0.076071] bcm_power_open() -> 0
[ 0.076096] bcm_power_request(0, 8)
[ 0.576773] bcm_mailbox_read -> 00000080, 0
[ 0.576811] bcm_power_request -> 0
[ 0.576837] Serial: AMBA PL011 UART driver
[ 0.576994] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83) is a PL011 rev3
[ 0.885113] console [ttyAMA0] enabled
[ 0.910627] bio: create slab <bio-0> at 0
[ 0.915852] SCSI subsystem initialized
[ 0.919846] usbcore: registered new interface driver usbfs
[ 0.925574] usbcore: registered new interface driver hub
[ 0.931161] usbcore: registered new device driver usb
[ 0.937211] Switching to clocksource stc
[ 0.941457] FS-Cache: Loaded
[ 0.944638] CacheFiles: Loaded
[ 0.961340] NET: Registered protocol family 2
[ 0.966175] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.974248] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.981747] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.988391] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.994813] TCP reno registered
[ 0.997981] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.003896] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.010683] NET: Registered protocol family 1
[ 1.015868] RPC: Registered named UNIX socket transport module.
[ 1.021995] RPC: Registered udp transport module.
[ 1.026719] RPC: Registered tcp transport module.
[ 1.031468] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.038213] bcm2708_dma: DMA manager at cf808000
[ 1.043012] bcm2708_gpio: bcm2708_gpio_probe c04e9c18
[ 1.048471] vc-mem: phys_addr:0x00000000 mem_base=0x0f000000 mem_size:0x10000000(256 MiB)
[ 1.057775] audit: initializing netlink socket (disabled)
[ 1.063326] type=2000 audit(0.750:1): initialized
[ 1.179815] VFS: Disk quotas dquot_6.5.2
[ 1.184061] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 1.191615] FS-Cache: Netfs 'nfs' registered for caching
[ 1.197878] msgmni has been set to 464
[ 1.203746] io scheduler noop registered
[ 1.207715] io scheduler deadline registered
[ 1.212290] io scheduler cfq registered (default)
[ 1.239707] Console: switching to colour frame buffer device 82x26
[ 1.252131] kgdb: Registered I/O driver kgdboc.
[ 1.268485] brd: module loaded
[ 1.278836] loop: module loaded
[ 1.284996] vcos: [1]: vchiq_init_state: slot_zero = 0xffd80000, is_master = 0
[ 1.294730] vcos: [1]: vchiq_init_state: called
[ 1.302421] vcos: [1]: vchiq: initialised - version 2 (min 2), device 252.0
[ 1.312399] usbcore: registered new interface driver smsc95xx
[ 1.320408] cdc_ncm: 04-Aug-2011
[ 1.326025] usbcore: registered new interface driver cdc_ncm
[ 1.333970] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.547082] Core Release: 2.80a
[ 1.552503] Setting default values for core params
[ 1.559428] Finished setting default values for core params
[ 1.772327] Using Buffer DMA mode
[ 1.777735] Periodic Transfer Interrupt Enhancement - disabled
[ 1.785729] Multiprocessor Interrupt Enhancement - disabled
[ 1.793457] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 1.799936] Dedicated Tx FIFOs mode
[ 1.805817] dwc_otg: Microframe scheduler enabled
[ 1.805870] dwc_otg bcm2708_usb: DWC OTG Controller
[ 1.813194] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[ 1.822774] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000
[ 1.830467] Init: Port Power? op_state=1
[ 1.836582] Init: Power Port (0)
[ 1.842113] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.851103] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.860564] usb usb1: Product: DWC OTG Controller
[ 1.867519] usb usb1: Manufacturer: Linux 3.2.27+ dwc_otg_hcd
[ 1.875468] usb usb1: SerialNumber: bcm2708_usb
[ 1.883071] hub 1-0:1.0: USB hub found
[ 1.888974] hub 1-0:1.0: 1 port detected
[ 1.895744] dwc_otg: FIQ enabled
[ 1.895762] dwc_otg: NAK holdoff enabled
[ 1.895783] Module dwc_common_port init
[ 1.896129] usbcore: registered new interface driver uas
[ 1.903636] Initializing USB Mass Storage driver...
[ 1.910808] usbcore: registered new interface driver usb-storage
[ 1.918993] USB Mass Storage support registered.
[ 1.925974] usbcore: registered new interface driver libusual
[ 1.934293] mousedev: PS/2 mouse device common for all mice
[ 1.942902] bcm2835-cpufreq: min=700000 max=700000 cur=700000
[ 1.948759] bcm2835-cpufreq: switching to governor powersave
[ 1.956589] bcm2835-cpufreq: switching to governor powersave
[ 1.964473] cpuidle: using governor ladder
[ 1.972646] cpuidle: using governor menu
[ 1.978599] sdhci: Secure Digital Host Controller Interface driver
[ 1.986802] sdhci: Copyright(c) Pierre Ossman
[ 1.993427] sdhci: Enable low-latency mode
[ 1.999491] bcm_power_open() -> 1
[ 2.005037] Registered led device: mmc0::
[ 2.006504] mmc0: SDHCI controller on BCM2708_Arasan [platform] using platform's DMA
[ 2.018436] mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77
[ 2.026502] sdhci-pltfm: SDHCI platform and OF driver helper
[ 2.035719] Registered led device: led0
[ 2.036115] usbcore: registered new interface driver usbhid
[ 2.043904] usbhid: USB HID core driver
[ 2.051071] TCP cubic registered
[ 2.056577] Initializing XFRM netlink socket
[ 2.065203] NET: Registered protocol family 17
[ 2.075051] Registering the dns_resolver key type
[ 2.084159] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[ 2.098307] Indeed it is in host mode hprt0 = 00021501
[ 2.110932] registered taskstats version 1
[ 2.131391] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 2.151821] Waiting for root device /dev/mmcblk0p3...
[ 2.217840] mmc0: problem reading SD Status register.
[ 2.232613] mmc0: new high speed SDHC card at address b5f2
[ 2.241126] mmcblk0: mmc0:b5f2 SD08G 7.42 GiB
[ 2.249743] mmcblk0: p1 p3
[ 2.311310] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 2.320855] Indeed it is in host mode hprt0 = 00001101
[ 2.551519] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[ 2.560503] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.570856] hub 1-1:1.0: USB hub found
[ 2.577056] hub 1-1:1.0: 3 ports detected
[ 2.861371] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 2.971782] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 2.980987] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.993814] smsc95xx v1.0.4
[ 3.056576] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:9c:86:fb
[ 3.151426] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[ 3.273462] usb 1-1.2: New USB device found, idVendor=0a12, idProduct=0001
[ 3.282848] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 3.580929] EXT4-fs (mmcblk0p3): recovery complete
[ 3.598530] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 3.611628] VFS: Mounted root (ext4 filesystem) on device 179:3.
[ 3.623530] devtmpfs: mounted
[ 3.629963] Freeing init memory: 124K
[ 4.997910] udevd[138]: starting version 175
[ 5.908936] bcm2708_i2c bcm2708_i2c.0: BSC0 Controller at 0x20205000 (irq 79) (baudrate 100k)
[ 6.125077] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)
[ 6.193638] bcm2708_i2c bcm2708_i2c.1: BSC1 Controller at 0x20804000 (irq 79) (baudrate 100k)
[ 6.480981] Bluetooth: Core ver 2.16
[ 6.811878] NET: Registered protocol family 31
[ 6.818796] Bluetooth: HCI device and connection manager initialized
[ 7.063168] Bluetooth: HCI socket layer initialized
[ 7.070488] Bluetooth: L2CAP socket layer initialized
[ 7.172691] Bluetooth: SCO socket layer initialized
[ 7.180998] Bluetooth: Generic Bluetooth USB driver ver 0.6
[ 7.216449] usbcore: registered new interface driver btusb
[ 8.261259] Bluetooth: hci0 command tx timeout
[ 9.261262] Bluetooth: hci0 command tx timeout
[ 10.261264] Bluetooth: hci0 command tx timeout
[ 11.337727] EXT4-fs (mmcblk0p3): re-mounted. Opts: (null)
[ 11.895570] EXT4-fs (mmcblk0p3): re-mounted. Opts: errors=remount-ro
[ 12.830829] bcm2835 ALSA card created!
[ 12.844733] bcm2835 ALSA chip created!
[ 12.850936] bcm2835 ALSA chip created!
[ 12.869656] bcm2835 ALSA chip created!
[ 12.881577] bcm2835 ALSA chip created!
[ 12.887548] bcm2835 ALSA chip created!
[ 12.902461] bcm2835 ALSA chip created!
[ 12.911344] bcm2835 ALSA chip created!
[ 22.085765] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[ 29.579033] CIFS VFS: default security mechanism requested. The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.3
[ 31.449051] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[ 37.337504] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 37.355202] Bluetooth: BNEP filters: protocol multicast
[ 37.421666] Bluetooth: RFCOMM TTY layer initialized
[ 37.429197] Bluetooth: RFCOMM socket layer initialized
[ 37.445683] Bluetooth: RFCOMM ver 1.11
[ 124.760116] input: 10:B7:F6:00:46:40 as /devices/virtual/input/input0

----------------------------------------------------------------------------------------------------
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by spiliot » Fri Jan 18, 2013 3:30 pm
I just submitted a pull request for a blind fix of the driver which in my case solved the problem of raspberry halting, explained a couple of messages before.

https://github.com/raspberrypi/linux/pull/195

I have no knowledge of how the USB driver works so this needs review cause it might have further implications that I'm unaware of.

I'm also including a compiled (3.6.11) kernel containing the fix, in case someone wants to try it without compiling. Download it from here http://ubuntuone.com/2LFgcHKL49ozryWB1gSSoq place it in /boot/ and load it from config.txt with kernel=kernel-3.6.11-usb-fix.img
Posts: 4
Joined: Tue Jan 15, 2013 10:32 pm
by castalla » Fri Jan 18, 2013 4:05 pm
Tried your fix - killed my distro!

probably my noobie skills!
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by spiliot » Fri Jan 18, 2013 4:37 pm
Although you don't explain what exactly "killed my distro" means, I guess it doesn't boot because it can't find the modules for the kernel where it expects them to be. Since adding a new kernel directive isn't destructive by any means, you should be able to revert the changes simply by deleting or commenting out the kernel=<whatever> command in config.txt. No need to reinstall anything.

To be able to use the "fixed" kernel you need to be on the latest kernel (3.6.11) and firmware, which should easily be done by updating your system with rpi-update (instructions are to be found in the forum). First rpi-update then change the kernel - as rpi-update will pull the 3.6.11+ modules the kernel needs.

My apologies for not mentioning this earlier.
Posts: 4
Joined: Tue Jan 15, 2013 10:32 pm
by castalla » Fri Jan 18, 2013 4:42 pm
yep - it won't boot .... so no way to edit the config.txt?

The kernel I had was from 13 jan 2013 - I've forgotten what version number was.
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by dom » Fri Jan 18, 2013 4:44 pm
castalla wrote:yep - it won't boot .... so no way to edit the config.txt?

Put the sdcard into a windows (or mac/linux) machine and edit config.txt with notepad.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3997
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by castalla » Fri Jan 18, 2013 5:00 pm
Thanks! Learned something new!

Here's uname -a

Linux squeezeplug 3.6.11+ #358 PREEMPT Tue Jan 15 00:45:33 GMT 2013 armv6l GNU/Linux
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by castalla » Fri Jan 18, 2013 6:20 pm
Applied patched kernel - sadly doesn't fix my bluetooth problem.

Worth a try - thanks.
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by with ice cream » Sun Jan 27, 2013 7:22 am
Using 3.6.11+ #362 PREEMPT Tue Jan 22 14:52:21 GMT 2013 and my 320 x 240 LCD display still crashes when bigger chunks of data get pushed to it (eg. when loading the lcd4linux splash screen or bigger images). My 128 x 128 display woks.

The error message says "bulk write: Resource temporarily unavailable". I know I can avoid the splash screen by starting lcd4linux with the "-q" option but then the screen doesn't start with a black background and it looks ugly. Loading a black image as background layer causes a crash again (as may be expected). Crippling the bus to USB 1 speed also helps but then everything else (USB wifi, USB sound card, webcam) becomes unusable.

Is there any hope that this can be fixed or is it a hardware problem? I may have written this before but would disabling LAN free up resources?
User avatar
Posts: 108
Joined: Mon Jul 30, 2012 7:25 am
by obcd » Sun Jan 27, 2013 8:53 am
There was a description how to disable the lan in the motorola lapdock thread. Older kernels had a problem with a limited number of rotating endpoints. (Not sure if I have this term right), but on the more recent kernels this should be fixed. I don't think it will help much to disable the wired lan.

Is anybody following the development twitters about this?
Someone is fulltime working on the rewrite of the driver, but what's the status at the moment?
Is this the full rewrite on Arm that will later be impemented on the vector graphics processor?
Posts: 890
Joined: Sun Jul 29, 2012 9:06 pm
by jamesh » Sun Jan 27, 2013 9:11 am
obcd wrote:There was a description how to disable the lan in the motorola lapdock thread. Older kernels had a problem with a limited number of rotating endpoints. (Not sure if I have this term right), but on the more recent kernels this should be fixed. I don't think it will help much to disable the wired lan.

Is anybody following the development twitters about this?
Someone is fulltime working on the rewrite of the driver, but what's the status at the moment?
Is this the full rewrite on Arm that will later be impemented on the vector graphics processor?


It's not a rewrite of the whole driver- just moving some parts of it in to a FIQ. Not sure we will push anything on to the GPU at this stage.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11557
Joined: Sat Jul 30, 2011 7:41 pm
by obcd » Sun Jan 27, 2013 10:22 am
Moving some parts in to a FIQ will fix the "low speed usb device split transaction issues" as there is a better latency control.
How will it affect streaming usb devices like webcams and usb audio adapters?
Posts: 890
Joined: Sun Jul 29, 2012 9:06 pm
by jamesh » Sun Jan 27, 2013 10:35 am
obcd wrote:Moving some parts in to a FIQ will fix the "low speed usb device split transaction issues" as there is a better latency control.
How will it affect streaming usb devices like webcams and usb audio adapters?


Gordon's the expert, but I believe that is a different problem. I guess he will get on to that once the FIQ stuff is done. Unless someone else comes in and helps too.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11557
Joined: Sat Jul 30, 2011 7:41 pm
by obcd » Sun Jan 27, 2013 11:02 am
In order to fix an issue, you need to know what's causing it.
I know the driver is open source, but it's giant and not very well documented.
So, supose someone is willing to help, what would be a start?
Is there an irc channel that can be used to exchange ideas about it?
I can understand Gordon isn't having time to explain in detail what he is doing so far, as most (likely including me) wouldn't understand the details.
I also know I can check github, but that is only showing finished work, nothing about the work in progress.
Posts: 890
Joined: Sun Jul 29, 2012 9:06 pm
by castalla » Sun Jan 27, 2013 11:34 am
As an ordinary noobie user, I'd just like some kind of announcement somewhere which tells us to do an rpi-update when something is fixed! Or am I missing something everybody knows about?
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by redhawk » Sun Jan 27, 2013 11:09 pm
I have a number of USB devices that are not working properly with Raspbian (just update/upgrade tonight).

My first problem device is a Bluetooth dongle from Poundland I can start the Pi with it already attached and even lsusb shows it's detected:
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
but...
root@raspberrypi:~# hcitool scan
Device is not available: No such device
I have to physically remote the dongle from the USB port and reinsert it to get it working.
I'm not sure if this is a USB driver issue but it's really annoying nevertheless.

Is there a way to force a USB device to reset without physically moving it??

As for other devices I have a few webcams that still don't work well on the Pi:
- Creative notebook cam - PD1170
very dark images and corrupted jpgs
USB 1.1 only device

- Trust webcam "eMPIA Technology, Inc. M035 Compact Web Cam"
cannot capture 640x480 always corrupted images
capture at 352x288 usually error free.
device is USB 2.0, (will not work in USB 1.1 mode)

So far only my Logitech Pro 5000 seems to capture reliable 640x480 images however if I use a USB hub then I get occasional corruption.

My main post concerns another cam I'm having trouble with (original post) viewtopic.php?f=44&t=31319&p=271263#p271263

It's a keychain video recorder / webcam also known as a "Camera 808 #3" based on the SPCA1527A/SPCA1528 chipset and fully compatible with Linux.
The first time I tried in the Pi it was working well then after further connections and reboots the device would never detect anymore.
If I connect and disconnect the USB leads several times then sometimes lsusb would show it's detected but after 2 seconds and I run lsusb again it's gone.
The voltage at the USB port is around 4.85v and should be plenty enough to power my webcam especially considering I have bridged the USB polyfuses.
The USB cable is about 40cm long and thus it shouldn't be suffering from any signal losses.
Using the same USB cable I have tested the webcam in my PC running in USB 2.0 and USB 1.1 mode without any issues.
To add to this mystery if I connect the webcam via a USB 1.1 hub (powered via Pi) then the webcam detects no problem however captures are only at USB 1.1 speeds.

I tried booting the Pi with the webcam plugged in and this is what dmseg looks like:

[ 3.833156] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[ 3.926934] udevd[137]: starting version 175
[ 4.115010] usb 1-1.3: New USB device found, idVendor=04fc, idProduct=0171
[ 4.142882] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.173951] usb 1-1.3: Product: General Image Devic
[ 4.182014] usb 1-1.3: Manufacturer: Sunplus Co Ltd
[ 4.222959] usb 1-1.3: SerialNumber: 01.00.00
[ 4.259660] scsi0 : usb-storage 1-1.3:1.0
[ 5.137773] usb 1-1.3: USB disconnect, device number 4
[ 5.393100] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[ 5.673432] usb 1-1.3: New USB device found, idVendor=04fc, idProduct=0171
[ 5.692926] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5.712927] usb 1-1.3: Product: General Image Devic
[ 5.730793] usb 1-1.3: Manufacturer: Sunplus Co Ltd
[ 5.747192] usb 1-1.3: SerialNumber: 01.00.00
[ 5.768864] scsi1 : usb-storage 1-1.3:1.0
[ 6.417943] usb 1-1.3: USB disconnect, device number 5
[ 6.673137] usb 1-1.3: new high-speed USB device number 6 using dwc_otg
[ 6.953360] usb 1-1.3: New USB device found, idVendor=04fc, idProduct=0171
[ 6.977773] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6.992905] usb 1-1.3: Product: General Image Devic
[ 7.000751] usb 1-1.3: Manufacturer: Sunplus Co Ltd
[ 7.028107] usb 1-1.3: SerialNumber: 01.00.00
[ 7.051820] usb 1-1.3: can't set config #1, error -71
[ 7.186026] usb 1-1.3: USB disconnect, device number 6
[ 7.442951] usb 1-1.3: new high-speed USB device number 7 using dwc_otg
[ 7.703087] usb 1-1.3: New USB device found, idVendor=04fc, idProduct=0171
[ 7.714893] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7.725286] usb 1-1.3: Product: General Image Devic
[ 7.733208] usb 1-1.3: Manufacturer: Sunplus Co Ltd
[ 7.741041] usb 1-1.3: SerialNumber: 01.00.00
[ 7.753149] usb 1-1.3: can't set config #1, error -71
[ 7.773506] usb 1-1.3: USB disconnect, device number 7
[ 8.023032] usb 1-1.3: new high-speed USB device number 8 using dwc_otg
[ 8.254917] usb 1-1.3: New USB device found, idVendor=04fc, idProduct=0171
[ 8.272094] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8.312871] usb 1-1.3: can't set config #1, error -71
[ 8.466060] usb 1-1.3: USB disconnect, device number 8
[ 8.723135] usb 1-1.3: new high-speed USB device number 9 using dwc_otg
[ 9.293083] usb 1-1.3: new high-speed USB device number 10 using dwc_otg
[ 9.573113] usb 1-1.3: new high-speed USB device number 11 using dwc_otg
[ 10.233088] usb 1-1.3: new high-speed USB device number 12 using dwc_otg
[ 10.753031] usb 1-1.3: new high-speed USB device number 13 using dwc_otg
[ 11.512957] usb 1-1.3: new high-speed USB device number 14 using dwc_otg
[ 12.033055] usb 1-1.3: new high-speed USB device number 15 using dwc_otg
[ 12.793027] usb 1-1.3: new high-speed USB device number 16 using dwc_otg
[ 13.562952] usb 1-1.3: new high-speed USB device number 17 using dwc_otg
[ 14.332911] usb 1-1.3: new high-speed USB device number 18 using dwc_otg
[ 14.361555] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 14.843137] usb 1-1.3: new high-speed USB device number 19 using dwc_otg
[ 15.300188] bcm2835 ALSA card created!
[ 15.314486] bcm2835 ALSA chip created!
[ 15.320825] bcm2835 ALSA chip created!
[ 15.343101] bcm2835 ALSA chip created!
[ 15.349335] bcm2835 ALSA chip created!
[ 15.363898] bcm2835 ALSA chip created!
[ 15.369964] bcm2835 ALSA chip created!
[ 15.389375] bcm2835 ALSA chip created!
[ 15.613314] usb 1-1.3: new high-speed USB device number 20 using dwc_otg
[ 16.123174] usb 1-1.3: new high-speed USB device number 21 using dwc_otg
[ 16.433094] usb 1-1.3: new high-speed USB device number 22 using dwc_otg
[ 16.773125] usb 1-1.3: new high-speed USB device number 23 using dwc_otg
[ 17.663114] usb 1-1.3: new high-speed USB device number 24 using dwc_otg
[ 17.943146] usb 1-1.3: new high-speed USB device number 25 using dwc_otg
[ 18.253188] usb 1-1.3: new high-speed USB device number 26 using dwc_otg
[ 18.753125] usb 1-1.3: new high-speed USB device number 27 using dwc_otg
[ 19.063160] usb 1-1.3: new high-speed USB device number 28 using dwc_otg
[ 19.712960] usb 1-1.3: new high-speed USB device number 29 using dwc_otg
[ 20.223179] usb 1-1.3: new high-speed USB device number 30 using dwc_otg
[ 20.993034] usb 1-1.3: new high-speed USB device number 31 using dwc_otg
[ 21.267420] mmc0: missed completion of cmd 18 DMA (512/512 [1]/[1]) - ignoring it
[ 21.278496] mmc0: DMA IRQ 6 ignored - results were reset
[ 21.763114] usb 1-1.3: new high-speed USB device number 32 using dwc_otg
[ 22.273178] usb 1-1.3: new high-speed USB device number 33 using dwc_otg
[ 23.043030] usb 1-1.3: new high-speed USB device number 34 using dwc_otg
[ 23.803135] usb 1-1.3: new high-speed USB device number 35 using dwc_otg
[ 24.573108] usb 1-1.3: new high-speed USB device number 36 using dwc_otg
[ 24.799252] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[ 25.083028] usb 1-1.3: new high-speed USB device number 37 using dwc_otg
[ 25.853131] usb 1-1.3: new high-speed USB device number 38 using dwc_otg
[ 26.363055] usb 1-1.3: new high-speed USB device number 39 using dwc_otg
[ 27.133014] usb 1-1.3: new high-speed USB device number 40 using dwc_otg
[ 27.902981] usb 1-1.3: new high-speed USB device number 41 using dwc_otg
[ 28.413070] usb 1-1.3: new high-speed USB device number 42 using dwc_otg
[ 29.183019] usb 1-1.3: new high-speed USB device number 43 using dwc_otg
[ 29.953117] usb 1-1.3: new high-speed USB device number 44 using dwc_otg
[ 30.213172] usb 1-1.3: new high-speed USB device number 45 using dwc_otg


Any idea why the Pi is having trouble identify my webcam??

Btw: I also tried adding dwc_otg.speed=1 to my boot options but it didn't help and in fact made it impossible to capture any images with my Logitech Pro 5000 webcam nor the camera 808 #3.

Any other suggestions to try out??

Richard S.
User avatar
Posts: 3318
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by redhawk » Tue Jan 29, 2013 2:20 pm
I fixed the Bluetooth problem it looks like something is deliberately taking the device offline which is different behaviour to inserting the same device after booting up.

To fix this I used: hciconfig device up

Any idea how to fix this without resorting to dirty hacks such as /etc/rc.local ??

Also can any help me get my 808 #3 webcam working with Raspbian in USB 2.0 mode??

Richard S.
User avatar
Posts: 3318
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by castalla » Tue Jan 29, 2013 2:32 pm
About the bt dongle: I've also seen this behaviour . It's up about 99% of the time on a reboot. Occasionally it's down. No idea why.

I don't think it's worth persevering with bt until the usb issues are ironed out!
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by redhawk » Tue Jan 29, 2013 3:57 pm
Despite the reported problems with Bluetooth audio I'm not experiencing any lockups or loss of Ethernet connectivity.

I also think there is a flaw in Raspbian it's not taking the device offline but rather not bothering to initialise the dongle's parameters during the booting process.
I wrote a simple script to fix this i.e. dongle name, class, pmode, imode and now my Bluetooth headset can auto-connect without any fiddling. :)

Richard S.
User avatar
Posts: 3318
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by castalla » Tue Jan 29, 2013 4:13 pm
redhawk wrote:Despite the reported problems with Bluetooth audio I'm not experiencing any lockups or loss of Ethernet connectivity.

I also think there is a flaw in Raspbian it's not taking the device offline but rather not bothering to initialise the dongle's parameters during the booting process.
I wrote a simple script to fix this i.e. dongle name, class, pmode, imode and now my Bluetooth headset can auto-connect without any fiddling. :)

Richard S.


That's interesting ... so what firmware and kernel are you using?

No lockup if you switch the headset off (which I assume you can do?)
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by redhawk » Tue Jan 29, 2013 4:46 pm
I'm using the latest firmware I did an update/upgrade last night although Bluetooth audio was working fine even before then.

My headset (BSH10) is already paired (via blueman) I simply turn it on and I get the 2 beeps to tell me it's connected to the Pi.
I run pulseaudio & via Putty to start Pulse Audio it complains about you shouldn't run as root but nevertheless it's works - I prefer to do everything as root anyway. :)
I start Music On Console via padsp mocp -R oss and play online music streams from Digitally Imported.
When the headset is turned off my Putty session is still active, when I turn on my headset it auto-connects and music playback is resumed.

I'm not sure why people are having such a hard time with Bluetooth audio but it's possible that Pulse Audio is causing a system hang and not the Bluetooth dongle itself.

Richard S.
User avatar
Posts: 3318
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by castalla » Tue Jan 29, 2013 5:20 pm
Hmm ... as far as I know the system I use hasn't got pulseaudio running - I may even have uninstalled it!

What happens if you just let the hheadset connect - don't actually play anything - but then switch it off ... still able to PuTTY? - give it a few seconds. Mine collapses after about 5-10 secs.
Posts: 469
Joined: Thu Jul 19, 2012 3:46 pm
by rajeshm » Tue Jan 29, 2013 7:16 pm
After extensive debugging I have come to the conclusion that all keyboard and other USB peripheral related problems have to do with the power supply. My guess is that the supply to the USB related circuitry is borderline and any drop at all anywhere along the path is enough to cause the board to stop responding to the USB peripherals. This problem is bad enough that with a good adapter (Apple iPad charger), a nice thick USB wire connecting the charger to the Pi but with the charger plugged into an overloaded socket at the end of a long extension cord (don't try this at home, folks) caused the Pi to stop responding to the keyboard. But when I plugged the charger directly into the wall socket, the keyboard was just fine. Note that even when the keyboard does not respond, the network connection works just fine and you can ssh to the Pi and see that everything else works as intended.

So the solution is to make sure that the supply is as good as you can make it. Exchanging the Pi for another one is probably not going to help much. They should fix this problem on the next rev of the Board.
Posts: 2
Joined: Tue Jan 29, 2013 6:57 pm