User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12023
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: USB - the Elephant in our Room

Tue Aug 21, 2012 5:39 am

MarcinM wrote:
MarcinM wrote:Yes, I have USB problems. With USB cameras, storage, WiFi. Even keyboard and mouse reset from time to time. Everything gets worse when connected to a HUB. I've measured the mythical 5V and it turned out to be about 4.9V. Then I decided to check if there is a distortion on 5V. Connected a scope and it turned out to be flat. Really flat. But then I've checked 3.3V... This one IS distorted. Voltage drops to as low as 2.85V. It's relatively quiet when there are no USB devices and no network traffic. It gets worse with USB devices connected.
I've put pictures here: http://marcin.homedns.org/~marcin/pic.html. The page is hosted on the Pi that's being measured so it may not be accessible from time to time...

Can somebody with more experience check if that may be the problem?

I've tried few caps in different places without any noticeable change. (few hundreds uF, nF and pF).
Probes were connected to P1. 3.3V looks the same measured directly on RG2.
I've made a basic mistake taking measurements. 3.3V is fine. I hope I didn't make too much confusion.
Well, that is good news, I was worried a bit about this one. ;)

dpws
Posts: 9
Joined: Sat Aug 18, 2012 2:11 pm

Re: USB - the Elephant in our Room

Tue Aug 21, 2012 8:28 am

Just in case this info helps (feel free to delete if it doesn't)

Using latest kernel (3.2.27-1) and firmware (20120820) from Arch repositories, with cmdline.txt

Code: Select all

smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 loglevel=2 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait sdhci-bcm2708.sync_after_dma=0 sdhci-bcm2708.missing_status=0 dwc_otg.microframe_schedule=1
Tests on SD card, USB powered external HDD connected directly to Pi (sda2) and USB unpowered external HDD (sdb2) connected via powered hub on the first HDD. Results from hdparm:

Code: Select all

╭─[email protected] ~  
╰─➤  sudo hdparm -Tt /dev/mmcblk0p2  

/dev/mmcblk0p2:
 Timing cached reads:   218 MB in  2.00 seconds = 108.77 MB/sec
 Timing buffered disk reads:  60 MB in  3.06 seconds =  19.58 MB/sec
╭─[email protected] ~  
╰─➤  sudo hdparm -Tt /dev/sda2       

/dev/sda2:
 Timing cached reads:   266 MB in  2.01 seconds = 132.62 MB/sec
 Timing buffered disk reads:  74 MB in  3.06 seconds =  24.21 MB/sec
╭─[email protected] ~  
╰─➤  sudo hdparm -Tt /dev/sdb2

/dev/sdb2:
 Timing cached reads:   270 MB in  2.01 seconds = 134.45 MB/sec
 Timing buffered disk reads:  56 MB in  3.01 seconds =  18.62 MB/sec

bfromcolo
Posts: 26
Joined: Sat Aug 11, 2012 11:20 pm

Re: USB - the Elephant in our Room

Tue Aug 21, 2012 1:02 pm

dom wrote:@bfromcolo
When system slows to a crawl, what does top report as the busy processes?
Are you in X or does it fail from initial console?
Does dmesg produce lots of errors?

If you set:
dwc_otg.microframe_schedule=0
does it behave better, or is it still broken?
The system is only around 10% utilized when it becomes sluggish. Top processes were: rsyslogd, xorg, top, x-terminal-emul, gksu

When I insert the wifi adapter I get this:
[ 281.242518] usb 1-1.3.4: new high-speed USB device number 9 using dwc_otg
[ 281.350658] usb 1-1.3.4: New USB device found, idVendor=0bda, idProduct=8189
[ 281.350694] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 281.350715] usb 1-1.3.4: Product: RTL8187B_WLAN_Adapter
[ 281.350731] usb 1-1.3.4: Manufacturer: Manufacturer_Realtek
[ 281.350762] usb 1-1.3.4: SerialNumber: 00e04c000001
[ 281.461316] cfg80211: Calling CRDA to update world regulatory domain
[ 281.900150] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 281.905011] ieee80211 phy0: hwaddr 00:08:54:a0:c0:a6, RTL8187BvE V0 + rtl8225z2, rfkill mask 2
[ 281.928155] rtl8187: Customer ID is 0x00
[ 281.931694] Registered led device: rtl8187-phy0::radio
[ 281.941881] Registered led device: rtl8187-phy0::tx
[ 281.946765] Registered led device: rtl8187-phy0::rx
[ 281.947787] rtl8187: wireless switch is on
[ 281.948033] usbcore: registered new interface driver rtl8187
[ 297.633072] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[ 302.633379] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000114
[ 307.633553] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[ 312.633794] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000118
[ 317.634029] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114

