gordon77
Posts: 4115
Joined: Sun Aug 05, 2012 3:12 pm

Re: USB redux

Wed Apr 03, 2013 4:21 pm

gordon77 wrote:Now up and running again, and now my Microsoft VX2000 webcam is working in my programme at 640 x 480, before it would only manage 352 x 288 :)

(philips 740 still not working)

Gordon77
I now have a Logitech C270 and can achieve single shots of upto 960x720 using pygame.camera :)

rupor
Posts: 1
Joined: Wed Apr 03, 2013 6:22 pm

Re: USB redux

Wed Apr 03, 2013 6:32 pm

Hello

After switching to latest firmware: "Linux raspberrypi 3.6.11+ #401 PREEMPT Fri Mar 29 22:59:09 GMT 2013 armv6l GNU/Linux" and removal of "dwc_otg.speed=1" from /boot/cmdline.txt I started to see following messages during boot:

Code: Select all

[  114.595967] mmc0: Timeout waiting for hardware interrupt - cmd18.
[  114.597620] mmcblk0: error -110 transferring data, sector 6013984, nr 256, cmd response 0x900, card status 0xb00
[  114.597743] mmcblk0: retrying using single block read
[  114.630438] mmc0: missed completion of cmd 18 DMA (512/512 [1]/[1]) - ignoring it
[  114.630668] mmc0: DMA IRQ 6 ignored - results were reset
sector number is random, however response and status are not.

I was under impression that this SD card troubles have been fixed long time ago. Does anybody sees similar messages? Is it a regression or a new problem? Is this a sign of potential problem? Any advice on how to avoid it?

Thank You

MastaG
Posts: 11
Joined: Fri Jun 08, 2012 8:14 am

Re: USB redux

Sun Apr 07, 2013 12:52 pm

Are all of the latest changes that are in the rpi-update kernel merged with the "rpi-3.6.y" branch on github?
Or should I use the "rebase" branch?

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

Re: USB redux

Sun Apr 07, 2013 12:59 pm

MastaG wrote:Are all of the latest changes that are in the rpi-update kernel merged with the "rpi-3.6.y" branch on github?
Or should I use the "rebase" branch?
rpi-update kernel is built from 3.6.y branch.
Anything else there is experimental and not recommended.

MastaG
Posts: 11
Joined: Fri Jun 08, 2012 8:14 am

Re: USB redux

Mon Apr 08, 2013 12:11 am

Well congratulations folks!
I've compiled yesterdays rpi-3.6.y kernel branch with all v4l/dvb frontends and devices enabled.
And the testing looks good so far.

My Hauppauge WinTV-HVR-930C DVB-C/T stick works great now.
See: http://www.linuxtv.org/wiki/index.php/H ... V-HVR-930C
After compiling the kernel, I only needed the dvb-usb-hauppauge-hvr930c-drxk.fw firmware.

I'm using TVHeadend (the one the ships with raspbmc) to stream live DVB-C to my computer.
I haven't tried to play it in xbmc yet but it works flawless so far for streaming.
Only a few continuity errors on changing channels, no errors in dmesg and perfect picture quality.
Even on HD channels!

See: http://tinypic.com/r/a1her/6

Next stick I will try is my PCTV QuatroStick-nano 520e.
This one used to be a nightmare back in the kernel-3.2.2.7 days.
I will report back.

Thanks again.

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

Re: USB redux

Mon Apr 08, 2013 8:11 pm

Here's some results from testing the native STK1160 driver included in the the rpi-3.8.y-temp kernel from:

https://github.com/raspberrypi/linux/tr ... 3.8.y-temp

Code: Select all

Linux raspberrypi 3.8.4+ #2 PREEMPT Sat Apr 6 14:00:12 BST 2013 armv6l GNU/Linux
Device registration from dmesg shows:

Code: Select all

[  108.580144] usb 1-1.3.1.3: new high-speed USB device number 11 using dwc_otg
[  108.681428] usb 1-1.3.1.3: New USB device found, idVendor=05e1, idProduct=0408
[  108.681459] usb 1-1.3.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  108.681476] usb 1-1.3.1.3: Product: USB 2.0 Video Capture Controller
[  108.681492] usb 1-1.3.1.3: Manufacturer: Syntek Semiconductor
[  108.794157] media: Linux media interface: v0.10
[  108.831712] Linux video capture interface: v2.00
[  108.893185] usb 1-1.3.1.3: New device Syntek Semiconductor USB 2.0 Video Capture Controller @ 480 Mbps (05e1:0408, interface 0, class 0)
[  108.893216] usb 1-1.3.1.3: video interface 0 found
[  109.332376] saa7115 0-0025: saa7113 found (1f7113d0e100000) @ 0x4a (stk1160)
[  109.722534] stk1160: driver ver 0.9.5 successfully loaded
[  109.987707] stk1160: registers to NTSC like standard
[  110.037895] stk1160 1-1.3.1.3:1.0: V4L2 device registered as video0
[  110.042967] usbcore: registered new interface driver snd-usb-audio
[  110.049603] usbcore: registered new interface driver stk1160
Set the capture standard to PAL

Code: Select all

[email protected] ~ $ v4l2-ctl --set-standard=pal
Standard set to 000000ff
Read from the device straight to /dev/null

Code: Select all

[email protected] ~ $ dd iflag=fullblock if=/dev/video0 of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 25.4348 s, 20.6 MB/s
The dmesg output for the capture shows buffer overruns

Code: Select all

