Page 16 of 21

Re: USB redux

Posted: Sat May 18, 2013 12:43 pm
by adam van gaalen
I'm happy to report that using kernel #450, for the first time ever, my Gembird switches appear to work very well on my Rpi. USB certainly has gotten a lot more stable now!

Re: USB redux

Posted: Sat May 18, 2013 4:44 pm
by whocares_ido
are any of those USB fixes already in the official OpenELEC builds for RPi? If not, do you know of any prebuilt OpenELEC versions that include those fixes (e.g. Rbej?)

Thank you

Re: USB redux

Posted: Sun May 19, 2013 6:44 pm
by eastpole
Possibly someone should pipe up in here when new firmware becomes available via rpi-update. It would help those who are subscribed to the thread and curious about ongoing improvements.

tai@psychic ~ $ uname -a
Linux psychic 3.6.11+ #452 PREEMPT Fri May 17 14:25:40 BST 2013 armv6l GNU/Linux

Re: USB redux

Posted: Sun May 19, 2013 6:49 pm
by gsh
Possible someone should read the previous page where I notified people about the new fiq code

Re: USB redux

Posted: Mon May 20, 2013 2:11 pm
by eastpole
gsh wrote:Possible someone should read the previous page where I notified people about the new fiq code
What, way back on the the 9th of May!? My memory doesn't stretch that far; it seems I see new firmware every week or so. In any case the list of reasons to install that branch indicated to me that my problems are ISOC-related, not FIQ.

Great work so far, GSH and M33P! I hope your code will be studied widely by software people who want to understand how USB works (and breaks).

eastpole

Re: USB redux

Posted: Mon May 20, 2013 8:38 pm
by superfly
Hi,

Update 14th June 2013: the problem appears gone with the latest Wheezy distribution 2013-05-25-wheezy-raspbian.zip
SHA-1 131f2810b1871a032dd6d1482dfba10964b43bd2. Uname reports 3.6.11+ #456 which looks to be the same as what I tried before, but perhaps something else got updated?