And the error messages repeat.

At this point I tried to launch a browser, after it started to initialize dmesg is filled with these messages which continue until I remove the wifi adapter:

[ 549.826391] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 549.834365] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 549.842387] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 549.847305] usb 1-1.3.4: USB disconnect, device number 9
[ 549.850398] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 549.864410] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[ 549.880669] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

Adding these did not change anything as far as I can tell:

dwc_otg.microframe_schedule=0
dwc_otg.speed=1

Let me know if I can provide anything else.

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: USB - the Elephant in our Room

Tue Aug 21, 2012 7:24 pm

fbutler wrote:I'll test it further tomorow night with a 10 port hub and some more devices, but so far it's looking good.
Tested again tonight with a 10 port hub and some additional devices. Again no periodic channel or other error messages.
However I did notice some very intermittent sticky keys when all of the devices were plugged in at the same time

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 006: ID 0a5c:21e8 Broadcom Corp.
Bus 001 Device 007: ID 0a81:0101 Chesen Electronics Corp. Keyboard
Bus 001 Device 008: ID 045e:0737 Microsoft Corp. Compact Optical Mouse 500
Bus 001 Device 012: ID 0424:2524 Standard Microsystems Corp. USB MultiSwitch Hub
Bus 001 Device 013: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 014: ID 20a0:0001 Clay Logic
Bus 001 Device 015: ID 050d:0102 Belkin Components Flip KVM
Bus 001 Device 016: ID 046d:c062 Logitech, Inc. LS1 Laser Mouse, corded
Bus 001 Device 017: ID 046d:0b04 Logitech, Inc.
Bus 001 Device 018: ID 046d:c713 Logitech, Inc.
Bus 001 Device 019: ID 046d:c714 Logitech, Inc. diNovo Edge Keyboard
 

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: USB - the Elephant in our Room

Tue Aug 21, 2012 7:42 pm

I have mentioned elsewhere my problems with powered USB hub mainly with Openelec - I didn't see this post!
Whilst reading here I came across a list of known good USB keyboards - WHAT? I have been using wired USB keyboards since approx USB-day-one on various servers, desktops, laptops, netbooks, ultrabooks, macbooks, iPads, PC powered test equipment under any OS you can mention (well almost, but at least 5 versions of Windows, Linux, Unix - SCO and others, iOS, QNX,) directly and through KVMs and have never, ever, not once had an 'incompatible' keyboard. Maybe I have just been lucky.

reggie
Posts: 151
Joined: Fri Aug 26, 2011 11:51 am

Re: USB - the Elephant in our Room

Tue Aug 21, 2012 10:48 pm

ppuskari wrote:I'll have to try and see if I can reproduce the failure but I was able to coax a traceback listing after plugging in my bluetooth usb dongle.

The main stack trace basically was REALLY unhappy about dma inside the usb stack it looked like... Once I get done building the USBIP modules I'll try and kill the raspi again and post the exact trace info. Maybe it'll help us?
I've got an unhappy dma/usb stack for my pwc based webcam, I'm also getting corruption on my rootfs every few boots (it fscks itself but.....).

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: USB - the Elephant in our Room

Wed Aug 22, 2012 4:52 am

