Repository navigation
Closed
Description
Latest firmware has fixed USB so that external usb sound cards will word at 96kHz. But the Fun Cube Dongle uses 192kHz, and when using it the following messages appear in /var/log/messages before the device is eventually disconnected....
May 30 21:52:14 pi1 kernel: [ 89.504376] usb 1-1.3.1: new full-speed USB device number 9 using dwc_otg
May 30 21:52:14 pi1 kernel: [ 89.611890] usb 1-1.3.1: New USB device found, idVendor=04d8, idProduct=fb31
May 30 21:52:14 pi1 kernel: [ 89.611930] usb 1-1.3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
May 30 21:52:14 pi1 kernel: [ 89.611948] usb 1-1.3.1: Product: FUNcube Dongle V2.0
May 30 21:52:14 pi1 kernel: [ 89.611962] usb 1-1.3.1: Manufacturer: Hanlincrest Ltd.
May 30 21:52:14 pi1 kernel: [ 89.634891] hid-generic 0003:04D8:FB31.0004: hiddev0,hidraw3: USB HID v1.11 Device [Hanlincrest Ltd. FUNcube Dongle V2.0 ] on usb-bcm2708_usb-1.3.1/input2
May 30 21:52:15 pi1 kernel: [ 89.889874] 9:1:1: cannot get freq at ep 0x81
May 30 21:52:15 pi1 kernel: [ 89.898371] usbcore: registered new interface driver snd-usb-audio
May 30 21:52:42 pi1 kernel: [ 117.372821] 9:1:1: cannot get freq at ep 0x81
May 30 21:52:45 pi1 kernel: [ 120.280148] Transfer to device 9 endpoint 0x1 frame 934 failed - FIQ timed out. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.282403] Transfer to device 6 endpoint 0x1 frame 936 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.288399] Transfer to device 8 endpoint 0x1 frame 942 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.290403] Transfer to device 6 endpoint 0x1 frame 944 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.296422] Transfer to device 8 endpoint 0x2 frame 950 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.298384] Transfer to device 6 endpoint 0x1 frame 952 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.304409] Transfer to device 8 endpoint 0x2 frame 958 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.306393] Transfer to device 6 endpoint 0x1 frame 960 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.312435] Transfer to device 8 endpoint 0x2 frame 966 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.314456] Transfer to device 6 endpoint 0x1 frame 968 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:45 pi1 kernel: [ 120.320398] Transfer to device 8 endpoint 0x1 frame 974 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:46 pi1 kernel: [ 120.728180] Transfer to device 9 endpoint 0x1 frame 1382 failed - FIQ timed out. Data may have been lost.
May 30 21:52:46 pi1 kernel: [ 120.898038] Transfer to device 9 endpoint 0x1 frame 1552 failed - FIQ timed out. Data may have been lost.
May 30 21:52:46 pi1 kernel: [ 121.584182] Transfer to device 9 endpoint 0x1 frame 190 failed - FIQ timed out. Data may have been lost.
May 30 21:52:49 pi1 kernel: [ 124.616189] Transfer to device 9 endpoint 0x1 frame 1174 failed - FIQ timed out. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.296442] dwc_otg_hcd_handle_hc_fsm: 1234 callbacks suppressed
May 30 21:52:50 pi1 kernel: [ 125.296483] Transfer to device 8 endpoint 0x2 frame 1854 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.298479] Transfer to device 6 endpoint 0x1 frame 1856 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.304444] Transfer to device 8 endpoint 0x2 frame 1862 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.306456] Transfer to device 6 endpoint 0x1 frame 1864 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.312475] Transfer to device 8 endpoint 0x2 frame 1870 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.314481] Transfer to device 6 endpoint 0x1 frame 1872 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.320414] Transfer to device 8 endpoint 0x1 frame 1878 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.322421] Transfer to device 6 endpoint 0x1 frame 1880 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.328444] Transfer to device 8 endpoint 0x1 frame 1886 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:50 pi1 kernel: [ 125.330446] Transfer to device 6 endpoint 0x1 frame 1888 failed - FIQ reported NYET. Data may have been lost.
May 30 21:52:53 pi1 kernel: [ 128.162103] Transfer to device 9 endpoint 0x1 frame 624 failed - FIQ timed out. Data may have been lost.
May 30 21:52:54 pi1 kernel: [ 129.104202] Transfer to device 9 endpoint 0x1 frame 1566 failed - FIQ timed out. Data may have been lost.
May 30 21:52:55 pi1 kernel: [ 129.872208] Transfer to device 9 endpoint 0x1 frame 286 failed - FIQ timed out. Data may have been lost.
May 30 21:52:55 pi1 kernel: [ 130.304428] dwc_otg_hcd_handle_hc_fsm: 1229 callbacks suppressed
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Usb probelms with Fun Cube Dongle Pro +[/-][+]Usb problems with Fun Cube Dongle Pro +[/+]P33M commentedon May 31, 2014
Getting timeouts to multiple devices is a telltale that your device is attached to a single-TT hub.
Please post a full
lsusb -vandlsusb -tPeterOGB commentedon May 31, 2014
I have now tried the FCD plugged directly into the PI and it works much better, but still gettting a few messages like this
May 31 20:26:28 pi1 kernel: [ 190.431880] Transfer to device 4 endpoint 0x2 frame 1454 failed - FIQ reported NYET. Data may have been lost.
May 31 20:26:28 pi1 kernel: [ 190.432432] Transfer to device 4 endpoint 0x1 frame 1455 failed - FIQ timed out. Data may have been lost.
May 31 20:26:28 pi1 kernel: [ 190.433853] Transfer to device 4 endpoint 0x2 frame 1456 failed - FIQ reported NYET. Data may have been lost.
Looks like I need to get a better hub ! Is there a list of "good hubs" that won't give this problem ?
I need a hub as I need to plug in kbd,mouse,radio i/f, funcube dongle or sound card, and hard disk !
PeterO
EDIT: Not seen any more of those messages, and it looks like they come from the hid control interface rather than the usb-audio device.
P33M commentedon Jun 1, 2014
I would say that unbinding the HID endpoint would help, but from the frequency control source code it appears that it's used for controlling the device.
Hubs are a bit of a crapshoot - USB2.0 hubs are now costed down to the point where chip manufacturers have even resorted to aggregating two 4-port hub dies in a single package (single TT of course).
If you find one advertised as multi-TT then you have some recourse should it not be up to scratch. The only hub that I've seen that advertises this is the PiHUB - http://shop.pimoroni.com/products/pihub
Please post a
lsusb -vfor the device - it's clearly in the oddball (or "esoteric") bucket.PeterOGB commentedon Jun 1, 2014
Yes the HID endpoint is used to control the frequency and other things in the RF sections.
I found a hub advertised as "Multi-TT" but it only seems to be available in the US so it's going to take a while to arrive :-( I'll get one form pimoroni as well for comparison.
lsusb -v output as requested:
I know the FCD developer so I can pass on any comments you may have.
PeterO
P33M commentedon Jun 1, 2014
Given that this is a SDR frontend bolted onto an isochronous streaming endpoint, does any data come out of the second audio channel? I.e. is the sampled stream mono or stereo?
PeterOGB commentedon Jun 1, 2014
When I opened it as an alsa device it is stereo providing I/Q signals at 192kHz and 16bit resolution.
Is an "an isochronous streaming endpoint" not the right way to do it then ? (Not that I know what an "an isochronous streaming endpoint" is without going to Google to find out :-) )
P33M commentedon Jun 1, 2014
Isochronous is a transport that should be used for guaranteed-bandwidth, periodic data (usually audio/video, but I/Q samples also fit the description).
The Pi, for various reasons, has trouble with Isochronous full-speed devices that go above ~752 bytes per frame. One thing that could improve matters would be the addition of alternate settings - usually, several different alternate settings for the interface are specified to allow "optimal" allocation of bandwidth.
As this is a custom device, there need not be any rigid adherence to the sample rate or bit depth commonly used in audio devices. Addition of an 8-bit mode or lower-rate sampling would take the data rate down below the bandwidth threshold for running out of frame time.
PeterOGB commentedon Jun 1, 2014
Howard said "in the firmware source I have an option to be able to select all manner of rates and bit depths. Unfortunately windaz doesn't allow end-user selection and auto-selects bit depth over sample rate (max 192/16bit or 96/32bit on USB full) so I removed the option from the firmware,to simplify it for the 99%" So if other settings could give better results on the PI it might be possible to get a version of the firmware built with them included (though Howard may not want the hassle of supporting more than one build).
I'm in the middle of refactoring my code so I've not had chance to do a "soak test" with the FCD plugged directly into the PI. I'll do that as soon as I have working code again.
PeterOGB commentedon Jun 1, 2014
Latest discovery.... With FCD plugged directly into the RPI, ethernet activity sometimes
upsets things. :-(
P33M commentedon Jun 1, 2014
Assuming that the interrupt OUT endpoint is only used when changing settings, I think you only have 125uS of leeway for scheduling latency (actually more like 90, due to various hardware constraints).
Hubs will disconnect devices that "babble" over a frame boundary, which is a Bad Thing (tm), therefore the FIQ will not progress a transfer if it was asked to start it too late in a frame.
With a 792-byte isochronous endpoint and a 64-byte interrupt endpoint, the transaction sequence will only succeed if the first transaction goes out right at the start of the USB frame. Delaying this sequence (due to interrupt latency) will cause timeouts. The sequencing is nondeterministic: either endpoint could get timed out.
You're at the edge of what's supportable on the Pi's OTG.
PeterOGB commentedon Jun 1, 2014
I've gone back to using a usb soundcard that samples at 96kHz, and with that plugged directly into the RPI I'm seeing these messages...
Jun 1 17:41:43 pi1 kernel: [36563.917293] retire_capture_urb: 2 callbacks suppressed
Jun 1 17:42:02 pi1 kernel: [36582.689331] retire_capture_urb: 2 callbacks suppressed
Jun 1 17:42:14 pi1 kernel: [36594.336363] retire_capture_urb: 9 callbacks suppressed
Jun 1 17:42:19 pi1 kernel: [36600.053387] retire_capture_urb: 2 callbacks suppressed
Jun 1 17:42:31 pi1 kernel: [36612.255415] retire_capture_urb: 4 callbacks suppressed
Jun 1 17:42:57 pi1 kernel: [36637.555456] retire_capture_urb: 1 callbacks suppressed
Jun 1 17:43:02 pi1 kernel: [36642.803492] retire_capture_urb: 6 callbacks suppressed
Jun 1 17:43:08 pi1 kernel: [36648.605507] retire_capture_urb: 3 callbacks suppressed
Do you know what causes these ?
PeterOGB commentedon Jun 1, 2014
Just a thought, I'm currently not overclocking anything. If this is "at the edge" Is there anything that can be done in that area that will help ?
PeterOGB commentedon Jun 2, 2014
Just had to try the overclocking this morning... With the settings below ("modest" plus a bit of a core boost) things are improved, though it still won't run for much over a minute without the FCD gettting somehow upset and requiring to be replugged.
#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=800
gpu_mem=128
core_freq=300
sdram_freq=400
over_voltage=0
P33M commentedon Jun 2, 2014
retire_capture_urb() is the callback function for the audio record USB request block, usually about 8 or 16 frames' worth of data.
http://lxr.free-electrons.com/source/sound/usb/pcm.c#L1238
Each frame has a status field that reports if it succeeded or not: if nonzero then that means something went wrong. It appears that the usb sound driver continues with it anyway as long as there's a nonzero length.
Amusingly, if the ratelimit is hit then the relevant messages don't get printed at all.
It's odd that the dwc driver is a bit quiet when that happens: in theory, those transfers should be completely reliable barring bus errors.
Overclocking will help somewhat, but the relationship won't be linear.
3 remaining items
P33M commentedon Jun 13, 2014
There's a possible workaround for the HID endpoint at least:
The BSD devs have found that you can cheat the hub by forcing interrupt transfers into the control/bulk handler. This removes many of the limitations found when dealing with periodic packets. It is a blatant USB specification violation but if it works then it'll free up a lot of low-speed bus bandwidth.
This may push the 192kHz case into the "more useable" camp.
P33M commentedon Jun 20, 2014
@PeterOGB
The latest commit to https://github.com/P33M/linux/tree/fiq_fsm may make 192kHz capture more useable. It's a 3.10 branch but that shouldn't break anything.
If you want to test it in advance of a firmware release, you will have to cross-compile and copy the image + kernel modules across to the Pi. To use the hack add
dwc_otg.fiq_fsm_mask=0xfto /boot/cmdline.txtPeterOGB commentedon Jun 20, 2014
On Fri, 2014-06-20 at 10:26 -0700, P33M wrote:
I'm not set up to do that, and 96 kHz is more than adequate for my
needs. I'm waiting for a 96kHz sampling version of the FCDPP+ firmware
at the moment.
PeterO
P33M commentedon Jun 20, 2014
192kHz (Fs/2 = 96kHz) would allow sufficient capture bandwidth for software demod of FM + stereo + RDS :]
PeterOGB commentedon Jun 20, 2014
On Fri, 2014-06-20 at 10:45 -0700, P33M wrote:
Not much of that on HF though !
PeterO
Merge branch 'mdio_module_unload'
racorac commentedon Oct 8, 2014
I seem to get much better performance with the following:
Run "sudo rpi-update" to get latest kernel. Add dwc_otg.fiq_fsm_mask=0xF to /boot/cmdline.txt and reboot.
Although my entry still contains the following due to other things I tried before:
dwc_otg.fiq_split_enable=0 dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0xF dwc_otg.lpm_enable=0
but I haven't tried the 0xF on it's own yet.
here is the post I got the information from:
http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=70437&p=621838#p621838
P33M commentedon Oct 8, 2014
fiq_split_enable has no effect in latest firmware. LPM_enable is 0 by default, fiq_enable is 1 by default, fiq_fsm_enable is 1 by default. The only parameter that has any reasonable effect on the situation is fiq_fsm_mask.
When you say "Much better", how reliable is the operation?
jester-xbmc commentedon Jul 6, 2015
I'm still getting this on a Rpi2, anything that can be tweaked?, as the Pi 2 should have enough power to run without issue.
Transfer to device 4 endpoint 0x2 frame 1664 failed - FIQ reported NYET
etc.
racorac commentedon Jul 7, 2015
I'm not following the scene so much anymore but I have a feeling even in
the new PI there are similar USB limitations. That is not to do with CPU
power
On 6 July 2015 at 20:05, Jester notifications@github.com wrote:
jester-xbmc commentedon Jul 7, 2015
I was hoping for USB stack improvement, basically I want to use the FCDPP with a rpi2 as a remote receiver, and use virtualhere to forward the usb to my client pc, another solution is also welcome but I dont see it yet....
Ruffio commentedon Aug 10, 2016
@PeterOGB has this issue been resolved? If yes, then please close this issue.
P33M commentedon May 4, 2017
Closing USB issues as OP has not updated the thread. Further comments by the OP stating that the issue is still present on latest rpi-update kernel will lead to a review.
Merge pull request raspberrypi#608 from danobi/file_flags_type