[  560.884031] stk1160: queue_setup: buffer count 8, each 829440 bytes
[  560.892166] stk1160: setting alternate 5
[  560.892196] stk1160: minimum isoc packet size: 3072 (alt=5)
[  560.892208] stk1160: setting alt 5 with wMaxPacketSize=3072
[  560.892747] stk1160: allocating urbs...
[  560.906741] stk1160: 16 urbs allocated
[  560.907573] stk1160: streaming started
[  561.091422] URB packet 13, status -63 [Buffer error (overrun)].
[  561.099624] URB packet 1, status -63 [Buffer error (overrun)].
[  561.557095] URB packet 40, status -63 [Buffer error (overrun)].
[  561.717730] URB packet 54, status -63 [Buffer error (overrun)].
[  561.732367] URB packet 5, status -63 [Buffer error (overrun)].
[  562.158271] URB packet 63, status -63 [Buffer error (overrun)].
[  562.397948] URB packet 40, status -63 [Buffer error (overrun)].
[  562.438189] URB packet 42, status -63 [Buffer error (overrun)].
[  563.038526] URB packet 44, status -63 [Buffer error (overrun)].
[  563.125244] URB packet 0, status -63 [Buffer error (overrun)].
[  566.274440] print_err_status: 21 callbacks suppressed
[  566.274502] URB packet 55, status -63 [Buffer error (overrun)].
[  566.306400] URB packet 61, status -63 [Buffer error (overrun)].
[  566.906628] URB packet 58, status -63 [Buffer error (overrun)].
[  566.995029] URB packet 55, status -63 [Buffer error (overrun)].
[  567.009872] URB packet 24, status -63 [Buffer error (overrun)].
[  567.506965] URB packet 54, status -63 [Buffer error (overrun)].
[  567.721870] URB packet 0, status -63 [Buffer error (overrun)].
[  568.090256] URB packet 19, status -63 [Buffer error (overrun)].
[  568.107365] URB packet 49, status -63 [Buffer error (overrun)].
[  568.114840] URB packet 9, status -63 [Buffer error (overrun)].
[  571.432767] print_err_status: 23 callbacks suppressed
[  571.432797] URB packet 56, status -63 [Buffer error (overrun)].
[  571.576971] URB packet 54, status -63 [Buffer error (overrun)].
[  572.392135] URB packet 0, status -63 [Buffer error (overrun)].
[  573.034137] URB packet 55, status -63 [Buffer error (overrun)].
[  573.194369] URB packet 60, status -63 [Buffer error (overrun)].
[  573.314242] URB packet 45, status -63 [Buffer error (overrun)].
[  573.481024] URB packet 0, status -63 [Buffer error (overrun)].
[  573.674840] URB packet 55, status -63 [Buffer error (overrun)].
[  573.755071] URB packet 58, status -63 [Buffer error (overrun)].
[  573.906715] URB packet 52, status -63 [Buffer error (overrun)].
[  576.839149] print_err_status: 29 callbacks suppressed
[  576.839207] URB packet 27, status -63 [Buffer error (overrun)].
[  577.030697] URB packet 14, status -63 [Buffer error (overrun)].
[  577.272195] URB packet 57, status -63 [Buffer error (overrun)].
[  577.392457] URB packet 59, status -63 [Buffer error (overrun)].
[  577.472510] URB packet 56, status -63 [Buffer error (overrun)].
[  577.479581] URB packet 13, status -63 [Buffer error (overrun)].
[  577.487994] URB packet 35, status -63 [Buffer error (overrun)].
[  577.496922] URB packet 50, status -63 [Buffer error (overrun)].
[  577.913558] URB packet 57, status -63 [Buffer error (overrun)].
[  578.273703] URB packet 55, status -63 [Buffer error (overrun)].
[  582.036613] print_err_status: 11 callbacks suppressed
[  582.036676] URB packet 61, status -63 [Buffer error (overrun)].
[  582.107732] URB packet 35, status -63 [Buffer error (overrun)].
[  582.236676] URB packet 49, status -63 [Buffer error (overrun)].
[  582.276861] URB packet 47, status -63 [Buffer error (overrun)].
[  582.477273] URB packet 56, status -63 [Buffer error (overrun)].
[  582.708360] URB packet 27, status -63 [Buffer error (overrun)].
[  582.716307] URB packet 4, status -63 [Buffer error (overrun)].
[  582.797583] URB packet 39, status -63 [Buffer error (overrun)].
[  582.805785] URB packet 54, status -63 [Buffer error (overrun)].
[  582.820801] URB packet 5, status -63 [Buffer error (overrun)].
[  586.310640] stk1160: killing 16 urbs...
[  586.310802] stk1160: all urbs killed
[  586.310820] stk1160: freeing 16 urb buffers...
[  586.311789] stk1160: all urb buffers freed
[  586.311806] stk1160: setting alternate 0
[  586.312652] stk1160: buffer [d6b5a000/2] aborted
[  586.312678] stk1160: buffer [d34e9800/3] aborted
[  586.312691] stk1160: buffer [d34e9000/4] aborted
[  586.312702] stk1160: buffer [d3681800/5] aborted
[  586.312712] stk1160: buffer [d3681000/6] aborted
[  586.312722] stk1160: buffer [d3019800/7] aborted
[  586.312730] stk1160: streaming stopped

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB redux

Mon Apr 08, 2013 8:35 pm

Danger! Danger Will Robinson!

The 3.8.y branch is not ready for primetime yet. Most notably the existing FIQ fix doesn't work which will likely have an impact on ISOC performance.

Does your capture device work anyway (i.e. using a real application and not dd)? There aren't "many" isoc frames lost in your output... I calculate a 0.081% level of data loss based on your capture time and number of dropped packets.

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

Re: USB redux

Mon Apr 08, 2013 8:57 pm

M33P wrote:Danger! Danger Will Robinson!

The 3.8.y branch is not ready for primetime yet. Most notably the existing FIQ fix doesn't work which will likely have an impact on ISOC performance.

Does your capture device work anyway (i.e. using a real application and not dd)? There aren't "many" isoc frames lost in your output... I calculate a 0.081% level of data loss based on your capture time and number of dropped packets.
Yeah, I'm aware that it's not ready for primetime, but the native STK1160 driver was only introduced in 3.7 so I thought I'd give it a go.

Capturing video using gstreamer 1.0 produces a reasonably clear picture, but there are clearly a lot of dropped frames causing interference with the overall video stream, and CPU usage during the capture is about 90%. Capturing audio, again using gstreamer 1.0, seems to work pretty well with it, with minimal distortion.

Any timeframe on when a stable 3.8 kernel build of Raspbian will be available ?

User avatar
with ice cream
Posts: 161
Joined: Mon Jul 30, 2012 7:25 am

Re: USB redux

Wed Apr 10, 2013 6:51 pm