As a last ditch attempt to get a working webcam I bought a Microsoft Lifecam VX-800 (second user from Amazon) on the http://elinux.org/RPi_VerifiedPeriphera ... SB_Webcams page. It does work OK except if I try to use it at its native VGA resolution and then it hangs. It doesn't continually drop out with segmentation faults like my others but not being able to use it at 640*480 is a pain. It behaves identically on a fully rpi-upated Raspdian and Arch and all the software I tried it with it including Motion. Again, like all my others it works flawlessly on my Ubuntu based PC and a hacked ARM box - Seagate Dockstar NAS with Debian squeeze at full resolution. Only one of my half dozen or so USB keyboards (Microsoft Sidewinder) and one of my dozen or so mice (Again a Microsoft) gives problems, but as I use it headless most of the time it's neither here nor there. I butchered the USB polyfuses with a soldering iron (short circuited them) and I power the PI with a 2.5 amp PSU via GPIO, I've had no problems whatever with SD cards and HDMI to a DVI monitor. None of the chips runs more than warm (and I have a IR thermometer), the warmest is the USB at around 46-48 C at 21C ambient.

For the Linux noobs out there, Linux isn't a load of pain, only Linux on the Pi.......
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: USB - the Elephant in our Room

Wed Aug 22, 2012 5:29 am

The test points don't move from 5.1 volts whatever I plug in and the Pi happily keeps running when plugging and un-plugging USB devices. I can safely say I have no power issues. :D

I haven't had any problems with WiFi adapters, because I don't use them, WiFi is the spawn of the devil, it gives problems an any platform at times. Long may it continue, I make money fixing WiFi issues on peoples computers...... Image
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: USB - the Elephant in our Room

Wed Aug 22, 2012 10:21 am

pluggy wrote:I haven't had any problems with WiFi adapters, because I don't use them, WiFi is the spawn of the devil, it gives problems an any platform at times....
Wow different world... my primary purpose in getting the RPi was as a WiFi interface that my Nexus 7 tablet (only WiFi) could mirror it's screen to the RPi for display on a 60" HDMI TV. Without WiFi the whole project would be mute. Never even used the Ethernet port on the RPi yet, don't need it . Been a flawless WiFi device.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

lazx888
Posts: 2
Joined: Wed Aug 22, 2012 4:29 pm

Re: USB - the Elephant in our Room

Wed Aug 22, 2012 5:11 pm

Using
dwc_otg.microframe_schedule=1 dwc_otg.speed=1
stops frequent disconnects of my Logitech Dinovo Edge keyboard/mouse. My (powered) usb hard drive transfer speed suffers though from the forced full speed (12Mbps) dwc_otg.speed cmdline.txt parameter.

Is there a way to set dwc_otg.speed for a single usb port?

zog
Posts: 200
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: USB - the Elephant in our Room

Wed Aug 22, 2012 11:20 pm

I think I can shed some more light on the usb problem.
First of all I upgraded my Raspbian to the latest version.
I added dwc_otg.microframe_schedule=1 to my cmdline.txt.

I have a Technika nano blue tooth adapter from tescos which has a cambridge silicon radio chip set in it.

I plugged the blue tooth adapter into one of the pi's usb ports and a powered belkin hub ( also from tesco ) into the other. To the powered hub I added a tesco value keyboard and a pixart usb optical mouse. Booting into Raspbian the keyboard works, but the mouse doesn't. If you unplug the mouse and plug it back in again it works intermitently. You can make either the mouse or the keyboard work by unplugging the other device.

Whilst in this faulty state I ran dmesg

No host channel available for periodic transfer.

ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008

INFO:: periodic_channel_available: Total channels: 8, Periodic: 6, Non-periodic: 2

INFO:: schedule_periodic: No host channel available for periodic transfer.

ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008

INFO:: periodic_channel_available: Total channels: 8, Periodic: 6, Non-periodic: 2

INFO:: schedule_periodic: No host channel available for periodic transfer.

ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008

INFO:: periodic_channel_available: Total channels: 8, Periodic: 6, Non-periodic: 2

INFO:: schedule_periodic: No host channel available for periodic transfer.

ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008

INFO:: periodic_channel_available: Total channels: 8, Periodic: 6, Non-periodic: 2

INFO:: schedule_periodic: No host channel available for periodic transfer.

ERROR::dwc_otg_hcd_urb_enqueue:487: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008