I have a Delcom USB light (http://www.delcomproducts.com/productde ... num=904006) which I'm trying to control via my Raspberry Pi using PyUSB, but there appear to be problems connecting to it. I'm connecting my keyboard and the light through a powered USB hub.

Initially I tried using the current Wheezy distribution on the RPi downloads page (uname reports it as #371). The Pi doesn't boot with the light attached, but spits out a stream of messages of the form:

Code: Select all

handle_hc_chhltd_intr_dma: 2131 handle_hc... Channel 6, MMA mod ChHIddset, but reason for haling unknown 0x401 intsts 0x6000021/0x6000029
Next I tried updating to the latest firmware via rpi-update, which was much better: the Pi could boot and I could query the device. However, the information returned seems incomplete, specifically lsusb reports that there are zero configurations for the device (bNumConfigurations is 0 and should be at least 1):

Code: Select all

pi@raspberrypi ~ $ sudo 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 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 005: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 083: ID 0fc5:b080 Delcom Engineering
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l GNU/Linux
pi@raspberrypi ~ $ set -o vi
pi@raspberrypi ~ $ sudo lsusb -v -d 0fc5:b080

Bus 001 Device 083: ID 0fc5:b080 Delcom Engineering
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0fc5 Delcom Engineering
  idProduct          0xb080
  bcdDevice            0.1f
  iManufacturer           1
  iProduct                2 USB IO Controller
  iSerial                 0
  bNumConfigurations      0
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled
I then tried the fiq_split (http://www.raspberrypi.org/phpBB3/viewt ... 05#p345905) branch, but then lsusb -v didn't work. That is, if I plugged in the USB light when the Pi was up, lsusb would list the light, but lsusb -v did not dump any information for it. If I booted the Pi with the light already attached then it wouldn't even show up via lsusb.

I don't have another linux platform to prove that the USB light works in other linux environments, but there are reports of using it on the internet so I'm leaning towards a problem with the Pi's USB code. This particular light works with our current windows setup so I think the hardware is also fine. In theory it provides a USB HID interface e.g. http://comments.gmane.org/gmane.comp.py ... sb.user/89 is an example of someone using PyUSB to control a Delcom USB light.

I understand that USB support is a work in progress--I'm hoping I can provide some diagnostic information that will help in this work. Are there any logs or further information I can provide that would help with this issue?

Re: USB redux

Posted: Tue May 21, 2013 3:58 am
by eastpole
eastpole wrote:Possibly someone should pipe up in here when new firmware becomes available via rpi-update. It would help those who are subscribed to the thread and curious about ongoing improvements.

Code: Select all

tai@psychic ~ $ uname -a
Linux psychic 3.6.11+ #452 PREEMPT Fri May 17 14:25:40 BST 2013 armv6l GNU/Linux
New today:

Code: Select all

Linux psychic 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l GNU/Linux

Re: USB redux

Posted: Tue May 21, 2013 1:51 pm
by dom
eastpole wrote:Possibly someone should pipe up in here when new firmware becomes available via rpi-update. It would help those who are subscribed to the thread and curious about ongoing improvements.
https://twitter.com/RPF_Dev_Updates

Re: USB redux

Posted: Thu Jun 06, 2013 7:52 pm
by whocares_ido
I still have some trouble which I think is related to USB (please correct me if I am wrong here).

My USB setup: (4-port USB hub powered by a 2.3A power supply, 16 GB USB Stick, DVB-C USB dongle)

Code: Select all

pi@raspbian-hf /var/log $ 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 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 5, If 0, Class=stor., Driver=usb-storage, 480M
            |__ Port 4: Dev 6, If 0, Class=vend., Driver=em28xx, 480M
version information:
I was running kernel/firmware that was available last Saturday (I believe it was what is described as "firmware: increase PCM buffer size again for ape audio" on Github for rpi-update)
Today I have upgraded to:

Code: Select all

pi@raspbian-hf /var/log $ uname -a
Linux raspbian-hf 3.6.11+ #462 PREEMPT Mon Jun 3 22:15:00 BST 2013 armv6l GNU/Linux
All devices connected to USB stopped working (Ethernet connectivity, DVB-C, ). Here is what I have found in /var/log/messages after the reboot that was necessary to get access again:

Code: Select all

Jun  5 22:33:36 raspbian-hf kernel: [462078.768188] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
Jun  5 22:33:36 raspbian-hf kernel: [462078.768234] smsc95xx 1-1.1:1.0: eth0: Error reading MII_ACCESS
Jun  5 22:33:36 raspbian-hf kernel: [462078.768252] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
Jun  5 22:33:41 raspbian-hf kernel: [462083.768495] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
Jun  5 22:33:41 raspbian-hf kernel: [462083.768541] smsc95xx 1-1.1:1.0: eth0: Error reading MII_ACCESS
Jun  5 22:33:41 raspbian-hf kernel: [462083.768559] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
Jun  5 22:33:47 raspbian-hf kernel: [462089.868876] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
Jun  5 22:33:47 raspbian-hf kernel: [462089.868906] smsc95xx 1-1.1:1.0: eth0: Error reading MII_ACCESS
Jun  5 22:33:47 raspbian-hf kernel: [462089.868921] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
Jun  5 22:33:52 raspbian-hf kernel: [462094.869178] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
Jun  5 22:33:52 raspbian-hf kernel: [462094.869206] smsc95xx 1-1.1:1.0: eth0: Error reading MII_ACCESS
Jun  5 22:33:52 raspbian-hf kernel: [462094.869223] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
Jun  5 22:33:53 raspbian-hf kernel: [462095.609262] xc5000: I2C read failed
Jun  5 22:33:54 raspbian-hf kernel: [462096.509209] xc5000: I2C read failed
Jun  5 22:33:54 raspbian-hf kernel: [462096.509258] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
Jun  5 22:33:54 raspbian-hf kernel: [462096.549545] xc5000: firmware uploading...
Jun  5 22:33:58 raspbian-hf kernel: [462100.599489] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000014
Jun  5 22:33:58 raspbian-hf kernel: [462100.599536] smsc95xx 1-1.1:1.0: eth0: Failed to write HW_CFG_LRST_ bit in HW_CFG
Jun  5 22:34:02 raspbian-hf kernel: [462104.609707] xc5000: I2C read failed
Jun  5 22:34:03 raspbian-hf kernel: [462105.509747] xc5000: I2C read failed
Jun  5 22:34:03 raspbian-hf kernel: [462105.509782] xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)...
Jun  5 22:34:03 raspbian-hf kernel: [462105.549224] xc5000: firmware uploading...
Jun  5 22:34:04 raspbian-hf kernel: [462106.599863] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000014
Jun  5 22:34:04 raspbian-hf kernel: [462106.599892] smsc95xx 1-1.1:1.0: eth0: Failed to write HW_CFG_LRST_ bit in HW_CFG
Jun  5 22:34:10 raspbian-hf kernel: [462112.600216] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000014
Jun  5 22:34:10 raspbian-hf kernel: [462112.600246] smsc95xx 1-1.1:1.0: eth0: Failed to write HW_CFG_LRST_ bit in HW_CFG
Jun  5 22:34:11 raspbian-hf kernel: [462113.610235] xc5000: I2C read failed
Jun  5 22:34:12 raspbian-hf kernel: [462114.510296] xc5000: I2C read failed
Is there anything else I can provide to help with the analysis?

Thank you!

Re: USB redux

Posted: Thu Jun 06, 2013 7:57 pm
by gsh
Have you tried the fiq_split branch to test the dequeueing patch?

sudo BRANCH=fiq_split rpi-update

Gordon

Re: USB redux

Posted: Thu Jun 06, 2013 9:15 pm
by whocares_ido
Thank you for the quick reply.

I have not tested the fiq_split branch yet.

Are there any other negative side effects of this branch? If so, where can I find information about the side effects?

Do I need to set any cmdline options when I use this branch or is it sufficient to run rpi-update?

Thank you!

Re: USB redux

Posted: Thu Jun 06, 2013 9:26 pm
by M33P
That's weird - there's been no significant update to the USB subsystem on the main branch for quite a while.

Your logs suggest a very long uptime before things started to go wrong (460,000 seconds - 5 days?) - did you reboot before or after a rpi-update to the latest version?

Re: USB redux

Posted: Thu Jun 06, 2013 9:35 pm
by whocares_ido
@M33P:
The system was set up last weekend with the latest (kernel/firmware) version that was available on Saturday (this was the version "May 26, 2013"). I am 100% sure that this updated version was installed and active (reboot was done).

Your estimated uptime is correct. According to the logs the system was fine until last night when the USB subsystem crashed (that is my interpretation).

There was no special activity. The system was idle as far as I can tell. tvheadend was running, but "idle scanning" had been deactivated and there were no clients active or recording scheduled, so no activity as far as I know.

Re: USB redux

Posted: Thu Jun 06, 2013 9:43 pm
by M33P
There is a potential defect in the driver that currently is very hard to trigger unless you're running fiq_split (and gsh checked in a patch for that branch to fix this anyway) - basically you have an infinitesimally small chance of the driver "losing track" of one of the 8 host channels in the hardware - if you get to <2 then USB generally breaks.

This really only comes about if you are dequeuing multiple transactions with other transactions active - but in the mainline driver you have to be doing something pretty ridiculous with USB to hit this bug. 5 days makes me nervous however - especially as you have only 2 devices plugged in (discounting ethernet) and they are all high-speed. Have you experienced any USB breakage before you updated? Has your Pi been active for similar lengths of time?

Re: USB redux

Posted: Thu Jun 06, 2013 10:14 pm
by whocares_ido
I do not have long-term experience with this particular setup (incl. the DVB-C stick).

I tried to build the same system some time ago but without running rpi-update. The DVB-C stick was not usable because there were too many glitches in the video. With rpi-update it is ok now (although not perfect but I blame the DVB-C signal / receiver for that)

I have another pi running soft float raspbian (to run a JAVA application). The max uptime there is roughly a week but as far as I can remember this was not limited by a crash recently but mostly because I regularly find a reason to reboot this Pi.

Re: USB redux

Posted: Tue Jun 11, 2013 4:14 am
by rogerdahl
Just wanted to report a success story with the #456 PREEMPT kernel. I've been running the Pi with the motion package and a Microsoft LifeCam Cinema without a single glitch, since updating the kernel, at least a month ago. I've been streaming 720p live video for long periods of time and have recorded some 20,000 still images, also in 720p. The images are first stored on the SD card and then copied to a remote server. Before the update, I had no end of trouble. Thanks for the great work, guys!

Re: USB redux

Posted: Sun Jun 23, 2013 9:45 am
by thradtke
Updated to #474, no longer repeating/missing characters with a USB1.1 mouse / USB2.0 keyboard setup (typing this with Midori on my Pi). Was there a major improvement in this regards?

Finally it works the way I wanted it to work :-). Will try my USB1.1 audio device later, but thanks a lot anyway!

Re: USB redux

Posted: Sun Jun 23, 2013 2:20 pm
by feverish
For the linux-incompetent, would someone please say when this wonderfully all-singing USB thingy is likely miraculously to appear when we go through the boring ritual apt-get upgrade and update stuff?

Re: USB redux

Posted: Sun Jun 23, 2013 7:33 pm
by thradtke
From one linux-incompetent to another linux-incompetent - as my Pi is not connected to broadband internet, I'm using this archive to manually update the system: https://github.com/raspberrypi/firmware.

Re: USB redux

Posted: Sun Jun 23, 2013 11:14 pm
by jjplano
hi!

does anybody know if these lasts fixes enable an easycap usb video capture dongle (or similar) to work properly on the pi?

thanks!

Re: USB redux

Posted: Mon Jun 24, 2013 1:59 am
by rogerdahl
@feverish, try the following magical incantation to get the latest USB goodness. You may also wish to draw a small hexagram and place the RPi on it, before starting the procedure :)

Code: Select all

$ sudo apt-get install git-core
$ sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
$ sudo rpi-update

Re: USB redux

Posted: Mon Jun 24, 2013 7:59 am
by gsh
That would be all-singing but if you want all-dancing as well you can try the fiq_split branch instead

Code: Select all

sudo BRANCH=fiq_split rpi-update

Re: USB redux

Posted: Mon Jun 24, 2013 2:33 pm
by feverish
super help,tks vm to both.
gsh thanks,but my raspi insists your fiq_split's rpi-update command does not exist. Probably my error but I can't see how.????

Re: USB redux

Posted: Mon Jun 24, 2013 2:44 pm
by MaxK1
What _does_ your pi have to say about it?

Re: USB redux

Posted: Mon Jun 24, 2013 3:15 pm
by feverish
MaxK1 wrote:What _does_ your pi have to say about it?
That gsh's rpi-update part of his command line is not recognised as existing..