camelator
Posts: 5
Joined: Sat Oct 27, 2012 8:53 am

Re: USB redux

Wed Jul 03, 2013 10:14 pm

hi Gordon,
thank you for your answer,
don't know very well where to put it.
I've repeated the sequence this evening, definitely, there is a regression with this branch.
I put it there:
https://github.com/Hexxeh/rpi-update/issues/101

If there is another location, I can move it.

Regards,

Christian.

MrEngman
Posts: 3949
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: USB redux

Sat Jul 13, 2013 4:51 pm

I've started to see some errors appear and have been advised to post here as it may be related to USB split FIQ what ever that is

Code: Select all

[  157.365717] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 7, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04400001
[  157.365717]
[  173.713839] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 6, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04400001
[  173.713839]
[  188.311524] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 4, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04400001
[  188.311524]
[  203.287140] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 3, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04400001
[  203.287140]
[  216.992828] ERROR::handle_hc_chhltd_intr_dma:2537: handle_hc_chhltd_intr_dma: Channel 1, DMA Mode -- ChHltd set, but reason for halting is unknown, hcint 0x00000002, intsts 0x04400001
[  216.992828]
They appear to occur mostly when I plug in a USB wifi adaptor in to my hub. The easy way to cause this error is to unplug a wifi adaptor and then plug it back in again although I think they also occur at other times like after a Pi has booted.

Further references here http://www.raspberrypi.org/phpBB3/viewt ... 28&t=49840 and here http://www.raspberrypi.org/phpBB3/viewt ... 23&start=0


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1489
Joined: Sat Sep 10, 2011 11:43 am

Re: USB redux

Sat Jul 13, 2013 5:41 pm

Yes,

Jonathan is currently working on a fix for this, so should have it soon.

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

MrEngman
Posts: 3949
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: USB redux

Sat Jul 13, 2013 6:53 pm

gsh wrote:Yes,

Jonathan is currently working on a fix for this, so should have it soon.

Gordon
Well, if you need a guinea pig for testing .... let me know


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

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

Re: USB redux

Sun Jul 14, 2013 12:32 pm

Hi Gordon

Here is a symptom (see attached screenshot).
dwc_otg_hcd_1315.jpg
dwc_otg_hcd_1315.jpg (63.36 KiB) Viewed 13130 times
(see in full size to be able to read it)

Freshly installed 2013-05-25-wheezy-raspbian, apt-get update and upgrade. Some more packages installed (motion, wvdial, bind9-host, dnsutils, inetutils-telnet, lsof)
And then:
sudo BRANCH=fiq_split rpi-update

Linux raspberrypi 3.8.13+ #460 PREEMPT Fri May 31 13:09:02 BST 2013 armv6l GNU/Linux

I was connected via ssh, let the Pi running for the night. In the morning the ssh connection was lost and I've found the attached screenshot on the screen, it does not reacted any keyboard press.

The connected devices are:
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 008: ID 0c45:6340 Microdia
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 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem
Bus 001 Device 007: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB


Hope it has some useful info for you. (I have the image in higher resolution if something is not readable)

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

Re: USB redux

Mon Jul 15, 2013 9:27 am