INFO:: periodic_channel_available: Total channels: 8, Periodic: 6, Non-periodic: 2

INFO:: schedule_periodic: No host channel available for periodic transfer.

This pattern of error codes is repeated rapidly addinfinitum.

lsusb showed the following

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 006: ID 04d9:1603 Holtek Semiconductor, Inc. Keyboard
Bus 001 Device 007: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse.

Under normal conditions once the blue tooth dongle is removed

dmesg return the following

Linux version 3.1.9+ ([email protected]) (gcc version 4.5.1 (Broadcom-2708) ) #66 Thu May 17 16:56:20 BST 2012
CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: BCM2708
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 57344
free_area_init_node: node 0, pgdat c03bb910, node_mem_map c0408000
Normal zone: 448 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 56896 pages, LIFO batch:15
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 56896
Kernel command line: dma.dmachans=0x3c bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708.boardrev=0x2 bcm2708.serial=0x51a3a411 smsc95xx.macaddr=B8:27:EB:A3:A4:11 dwc_otg.microframe_schedule=1 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 elevator=noop rootwait
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 224MB = 224MB total
Memory: 223208k/223208k available, 6168k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
vmalloc : 0xce800000 - 0xd8000000 ( 152 MB)
lowmem : 0xc0000000 - 0xce000000 ( 224 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0381000 (3556 kB)
.init : 0xc0381000 - 0xc039e000 ( 116 kB)
.data : 0xc039e000 - 0xc03bbfa0 ( 120 kB)
.bss : 0xc03bbfc4 - 0xc0407478 ( 302 kB)
NR_IRQS:85
timer_set_mode: unhandled mode:1
timer_set_mode: unhandled mode:3
Console: colour dummy device 80x30
console [tty1] enabled
Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
vc-mem: mm_vc_mem_phys_addr = 0x00000000
vc-mem: mm_vc_mem_size = 0x10000000 (256 MiB)
mailbox: Broadcom VideoCore Mailbox driver
bcm2708_vcio: mailbox at f200b880
bcm_power: Broadcom power driver
bcm_power_open() -> 0
bcm_power_request(0, 8)
bcm_mailbox_read -> 00000080, 0
bcm_power_request -> 0
Serial: AMBA PL011 UART driver
dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83) is a PL011 rev3
console [ttyAMA0] enabled
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource stc
FS-Cache: Loaded
CacheFiles: Loaded
Switched to NOHz mode on CPU #0
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
bcm2708_dma: DMA manager at ce808000
bcm2708_gpio: bcm2708_gpio_probe c03a3d88
vc-mem: Videocore memory driver
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
FS-Cache: Netfs 'nfs' registered for caching
msgmni has been set to 435
io scheduler noop registered (default)
io scheduler deadline registered
io scheduler cfq registered
BCM2708FB: registering framebuffer ([email protected])
bcm2708_fb_set_par info(cd888000) 1824x984 (1824x984), 0, 16
BCM2708FB: start = cec00000,4f385000 width=1824, height=984, bpp=16, pitch=3648 size=3620864 success=0
Console: switching to colour frame buffer device 228x61
BCM2708FB: register framebuffer (0)
brd: module loaded
loop: module loaded
vcos: [1]: vchiq_init_state: slot_zero = 0xffd80000, is_master = 0
vcos: [1]: vchiq_init_state: called
vcos: [1]: vchiq: initialised - version 2 (min 2), device 253.0
usbcore: registered new interface driver smsc95xx
cdc_ncm: 04-Aug-2011
usbcore: registered new interface driver cdc_ncm
dwc_otg: version 2.90b 6-MAY-2010 (platform bus)
Core Release: 2.80a
Setting default values for core params
Finished setting default values for core params
ce840008 -> 1
Using Buffer DMA mode
Periodic Transfer Interrupt Enhancement - disabled
Multiprocessor Interrupt Enhancement - disabled
Dedicated Tx FIFOs mode
dwc_otg bcm2708_usb: DWC OTG Controller
dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
dwc_otg bcm2708_usb: irq 75, io mem 0x00000000
Init: Port Power? op_state=1
Init: Power Port (0)
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: DWC OTG Controller
usb usb1: Manufacturer: Linux 3.1.9+ dwc_otg_hcd
usb usb1: SerialNumber: bcm2708_usb
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Module dwc_common_port init
usbcore: registered new interface driver uas
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver libusual
mousedev: PS/2 mouse device common for all mice
cpuidle: using governor ladder
cpuidle: using governor menu
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
bcm_power_open() -> 1
Registered led device: mmc0::
mmc0: SDHCI controller on BCM2708_Arasan [platform] using platform's DMA
mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77
sdhci-pltfm: SDHCI platform and OF driver helper
Registered led device: led0
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
Registering the dns_resolver key type
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
Waiting for root device /dev/mmcblk0p3...
mmc0: problem reading SD Status register.
mmc0: new SDHC card at address b368
mmcblk0: mmc0:b368 SMI 7.52 GiB
mmcblk0: p1 p2 p3
usb 1-1: new high speed USB device number 2 using dwc_otg
EXT4-fs (mmcblk0p3): mounted filesystem without journal. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:3.
Freeing init memory: 116K
usb 1-1: New USB device found, idVendor=0424, idProduct=9512
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 3 ports detected
usb 1-1.1: new high speed USB device number 3 using dwc_otg
usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
smsc95xx v1.0.4
smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:a3:a4:11
usb 1-1.2: new high speed USB device number 4 using dwc_otg
usb 1-1.2: New USB device found, idVendor=05e3, idProduct=0608
usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-1.2: Product: USB2.0 Hub
hub 1-1.2:1.0: USB hub found
hub 1-1.2:1.0: 4 ports detected
usb 1-1.3: new low speed USB device number 5 using dwc_otg
usb 1-1.3: New USB device found, idVendor=093a, idProduct=2510
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.3: Product: USB OPTICAL MOUSE
usb 1-1.3: Manufacturer: PIXART
input: PIXART USB OPTICAL MOUSE as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/input/input0
generic-usb 0003:093A:2510.0001: input: USB HID v1.11 Mouse [PIXART USB OPTICAL MOUSE] on usb-bcm2708_usb-1.3/input0
usb 1-1.2.2: new low speed USB device number 6 using dwc_otg
usb 1-1.2.2: New USB device found, idVendor=04d9, idProduct=1603
usb 1-1.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.2.2: Product: USB Keyboard
usb 1-1.2.2: Manufacturer:
input: USB Keyboard as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.0/input/input1
generic-usb 0003:04D9:1603.0002: input: USB HID v1.10 Keyboard [ USB Keyboard] on usb-bcm2708_usb-1.2.2/input0
input: USB Keyboard as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2:1.1/input/input2
generic-usb 0003:04D9:1603.0003: input: USB HID v1.10 Device [ USB Keyboard] on usb-bcm2708_usb-1.2.2/input1
Adding 262140k swap on /dev/mmcblk0p2. Priority:-1 extents:1 across:262140k SS
EXT4-fs (mmcblk0p3): re-mounted. Opts: (null)
EXT4-fs (mmcblk0p3): re-mounted. Opts: errors=remount-ro
Bluetooth: Core ver 2.16
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
fuse init (API version 7.17)
bcm2708_fb_check_var info(cd888000) 1824x984 (1824x984), 3620864, 16
bcm2708_fb_check_var var(cdb67cdc) 1824x984 (1824x984), 16, 1810432
bcm2708_fb_set_par info(cd888000) 1824x984 (1824x984), 3620864, 16
BCM2708FB: start = cf000000,4f6fa000 width=1824, height=984, bpp=16, pitch=3648 size=3620864 success=0


So I am guessing the reason why USB is falling over is that from time to it runs out of usb periodic channels on which to transmit URBs. The blue tooth dongle does work, as some URBs get through, but with extreamely poor performance.

My conclusion is that if the usb system becomes busy i.e by plugging in lots of devices or certain devices with a high transmit rate these lack of channel errors will occur frequently and stop the usb system from functioning.
I think the fault lies with dwc_otg the USB_HOST controller. I don't know if the number of periodic channels can be increased, but I am guessing the bandwidth per channel will be decreased if the number of channels is increased.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5287
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 12:16 am

@zog
I think you've either not got the latest kernel, or haven't applied
dwc_otg.microframe_schedule=1
to cmdline.txt.

The "no host channel..." message can't happen if both those are true.

User avatar
NickT
Posts: 271
Joined: Mon May 21, 2012 10:43 am
Location: UK

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 9:11 am

dom wrote:@zog
I think you've either not got the latest kernel, or haven't applied
dwc_otg.microframe_schedule=1
to cmdline.txt.

The "no host channel..." message can't happen if both those are true.
@zog - you definitely don't have the latest kernel as your dmesg is reporting

"Linux version 3.1.9+ ([email protected]) (gcc version 4.5.1 (Broadcom-2708) ) #66 Thu May 17 16:56:20 BST 2012"