lcd4linux user here. I had already given up and invested in a composite screen as a status display. Today I was adventurous and did an update (Linux berry 3.6.11+ #403 PREEMPT Tue Apr 2 22:48:13 BST 2013). The first reboot after the update failed and I had to replace start.elf manually.

For a while I was successful with my LCD (keychain) display, it seemed to work. But now the display keeps getting disconnected - without my having changed anything. Strangely, a reboot doesn't help.

The lcd4linux output shows this:

Code: Select all

(...)
Found AX206 DPF
Got LCD dimensions: 320x240
bulk write: Resource temporarily unavailable
(...)
lcd4linux.c: starting main loop
bulk write: Resource temporarily unavailable
(...)
bulk write: Resource temporarily unavailable
bulk write: Resource temporarily unavailable
bulk write: Resource temporarily unavailable
(...)
lcd4linux.c: got signal 15
lcd4linux.c: got signal 15
lcd4linux.c: leaving main loop
DPF: shutting down.
drv_dpf.c: closing connection
Relevant syslog entries show:

Code: Select all

kernel	Info	kernel	berry	"[  121.674856] usb 1-1.3.1.4: new full-speed USB device number 13 using dwc_otg"
kernel	Info	kernel	berry	"[  121.793456] usb 1-1.3.1.4: New USB device found, idVendor=1908, idProduct=0102"
kernel	Info	kernel	berry	"[  121.793524] usb 1-1.3.1.4: New USB device strings: Mfr=2, Product=3, SerialNumber=1"
kernel	Info	kernel	berry	"[  121.793543] usb 1-1.3.1.4: Product: USB-Display"
kernel	Info	kernel	berry	"[  121.793556] usb 1-1.3.1.4: Manufacturer: hackfin"
kernel	Info	kernel	berry	"[  121.793596] usb 1-1.3.1.4: SerialNumber: 001"
user-level	Info	mtp-probe	berry	"checking bus 1, device 13: ""/sys/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.1/1-1.3.1.4"""
user-level	Info	mtp-probe	berry	"bus: 1, device: 13 was not an MTP device"
There are several things that a weird.

The most obvious weirdness is that it started to work and then failed. Also, in the past I used to get one bulk write error and then it failed and now I get several and it looks like to process gets actively killed (signal 15). As far as I recall, it hasn't happened like this in the past. Lastly, MTP did not play a role in the past and now it looks like it is what actually rejects the device. Lastly, with every attempt the device gets freshly recognized and the device number incremented.

What comes next?

chriglu
Posts: 27
Joined: Thu Mar 28, 2013 10:17 pm

Re: USB redux

Thu Apr 11, 2013 11:36 am

Hello again

I've got simliar issues, one of my webcams get disconnected randomly. Sometimes it works two days without an issue and afterwards it disconnects every 5 minutes. I've already replaced the webcam with a new and different one, so that shouldn't be the problem.

I use motion and a few temperature sensors for my bird-watching-project. Everything is working like a charm and i got a good 640x480 pixels stream from both of the cameras.

Webcams (on a powered usb hub):

Code: Select all

Bus 001 Device 007: ID 046d:081b Logitech, Inc. Webcam C310
Bus 001 Device 011: ID 046d:0825 Logitech, Inc. Webcam C270
Kernel:

Code: Select all

[email protected] ~ $ uname -a
Linux earlybirdpi 3.6.11+ #408 PREEMPT Wed Apr 10 20:33:39 BST 2013 armv6l GNU/Linux
Syslog entries:

Code: Select all

Apr 11 13:28:15 earlybirdpi kernel: [  313.897731] usb 1-1.2.7: USB disconnect, device number 10
Apr 11 13:28:15 earlybirdpi kernel: [  314.143378] usb 1-1.2.7: new high-speed USB device number 11 using dwc_otg
Apr 11 13:28:16 earlybirdpi kernel: [  314.456638] usb 1-1.2.7: New USB device found, idVendor=046d, idProduct=0825
Apr 11 13:28:16 earlybirdpi kernel: [  314.456670] usb 1-1.2.7: New USB device strings: Mfr=0, Product=0, SerialNumber=2
Apr 11 13:28:16 earlybirdpi kernel: [  314.456716] usb 1-1.2.7: SerialNumber: 85B579E0
Apr 11 13:28:16 earlybirdpi kernel: [  314.466016] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
Apr 11 13:28:16 earlybirdpi kernel: [  314.482765] input: UVC Camera (046d:0825) as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2.7/1-1.2.7:1.0/input/input4
Apr 11 13:28:16 earlybirdpi motion: [2] v4l2_next: VIDIOC_QBUF: No such device
Apr 11 13:28:16 earlybirdpi motion: [2] Video device fatal error - Closing video device
Apr 11 13:28:16 earlybirdpi motion: [2] Closing video device /dev/video1
Apr 11 13:28:17 earlybirdpi kernel: [  315.482943] 11:3:1: cannot set freq 16000 to ep 0x86
Apr 11 13:28:18 earlybirdpi kernel: [  316.482904] 11:3:2: cannot set freq 24000 to ep 0x86
Apr 11 13:28:19 earlybirdpi kernel: [  317.482824] 11:3:3: cannot set freq 32000 to ep 0x86
Thanks in advance!

User avatar
with ice cream
Posts: 161
Joined: Mon Jul 30, 2012 7:25 am

Re: USB redux

Thu Apr 11, 2013 11:53 am

Update: the removal of mtd-probe does not improve the situation.

gordon77
Posts: 4115
Joined: Sun Aug 05, 2012 3:12 pm

Re: USB redux

Thu Apr 11, 2013 12:42 pm

I use an Arduino Uno connected on the USB and I send it serial commands, to drive my telescope, such as :Mgn1000. These commands are sent at a max of 1 per second.

Sometimes I note that the commands appear to stop arriving at the Uno maybe after 20mins, maybe longer.
The python program controlling it all carries on normally and doesn't report any issues ie no loss of /dev/ACMO, which I get if I try to start the program without the Uno connected.

Gordon77

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB redux

Fri Apr 12, 2013 7:29 pm

with ice cream wrote: For a while I was successful with my LCD (keychain) display, it seemed to work. But now the display keeps getting disconnected - without my having changed anything. Strangely, a reboot doesn't help.

There are several things that a weird.

The most obvious weirdness is that it started to work and then failed. Also, in the past I used to get one bulk write error and then it failed and now I get several and it looks like to process gets actively killed (signal 15). As far as I recall, it hasn't happened like this in the past. Lastly, MTP did not play a role in the past and now it looks like it is what actually rejects the device. Lastly, with every attempt the device gets freshly recognized and the device number incremented.

What comes next?
Did your device work acceptably before you tried to update?

If yes then you're seeing an apparent regression - though treat with care as there are still bugs in the driver that may just have been uncovered as a result of fixing something that was problematic for another application.

If you want to pin it down, then you need to do rpi-update with the commit number appended, i.e.

Code: Select all

sudo rpi-update 94e9807eb9534d46fb94a1bff39aa4c26c05b9d
The commits are all pulled from https://github.com/hexxeh/rpi-firmware.

Caution: a previous commit pulled in from upstream caused a high chance of corrupting FAT32 partitions. You should do rpi-update on another linux machine with the SD card plugged into it, if you have one, and specify ROOT_PATH= and BOOT_PATH= as listed in the readme in https://github.com/hexxeh/rpi-update. If not then be prepared to re-write your boot partition on another PC if you are running the Pi on one of the dodgy updates.

The problem exists if you are using a pi with a kernel from aea9d8e529baf2c11e0282706b71ae8cfc8ee909 to b68696fa24c2512e91903b8e202502e7c21f325b and updating the sd card on the Pi. (this is only 2 firmware revisions though).

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB redux

Fri Apr 12, 2013 7:31 pm

gordon77 wrote:I use an Arduino Uno connected on the USB and I send it serial commands, to drive my telescope, such as :Mgn1000. These commands are sent at a max of 1 per second.

Sometimes I note that the commands appear to stop arriving at the Uno maybe after 20mins, maybe longer.
The python program controlling it all carries on normally and doesn't report any issues ie no loss of /dev/ACMO, which I get if I try to start the program without the Uno connected.

Gordon77
Are you using a model A?

How are you determining that the Uno isn't receiving any data any more?

Can you lsusb -v for the Uno?

gordon77
Posts: 4115
Joined: Sun Aug 05, 2012 3:12 pm

Re: USB redux

Fri Apr 12, 2013 7:46 pm

M33P wrote:
gordon77 wrote:I use an Arduino Uno connected on the USB and I send it serial commands, to drive my telescope, such as :Mgn1000. These commands are sent at a max of 1 per second.

Sometimes I note that the commands appear to stop arriving at the Uno maybe after 20mins, maybe longer.
The python program controlling it all carries on normally and doesn't report any issues ie no loss of /dev/ACMO, which I get if I try to start the program without the Uno connected.

Gordon77
Are you using a model A?

How are you determining that the Uno isn't receiving any data any more?

Can you lsusb -v for the Uno?
Model B rev1. The uno stops responding, it normals flashes LEDs to show the commands being activated.

Gordon77

hoeken
Posts: 5
Joined: Tue Apr 09, 2013 4:33 am

Re: USB redux

Mon Apr 15, 2013 8:32 am

This fix works great and the new kernel allows me to use the max resolution without corruption.

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB redux

Tue Apr 16, 2013 6:16 pm

I've seen a few things bubble to the surface in recent days - perhaps as a result of wider adoption of the tasklet patch.

The main theme seems to be with USB storage devices - HDDs or pendrives - that are used frequently e.g. as a root filesystem device or for filesystem duties.

There may be related issues with Ralink wifi dongles that "drop" connection, most notably with "-110 timeout" messages and become unresponsive.

- USB storage devices are more resilient to freezes because of the SCSI layer on top. This will monitor drive performance and issue resets as necessary to keep devices working.
- Wifi dongles appear to not be as error-tolerant.

Most users with these problems are reporting intermittent failures in the region of 30 minute to 5 hour intervals. These failures are characterised by unresponsive devices / lots of reset spam in the kernel log.

If you are experiencing a specific issue that was not present before updating, can you revert to a commit before the tasklet patch - compare a

Code: Select all

sudo rpi-update aea9d8e529baf2c11e0282706b71ae8cfc8ee909
with the latest kernel.

Caution: the aea9d8 version contains a change which was later found to occasionally trash FAT32 partitions. Make a backup of your /boot partition after a rpi-update to latest (by copying the data from the visible SD card partition in windows, or partition 1 in linux) and run rpi-update aea9d8... to get the old version installed. Do not run rpi-update again with this older version on the pi - copy the files from your backup back to the SD card using a PC.

My feeling at this time is that changing completions to a tasklet (to fix most webcams) has unearthed some other bug in the driver, but one that I believe I am currently seeing with my own testing. I would like more data though.

chriglu
Posts: 27
Joined: Thu Mar 28, 2013 10:17 pm

Re: USB redux

Thu Apr 18, 2013 4:57 am

I've got another pi and two webcams beside my bird project where i've made the following test with two webcams attached and different firmware-releases: started the pi, started motion as a daemon with two threads/webcams with a resolution of 640x480 streaming at ~1fps.

Test1, Resolution 640x480, #408 7d7f8510f103f3c6686835c0a002de038da0946f
- the second webcam disconnected after 7h04

Test2, Resolution 640x480, #397 aea9d8e529baf2c11e0282706b71ae8cfc8ee909
- motion failed to start with a resolution 640x480 and 320x240

Test3, Resolution 640x480, #399 61f7aa5742bc8f07be2378d727ac8dc14268e848
- the second webcam disconnected after 1h08

Test3, Resolution 640x480, #401 b68696fa24c2512e91903b8e202502e7c21f325b
- motion is running now since 11h and still both webcams connected, i will leave it running for the next 12h

Test4, Resolution 640x480 1cam, #408 7d7f8510f103f3c6686835c0a002de038da0946f
- On my bird-project (other pi with two cams) i am testing motion only the first webcam since 14h but the second webcam disconnected around 9 times since the start. But motion with cam1 is still running

It seems to me that mostly the second attached webcam disconnects. If i swap the two cams, the second attached will disconnect. I'm not 100% sure yet, i will try to find out further.. Let me know if i can do further tests. Do you want me to test the newer releases aswell up from #401+ ?

Update #1:
I've updated my bird-project-pi to #401 and tested again with two webcams, it failed after 1h. The other Raspi is still running with motion and two webcams BUT it is connected via LAN. The bird-project-pi is connected with a wifi-usb-adapter. I will try to connect the other Raspi with a wifi-usb-adapter aswell and have a look, if it fails.

Update #2:
We haven't had the chance to connect my bird-box with ethernet yet. But i changed the cabling the following way:
Port1: USB-Hub with First-Webcam and Wlan Adapter
Port2: Second-Webcam

Before, i've had all the USB-Devices connected via Hub to Port1. It seems to be more stable now since almost 4 days and i haven't had a disconnect so far (fingers crossed). Not sure if this helps debug/resolve the usb-issues any further. Let me know if you need more help. I'm still on #401 with my bird-box and will update this soon.

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB redux

Tue Apr 23, 2013 12:59 pm

Hi.

A new kernel with an update to the USB driver is available via rpi-update

Please test if you have experienced the following issues:
  • * If you are seeing lots of "reset high speed USB device x using dwc_otg" messages in the kernel log, usually separated by several seconds
    * If you have a device (most notably certain types of wlan dongle) that randomly stops working after anything from several minutes to a few hours, requiring either a reboot or a replug of the device
This patch corrects a bug in the mechanism used to hold off NAKs on split-BULK endpoints (without it we got 30,000 interrupts per second when accessing serial port devices). There was a small chance that a device employing a bulk endpoint would get "skipped" for further transactions if a certain number of conditions were met.

User avatar
with ice cream
Posts: 161
Joined: Mon Jul 30, 2012 7:25 am

Re: USB redux

Tue Apr 23, 2013 7:52 pm

M33P wrote:A new kernel with an update to the USB driver is available via rpi-update.
No improvement for me.

lcd4linux loads a splash screen on start (a black background). This big chunk of data seems to be too much. I still get the error "bulk write: Resource temporarily unavailable" and the process quits.

The splash screen can be suppressed (option "-q") but then output is drawn on the splash screen of the LCD display's firmware.

att
Posts: 3
Joined: Fri Apr 26, 2013 5:17 pm

Re: USB redux

Fri Apr 26, 2013 5:49 pm

Hi gsh, M33P,

First of all thank you for your big achievements on the USB issues.
One of my purposes with RPi is to get one or two webcam connected, record motions and provide some periodic snapshots when no motion is detected (with motion). Then transfer the pictures to an other remote machine (maybe with rsync). At the final place a 3G modem is the only option to get connected.
I've been struggling for months to get the webcam usable on the Pi. But the maximum was 352 x 288 @ 1fps (while my openwrt router could provide 640 x 480 @ 2fps with the same cam but with half speed processor and 16 times less RAM).

With your recent changes it is much much better. Now it is 640 x 480 @ 6-8fps. (1024 x 768 is almost working at 2fps, but the parts of the picture are mosaic mixed)

I'm running the Pi for 18 day now continuously (unfortunately the uptime is less) as kind of stress test. The Pi is powered from the same 7 port USB hub where its peripherals are connected, it's an Eminent EM1107 7 Port USB 2.0 Hub with 2 A power adapter. According to http://elinux.org/RPi_VerifiedPeriphera ... g_USB_Hubs "It's able to power the Raspberry Pi, external HDD and other peripherals."
The common receiver/transmitter of the keyboard and mouse is plugged to the other USB port directly (not measured it's consumption but it was working happily on the other 256MB model B Pi which still has the polyfuses on it's USB ports).
The camera and a Huawei E220 3G modem (not yet used or configured just consuming power) are connected to the HUB. Sometimes I've connected a mobile to the HUB just for charging (even if we consider the modem and the phone as full load devices the Pi+cam+wireless receiver should fit to the other 1A).

The hardware setup was unchanged since boot (but as mentioned sometimes a phone is connected for charging). And at start the wired LAN was not connected (it was connected several hours later and is connected since then).

motion was not running continuously usually I've started it morning and killed it at the evening.

Here are my experiences:
  • at start only 3 port of the HUB was visible (lsusb shown only one 4 port HUB instead of the two, the 7 port is two 4 port internally), but power was present on all ports (the phone charging cable is connected to a 'power only' port)
  • at day 8 couldn't reach it remotely via SSH when I checked it locally ifconfig shown that it has no IP address, anyway I let it running without any configuration
  • some days later it was not in my mind that it has no IP address and I've ssh-ed to it successfully, the reason is that there was a reboot (reason unknown) two days earlier
  • currently the uptime is 8 and half days (I'm not sure if this is only the second start or maybe there was an approx. 2 days uptime in between and then this is the third start)
  • since the last reboot there is no output on HDMI
  • now both 4 port USB hub is listed by lsusb and I guess this was so in the past 8 and half days as occasional (re)connecting of phone is visible in dmesg
here are some logs:

Code: Select all

[email protected] ~ $ uptime
 18:47:01 up 8 days, 11:12,  1 user,  load average: 0.40, 0.24, 0.18

[email protected] ~ $ uname -a
Linux raspberrypi 3.6.11+ #403 PREEMPT Tue Apr 2 22:48:13 BST 2013 armv6l GNU/Linux

[email protected] ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 062a:0102 Creative Labs Wireless Keyboard/Mouse Combo [MK1152WC]
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 009: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem
Bus 001 Device 006: ID 0c45:6340 Microdia     <-- this is the webcam, it is Trust Sptolight Webcam Pro
Bus 001 Device 021: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB

[email protected] ~ $ lsusb -t
/:  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 4, If 0, Class=HID, Driver=usbhid, 1.5M
        |__ Port 2: Dev 4, If 1, Class=HID, Driver=usbhid, 1.5M
        |__ Port 3: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 9, If 0, Class=vend., Driver=option, 12M
            |__ Port 1: Dev 9, If 1, Class=vend., Driver=option, 12M
            |__ Port 1: Dev 9, If 2, Class=stor., Driver=usb-storage, 12M
            |__ Port 3: Dev 6, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
            |__ Port 3: Dev 6, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
            |__ Port 3: Dev 6, If 2, Class=audio, Driver=snd-usb-audio, 480M
            |__ Port 3: Dev 6, If 3, Class=audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 21, If 0, Class=hub, Driver=hub/4p, 480M
dmesg from the first startup (collected after I've could not reach it via SSH (had no IP address)):

Code: Select all

[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.6.11+ ([email protected]) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #403 PREEMPT Tue Apr 2 22:48:13 BST 2013
[    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] cma: CMA: reserved 16 MiB at 1b000000
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 114688
[    0.000000] free_area_init_node: node 0, pgdat c053b854, node_mem_map c05e5000
[    0.000000]   Normal zone: 896 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 113792 pages, LIFO batch:31
[    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: 113792
[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1816 bcm2708_fb.fbheight=984 bcm2708.boardrev=0xf bcm2708.serial=0xd6d58274 smsc95xx.macaddr=XX:XX:XX:XX:XX:XX sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 448MB = 448MB total
[    0.000000] Memory: 432264k/432264k available, 26488k 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 : 0xdc800000 - 0xff000000   ( 552 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdc000000   ( 448 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc04e647c   (4986 kB)
[    0.000000]       .init : 0xc04e7000 - 0xc0507f24   ( 132 kB)
[    0.000000]       .data : 0xc0508000 - 0xc053c080   ( 209 kB)
[    0.000000]        .bss : 0xc053c0a4 - 0xc05e4758   ( 674 kB)
[    0.000000] NR_IRQS:330
[    0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4294967ms
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [tty1] enabled
[    0.001006] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[    0.060128] pid_max: default: 32768 minimum: 301
[    0.060462] Mount-cache hash table entries: 512
[    0.061221] Initializing cgroup subsys cpuacct
[    0.061275] Initializing cgroup subsys devices
[    0.061308] Initializing cgroup subsys freezer
[    0.061336] Initializing cgroup subsys blkio
[    0.061426] CPU: Testing write buffer coherency: ok
[    0.061760] hw perfevents: enabled with v6 PMU driver, 3 counters available
[    0.061902] Setting up static identity map for 0x39d5f8 - 0x39d654
[    0.063404] devtmpfs: initialized
[    0.074102] NET: Registered protocol family 16
[    0.080576] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[    0.081673] bcm2708.uart_clock = 0
[    0.083059] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.083114] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.083149] mailbox: Broadcom VideoCore Mailbox driver
[    0.083242] bcm2708_vcio: mailbox at f200b880
[    0.083342] bcm_power: Broadcom power driver
[    0.083381] bcm_power_open() -> 0
[    0.083406] bcm_power_request(0, 8)
[    0.584094] bcm_mailbox_read -> 00000080, 0
[    0.584135] bcm_power_request -> 0
[    0.584162] Serial: AMBA PL011 UART driver
[    0.584307] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83) is a PL011 rev3
[    0.908138] console [ttyAMA0] enabled
[    0.931626] bio: create slab <bio-0> at 0
[    0.936504] SCSI subsystem initialized
[    0.940602] usbcore: registered new interface driver usbfs
[    0.946185] usbcore: registered new interface driver hub
[    0.951787] usbcore: registered new device driver usb
[    0.958133] Switching to clocksource stc
[    0.962376] FS-Cache: Loaded
[    0.965522] CacheFiles: Loaded
[    0.980332] NET: Registered protocol family 2
[    0.985609] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.993352] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[    1.000142] TCP: Hash tables configured (established 16384 bind 16384)
[    1.006747] TCP: reno registered
[    1.010002] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.015902] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.022483] NET: Registered protocol family 1
[    1.027348] RPC: Registered named UNIX socket transport module.
[    1.033394] RPC: Registered udp transport module.
[    1.038116] RPC: Registered tcp transport module.
[    1.042860] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.049973] bcm2708_dma: DMA manager at f2007000
[    1.054763] bcm2708_gpio: bcm2708_gpio_probe c0515d98
[    1.060228] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[    1.069391] audit: initializing netlink socket (disabled)
[    1.074988] type=2000 audit(0.930:1): initialized
[    1.197226] VFS: Disk quotas dquot_6.5.2
[    1.201261] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.208321] FS-Cache: Netfs 'nfs' registered for caching
[    1.214070] NFS: Registering the id_resolver key type
[    1.219233] Key type id_resolver registered
[    1.223528] Key type id_legacy registered
[    1.227893] msgmni has been set to 876
[    1.233437] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.241149] io scheduler noop registered
[    1.245195] io scheduler deadline registered (default)
[    1.250379] io scheduler cfq registered
[    1.292643] Console: switching to colour frame buffer device 227x61
[    1.318957] kgdb: Registered I/O driver kgdboc.
[    1.324337] vc-cma: Videocore CMA driver
[    1.328382] vc-cma: vc_cma_base      = 0x00000000
[    1.333247] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    1.338777] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    1.353754] brd: module loaded
[    1.362021] loop: module loaded
[    1.365724] vchiq: vchiq_init_state: slot_zero = 0xdb000000, is_master = 0
[    1.373599] Loading iSCSI transport class v2.0-870.
[    1.379600] usbcore: registered new interface driver smsc95xx
[    1.385788] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.596899] Core Release: 2.80a
[    1.600165] Setting default values for core params
[    1.605181] Finished setting default values for core params
[    1.815972] Using Buffer DMA mode
[    1.819398] Periodic Transfer Interrupt Enhancement - disabled
[    1.825393] Multiprocessor Interrupt Enhancement - disabled
[    1.831101] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.835592] Dedicated Tx FIFOs mode
[    1.840186] dwc_otg: Microframe scheduler enabled
[    1.840619] dwc_otg bcm2708_usb: DWC OTG Controller
[    1.845759] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[    1.853354] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000
[    1.859030] Init: Port Power? op_state=1
[    1.863092] Init: Power Port (0)
[    1.866514] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.873511] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.886310] usb usb1: Product: DWC OTG Controller
[    1.896351] usb usb1: Manufacturer: Linux 3.6.11+ dwc_otg_hcd
[    1.907491] usb usb1: SerialNumber: bcm2708_usb
[    1.918199] hub 1-0:1.0: USB hub found
[    1.927362] hub 1-0:1.0: 1 port detected
[    1.936926] dwc_otg: FIQ enabled
[    1.936943] dwc_otg: NAK holdoff enabled
[    1.936965] Module dwc_common_port init
[    1.937185] Initializing USB Mass Storage driver...
[    1.947612] usbcore: registered new interface driver usb-storage
[    1.958968] USB Mass Storage support registered.
[    1.969087] usbcore: registered new interface driver libusual
[    1.980520] mousedev: PS/2 mouse device common for all mice
[    1.992326] bcm2835-cpufreq: min=700000 max=950000 cur=700000
[    2.003668] bcm2835-cpufreq: switching to governor powersave
[    2.014675] bcm2835-cpufreq: switching to governor powersave
[    2.025635] cpuidle: using governor ladder
[    2.035087] cpuidle: using governor menu
[    2.044229] sdhci: Secure Digital Host Controller Interface driver
[    2.055697] sdhci: Copyright(c) Pierre Ossman
[    2.065354] sdhci: Enable low-latency mode
[    2.112429] mmc0: SDHCI controller on BCM2708_Arasan [platform] using platform's DMA
[    2.125765] mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77
[    2.139110] Indeed it is in host mode hprt0 = 00021501
[    2.149696] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.177249] usbcore: registered new interface driver usbhid
[    2.212225] usbhid: USB HID core driver
[    2.221859] TCP: cubic registered
[    2.252310] Initializing XFRM netlink socket
[    2.282261] NET: Registered protocol family 17
[    2.292036] Key type dns_resolver registered
[    2.303637] mmc0: read SD Status register (SSR) after 3 attempts
[    2.321537] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    2.335029] mmc0: new high speed SDHC card at address 0002
[    2.346613] registered taskstats version 1
[    2.356797] mmcblk0: mmc0:0002 00000 7.41 GiB 
[    2.369633]  mmcblk0: p1 p2
[    2.399622] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.413468] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.432321] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.444551] Indeed it is in host mode hprt0 = 00001101
[    2.456477] devtmpfs: mounted
[    2.472674] Freeing init memory: 128K
[    2.672783] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.686167] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.700433] hub 1-1:1.0: USB hub found
[    2.709930] hub 1-1:1.0: 3 ports detected
[    2.992541] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.123068] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.146123] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.177036] smsc95xx v1.0.4
[    3.258034] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, xx:xx:xx:xx:xx:xx
[    3.352596] usb 1-1.2: new low-speed USB device number 4 using dwc_otg
[    3.497192] usb 1-1.2: New USB device found, idVendor=062a, idProduct=0102
[    3.521691] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.548488] usb 1-1.2: Product: Wireless Keyboard & Mouse
[    3.571337] usb 1-1.2: Manufacturer: MOSART Semi.
[    3.606781] input: MOSART Semi. Wireless Keyboard & Mouse as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
[    3.652956] hid-generic 0003:062A:0102.0001: input,hidraw0: USB HID v1.10 Keyboard [MOSART Semi. Wireless Keyboard & Mouse] on usb-bcm2708_usb-1.2/input0
[    3.706524] input: MOSART Semi. Wireless Keyboard & Mouse as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.1/input/input1
[    3.749241] hid-generic 0003:062A:0102.0002: input,hiddev0,hidraw1: USB HID v1.10 Mouse [MOSART Semi. Wireless Keyboard & Mouse] on usb-bcm2708_usb-1.2/input1
[    3.872528] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[    4.013147] usb 1-1.3: New USB device found, idVendor=1a40, idProduct=0101
[    4.042334] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    4.070317] usb 1-1.3: Product: USB 2.0 Hub [MTT]
[    4.086095] hub 1-1.3:1.0: USB hub found
[    4.096991] hub 1-1.3:1.0: 4 ports detected
[    4.264575] udevd[142]: starting version 175
[    4.382605] usb 1-1.3.1: new full-speed USB device number 6 using dwc_otg
[    4.525023] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=1003
[    4.561821] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.607650] usb 1-1.3.1: Product: HUAWEI Mobile
[    4.640750] usb 1-1.3.1: Manufacturer: HUAWEI Technologies
[    4.669753] scsi2 : usb-storage 1-1.3.1:1.2
[    4.742534] usb 1-1.3.3: new high-speed USB device number 7 using dwc_otg
[    4.844699] usbcore: registered new interface driver usbserial
[    4.923202] usb 1-1.3.3: New USB device found, idVendor=0c45, idProduct=6340
[    4.942497] usbcore: registered new interface driver usbserial_generic
[    4.972331] usb 1-1.3.3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[    5.012347] usb 1-1.3.3: Product: USB 2.0 Camera
[    5.032465] USB Serial support registered for generic
[    5.044773] usb 1-1.3.3: Manufacturer: Sonix Technology Co., Ltd.
[    5.084889] usbserial: USB Serial Driver core
[    5.151274] usbcore: registered new interface driver option
[    5.241950] USB Serial support registered for GSM modem (1-port)
[    5.285038] option 1-1.3.1:1.0: GSM modem (1-port) converter detected
[    5.372962] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB0
[    5.532563] option 1-1.3.1:1.1: GSM modem (1-port) converter detected
[    5.653060] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB1
[    5.671588] scsi 2:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[    5.952457] Registered led device: led0
[    6.911058] Linux media interface: v0.10
[    7.138421] Linux video capture interface: v2.00
[    7.438534] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:6340)
[    7.587327] input: USB 2.0 Camera as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/input/input2
[    7.668659] usbcore: registered new interface driver uvcvideo
[    7.717845] USB Video Class driver (1.1.1)
[    8.237827] sr0: scsi3-mmc drive: 0x/0x caddy
[    8.302313] cdrom: Uniform CD-ROM driver Revision: 3.20
[    8.385989] sr 2:0:0:0: Attached scsi CD-ROM sr0
[    8.656909] sr0: CDROM (ioctl) error, command: cdb[0]=0x51 51 00 00 00 00 00 00 00 02 00
[    8.680369] sr: Sense Key : 0x4 [current] 
[    8.692357] sr: ASC=0x0 ASCQ=0x0
[    8.749077] 7:3:1: cannot get freq at ep 0x84
[    8.774681] usbcore: registered new interface driver snd-usb-audio
[   11.536837] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   12.031369] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   12.704285] bcm2835 ALSA card created!
[   12.732688] bcm2835 ALSA chip created!
[   12.749539] bcm2835 ALSA chip created!
[   12.768034] bcm2835 ALSA chip created!
[   12.792414] bcm2835 ALSA chip created!
[   12.808879] bcm2835 ALSA chip created!
[   12.829283] bcm2835 ALSA chip created!
[   12.846580] bcm2835 ALSA chip created!
[   17.222023] mmc0: missed completion of cmd 18 DMA (512/512 [1]/[1]) - ignoring it
[   17.235884] mmc0: DMA IRQ 6 ignored - results were reset
[   22.558189] bcm2835-cpufreq: switching to governor ondemand
[   22.558220] bcm2835-cpufreq: switching to governor ondemand
[   24.681315] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
[  301.958063] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[271135.557015] hub 1-1:1.0: port 3 disabled by hub (EMI?), re-enabling...
[271135.557071] usb 1-1.3: USB disconnect, device number 5
[271135.557090] usb 1-1.3.1: USB disconnect, device number 6
[271135.557380] option1 ttyUSB0: option_instat_callback: error -108
[271135.557871] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[271135.557982] option 1-1.3.1:1.0: device disconnected
[271135.562352] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[271135.562512] option 1-1.3.1:1.1: device disconnected
[271135.577064] usb 1-1.3.3: USB disconnect, device number 7
[271135.834209] usb 1-1.3: new high-speed USB device number 8 using dwc_otg
[271135.935244] usb 1-1.3: New USB device found, idVendor=1a40, idProduct=0101
[271135.935274] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[271135.935291] usb 1-1.3: Product: USB 2.0 Hub [MTT]
[271135.936381] hub 1-1.3:1.0: USB hub found
[271135.936612] hub 1-1.3:1.0: 4 ports detected
[271136.089003] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[271136.089036] smsc95xx 1-1.1:1.0: eth0: Error reading MII_ACCESS
[271136.089053] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
[271136.089200] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[271136.089236] smsc95xx 1-1.1:1.0: eth0: Error reading MII_ACCESS
[271136.089253] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
[271136.214239] usb 1-1.3.1: new full-speed USB device number 9 using dwc_otg
[271136.315838] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=1003
[271136.315884] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[271136.315904] usb 1-1.3.1: Product: HUAWEI Mobile
[271136.315918] usb 1-1.3.1: Manufacturer: HUAWEI Technologies
[271136.321691] option 1-1.3.1:1.0: GSM modem (1-port) converter detected
[271136.322334] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB0
[271136.324684] option 1-1.3.1:1.1: GSM modem (1-port) converter detected
[271136.326806] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB1
[271136.330146] scsi5 : usb-storage 1-1.3.1:1.2
[271136.404410] usb 1-1.3.3: new high-speed USB device number 10 using dwc_otg
[271136.544639] usb 1-1.3.3: New USB device found, idVendor=0c45, idProduct=6340
[271136.544685] usb 1-1.3.3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[271136.544702] usb 1-1.3.3: Product: USB 2.0 Camera
[271136.544717] usb 1-1.3.3: Manufacturer: Sonix Technology Co., Ltd.
[271136.547833] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:6340)
[271136.561624] input: USB 2.0 Camera as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/input/input3
[271136.572962] 10:3:1: cannot get freq at ep 0x84
[271136.576880] hub 1-1:1.0: port 1 disabled by hub (EMI?), re-enabling...
[271136.576932] usb 1-1.1: USB disconnect, device number 3
[271136.577200] smsc95xx 1-1.1:1.0: eth0: unregister 'smsc95xx' usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet
[271136.824308] usb 1-1.1: new high-speed USB device number 11 using dwc_otg
[271136.924725] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[271136.924753] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[271136.927781] smsc95xx v1.0.4
[271136.989024] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, xx:xx:xx:xx:xx:xx
[271137.327075] scsi 5:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[271137.332015] sr0: scsi3-mmc drive: 0x/0x caddy
[271137.332818] sr 5:0:0:0: Attached scsi CD-ROM sr0
[271137.608974] sr0: CDROM (ioctl) error, command: cdb[0]=0x51 51 00 00 00 00 00 00 00 02 00
[271137.609024] sr: Sense Key : 0x4 [current] 
[271137.609036] sr: ASC=0x0 ASCQ=0x0
[271138.551350] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[474717.263449] usb 1-1.3: USB disconnect, device number 8
[474717.263481] usb 1-1.3.1: USB disconnect, device number 9
[474717.263776] option1 ttyUSB0: option_instat_callback: error -108
[474717.264270] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[474717.264380] option 1-1.3.1:1.0: device disconnected
[474717.269051] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[474717.269193] option 1-1.3.1:1.1: device disconnected
[474717.275252] usb 1-1.3.3: USB disconnect, device number 10
[474717.547111] usb 1-1.3: new high-speed USB device number 12 using dwc_otg
[474717.648146] usb 1-1.3: New USB device found, idVendor=1a40, idProduct=0101
[474717.648177] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[474717.648193] usb 1-1.3: Product: USB 2.0 Hub [MTT]
[474717.649287] hub 1-1.3:1.0: USB hub found
[474717.649517] hub 1-1.3:1.0: 4 ports detected
[474717.927156] usb 1-1.3.1: new full-speed USB device number 13 using dwc_otg
[474718.029381] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=1003
[474718.029428] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[474718.029446] usb 1-1.3.1: Product: HUAWEI Mobile
[474718.029460] usb 1-1.3.1: Manufacturer: HUAWEI Technologies
[474718.035245] option 1-1.3.1:1.0: GSM modem (1-port) converter detected
[474718.035938] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB0
[474718.040676] option 1-1.3.1:1.1: GSM modem (1-port) converter detected
[474718.041316] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB1
[474718.043711] scsi8 : usb-storage 1-1.3.1:1.2
[474718.127325] usb 1-1.3.3: new high-speed USB device number 14 using dwc_otg
[474718.267744] usb 1-1.3.3: New USB device found, idVendor=0c45, idProduct=6340
[474718.267775] usb 1-1.3.3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[474718.267791] usb 1-1.3.3: Product: USB 2.0 Camera
[474718.267835] usb 1-1.3.3: Manufacturer: Sonix Technology Co., Ltd.
[474718.270913] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:6340)
[474718.285185] input: USB 2.0 Camera as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/input/input4
[474718.297028] 14:3:1: cannot get freq at ep 0x84
[474719.041340] scsi 8:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[474719.046287] sr0: scsi3-mmc drive: 0x/0x caddy
[474719.047175] sr 8:0:0:0: Attached scsi CD-ROM sr0
[474719.263249] sr0: CDROM (ioctl) error, command: cdb[0]=0x51 51 00 00 00 00 00 00 00 02 00
[474719.263325] sr: Sense Key : 0x4 [current] 
[474719.263342] sr: ASC=0x0 ASCQ=0x0
[600391.115847] option1 ttyUSB0: option_instat_callback: error -108
[600391.116439] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[600391.116565] option 1-1.3.1:1.0: device disconnected
[600391.121132] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[600391.121299] option 1-1.3.1:1.1: device disconnected
[600391.121603] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.121943] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.124705] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.124965] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.125191] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.125213] hub 1-1.3:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[600391.125438] hub 1-1.3:1.0: cannot disable port 1 (err = -71)
[600391.125698] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.125944] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.126185] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.126460] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.126723] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.126745] hub 1-1.3:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[600391.127081] hub 1-1.3:1.0: cannot disable port 1 (err = -71)
[600391.127340] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.127579] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.127814] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.128072] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.128316] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.128337] hub 1-1.3:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[600391.128570] hub 1-1.3:1.0: cannot disable port 1 (err = -71)
[600391.128819] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.129077] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.129322] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.129564] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.129825] hub 1-1.3:1.0: cannot reset port 1 (err = -71)
[600391.129847] hub 1-1.3:1.0: Cannot enable port 1.  Maybe the USB cable is bad?
[600391.130078] hub 1-1.3:1.0: cannot disable port 1 (err = -71)
[600391.130316] hub 1-1.3:1.0: cannot disable port 1 (err = -71)
[600391.130682] hub 1-1.3:1.0: hub_port_status failed (err = -71)
[600391.169146] hub 1-1:1.0: port 3 disabled by hub (EMI?), re-enabling...
[600391.169218] usb 1-1.3: USB disconnect, device number 12
[600391.169239] usb 1-1.3.1: USB disconnect, device number 13
[600391.170575] uvcvideo: Failed to resubmit video URB (-19).
[600391.174594] uvcvideo: Failed to resubmit video URB (-19).
[600391.178590] uvcvideo: Failed to resubmit video URB (-19).
[600391.182586] uvcvideo: Failed to resubmit video URB (-19).
[600391.186574] uvcvideo: Failed to resubmit video URB (-19).
[600391.186730] usb 1-1.3.3: USB disconnect, device number 14
[600391.432435] usb 1-1.3: new high-speed USB device number 15 using dwc_otg
[600391.533496] usb 1-1.3: New USB device found, idVendor=1a40, idProduct=0101
[600391.533527] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[600391.533543] usb 1-1.3: Product: USB 2.0 Hub [MTT]
[600391.534654] hub 1-1.3:1.0: USB hub found
[600391.534999] hub 1-1.3:1.0: 4 ports detected
[600391.812513] usb 1-1.3.1: new full-speed USB device number 16 using dwc_otg
[600391.914708] usb 1-1.3.1: New USB device found, idVendor=12d1, idProduct=1003
[600391.914738] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[600391.914769] usb 1-1.3.1: Product: HUAWEI Mobile
[600391.914785] usb 1-1.3.1: Manufacturer: HUAWEI Technologies
[600391.920670] option 1-1.3.1:1.0: GSM modem (1-port) converter detected
[600391.921316] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB0
[600391.926280] option 1-1.3.1:1.1: GSM modem (1-port) converter detected
[600391.926963] usb 1-1.3.1: GSM modem (1-port) converter now attached to ttyUSB1
[600391.929433] scsi11 : usb-storage 1-1.3.1:1.2
[600392.012681] usb 1-1.3.3: new high-speed USB device number 17 using dwc_otg
[600392.153273] usb 1-1.3.3: New USB device found, idVendor=0c45, idProduct=6340
[600392.153323] usb 1-1.3.3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[600392.153341] usb 1-1.3.3: Product: USB 2.0 Camera
[600392.153356] usb 1-1.3.3: Manufacturer: Sonix Technology Co., Ltd.
[600392.156428] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:6340)
[600392.170341] input: USB 2.0 Camera as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.3/1-1.3.3:1.0/input/input5
[600392.181487] 17:3:1: cannot get freq at ep 0x84
[600392.925237] scsi 11:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[600392.930169] sr0: scsi3-mmc drive: 43x/40x dvd-ram caddy
[600392.931053] sr 11:0:0:0: Attached scsi CD-ROM sr0
[600393.147099] sr0: CDROM (ioctl) error, command: cdb[0]=0x51 51 00 00 00 00 00 00 00 02 00
[600393.147171] sr: Sense Key : 0x4 [current] 
[600393.147188] sr: ASC=0x0 ASCQ=0x0
dmesg from now (the last 8 and half days):