Rebooted two times, but one of the 4-port USB hub and the webcam are not listed by lsusb (actually it's one 7-port hub which is two 4-port hubs internally)
I've to add that the Pi is powered from the hub.

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 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA Modem

teratech
Posts: 7
Joined: Sun Jun 02, 2013 4:16 pm

Re: USB redux

Sat Jul 27, 2013 4:09 pm

Greetings to all,

I am here by way of another posting's feedback telling me to post my issue here. If this is the wrong place, then please accept my apology.

I need help with an USB issue. I am trying to capture several consecutive two hour recordings using the Raspi with the audio encoder directly attached to the Raspi USB port. Sometimes I get one or two of the consecutive two hour recordings. However, after a varying amount of time ranging from a few minutes up to several hours, the USB bus errors out and the USB bus will not longer function with the audio encoder. The same USB error occurs after running Darkice, an audio streaming program, for several hours. I have tried two different USB audio encoders, and running the raspi from 700 to 950 MHz. Once I get the error, arecord or Darkice will not work unless I unplug then re-plug the usb device or reboot the raspi.



Now here is the monkey wrench: When I connect either of the audio encoders to a 4-port hub that is connected to the raspi, I don't get the USB error. I would use this configuration but the USB hub distorts the audio signal going through it. Is there a USB hub that passes audio signals to the raspi without distortion?



Here is the arecord command entered twice and the resulting output. The first command was enter right after I had unplugged then re-plugged the USB audio encoder which seems to reset the error condition. The error can occur as quickly as a few minutes or up to several hours. Most fails occur after about 10 to 20 minutes after the arecord command is entered. Then after the error, the same arecord command is entered again. The resulting message from the error is displayed.


[email protected] /var/mail $ arecord -f S16_LE -c2 -r44100 -d 0 -D hw:1,0 -t wav | lame - -o /home/pi/stereo/river_$(date +%y%m%d%H%M).mp3
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
overrun!!! (at least 23.666 ms long)
overrun!!! (at least 11.607 ms long)
overrun!!! (at least 46.105 ms long)
arecord: pcm_read:1801: read error: Input/output error
LAME 3.99.5 32bits ({C}http://lame.sf.net{C})
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding <stdin> to /home/pi/stereo/river_1306021025.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3



[email protected] /var/mail $ arecord -f S16_LE -c2 -r44100 -d 0 -D hw:1,0 -t wav | lame - -o /home/pi/stereo/river_$(date +%y%m%d%H%M).mp3
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: set_params:1145: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (125011 125012)
PERIOD_SIZE: 5513
PERIOD_BYTES: 22052
PERIODS: (3 4)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0
Warning: unsupported audio format
[email protected] /var/mail $



So hopefully this information will help. Oh, I almost forgot my level of Wheezy:


http://downloads.ras... ... spbian.zip


# I have a "B" model Pi that I received shortly after the first of this year. It has the "Made in China" sticker.
# If I run the arecord command shown above on a Single Board Computer with an Intel N450 processor that I have running Ubuntu 12.04, it works as expected. (But the SBC uses at least 5 times the power of the raspi) I am working a battery application.
# If I run Darkice to stream MP3, the raspi will stream at 128kbps with the same hardware setup as the failing arecord example above, and has the same problem.
# When I power the audio encoder externally, (not through the raspi) I still get the error.

# I have also tried running the command above as sudo.


So I am out of gas for ideas as to what to look at. With my limited knowledge, I would guess the issue is related to the USB subsystem on the raspi because when I plug the 4 port expander in the USB path between the audio encoder and the raspi, the USB error stops happening.



Joel

AUG 11, 2013, --- MY ISSUE IS NOW RESOLVED:

After getting a reply from another posting, I was able to confirmation that Wheezy
level I was using and the Raspi hardware are most likely not the problem. I
also had tried a couple of different power supplies with no improvement. So I
focused on the pcm encoder. The two different encoders I had would not work.

After looking over a recommended list of audio encoders for Raspi, I decided
on the Focusrite Scarlett 2i2 because I am using XLR inputs. This encoder has
been working for the last three days continuously without error. So in the end it was a
matter of finding a compatible encoder to operate with the Raspi for continuous
audio USB operations.

Thanks for all the support!

Joel Goodwin
Last edited by teratech on Sun Aug 11, 2013 3:40 pm, edited 1 time in total.

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

Re: USB redux

Sat Jul 27, 2013 4:43 pm

teratech wrote:So I am out of gas for ideas as to what to look at. With my limited knowledge, I would guess the issue is related to the USB subsystem on the raspi because when I plug the 4 port expander in the USB path between the audio encoder and the raspi, the USB error stops happening.
Can you run rpi-update and confirm that the problem still exists with latest firmware?

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden
Contact: Website

Re: USB redux

Sun Jul 28, 2013 8:49 pm

Greetings!
I too am recording sound for extended lengths of time. In fact, I'm recording 24/7. I'm Head of All Things Technical at a small community radio station, and we are required by law to a keep an archive of everything we transmit for at least 6 months. I'm looking to substitute the Windows PC that now fulfills that role with something smaller and quieter.

My setup: a headless RPi mod. B v2 with an USB harddrive with its own power supply, holding all file systems except /boot, and a CMedia CM106 sound card. The sound card is USB 1.1. Both are connected directly to the RPi. I have tried with the sound card connected through a couple of different hubs, but all the hubs at my disposal are of the cheap and nasty kind with only a single TT and I don't think that helps...

The software I'm using is rotter - http://www.aelius.com/njh/rotter/ - which is made for the purpose. Rotter is available in the repositories. It requires JACK, so I've also installed jackd2.
I start a jack server and then rotter and if I leave the RPi at that everything is working OK. It can record for days at end. But if I generate a lot of USB2 activity for more than about 20 seconds, the sound card gets disconnected.

I have been able to make the sound card disconnect at will, just by starting something that generates lots of USB2 traffic for a prolonged amount of time.
For instance updatedb from the locate package.
Here's an excerpt from kern.log, updatedb started at 06:25 and less than half a minute later, the sound card (at this time connected through a hub) was lost:

Code: Select all

Jul 21 10:35:54 radio kernel: [   12.474438]  mmcblk0: p1 p2
Jul 21 10:35:54 radio kernel: [   14.576532] Adding 4193276k swap on /dev/sda3.  Priority:-1 extents:1 across:4193276k
Jul 21 10:35:54 radio kernel: [   14.848753] EXT4-fs (sda2): re-mounted. Opts: (null)
Jul 21 10:35:54 radio kernel: [   15.754794] EXT4-fs (sda2): re-mounted. Opts: (null)
Jul 21 10:35:54 radio kernel: [   26.792726] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Jul 21 10:35:54 radio kernel: [   28.370621] bcm2835-cpufreq: switching to governor ondemand
Jul 21 10:35:54 radio kernel: [   28.370653] bcm2835-cpufreq: switching to governor ondemand
Jul 22 06:25:24 radio kernel: [71159.985199] hub 1-1.2:1.0: port 3 disabled by hub (EMI?), re-enabling...
Jul 22 06:25:24 radio kernel: [71159.985821] usb 1-1.2.3: USB disconnect, device number 6
Jul 22 06:25:24 radio kernel: [71161.062116] [sched_delayed] sched: RT throttling activated
Jul 22 06:25:27 radio kernel: [71164.072864] usb 1-1.2.3: new full-speed USB device number 8 using dwc_otg
Jul 22 06:25:28 radio kernel: [71165.089861] usb 1-1.2.3: New USB device found, idVendor=0d8c, idProduct=0102
Jul 22 06:25:28 radio kernel: [71165.089892] usb 1-1.2.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
Jul 22 06:25:28 radio kernel: [71165.089909] usb 1-1.2.3: Product: USB Sound Device
Jul 22 06:25:29 radio kernel: [71166.070789] input: USB Sound Device         as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3:1.3/input/input1
Jul 22 06:25:29 radio kernel: [71166.075294] hid-generic 0003:0D8C:0102.0002: input,hidraw0: USB HID v1.00 Device [USB Sound Device        ] on usb-bcm2708_usb
Another test, this time with another sound card, a Presonus AudioBox, and no hub:

Code: Select all

Jul 22 13:09:51 radio kernel: [   14.540309] EXT4-fs (sda2): re-mounted. Opts: (null)
Jul 22 13:09:51 radio kernel: [   15.424473] EXT4-fs (sda2): re-mounted. Opts: (null)
Jul 22 13:09:51 radio kernel: [   26.614723] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Jul 22 13:09:51 radio kernel: [   27.947430] bcm2835-cpufreq: switching to governor ondemand
Jul 22 13:09:51 radio kernel: [   27.947460] bcm2835-cpufreq: switching to governor ondemand
Jul 22 19:41:07 radio kernel: [23485.304819] usb 1-1.2.3: USB disconnect, device number 6
Jul 22 19:44:09 radio kernel: [23668.006157] usb 1-1.2.4.3: new full-speed USB device number 8 using dwc_otg
Jul 22 19:44:11 radio kernel: [23669.471350] usb 1-1.2.4.3: New USB device found, idVendor=194f, idProduct=0301
Jul 22 19:44:11 radio kernel: [23669.471382] usb 1-1.2.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jul 22 19:44:11 radio kernel: [23669.471398] usb 1-1.2.4.3: Product: AudioBox USB
Jul 22 19:44:11 radio kernel: [23669.471411] usb 1-1.2.4.3: Manufacturer: PreSonus Audio
Another favorite to make the sound card fall over is making a backup of the RPi over the network with rsync - lots of HDD and network activity. Again, after about 20 seconds, the sound card disappears. I have even been able to make it fall over at two instances just by running lsusb -v :!:


That was the situation up until today. I noticed on github that there were updates made yesterday (27 July), so I grabbed the kernel sources and firmware. I'm testing a small USB FM receiver, whose driver is not included the standard builds, so build my own kernels. I'm using the stock .config from /proc/config.gz and just add the USB_SI470X driver as a module.

My first test on the new kernel/firmware looked promising. I ran updatedb and the sound card actually survived through the entire 8 minutes it took :o :shock: That is the first time that has ever happened. 8-)
Next test, a backup over the network with rsync. That looked good for about 10 minutes, i could see jackd and rotter running and the mp3 file rotter records to kept growing. But then the kernel log started getting spammed with retire_capture_urb messages:

Code: Select all

Jul 28 18:51:24 radio kernel: [   14.427942] EXT4-fs (sda2): re-mounted. Opts: (null)
Jul 28 18:51:24 radio kernel: [   15.339751] EXT4-fs (sda2): re-mounted. Opts: (null)
Jul 28 18:51:24 radio kernel: [   26.150544] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
Jul 28 18:51:24 radio kernel: [   27.788900] bcm2835-cpufreq: switching to governor ondemand
Jul 28 18:51:24 radio kernel: [   27.788929] bcm2835-cpufreq: switching to governor ondemand
Jul 28 19:18:47 radio kernel: [ 1650.665306] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped # This was during the updatedb run.
# I started the rsync job at 19:25
Jul 28 19:27:59 radio kernel: [ 2203.366361] smsc95xx 1-1.1:1.0: eth0: kevent 2 may have been dropped
Jul 28 19:36:52 radio kernel: [ 2736.136585] retire_capture_urb: 4985 callbacks suppressed
Jul 28 19:36:57 radio kernel: [ 2741.146286] retire_capture_urb: 4995 callbacks suppressed
Jul 28 19:37:02 radio kernel: [ 2746.156946] retire_capture_urb: 4997 callbacks suppressed
Jul 28 19:37:07 radio kernel: [ 2751.166637] retire_capture_urb: 4988 callbacks suppressed
Jul 28 19:37:12 radio kernel: [ 2756.177308] retire_capture_urb: 4992 callbacks suppressed
Jul 28 19:37:17 radio kernel: [ 2761.187014] retire_capture_urb: 4991 callbacks suppressed
Jul 28 19:37:22 radio kernel: [ 2766.196713] retire_capture_urb: 4969 callbacks suppressed
Jul 28 19:37:27 radio kernel: [ 2771.207352] retire_capture_urb: 4992 callbacks suppressed
Jul 28 19:37:32 radio kernel: [ 2776.217035] retire_capture_urb: 4995 callbacks suppressed
Jul 28 19:37:37 radio kernel: [ 2781.227725] retire_capture_urb: 4946 callbacks suppressed
Jul 28 19:37:42 radio kernel: [ 2786.237424] retire_capture_urb: 4957 callbacks suppressed
Jul 28 19:37:47 radio kernel: [ 2791.248076] retire_capture_urb: 4905 callbacks suppressed
Jul 28 19:37:52 radio kernel: [ 2796.257751] retire_capture_urb: 4927 callbacks suppressed
Jul 28 19:37:57 radio kernel: [ 2801.267448] retire_capture_urb: 4944 callbacks suppressed
Jul 28 19:38:02 radio kernel: [ 2806.278119] retire_capture_urb: 4944 callbacks suppressed
Jul 28 19:38:07 radio kernel: [ 2811.287809] retire_capture_urb: 4967 callbacks suppressed
Jul 28 19:38:12 radio kernel: [ 2816.298505] retire_capture_urb: 4946 callbacks suppressed
Jul 28 19:38:17 radio kernel: [ 2821.311220] retire_capture_urb: 4942 callbacks suppressed
Jul 28 19:38:22 radio kernel: [ 2826.318838] retire_capture_urb: 4947 callbacks suppressed
and so on and so on....
The retire_capture_urb messages are still coming as I write this, almost two hours later.
At 20:12 the jack server was starved to death and seems to have given up:

Code: Select all

ALSA: poll time out, polled for 34828087 usecs
JackAudioDriver::ProcessAsync: read error, stopping...
JackPosixProcessSync::LockedTimedWait error usec = 464380 err = Connection timed out
JackEngine::ClientDeactivate wait error ref = 2 name = rotter1
JackPosixProcessSync::LockedTimedWait error usec = 464380 err = Connection timed out
JackEngine::ClientDeactivate wait error ref = 2 name = rotter1
JackServer::ClientKill ref = 2 cannot be removed from the graph !!
JackPosixProcessSync::LockedTimedWait error usec = 92876 err = Connection timed out
JackEngine::ClientCloseAux wait error ref = 2
Soon followed by rotter:

Code: Select all

JackPosixSemaphore::TimedWait err = Connection timed out
SuspendRefNum error
JackClient::Execute error name = rotter1
[ERROR]  Sun Jul 28 20:12:35 2013  Rotter quitting because jackd is shutting down.
The jackd process is still running but it isn't doing anything useful. I think it is still busy trying to talk to the sound card.

Interesting is that this time dmesg shows nothing about the sound card disconnecting.
But it is gone, or rather half gone, both jack and arecord can see it but neither are able to use it...

Code: Select all

[email protected]:~# jackd -d alsa -r 44100 -C hw:1 -i 2 -S -n 3
jackdmp 1.9.9
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2012 Grame.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
creating alsa driver ... -|hw:1|1024|3|44100|2|0|nomon|swmeter|-|16bit
control device hw:0
configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 3 periods for capture
ALSA: cannot set hardware parameters for capture
ALSA: cannot configure capture channel
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server

[email protected]:~/tmp# arecord  -c 2 -D hw:1,0 -r 44100 -f s16_LE > test1.wav   
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: set_params:1145: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (125011 125012)
PERIOD_SIZE: 5513
PERIOD_BYTES: 22052
PERIODS: (3 4)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0
...even though lsusb shows that it is there...

Code: Select all

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 0d8c:0102 C-Media Electronics, Inc. CM106 Like Sound Device
Bus 001 Device 005: ID 13fd:1340 Initio Corporation Hi-Speed USB to SATA Bridge
So, now I've killed the jackd process and the retire_capture_urb messages have stopped coming. But if I try to start jackd again, another kind of message starts coming, so something has gone awry...

Code: Select all

Jul 28 21:38:09 radio kernel: [10013.669991] 4:2:1: usb_set_interface failed (-32)
Jul 28 21:38:25 radio kernel: [10029.464140] 4:2:1: usb_set_interface failed (-32)
Jul 28 21:39:56 radio kernel: [10120.630001] 4:2:1: usb_set_interface failed (-32)
Jul 28 21:40:17 radio kernel: [10140.976030] 4:2:1: usb_set_interface failed (-32)
Time for Ye Olde Reboot, it seems :D

If I can assist with testing, logs or debugging or whatever, just let me know.

TL;DR Kernel and firmware of 27 July seems to have improved stability quite a lot, but not quite there yet ;)