The latest kernel is a 3.2.27 version dated August

zog
Posts: 200
Joined: Sun Nov 20, 2011 5:43 pm
Contact: Website

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 12:58 pm

Thanks for the speedy responses. I have been using apt-get update
apt-get upgrade to do my updates. How can I get the latest kernel ? :-)
I have to return to work now and I will try to have another go tonight.

jeffhaddow
Posts: 118
Joined: Thu Jun 14, 2012 1:50 pm

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 1:15 pm

zog wrote:Thanks for the speedy responses. I have been using apt-get update
apt-get upgrade to do my updates. How can I get the latest kernel ? :-)
I have to return to work now and I will try to have another go tonight.
Hello zog
You can get the latest kernel by following the links
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware
you will probably need to install git-core and then run
sudo rpi-update
I followed thhis advice from "dom" and this is the easier way of doing this.

All the best
Jeff

ubergrog
Posts: 6
Joined: Sun Aug 12, 2012 9:00 pm

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 1:55 pm

zog wrote:Thanks for the speedy responses. I have been using apt-get update
apt-get upgrade to do my updates. How can I get the latest kernel ? :-)
I have to return to work now and I will try to have another go tonight.
rpi-update. Get from here

kyelo
Posts: 64
Joined: Sun Oct 23, 2011 6:31 pm

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 5:58 pm

@Dom,

Along with Raspbian, I am using Puppy Linux, which uses Debian Squeeze as its base (a Raspbian version is in the works but is not yet available) and has the 3.19 Debian kernel.

Do dwc_otg.microframe_schedule=1, sdhci-bcm2707.sync_after_dma=0, and sdhci-bcm2708.missing_status=0 work with kernel 3.19, or is kernel 3.2.27+ required?

And when one of the above statements is included in cmdline.txt, does it have to be appended to the end of the existing line, or can you write it as a second line?

You also mentioned an update on the synopsis driver (to version 2.94)...can this be used with Squeeze/kernel 3.19? If so, how do you obtain it?

Thank you.

lingon
Posts: 117
Joined: Fri Aug 26, 2011 7:31 am

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 6:25 pm

I'm using currently this kernel version:
uname -a
Linux raspberrypi 3.2.27+ #54 PREEMPT Wed Aug 22 13:22:32 BST 2012 armv6l GNU/Linux
with the kernel options
cat /proc/cmdline
dma.dmachans=0x3c bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1200 bcm2708.boardrev=0x2 bcm2708.serial=0xfaa5f269 smsc95xx.macaddr=B8:27:EB:A5:F2:69 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=noop rootwait dwc_otg.microframe_schedule=1

If I have a USB sound card and the USB mouse both connected to my powered hub and start to play music, then the USB mouse becomes unusable slow. The seven port USB hub consists of two four port hubs internally. The USB sound card is working at 12 Mb/s and the mouse is a 1,5 Mb/s device. The configuration when the mouse slows down to a crawl is this:
lsusb ; lsusb -t
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 017: ID 04ca:0050 Lite-On Technology Corp.
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 016: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 008: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 013: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/3p, 480M
|__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
|__ Port 2: Dev 17, If 0, Class=HID, Driver=usbhid, 1.5M
|__ Port 2: Dev 17, If 1, Class=HID, Driver=usbhid, 1.5M
|__ Port 3: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 1: Dev 16, If 0, Class=HID, Driver=usbhid, 1.5M
|__ Port 4: Dev 8, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 3: Dev 13, If 0, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 3: Dev 13, If 1, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 3: Dev 13, If 2, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 3: Dev 13, If 3, Class=HID, Driver=usbhid, 12M

If I connect the mouse to one of the USB ports on the Raspberry Pi and move to keyboard to the powered hub, then I'm able to have a normally working mouse while playing music on the USB sound card.
lsusb ; lsusb -t
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 018: ID 04ca:0050 Lite-On Technology Corp.
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 019: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 008: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 013: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/3p, 480M
|__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
|__ Port 2: Dev 19, If 0, Class=HID, Driver=usbhid, 1.5M
|__ Port 3: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 4: Dev 8, If 0, Class=hub, Driver=hub/4p, 480M
|__ Port 4: Dev 18, If 0, Class=HID, Driver=usbhid, 1.5M
|__ Port 4: Dev 18, If 1, Class=HID, Driver=usbhid, 1.5M
|__ Port 3: Dev 13, If 0, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 3: Dev 13, If 1, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 3: Dev 13, If 2, Class=audio, Driver=snd-usb-audio, 12M
|__ Port 3: Dev 13, If 3, Class=HID, Driver=usbhid, 12M

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 8:16 pm

Dweeber wrote:
pluggy wrote:I haven't had any problems with WiFi adapters, because I don't use them, WiFi is the spawn of the devil, it gives problems an any platform at times....
Wow different world... my primary purpose in getting the RPi was as a WiFi interface that my Nexus 7 tablet (only WiFi) could mirror it's screen to the RPi for display on a 60" HDMI TV. Without WiFi the whole project would be mute. Never even used the Ethernet port on the RPi yet, don't need it . Been a flawless WiFi device.
Old git with dinosaur/luddite tendencies, just been in the game too long I guess. :lol:
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

pithonica
Posts: 8
Joined: Thu Jul 12, 2012 9:57 pm

Re: USB - the Elephant in our Room

Thu Aug 23, 2012 8:25 pm

Note the workaround the RaspI DLSR grip project guy had to use:
http://www.raspberrypi.org/archives/1824

http://davidhunt.ie/?p=2641

"After a few requests to the camera, the gphoto app responds with “Unknown Error”, and the only solution seems to be to unplug the usb cable and re-insert it. Not a workable solution, so I’ll have to look into that. Works fine on my other linux box, but a full-sized PC won’t fit into the battery grip! –Note– I found a wee ‘C’ code snippet that will reset a USB port, and that seems to do the trick if I call it between each gphoto2 call. Not ideal, but it gets me away from constantly unplugging the cable"

Refereed him to this thread in case the updates or configs here help.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5287
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Fri Aug 24, 2012 12:05 am

kyelo wrote:@Dom,

Along with Raspbian, I am using Puppy Linux, which uses Debian Squeeze as its base (a Raspbian version is in the works but is not yet available) and has the 3.19 Debian kernel.

Do dwc_otg.microframe_schedule=1, sdhci-bcm2707.sync_after_dma=0, and sdhci-bcm2708.missing_status=0 work with kernel 3.19, or is kernel 3.2.27+ required?

And when one of the above statements is included in cmdline.txt, does it have to be appended to the end of the existing line, or can you write it as a second line?
You need to update the kernel to test the features being discussed here. I'm not familiar with Puppy, but I'd imagine running rpi-update will do what you want.

Command line arguments need to be on a single line. Anything after a new line will be ignored.

ppuskari
Posts: 38
Joined: Sat Jul 07, 2012 4:04 am

Re: USB - the Elephant in our Room

Fri Aug 24, 2012 12:59 am

I just got home and have been playing with something interesting the last few days. I was able to get the latest USBIP software compiled for the raspi and the new kernel modules built, as well as on amd64 Ubuntu 12.04

On the Ubuntu side I attached:

IBM USB keyboard (built in 2 port low power hub)
Logitech trackball USB
MS Intellieye mouse
Terminus Technology 4 port non powered hub
PL2303 USB serial port converter
Alcor Micro high-speed usb webcam

I was able to bind them all to the unbuntu usbip-host daemon then
usbip attach -h xxx.xxx.xxx.xxx -b insertbusidhere
for all the devices and lo and behold for the first time ever ALL the usb devices were usable WITHOUT major issue or lag on the Raspi.

The only issue was due to how USBIP works it does spike processor usage as each data stream is about 800kbit/sec it seems.

The important part of this is that USBIP through the kernel modules presents the remote usb devices as local usb stack endpoints via the vhci_hcd virtual usb hub.

I've tried to hook the above to the raspi directly but found all the normal pitfalls we are trying to figure out.

This is definitely a mix of low and high speed devices present on the same virtual hub. So now we know it IS possible, but only from the software side up.

I'll have to hook up the usbmon software and capture usb packet data and compare to wireshark usb packet encapsulation to see if the "missing usb packet" issue is still present but so far even the webcam works flawlessly like this with kamerka. no missing lines or anything.

The ONLY device plugged into the raspi is my CyberStorm powered 2.0 hub, and a 2.5" ide external usb drive from the hub. I ssh into the unit and map all the usb periphs and watch as the computer comes to life in X with keyboard and mouse control. The problematic PL2303 (ftdi) serial converter even sends and receives commands properly to a USR 56k modem.

So what does this mean? Well I'm not certain yet, but I'm thinking that since USBIP inserts virtually in driver space that we might be dealing with more of an actual hardware issue here or maybe firmware of the usb hardware itself instead of usb driver land.

Can someone perhaps help me extrapolate this theory?

All I know is this works and works VERY well. Please email me and if there is enough interest I'll post the step by steps that it took me to get this all working since it's actually a bit non trivial and it requires recompiling modules from linux source tree and such. There's a guide on the net elsewhere that covers much of it however for USBIP functionality and install.

At least now I KNOW I can present endpoints to the raspbian usb stack and from that part up it seems to work wonderfully! Now to compile the usbip modules into the kernel and then auto config it so it loads the remote ip endpoint to load the usb hd at boot time too. Then the little guy can run headless, and usbless but still have full peripheral support!

And just for giggles I modded pyrocket to work with my DreamCheeky (non webcam version) missile launcher and works well, but only if the device is physically on one of the local raspi usb ports. It appears USBIP doesn't fully work with that device, neither does my bluetooth dongle. This is a USBIP issue however since BOTH devices failed in the same manor as raspi when attached to one of my other Ubuntu boxes.

bfromcolo
Posts: 26
Joined: Sat Aug 11, 2012 11:20 pm

Re: USB - the Elephant in our Room

Fri Aug 24, 2012 1:16 pm

dom wrote: Command line arguments need to be on a single line. Anything after a new line will be ignored.
Doh! I had added these to the bottom of config.txt as separate lines when I tested this before.

dwc_otg.microframe_schedule=0
dwc_otg.speed=1

I think the only other thing I have in there that is not commented out is
overscandisable_overscan=1

Do I need to put every actual command on a single line separated by commas? Or just the dwc_otg commands? Can they be anywhere in the file (top, bottom)?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5287
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Fri Aug 24, 2012 1:19 pm

bfromcolo wrote:Doh! I had added these to the bottom of config.txt as separate lines when I tested this before.

dwc_otg.microframe_schedule=0
dwc_otg.speed=1

I think the only other thing I have in there that is not commented out is
overscandisable_overscan=1

Do I need to put every actual command on a single line separated by commas? Or just the dwc_otg commands? Can they be anywhere in the file (top, bottom)?
These go in cmdline.txt (with no newline)
dwc_otg.microframe_schedule=0 dwc_otg.speed=1

These go in config.txt (with a newline between each option)
disable_overscan=1

(overscandisable_overscan is not a valid option).

JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: USB - the Elephant in our Room

Fri Aug 24, 2012 3:04 pm

Would like to add that with the Lapdock and the latest official Rasbian distro I seem to be stable again.

Well done all!

Return to “Troubleshooting”