Code: Select all

see next message (couldn't fit to this message)
I plan to reboot and do an rpi-update soon. So please tell if you interested about other logs, symptoms.

richardp
Posts: 117
Joined: Thu Jan 12, 2012 11:46 am

Re: USB redux

Sun Apr 28, 2013 4:18 pm

Any new developments on the USB Reliability? I read lots on the new cameras and such things , but yet a FUNDAMENTAL function on the RaspberryPi is yet to be clarified, or even fixed.

Is there a timeline for the USB code to be fixed? or is 'Whenever' acceptable ? - Progress has been made, I do accept that; but how longer is this going to go on for? (Hint: Instead of playing with a camera that is not on sale, how about putting some more resources on the USB issues and get it off the list once and for all)

Richard
RaspberryPi's galore
Solid run CuBox
ODroid U2

drgeoff
Posts: 9741
Joined: Wed Jan 25, 2012 6:39 pm

Re: USB redux

Sun Apr 28, 2013 5:00 pm

richardp wrote:Any new developments on the USB Reliability? I read lots on the new cameras and such things , but yet a FUNDAMENTAL function on the RaspberryPi is yet to be clarified, or even fixed.

Is there a timeline for the USB code to be fixed? or is 'Whenever' acceptable ? - Progress has been made, I do accept that; but how longer is this going to go on for? (Hint: Instead of playing with a camera that is not on sale, how about putting some more resources on the USB issues and get it off the list once and for all)

Richard
Given that it is more than a year since USB problems were first reported (http://www.raspberrypi.org/phpBB3/viewt ... 813#p69813) and the Foundation is said to have someone working on it full-time since the start of 2013, I wouldn't have much confidence in any predicted date.

Some people may even think the more pertinent question is "Can or will there ever be a fix such that the RPi's USB works to the same (admittedly not 100%) level as is routinely expected on other platforms?" I'm still sitting on the fence about that, though as time passes my doubts do increase. :(

vmsda
Posts: 32
Joined: Tue Mar 12, 2013 5:02 pm

Re: USB redux

Sun Apr 28, 2013 5:57 pm

drgeoff wrote: ... Some people may even think the more pertinent question is "Can or will there ever be a fix such that the RPi's USB works to the same (admittedly not 100%) level as is routinely expected on other platforms?"...
Amen to that.
Samsung 900X, Ubuntu 12.04 host, VirtualBox, Windows 7 guest.
Raspberry Pi running 2013-02-09-wheezy-raspbian.img; Edimax EW-7811Un 802.11b/g/n adapter; Plugable USB2.0 4-port Hub.

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: USB redux

Sun Apr 28, 2013 7:40 pm

richardp wrote:Any new developments on the USB Reliability? I read lots on the new cameras and such things , but yet a FUNDAMENTAL function on the RaspberryPi is yet to be clarified, or even fixed.

Is there a timeline for the USB code to be fixed? or is 'Whenever' acceptable ? - Progress has been made, I do accept that; but how longer is this going to go on for? (Hint: Instead of playing with a camera that is not on sale, how about putting some more resources on the USB issues and get it off the list once and for all)

Richard
What issues remain?

Off the top of my head - global issues within the driver:
Split transactions - see the FIQ testing sticky.
Webcams/ISOC high-speed devices - still moderately unreliable at high bandwidths (we're talking 10MB/s+ here - reserved for the most basic of devices that transmit uncompressed video)
Crashes? I've tried quite hard on recent kernels and it's a hell of a lot harder to crash under "normal" usage than before.

Aside from these, if you have a repeatable problem with a USB device not experienced when using it under Linux on a PC, then post it to this thread, or start a new thread if you have not fully defined the problem.
drgeoff wrote: Given that it is more than a year since USB problems were first reported (http://www.raspberrypi.org/phpBB3/viewt ... 813#p69813) and the Foundation is said to have someone working on it full-time since the start of 2013, I wouldn't have much confidence in any predicted date.

Some people may even think the more pertinent question is "Can or will there ever be a fix such that the RPi's USB works to the same (admittedly not 100%) level as is routinely expected on other platforms?" I'm still sitting on the fence about that, though as time passes my doubts do increase. :(
The crux of the matter is, the hardware within the R-pi was never intended to be a PC-level host. The Designware OTG controller is just that - an on-the-go USB controller which has "dual role" capability - in that it can act as either a host or a device - but as an OTG host would only ever be expected to talk to 1-2 devices. Think mobile telephone plugged into USB pendrive, or a USB hdd plugged into a TV.

While the actual silicon is technically capable of implementing all the features of each type of individual USB transaction, it stops far short of providing the level of hardware integration that EHCI/xHCI compliant controllers found in desktop computers offer.

This means that all the necessary features to provide a fully-featured host must be performed in software. The driver effectively has to implement all queue management, scheduling, multi-step transaction state storage and error handling.

The following example illustrates my point:

Code: Select all

slocclount drivers/usb/host/dwc_otg
SLOC    Directory       SLOC-by-Language (Sorted)
26661   top_dir         ansic=26661
530     test            perl=530
0       doc             (none)

Totals grouped by language (dominant language first):
ansic:        26661 (98.05%)
perl:           530 (1.95%)
Total Physical Source Lines of Code (SLOC)                = 27,191

Code: Select all

sloccount drivers/usb/host/ehci*
SLOC    Directory       SLOC-by-Language (Sorted)
11373   top_dir         ansic=11373

Totals grouped by language (dominant language first):
ansic:        11373 (100.00%)
Total Physical Source Lines of Code (SLOC)                = 11,373
The driver for this specific piece of hardware is 2.3x bigger than the entire multi-vendor EHCI codebase in the linux kernel.

The primary method that the hardware uses to communicate state with the driver is via hardware interrupts. A single bit is set in the ARM's interrupt source registers, the cause of which must be divined by the driver and appropriate action taken. This requires precious processor cycles in an interrupt context.

There are a number of consequences to this. The first is that the overhead of processing an interrupt, even the simplest at the start-of-frame (without workarounds described later), takes approximately 10 microseconds of a 125uS (micro)frame. Various other commonly encountered USB interrupts have similar processing times. Additionally, several of these types of interrupt must be serviced within the 125uS microframe or the USB hardware will raise an error condition. If the Linux kernel is either already servicing another piece of hardware (interrupt handlers are not re-entrant in Linux, only one will run at a single time) then USB processing will be deferred until the first handler has done its task. The converse situation is where the Linux kernel specifically disables responding to hardware interrupts in order to service data structures or registers that may be altered by interrupt processing - again this time spent with IRQs disabled must be small or similar results will appear for USB.

The other consequence is that processing time in an interrupt handler is processing time not being used for other tasks. If we take the basic example of the start-of-frame interrupt handler taking 10uS every 125uS, then the ARM is spending 12% of its time dealing with the USB hardware.

The reason this processing takes so long is because the ARM is not a fast processor. It has approximately 1/8th the MIPS of a modern Intel desktop core. It also uses a tiny fraction of the wattage an Intel desktop CPU consumes - different design goals.

Aside from fixing bugs in the 27,000-line vendor-supplied driver, some of which are quite hard to reproduce due to the myriad of concurrency/timing conditions required to hit them, the major improvement has come through the use of the ARM's FIQ mechanism - a high-priority interrupt that will run and preempt any other context. This removes much of the overhead through precomputing an expected state, servicing the overall interrupt in an FIQ and then only requiring the lower-level IRQ to do something if actual hardware interaction is required.

In addition to the FIQ removing most of the overhead, the expansion to the FIQ will integrate split-transaction completion (which is VERY timing sensitive due to the nature of hub implementations - if a hub is ignored for 125uS with completed split-transaction transfers stored in its transaction translator, it will drop them - leading to missed keypresses, garbled audio) which should eliminate dropped split packets. This also neatly avoids situations where a particularly slow codepath in kernel contexts blocks interrupts for a long period of time - it doesn't block FIQs.

In short, providing a necessarily complex but efficient software implementation to cater for the underlying simplicity of the hardware is HARD.

Even after the software is improved to a level where the vast majority of all transactions are completed without much fuss, we then bump up against the limits of the hardware. There are 8 host channels within the USB core, each can handle one USB transaction at once. While the microframe scheduler patch ensures that these are near optimally-allocated on a microframe granularity, the fact of the matter is that if you plug lots of devices into a Pi, and use them all at once, expect stuff to go wrong.

Return to “Troubleshooting”