Cheers, Ragnar

grantonstar
Posts: 30
Joined: Sat Nov 24, 2012 1:08 pm

Re: USB redux

Thu Aug 01, 2013 9:30 am

After months of my Pi just working I’m struggling now with crashes every couple of hours. Running Raspbian with the Pi acting as a DLNA/SMB/NFS and Transmission server. Have a powered USB hub from DLink (listed as recommended) connecting to a couple of external hard drives, also independently powered.

The Pi seems to reboot, no kernel panics, nothing in syslog or anywhere else in /var/log to indicate an issue. Upon reboot, network services are inaccessible so it’s like the Pi isn’t rebooting cleanly. I’ve tried:

1. Full fsck on the SD card and connected drives.
2. Updated kernel/firmware to bleeding edge using rpi-update and then reverted back to stable.
3. Have selectively enabled, disabled various services to see if any had an impact. Disabling transmission-daemon possibly delays the crashes a little but certainly doesn’t remove them.

Nothing else has changed software or configuration wise with the Pi. I doubt this is directly linked to high activity on the USB/Ethernet as I don’t see the typical symptoms – kevent errors and so on. Also, the reboots as far as I can see from syslog occur generally at times of relative low load, certainly not when streaming 1080p mkv’s. I’ve also performed all the usual tweaks to cmdline.txt, sysctl.conf and so on.

Next candidate is power. I’ve replaced the power supply, actually tried two new supplies. No change. The only thing I can think of next is to remove the powered hub and plug one of the external HD’s directly into the USB on the Pi itself to try to rule out the USB hub. Is it common or possible for a failing USB hub to cause reboots like this? I've also read where the ethernet chip can overheat and crash the pi. Should I be thinking of returning the Pi for a warranty repair?

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2237
Joined: Thu Jul 11, 2013 2:37 pm

Re: USB redux

Thu Aug 01, 2013 6:52 pm

A USB device failing, or the USB driver failing usually results in either

- Kernel panic (no reboot, unless you have either panic=10 on the commandline or the watchdog set up)
- Device becoming unresponsive, which may or may not have associated syslog spam
- USB in general breaking and becoming unresponsive, while the Pi carries on regardless

If you're rebooting at random, then I would look at power.
Rockets are loud.
https://astro-pi.org

User avatar
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: USB redux

Thu Aug 01, 2013 7:33 pm

ragnarjensen wrote:Next test, a backup over the network with rsync...
I appreciate that you're giving a bug report, and hopefully the USB situation can still be improved further.

However we do know the R-Pi has limited CPU and limited USB bandwidth relative to a regular PC, due to hardware that we are stuck with for now. So if you wanted to consider a workaround, given that it worked OK for some minutes, you might get away with it for extended times if you could throttle the network traffic rate, to avoid the USB audio device timeout / lockup.

I have not used it, but I know that Linux supports traffic shaping / bandwidth limiting, see for example
http://www.iplocation.net/tools/traffic-control.php
http://www.tldp.org/HOWTO/html_single/T ... WTO/#intro

bendan
Posts: 7
Joined: Fri Mar 29, 2013 5:29 pm

Re: USB redux

Thu Aug 01, 2013 8:08 pm

There is a cron job that worked for me.

Google for "/opt/check_lan/stuck.fflg"

There are many hits but I used the info at:
http://www.raspberrypi.org/phpBB3/viewt ... 28&t=19971

my RPi was dropping lan connection ... usually with in 24 hours of boot.

The cron job solved that problem, I have been up for days now.

Good luck

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

Re: USB redux

Fri Aug 02, 2013 11:15 am

jbeale wrote: However we do know the R-Pi has limited CPU and limited USB bandwidth relative to a regular PC, due to hardware that we are stuck with for now.
(My emphasis).
Was that just careless writing or do you know something we don't? :)

User avatar
ragnarjensen
Posts: 332
Joined: Wed May 15, 2013 6:13 pm
Location: Stockholm, Sweden
Contact: Website

Re: USB redux

Sat Aug 03, 2013 11:06 am

jbeale wrote: So if you wanted to consider a workaround, given that it worked OK for some minutes, you might get away with it for extended times if you could throttle the network traffic rate, to avoid the USB audio device timeout / lockup.
That was my first thought too. I have a working setup now, using rsync's --bwlimit option to throttle the network. I have the backups running at a measly 2Mbit/s, but it gets the job done. There is ~600MB per day that needs backing up and that takes about 45 minutes.

The Pi has been been up, recording and being backed up, for 5 1/2 days now. It's chugging along nicely.

maniaque
Posts: 10
Joined: Mon Mar 11, 2013 3:33 pm

Re: USB redux

Sat Aug 03, 2013 3:47 pm


grantonstar
Posts: 30
Joined: Sat Nov 24, 2012 1:08 pm

Re: USB redux

Mon Aug 05, 2013 8:28 am

jdb wrote:A USB device failing, or the USB driver failing usually results in either

- Kernel panic (no reboot, unless you have either panic=10 on the commandline or the watchdog set up)
- Device becoming unresponsive, which may or may not have associated syslog spam
- USB in general breaking and becoming unresponsive, while the Pi carries on regardless

If you're rebooting at random, then I would look at power.
It's been over three days now since I disconnected my USB hub and connected one of the external hard drives directly to the Pi itself. No crashes, freezes or any other suspect behaviour so I am going to return the USB hub for repair.

In case I have trouble getting a repair, I've noticed many of the USB hubs listed on eLinux.org are quite old with limited availability. Are there any recommenedations for newer models? My Pi is independently powered and all of my external devices are too so not sure a powered hub is needed?

EDIT: Jinxed myself! Crashed this morning. Pi going back for repair/replacement.

oso71
Posts: 1
Joined: Tue Aug 20, 2013 4:13 pm

Re: USB redux

Tue Aug 20, 2013 4:19 pm

Sorry for digging up an old post. I have been using dwc_otg.microframe_schedule=1 dwc_otg.speed=1 dwc_otg.fiq_fix_enable=1 in my cmdline.txt for the last month and have found that this has made my USB MCE remote a lot less erratic and no longer lose power to it. The downside to this is I am using OpenElec with a USB as the main storage and it is corrupting the card.
What I was hoping was that I could keep the lower usb port at default speed and have the upper port running at 1.1 to maintain the stability of the MCE remote. Thanks in advance.

Maxion
Posts: 138
Joined: Mon Dec 03, 2012 2:22 pm

Re: USB redux

Thu Aug 22, 2013 2:27 pm

Here's an interesting post about a current bug in USB core of linux. I'm not entirely sure if this would apply to any of the problems regarding USB on the RPi.

https://plus.google.com/u/0/11696035749 ... Zpndv4BCCD

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: USB redux

Fri Aug 23, 2013 7:12 am

Probably not as we have OTG USB w/o EHCI.

Problems exist since OTG USB leaves lots of work to the CPU plus the original Linux OTG drivers weren't of much interest until recently.

The Pi community has its own driver developers, and I don't think much of what was there in terms of code base is still in use.

This is how I understand it.
Rocket Scientist.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1489
Joined: Sat Sep 10, 2011 11:43 am

Re: USB redux

Fri Aug 23, 2013 8:13 am

Not sure, I've got in contact with the person, but it may be that the problem also effects us. I believe (without checking) that the bug found is in the root hub code and the way it handles suspension and resumption of devices. So if that is the case then it would also effect us.

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

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

Re: USB redux

Sat Nov 09, 2013 7:29 pm

On a Raspberry Pi Model B with 512 MB RAM I have the problem that the USB interface stops working. The ethernet LEDs seem to work normally, but no ethernet connection is possible when the USB system has stopped working. Previously this has been a rare problem occurring when the computer has been idle. Today I saw for the first time that this error message was given when the USB system failed:
kernel: Disabling IRQ #32
The only way to recover is to cut the power from the Raspberry Pi. The keyboard and mouse are connected to the Pi through a powered USB hub.

Code: Select all

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 4: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
                |__ Port 3: Dev 6, If 0, Class=HID, Driver=usbhid, 1.5M
                |__ Port 3: Dev 6, If 1, Class=HID, Driver=usbhid, 1.5M
                |__ Port 4: Dev 7, If 0, Class=HID, Driver=usbhid, 1.5M
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 006: ID 04ca:0050 Lite-On Technology Corp. 
Bus 001 Device 007: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
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 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

uname -a
Linux raspberrypi 3.6.11+ #541 PREEMPT Sat Sep 7 19:46:21 BST 2013 armv6l GNU/Linux

cat /boot/cmdline.txt 
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Is this a known problem?

Is there any known workaround for this problem?

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

Re: USB redux

Thu Nov 28, 2013 8:14 pm

lingon wrote:On a Raspberry Pi Model B with 512 MB RAM I have the problem that the USB interface stops working. The ethernet LEDs seem to work normally, but no ethernet connection is possible when the USB system has stopped working. Previously this has been a rare problem occurring when the computer has been idle. Today I saw for the first time that this error message was given when the USB system failed:
kernel: Disabling IRQ #32
Unfortunately this problem still exists with the new kernel version
uname -a
Linux raspberrypi 3.10.19+ #600 PREEMPT Sat Nov 16 20:34:43 GMT 2013 armv6l GNU/Linux

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25413
Joined: Sat Jul 30, 2011 7:41 pm

Re: USB redux

Thu Nov 28, 2013 9:58 pm

Have you checked your power supply/cable - I had ethernet issues when using the camera due to lack of power - the symptom was the ethernet stopping and not coming back. Everything else seemed fine and it was a desktop power supply! The cable was bad.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1489
Joined: Sat Sep 10, 2011 11:43 am

Re: USB redux

Fri Nov 29, 2013 7:14 am

Does the problem still occur if you remove the external hub?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

Return to “Troubleshooting”