Skip to content

USB Audio broken in kernel 3.18.7+ #888

Closed

Description

@Halloran

I run an RPi as an audio server: mpd 0.19.7 using ALSA to output to a Schiit Modi USB DAC, serving MP3's and FLAC files.

Recently, I ran apt-get update, apt-get upgrade, and my kernel went from 3.12.28+ to 3.18.7+, and this completely broke the audio output. Audio was being output more or less as white noise, not as slightly distorted, and this was the case with the aplay utility as well as with MPD. After a lot of troubleshooting with MPD, ALSA, etc., I used rpi-update to downgrade to the 3.12.28+ kernel, and all is working fine....

No idea it this is limited to USB audio, or if the problem might be deeper, but wanted to report it. Am happy to help with more system information, etc.

Activity

  1. popcornmix commented on Mar 15, 2015

    @popcornmix
    Collaborator

    sudo rpi-update f74b92120e0d469fc5c2dc85b2b5718d877e1cbb
    is the latest 3.12 and
    sudo rpi-update cad071ac50ddf8a9f3c7a5d808cfa0daf5effb45
    is the oldest 3.18 kernel.
    Can you test those two and report which work?

  2. Halloran commented on Mar 15, 2015

    @Halloran
    Author

    Looks like the latest 3.12 works, the oldest 3.18 does not:

    Ran:

    sudo rpi-update f74b92120e0d469fc5c2dc85b2b5718d877e1cbb
    

    got:

    pi@framboise ~ $ uname -a
    Linux framboise 3.12.36+ #737 PREEMPT Wed Jan 14 19:40:07 GMT 2015 armv6l GNU/Linux
    

    Audio works

    Ran

    sudo rpi-update cad071ac50ddf8a9f3c7a5d808cfa0daf5effb45
    

    got:

    pi@framboise ~ $ uname -a
    Linux framboise 3.18.3+ #739 PREEMPT Tue Jan 20 17:45:32 GMT 2015 armv6l GNU/Linux
    

    Audio broken

  3. popcornmix commented on Mar 15, 2015

    @popcornmix
    Collaborator

    Are you able to test the USB on a different platform (e.g. x86) with 3.18 kernel?

    The point where it broke was switching to a newer upstream kernel rather than a change to any Pi specific code. It may be this is a common problem for that sound card with newer kernel versions.

    Could be worth searching for similar problems on other platforms, in case there are known patches or workarounds.

  4. Halloran commented on Mar 15, 2015

    @Halloran
    Author

    Testing on x86 is not something that I can do anytime soon, though I'll try to figure out a way to do that.... I have looked through a lot of Audio sites, and it's hard to isolate the issues mentioned there, b/c getting USB audio working on Ubuntu seems to be pretty confusing in the first place....

    But thanks for that feedback. I will try to do more digging, and see if I can make any progress.

    In my case, the 3.12.x kernel is not really a problem, so I'll admit that my motivation here is pretty low.

    Again, let me know if there are other things you'd like me to check, and if I can get an x86 machine running 3.18 I'll post results here.

  5. P33M commented on Mar 16, 2015

    @P33M
    Contributor

    For reference, can you post a lsusb -v for the card in question?

    At this point I'm not convinced this is a Pi-specific issue, namely because recent updates should have absolutely no effect on Pi 1 USB performance.

  6. Halloran commented on Mar 16, 2015

    @Halloran
    Author

    Cannot figure out which device it is, as the manufacturer is not showing up, but here are the 2 possibilities:

    Bus 001 Device 004: ID 0d8c:1319 C-Media Electronics, Inc. 
    Couldn't open device, some information will be missing
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            0 (Defined at Interface level)
      bDeviceSubClass         0 
      bDeviceProtocol         0 
      bMaxPacketSize0        64
      idVendor           0x0d8c C-Media Electronics, Inc.
      idProduct          0x1319 
      bcdDevice            1.05
      iManufacturer           1 
      iProduct                2 
      iSerial                 0 
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          214
        bNumInterfaces          3
        bConfigurationValue     1
        iConfiguration          0 
        bmAttributes         0xc0
          Self Powered
        MaxPower              500mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      1 Control Device
          bInterfaceProtocol      0 
          iInterface              2 
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      1 (HEADER)
            bcdADC               1.00
            wTotalLength           40
            bInCollection           1
            baInterfaceNr( 0)       1
          AudioControl Interface Descriptor:
            bLength                12
            bDescriptorType        36
            bDescriptorSubtype      2 (INPUT_TERMINAL)
            bTerminalID             1
            wTerminalType      0x0101 USB Streaming
            bAssocTerminal          0
            bNrChannels             2
            wChannelConfig     0x0003
              Left Front (L)
              Right Front (R)
            iChannelNames           0 
            iTerminal               0 
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      3 (OUTPUT_TERMINAL)
            bTerminalID             7
            wTerminalType      0x0301 Speaker
            bAssocTerminal          0
            bSourceID              13
            iTerminal               0 
          AudioControl Interface Descriptor:
            bLength                10
            bDescriptorType        36
            bDescriptorSubtype      6 (FEATURE_UNIT)
            bUnitID                13
            bSourceID               1
            bControlSize            1
            bmaControls( 0)      0x01
              Mute Control
            bmaControls( 1)      0x00
            bmaControls( 2)      0x00
            iFeature                0 
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              4 
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       1
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                 7
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bDelay                  1 frames
            wFormatTag              1 PCM
          AudioStreaming Interface Descriptor:
            bLength                20
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bNrChannels             2
            bSubframeSize           2
            bBitResolution         16
            bSamFreqType            4 Discrete
            tSamFreq[ 0]        44100
            tSamFreq[ 1]        48000
            tSamFreq[ 2]        88200
            tSamFreq[ 3]        96000
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0188  1x 392 bytes
            bInterval               4
            bRefresh                0
            bSynchAddress         133
            AudioControl Endpoint Descriptor:
              bLength                 7
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x01
                Sampling Frequency
              bLockDelayUnits         0 Undefined
              wLockDelay              0 Undefined
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes            1
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0003  1x 3 bytes
            bInterval               4
            bRefresh                5
            bSynchAddress           0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       2
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                 7
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bDelay                  1 frames
            wFormatTag              1 PCM
          AudioStreaming Interface Descriptor:
            bLength                20
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bNrChannels             2
            bSubframeSize           3
            bBitResolution         24
            bSamFreqType            4 Discrete
            tSamFreq[ 0]        44100
            tSamFreq[ 1]        48000
            tSamFreq[ 2]        88200
            tSamFreq[ 3]        96000
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x024c  1x 588 bytes
            bInterval               4
            bRefresh                0
            bSynchAddress         133
            AudioControl Endpoint Descriptor:
              bLength                 7
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x01
                Sampling Frequency
              bLockDelayUnits         0 Undefined
              wLockDelay              0 Undefined
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes            1
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0003  1x 3 bytes
            bInterval               4
            bRefresh                5
            bSynchAddress           0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          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.00
              bCountryCode            0 Not supported
              bNumDescriptors         1
              bDescriptorType        34 Report
              wDescriptorLength      24
             Report Descriptors: 
               ** UNAVAILABLE **
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x84  EP 4 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0010  1x 16 bytes
            bInterval               4
    
  7. pssc commented on Mar 16, 2015

    @pssc

    USB audio working
    Bus 001 Device 004: ID 08bb:2902 Texas Instruments Japan PCM2902 Audio Codec

    Hardware : BCM2708
    Revision : 000f

    Linux raspberrypi 3.18.9

  8. P33M commented on Mar 16, 2015

    @P33M
    Contributor

    @Halloran With audio playing (either MPD or aplay) can you post the output of cat /proc/asound/card1/stream0 - and compare the 3.12 version with 3.18 to see if it's any different?

  9. P33M commented on Mar 16, 2015

    @P33M
    Contributor

    @Halloran I've just noticed that the device is likely to use a High-Speed chipset (CM6631A). Can you post a lsusb -t to confirm?

  10. sanjibm commented on Mar 16, 2015

    @sanjibm

    I can second this USB audio issue. I had to downgrade my kernel to 3.12 to get USB audio to work. BTW, I am also using a Schiit Modi USB DAC. Anything beyond 3.12 breaks the audio into crackles and corruption/noise.

    This might have a connection with the nrpacks option in the snd-usb-audio module. I noticed that this option is no longer supported in the latest kernels. According to modinfo, this sets the: Max. number of packets per URB. (int). Setting this to "nrpacks=1" should allow latencies in the area of 4-6 msecs.

    So if it shows up in the kernel as a valid parameter, then all is well:

    modinfo snd-usb-audio | grep ^parm:

    If nrpacks isn't available, then USB audio doesn't seem to work with the Schiit Modi DAC; this option has been recommended for other popular USB DACs too.

    I am not sure, but it appears that the nrpacks option was removed as the configuration for setting the number of packets per URB has been made automatic, hence this is no longer needed. Clearly something seems to be going wrong with this new implementation, or perhaps I am missing a replacement bit of configuration for the new kernels. Need to investigate a bit more

  11. pssc commented on Mar 16, 2015

    @pssc

    "Anything beyond 3.12 breaks the audio into crackles and corruption/noise."

    This would seem to be related to buffer settings in the audio subsystem have you tried upping buffer time and period count / buffer size for reliable usb audio try periodCount=5 bufferTime=113378,
    I had to significantly up these for USB audio (internal pc=3 bt=50).

  12. P33M commented on Mar 16, 2015

    @P33M
    Contributor

    @pssc @sanjibm It it unlikely that these module parameters need altering from defaults. With 3.18 in the wild and packaged for the latest release of Raspbian, if these changes caused failures across all usb-audio devices then the entire world would be screaming on the forums. As of 3.18 (actually as of 3.13) the nrpacks parameter is redundant because the driver has a notionally saner algorithm for calculating the number of URBs required.

    Both the reported problems are with a specific type of DAC. This DAC is unusual in being a high-speed device. There are differences with handling of packet intervals for high-speed Isochronous devices, which a move to 3.18 may have caused to change.

  13. pssc commented on Mar 16, 2015

    @pssc

    ok well event with my low speed devices I had to alter the application settings (not kernel) to get sane usb audio, if the system was under any load. I could also distort the USB audio by altering the spi bus frequency for the piftft screen (but I think that’s a different issue)
    The above settings where tuned to cause ~3-4k buffer update for a given period, reducing the strain on the system, before this the some of the USB audio device I tried sounded like the world had ended. Other USB sound devices where tolerant of lower settings(but caused horribly distorted audio on others). but still significantly more than the defaults alsa settings for internal output, which I guess reflects the latencies in the USB system and the occasion URB drop.

  14. Halloran commented on Mar 16, 2015

    @Halloran
    Author

    @P33M I've had to travel so do not have access to the machine at the moment. Will get you the info you requested above, but it might be a couple of days.

  15. pssc commented on Mar 16, 2015

    @pssc

    Looking at one of my home PI's the least tolerant device I have was a
    Bus 001 Device 005: ID 0d8c:0103 C-Media Electronics, Inc. CM102-A+/102S+ Audio Controller
    which looks like it may me similar to the chip set in the above mentioned DAC.
    With this device I also found a reboot didn’t recover from the distorting and it need a complete power removal from the pi to restore reasonable audio.

  16. 12 remaining items

  17. P33M commented on Mar 30, 2015

    @P33M
    Contributor

    I now have a Schitt Modi 2.

    Interestingly, there's a switch on the back that puts the device in "expert" mode.

    It changes the descriptors like so:

    
    Bus 001 Device 004: ID 0d8c:0319 C-Media Electronics, Inc. 
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass          239 Miscellaneous Device
      bDeviceSubClass         2 ?
      bDeviceProtocol         1 Interface Association
      bMaxPacketSize0        64
      idVendor           0x0d8c C-Media Electronics, Inc.
      idProduct          0x0319 
      bcdDevice            1.05
      iManufacturer           1 Schiit Audio
      iProduct                2 USB Modi Device
      iSerial                 0 
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          298
        bNumInterfaces          3
        bConfigurationValue     1
        iConfiguration          0 
        bmAttributes         0xc0
          Self Powered
        MaxPower              500mA
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         0
          bInterfaceCount         2
          bFunctionClass          1 Audio
          bFunctionSubClass       0 
          bFunctionProtocol      32 
          iFunction               0 
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         1 Audio
          bInterfaceSubClass      1 Control Device
          bInterfaceProtocol     32 
          iInterface              2 USB Modi Device
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      1 (HEADER)
            bcdADC               2.00
            bCategory              10
            wTotalLength          256
            bmControl            0x00
          AudioControl Interface Descriptor:
            bLength                17
            bDescriptorType        36
            bDescriptorSubtype      2 (INPUT_TERMINAL)
            bTerminalID             1
            wTerminalType      0x0101 USB Streaming
            bAssocTerminal          0
            bCSourceID             18
            bNrChannels             0
            bmChannelConfig   0x00000000
            bmControls    0x0040
              Cluster Control (read-only)
            iChannelNames           0 
            iTerminal               0 
          AudioControl Interface Descriptor:
            bLength                12
            bDescriptorType        36
            bDescriptorSubtype      3 (OUTPUT_TERMINAL)
            bTerminalID             7
            wTerminalType      0x0301 Speaker
            bAssocTerminal          0
            bSourceID              13
            bCSourceID             18
            bmControls         0x0000
            iTerminal               0 
          AudioControl Interface Descriptor:
            bLength                18
            bDescriptorType        36
            bDescriptorSubtype      6 (FEATURE_UNIT)
            bUnitID                13
            bSourceID               1
            bmaControls( 0)      0x00000003
              Mute Control (read/write)
            bmaControls( 1)      0x00000000
            bmaControls( 2)      0x00000000
            iFeature                0 
          AudioControl Interface Descriptor:
            bLength                 8
            bDescriptorType        36
            bDescriptorSubtype     10 (CLOCK_SOURCE)
            bClockID               18
            bmAttributes         0x03 Internal programmable Clock 
            bmControls           0x07
              Clock Frequency Control (read/write)
              Clock Validity Control (read-only)
            bAssocTerminal          0
            iClockSource            0 
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x8f  EP 15 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0006  1x 6 bytes
            bInterval               4
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol     32 
          iInterface              4 Speaker-Schiit USB Audio Device
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       1
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol     32 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                16
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bmControls           0x05
              Active Alternate Setting Control (read-only)
              Valid Alternate Setting Control (read-only)
            bFormatType             1
            bmFormats               1
              PCM
            bNrChannels             2
            bmChannelConfig   0x00000003
              Front Left (FL)
              Front Right (FR)
            iChannelNames           0 
          AudioStreaming Interface Descriptor:
            bLength                 6
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bSubslotSize            2
            bBitResolution         16
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0068  1x 104 bytes
            bInterval               1
            AudioControl Endpoint Descriptor:
              bLength                 8
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x00
              bmControls           0x00
              bLockDelayUnits         0 Undefined
              wLockDelay              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes           17
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Feedback
            wMaxPacketSize     0x0004  1x 4 bytes
            bInterval               4
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       2
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol     32 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                16
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bmControls           0x05
              Active Alternate Setting Control (read-only)
              Valid Alternate Setting Control (read-only)
            bFormatType             1
            bmFormats               1
              PCM
            bNrChannels             2
            bmChannelConfig   0x00000003
              Front Left (FL)
              Front Right (FR)
            iChannelNames           0 
          AudioStreaming Interface Descriptor:
            bLength                 6
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bSubslotSize            3
            bBitResolution         24
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x009c  1x 156 bytes
            bInterval               1
            AudioControl Endpoint Descriptor:
              bLength                 8
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x00
              bmControls           0x00
              bLockDelayUnits         0 Undefined
              wLockDelay              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes           17
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Feedback
            wMaxPacketSize     0x0004  1x 4 bytes
            bInterval               4
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       3
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol     32 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                16
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bmControls           0x05
              Active Alternate Setting Control (read-only)
              Valid Alternate Setting Control (read-only)
            bFormatType             1
            bmFormats               1
              PCM
            bNrChannels             2
            bmChannelConfig   0x00000003
              Front Left (FL)
              Front Right (FR)
            iChannelNames           0 
          AudioStreaming Interface Descriptor:
            bLength                 6
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bSubslotSize            4
            bBitResolution         32
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x00d0  1x 208 bytes
            bInterval               1
            AudioControl Endpoint Descriptor:
              bLength                 8
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x00
              bmControls           0x00
              bLockDelayUnits         0 Undefined
              wLockDelay              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes           17
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Feedback
            wMaxPacketSize     0x0004  1x 4 bytes
            bInterval               4
        Interface Association:
          bLength                 8
          bDescriptorType        11
          bFirstInterface         2
          bInterfaceCount         1
          bFunctionClass          3 Human Interface Device
          bFunctionSubClass       0 No Subclass
          bFunctionProtocol       0 None
          iFunction               0 
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          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.00
              bCountryCode            0 Not supported
              bNumDescriptors         1
              bDescriptorType        34 Report
              wDescriptorLength      24
             Report Descriptors: 
               ** UNAVAILABLE **
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x84  EP 4 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          239 Miscellaneous Device
      bDeviceSubClass         2 ?
      bDeviceProtocol         1 Interface Association
      bMaxPacketSize0        64
      bNumConfigurations      1
    Device Status:     0x0000
      (Bus Powered)
    
  18. P33M commented on Mar 30, 2015

    @P33M
    Contributor
    
    Bus 001 Device 005: ID 0d8c:1319 C-Media Electronics, Inc. 
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            0 (Defined at Interface level)
      bDeviceSubClass         0 
      bDeviceProtocol         0 
      bMaxPacketSize0        64
      idVendor           0x0d8c C-Media Electronics, Inc.
      idProduct          0x1319 
      bcdDevice            1.05
      iManufacturer           1 Schiit Audio
      iProduct                2 USB Modi Device
      iSerial                 0 
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          214
        bNumInterfaces          3
        bConfigurationValue     1
        iConfiguration          0 
        bmAttributes         0xc0
          Self Powered
        MaxPower              500mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      1 Control Device
          bInterfaceProtocol      0 
          iInterface              2 USB Modi Device
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      1 (HEADER)
            bcdADC               1.00
            wTotalLength           40
            bInCollection           1
            baInterfaceNr( 0)       1
          AudioControl Interface Descriptor:
            bLength                12
            bDescriptorType        36
            bDescriptorSubtype      2 (INPUT_TERMINAL)
            bTerminalID             1
            wTerminalType      0x0101 USB Streaming
            bAssocTerminal          0
            bNrChannels             2
            wChannelConfig     0x0003
              Left Front (L)
              Right Front (R)
            iChannelNames           0 
            iTerminal               0 
          AudioControl Interface Descriptor:
            bLength                 9
            bDescriptorType        36
            bDescriptorSubtype      3 (OUTPUT_TERMINAL)
            bTerminalID             7
            wTerminalType      0x0301 Speaker
            bAssocTerminal          0
            bSourceID              13
            iTerminal               0 
          AudioControl Interface Descriptor:
            bLength                10
            bDescriptorType        36
            bDescriptorSubtype      6 (FEATURE_UNIT)
            bUnitID                13
            bSourceID               1
            bControlSize            1
            bmaControls( 0)      0x01
              Mute Control
            bmaControls( 1)      0x00
            bmaControls( 2)      0x00
            iFeature                0 
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              4 Speaker-Schiit USB Audio Device
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       1
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                 7
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bDelay                  1 frames
            wFormatTag              1 PCM
          AudioStreaming Interface Descriptor:
            bLength                20
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bNrChannels             2
            bSubframeSize           2
            bBitResolution         16
            bSamFreqType            4 Discrete
            tSamFreq[ 0]        44100
            tSamFreq[ 1]        48000
            tSamFreq[ 2]        88200
            tSamFreq[ 3]        96000
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0188  1x 392 bytes
            bInterval               4
            bRefresh                0
            bSynchAddress         133
            AudioControl Endpoint Descriptor:
              bLength                 7
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x01
                Sampling Frequency
              bLockDelayUnits         0 Undefined
              wLockDelay              0 Undefined
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes            1
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0003  1x 3 bytes
            bInterval               4
            bRefresh                5
            bSynchAddress           0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       2
          bNumEndpoints           2
          bInterfaceClass         1 Audio
          bInterfaceSubClass      2 Streaming
          bInterfaceProtocol      0 
          iInterface              0 
          AudioStreaming Interface Descriptor:
            bLength                 7
            bDescriptorType        36
            bDescriptorSubtype      1 (AS_GENERAL)
            bTerminalLink           1
            bDelay                  1 frames
            wFormatTag              1 PCM
          AudioStreaming Interface Descriptor:
            bLength                20
            bDescriptorType        36
            bDescriptorSubtype      2 (FORMAT_TYPE)
            bFormatType             1 (FORMAT_TYPE_I)
            bNrChannels             2
            bSubframeSize           3
            bBitResolution         24
            bSamFreqType            4 Discrete
            tSamFreq[ 0]        44100
            tSamFreq[ 1]        48000
            tSamFreq[ 2]        88200
            tSamFreq[ 3]        96000
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x05  EP 5 OUT
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x024c  1x 588 bytes
            bInterval               4
            bRefresh                0
            bSynchAddress         133
            AudioControl Endpoint Descriptor:
              bLength                 7
              bDescriptorType        37
              bDescriptorSubtype      1 (EP_GENERAL)
              bmAttributes         0x01
                Sampling Frequency
              bLockDelayUnits         0 Undefined
              wLockDelay              0 Undefined
          Endpoint Descriptor:
            bLength                 9
            bDescriptorType         5
            bEndpointAddress     0x85  EP 5 IN
            bmAttributes            1
              Transfer Type            Isochronous
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0003  1x 3 bytes
            bInterval               4
            bRefresh                5
            bSynchAddress           0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          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.00
              bCountryCode            0 Not supported
              bNumDescriptors         1
              bDescriptorType        34 Report
              wDescriptorLength      24
             Report Descriptors: 
               ** UNAVAILABLE **
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x84  EP 4 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            0 (Defined at Interface level)
      bDeviceSubClass         0 
      bDeviceProtocol         0 
      bMaxPacketSize0        64
      bNumConfigurations      1
    Device Status:     0x0000
      (Bus Powered)
    
  19. P33M commented on Mar 30, 2015

    @P33M
    Contributor

    This is the output on a B+ with 3.18:
    tek00000
    And on 3.12:
    tek00001

    On 3.12, I note that the audio actually plays ridiculously fast. Yep, it's broken.

    There's some substantial weirdness with the packet intervals.

    On 3.12, I get a packet every microframe (which is totally wrong) but it's somewhat consistent.

    On 3.18, I get 3-4 packets every 8 microframes, which is even more wrong.

  20. P33M commented on Mar 30, 2015

    @P33M
    Contributor

    @Halloran Can you try using the device with dwc_otg.fiq_fsm_enable=0? Or alternatively if your keyboard starts to play up, substitute dwc_otg.fiq_fsm_enable=0 for dwc_otg.fiq_fsm_mask=0x3.

  21. Halloran commented on Mar 30, 2015

    @Halloran
    Author

    Happy to give that a try. Where/how do I configure that?

  22. P33M commented on Mar 30, 2015

    @P33M
    Contributor

    Add the parameter to /boot/cmdline.txt and reboot.

  23. Halloran commented on Apr 1, 2015

    @Halloran
    Author

    Yup. That works.

    What are the implications of that?

  24. P33M commented on Apr 1, 2015

    @P33M
    Contributor

    The fiq_fsm handler is incorrectly performing transfers to high-speed isoc OUT endpoints. It appears that it's blindly transferring data every microframe instead of strided per 2^(n-1) microframes. With Isoc IN endpoints, you can request data every microframe and the device just responds as-and-when.

    This is why nrpacks=1 worked - one isochronous transfer per URB which hid the bug.

    Without FIQ support, microframe jitter will cause variations in timing of the OUT packets which will probably cause sample rate skew. I'll look at implementing strided transfer support.

  25. Halloran commented on Apr 1, 2015

    @Halloran
    Author

    OK. Going back to the 3.12 kernel. Happy to test things out to help. And many thanks for working on this.

  26. Ruffio commented on Aug 15, 2016

    @Ruffio

    @Halloran has your issue been resolved? If so, please close this issue. Thanks.

  27. Halloran commented on Aug 15, 2016

    @Halloran
    Author

    @Ruffio am I correct that you are asking if the issue is resolved in the 4.1 kernel? Or is there a 3 series kernel that I should be testing?

  28. Ruffio commented on Aug 15, 2016

    @Ruffio

    @Halloran I would test with latest version (4.4)

  29. Halloran commented on Aug 15, 2016

    @Halloran
    Author

    @Ruffio will try to give that a go sometime this week. Sorry to have left this open so long.

  30. Halloran commented on Aug 16, 2016

    @Halloran
    Author

    Updated kernel to 4.4.17+ and the issue is resolved.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions