Usb problems with Fun Cube Dongle Pro + #608

Open
PeterOGB opened this Issue May 31, 2014 · 28 comments

Projects

None yet

5 participants

@PeterOGB

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
@popcornmix popcornmix changed the title from Usb probelms with Fun Cube Dongle Pro + to Usb problems with Fun Cube Dongle Pro + May 31, 2014
@P33M
Contributor
P33M commented 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 -v and lsusb -t

@PeterOGB

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
Contributor
P33M commented 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 -v for the device - it's clearly in the oddball (or "esoteric") bucket.

@PeterOGB
PeterOGB commented 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:

Bus 001 Device 005: ID 04d8:fb31 Microchip Technology, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0xfb31 
  bcdDevice           20.03
  iManufacturer           1 Hanlincrest Ltd.         
  iProduct                2 FUNcube Dongle V2.0  
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          132
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           30
        bInCollection           1
        baInterfaceNr( 0)       1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0603 Line Connector
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0000
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               1
        iTerminal               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bDelay                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]       192000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0318  1x 792 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      29
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0001
  Self Powered

I know the FCD developer so I can pass on any comments you may have.
PeterO

@P33M
Contributor
P33M commented 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
PeterOGB commented 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
Contributor
P33M commented 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
PeterOGB commented 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
PeterOGB commented Jun 1, 2014

Latest discovery.... With FCD plugged directly into the RPI, ethernet activity sometimes
upsets things. :-(

@P33M
Contributor
P33M commented 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
PeterOGB commented 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
PeterOGB commented 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
PeterOGB commented 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
Contributor
P33M commented 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.

@PeterOGB
PeterOGB commented Jun 2, 2014

Experiments this evening show it to be most stable when running with a hub with just the FCD plugged into it. It has run for as long as 10 minutes without anything being put into /var/log/messages. After 10 mins the FCD disconnected and reconnected (which killed my program of course). It's ho so close to working reliably at 192kHz sampling.

@PeterOGB
PeterOGB commented Jun 3, 2014

Today I received a Pimoroni PiHUB which is a multi-TT design. Using this the FCDPP is working much better. It still occasionally disconnects and some messages are generated when the HID interface is used to set the frequency. The longest I've seen it run for is 16 minutes. This is with no overclocking in use so I'm now going to try some moderate settings and see if that helps.
It really is very close to being stable and usable !

@PeterOGB
PeterOGB commented Jun 4, 2014
/:  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=hub, Driver=hub/4p, 480M
            |__ Port 2: Dev 9, If 0, Class=audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 9, If 1, Class=audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 9, If 2, Class=HID, Driver=usbhid, 12M
            |__ Port 4: Dev 7, If 0, Class=HID, Driver=usbhid, 1.5M
            |__ Port 4: Dev 7, If 1, Class=HID, Driver=usbhid, 1.5M
        |__ Port 3: Dev 5, If 0, Class=stor., Driver=usb-storage, 480M

sudo lsusb -v

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0x9512 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      1 Single TT
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2 TT per port
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             3
  wHubCharacteristic 0x000d
    Per-port power switching
    Compound device
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent      1 milli Ampere
  DeviceRemovable    0x02
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
   Port 2: 0000.0503 highspeed power enable connect
   Port 3: 0000.0503 highspeed power enable connect
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            3.12
  iManufacturer           3 Linux 3.12.20+ dwc_otg_hcd
  iProduct                2 DWC OTG Controller
  iSerial                 1 bcm2708_usb
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x0008
    Ganged power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood        1 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
Device Status:     0x0001
  Self Powered

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0xec00 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               4
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x05e3 Genesys Logic, Inc.
  idProduct          0x0610 4-port hub
  bcdDevice           32.98
  iManufacturer           0 
  iProduct                1 USB2.0 Hub
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      1 Single TT
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2 TT per port
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             4
  wHubCharacteristic 0x00e0
    Ganged power switching
    Ganged overcurrent protection
    TT think time 32 FS bits
    Port indicators
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0103 power enable connect
   Port 3: 0000.0100 power
   Port 4: 0000.0303 lowspeed power enable connect
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 005: ID 0bc2:2320 Seagate RSS LLC 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bc2 Seagate RSS LLC
  idProduct          0x2320 
  bcdDevice            1.00
  iManufacturer           2 Seagate
  iProduct                3 Expansion
  iSerial                 1 NA4535M0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 009: ID 04d8:fb31 Microchip Technology, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0xfb31 
  bcdDevice           20.03
  iManufacturer           1 Hanlincrest Ltd.         
  iProduct                2 FUNcube Dongle V2.0  
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          132
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           30
        bInCollection           1
        baInterfaceNr( 0)       1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0603 Line Connector
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0000
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               1
        iTerminal               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bDelay                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]       192000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0318  1x 792 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay              0 Undefined
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      29
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0001
  Self Powered

Bus 001 Device 007: ID 04f3:0103 Elan Microelectronics Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x04f3 Elan Microelectronics Corp.
  idProduct          0x0103 
  bcdDevice            1.07
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           59
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      54
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      52
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0003  1x 3 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)
pi@pi1 /opt/RPI/PiPan/src $ 
@P33M
Contributor
P33M commented 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
Contributor
P33M commented 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=0xf to /boot/cmdline.txt

@PeterOGB

On Fri, 2014-06-20 at 10:26 -0700, P33M wrote:

@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 alter 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=0xf to /boot/cmdline.txt

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


Reply to this email directly or view it on GitHub.

@P33M
Contributor
P33M commented Jun 20, 2014

192kHz (Fs/2 = 96kHz) would allow sufficient capture bandwidth for software demod of FM + stereo + RDS :]

@PeterOGB

On Fri, 2014-06-20 at 10:45 -0700, P33M wrote:

192kHz (Fs/2 = 96kHz) would allow sufficient capture bandwidth for
software demod of FM + stereo + RDS :]

Not much of that on HF though !

PeterO


Reply to this email directly or view it on GitHub.

@popcornmix popcornmix pushed a commit that referenced this issue Aug 4, 2014
@davem330 davem330 Merge branch 'mdio_module_unload'
Ezequiel Garcia says:

====================
net: phy: Prevent an MDIO bus from being unloaded while in use

Changes from v1:
  * Dropped the unneeded module_put() on phy_attach_direct().

The motivation of this small series is to fix the current lack of relationship
between an ethernet driver and the MDIO bus behind the PHY device. In such
cases, we would find no visible link between the drivers:

  $ lsmod
  Module                  Size  Used by    Not tainted
  mvmdio                  2941  0
  mvneta                 22069  0

Which means nothing prevents the MDIO driver from being removed:

  $ modprobe -r mvmdio

  # Unable to handle kernel NULL pointer dereference at virtual address 00000060
  pgd = c0004000
  [00000060] *pgd=00000000
  Internal error: Oops: 17 [#1] SMP ARM
  Modules linked in: mvneta [last unloaded: mvmdio]
  CPU: 0 PID: 22 Comm: kworker/0:1 Not tainted 3.16.0-rc5-01127-g62c0816-dirty #608
  Workqueue: events_power_efficient phy_state_machine
  task: df5ec840 ti: df67a000 task.ti: df67a000
  PC is at phy_state_machine+0x1c/0x468
  LR is at phy_state_machine+0x18/0x468
  [snip]

This patchset fixes this problem by adding a pair of module_{get,put},
so the module reference count is increased when the PHY device is attached
and is decreased when the PHY is detached.

Tested with mvneta and mv643xx_eth drivers, which depend on the mvmdio
driver to handle MDIO. This series applies on both net and net-next branches.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
a88a7be
@racorac
racorac commented 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
Contributor
P33M commented 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

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
racorac commented 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:

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.


Reply to this email directly or view it on GitHub
#608 (comment).

@jester-xbmc

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
Ruffio commented Aug 10, 2016

@PeterOGB has this issue been resolved? If yes, then please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment