2.246, UMC204HD, audio glitches, spotify sample rate

Hi Everyone,

Love the look of the Volumio project - I first came across it some time ago but I didn’t have a DAC to use with my Pi so didn’t go any further with it at the time.

I recently bought a Behringer U-Phoria UMC204HD USB sound interface - I didn’t buy it specifically for Volumio - I bought it for use with a WIndows 7 Laptop for speaker measurement (and it’s working perfectly there) however now I have it I thought why not plug it into Volumio and see if it was detected and supported at all. (I notice it is not in the supported list)

To my surprise it is detected and works but not without issues, hence this post. My initial testing was on the latest Pi build using a Raspberry Pi 2B.

Issue 1 is that the Spotify plugin behaves very strangely - playback is at chipmunk speed, it sounds as if the DAC is being set to twice the sample rate of the source material so it plays at twice speed and twice pitch for a few seconds then starts breaking up with the average speed being correct but short bursts of too high a sample rate.

I also tested Airplay from my iPhone and aplay from the command line and both play at the correct sample rate so this seems to be specific to the spotify plugin.

Issue 2 is I am noticing intermittent glitches/dropouts in the audio on the order of one every 2-3 seconds. It’s subtle enough that I didn’t even notice it at first on some music but its very noticeable on other music or on a sinewave test. To rule out airplay dropouts I played a sinewave test using aplay and the same glitches are there.

I’m one of the devs over on the OSMC project (Raspbian/Debian based Kodi on arm hardware) so I’m well aware of the USB packet loss issues that have plagued the Pi over the years but I thought those had been largely addressed in recent kernels.

I tried dwc_otg.speed=1 to disable hi-speed mode and that did help quite a lot and reduced the frequency of the glitches considerably but didn’t solve the problem completely and was only a quick test anyway as I don’t want my Ethernet speed limited.

To try to work out whether it is USB packet loss as the underlying issue and not a flaw of the UMC204HD sound interface or the linux drivers for it I also have a dual core Cubox-i so I installed the latest Cubox version of Volumio (which I notice is a lot older) and performed the same tests.

Result - absolutely perfect glitch free sound both on airplay and on an aplay sinewave test. So this is definitely a Pi specific problem I’m seeing and not a flaw in the interface.

As a side note the spotify plugin does not work at all on the cubox-i build - I get no sound at all instead of chipmunk sound, which is a shame as Spotify would be one of my main music sources. I’m assuming this is just because its a much older build of Volumio or possibly a difference in the sound interface driver as the kernel is much older.

So I’m wondering if there is anything I can do to get this interface working properly - I get the impression that the Cubox-i is not as well supported by Volumio both from relatively old version available for download, and the legacy kernel that it is running, so I’m not sure if I want to spend a lot of time on the Cubox-i build if it might get dropped soon or always be lagging behind - I’d prefer to have it working on my Pi 2 if possible.

A friend is sending me a spare GPIO based Justboom DAC HAT to try which assuming it is supported should avoid the USB glitch issue but I’d still like to see if I can improve performance of the UMC204HD if possible, and I’m quite happy to do some more testing and dig into the problem a bit further. Although I’m a dev ALSA is not my strong point and I have relatively little experience with it so would need a few pointers of where to look.

I’ve managed to work around the spotify issue by manually editing spopd.conf, I changed the last line from

output_name = hw:5

to

output_name = plughw:5

Now the playback from spotify is working normally, aside from the occasional pop/click discussed in the previous post. I’m not sure what this should be necessary, I can only assume that spopd is trying to output a non standard sample rate that the hardware doesn’t directly support.

Here is the output from aplay -L:

null Discard all samples (playback) or generate zero samples (capture) default:CARD=ALSA bcm2835 ALSA, bcm2835 ALSA Default Audio Device sysdefault:CARD=ALSA bcm2835 ALSA, bcm2835 ALSA Default Audio Device dmix:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct sample mixing device dmix:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct sample mixing device dsnoop:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct sample snooping device dsnoop:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct sample snooping device hw:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct hardware device without any conversions hw:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct hardware device without any conversions plughw:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Hardware device with all software conversions plughw:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Hardware device with all software conversions default:CARD=U192k UMC204HD 192k, USB Audio Default Audio Device sysdefault:CARD=U192k UMC204HD 192k, USB Audio Default Audio Device front:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio Front speakers surround21:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio Direct sample mixing device dsnoop:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio Direct sample snooping device hw:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio Direct hardware device without any conversions plughw:CARD=U192k,DEV=0 UMC204HD 192k, USB Audio Hardware device with all software conversions
And here is lsusb -vv:

Bus 001 Device 004: ID 1397:0508 BEHRINGER International GmbH 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x1397 BEHRINGER International GmbH
  idProduct          0x0508 
  bcdDevice            1.12
  iManufacturer           1 BEHRINGER
  iProduct                3 UMC204HD 192k
  iSerial                 0 
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          433
    bNumInterfaces          6
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         3
      bFunctionClass          1 Audio
      bFunctionSubClass       0 
      bFunctionProtocol      32 
      iFunction               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol     32 
      iInterface              3 UMC204HD 192k
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               2.00
        bCategory               8
        wTotalLength          127
        bmControl            0x00
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     10 (CLOCK_SOURCE)
        bClockID               41
        bmAttributes         0x03 Internal programmable Clock 
        bmControls           0x07
          Clock Frequency Control (read/write)
          Clock Validity Control (read-only)
        bAssocTerminal          0
        iClockSource            9 UMC204HD 192k Internal Clock
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     11 (CLOCK_SELECTOR)
        bUnitID                40
        bNrInPins               1
        baCSourceID( 0)        41
        bmControls           0x03
          Clock Selector Control (read/write)
        iClockSelector         13 Out 1
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             4
        bmChannelConfig   0x00000000
        bmControls    0x0000
        iChannelNames          13 Out 1
        iTerminal               6 UMC204HD 192k Output
      AudioControl Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                10
        bSourceID               2
        bmaControls( 0)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 1)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 2)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 3)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 4)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            20
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID              10
        bCSourceID             40
        bmControls         0x0000
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Microphone
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             2
        bmChannelConfig   0x00000000
        bmControls    0x0000
        iChannelNames          17 In 1
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                11
        bSourceID               1
        bmaControls( 0)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 1)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 2)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            22
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID              11
        bCSourceID             40
        bmControls         0x0000
        iTerminal               7 UMC204HD 192k Input
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 UMC204HD 192k Output
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 UMC204HD 192k Output
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bmControls           0x00
        bFormatType             1
        bmFormats         0x00000001
          PCM
        bNrChannels             4
        bmChannelConfig   0x00000000
        iChannelNames          13 Out 1
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0190  1x 400 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              8
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 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              4 UMC204HD 192k Output
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bmControls           0x00
        bFormatType             1
        bmFormats         0x00000001
          PCM
        bNrChannels             4
        bmChannelConfig   0x00000000
        iChannelNames          13 Out 1
      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     0x01  EP 1 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              8
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 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        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 UMC204HD 192k Input
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 UMC204HD 192k Input
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink          22
        bmControls           0x00
        bFormatType             1
        bmFormats         0x00000001
          PCM
        bNrChannels             2
        bmChannelConfig   0x00000000
        iChannelNames          17 In 1
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              8
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      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            9
        bInCollection           1
        baInterfaceNr( 0)       1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      3 MIDI Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      MIDIStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           65
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               1 Embedded
        bJackID                 1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               2 External
        bJackID                 2
        iJack                  12 UMC204HD 192k MIDI In
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               1 Embedded
        bJackID                 3
        bNrInputPins            1
        baSourceID( 0)          2
        BaSourcePin( 0)         1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               2 External
        bJackID                 4
        bNrInputPins            1
        baSourceID( 0)          1
        BaSourcePin( 0)         1
        iJack                  11 UMC204HD 192k MIDI Out
      Endpoint Descriptor:
        bLength                 9
        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
        bRefresh                0
        bSynchAddress           0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       1
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        bRefresh                0
        bSynchAddress           0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       3
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface             10 UMC204HD 192k DFU
      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        7
          Will Not Detach
          Manifestation Tolerant
          Upload Supported
          Download Supported
        wDetachTimeout                    250 milliseconds
        wTransferSize                      64 bytes
        bcdDFUVersion                   1.10
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          433
    bNumInterfaces          6
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         3
      bFunctionClass          1 Audio
      bFunctionSubClass       0 
      bFunctionProtocol      32 
      iFunction               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol     32 
      iInterface              3 UMC204HD 192k
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               2.00
        bCategory               8
        wTotalLength          127
        bmControl            0x00
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     10 (CLOCK_SOURCE)
        bClockID               41
        bmAttributes         0x03 Internal programmable Clock 
        bmControls           0x07
          Clock Frequency Control (read/write)
          Clock Validity Control (read-only)
        bAssocTerminal          0
        iClockSource            9 UMC204HD 192k Internal Clock
      AudioControl Interface Descriptor:
        bLength                 8
        bDescriptorType        36
        bDescriptorSubtype     11 (CLOCK_SELECTOR)
        bUnitID                40
        bNrInPins               1
        baCSourceID( 0)        41
        bmControls           0x03
          Clock Selector Control (read/write)
        iClockSelector         13 Out 1
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             2
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             4
        bmChannelConfig   0x00000000
        bmControls    0x0000
        iChannelNames          13 Out 1
        iTerminal               6 UMC204HD 192k Output
      AudioControl Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                10
        bSourceID               2
        bmaControls( 0)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 1)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 2)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 3)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 4)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            20
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID              10
        bCSourceID             40
        bmControls         0x0000
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                17
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0201 Microphone
        bAssocTerminal          0
        bCSourceID             40
        bNrChannels             2
        bmChannelConfig   0x00000000
        bmControls    0x0000
        iChannelNames          17 In 1
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                18
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                11
        bSourceID               1
        bmaControls( 0)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 1)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        bmaControls( 2)      0x0000000f
          Mute Control (read/write)
          Volume Control (read/write)
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            22
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID              11
        bCSourceID             40
        bmControls         0x0000
        iTerminal               7 UMC204HD 192k Input
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 UMC204HD 192k Output
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              4 UMC204HD 192k Output
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bmControls           0x00
        bFormatType             1
        bmFormats         0x00000001
          PCM
        bNrChannels             4
        bmChannelConfig   0x00000000
        iChannelNames          13 Out 1
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x0190  1x 400 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              8
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 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              4 UMC204HD 192k Output
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           2
        bmControls           0x00
        bFormatType             1
        bmFormats         0x00000001
          PCM
        bNrChannels             4
        bmChannelConfig   0x00000000
        iChannelNames          13 Out 1
      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     0x01  EP 1 OUT
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              8
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 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        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 UMC204HD 192k Input
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol     32 
      iInterface              5 UMC204HD 192k Input
      AudioStreaming Interface Descriptor:
        bLength                16
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink          22
        bmControls           0x00
        bFormatType             1
        bmFormats         0x00000001
          PCM
        bNrChannels             2
        bmChannelConfig   0x00000000
        iChannelNames          17 In 1
      AudioStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bSubslotSize            4
        bBitResolution         24
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            5
          Transfer Type            Isochronous
          Synch Type               Asynchronous
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        AudioControl Endpoint Descriptor:
          bLength                 8
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bmControls           0x00
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay              8
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      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            9
        bInCollection           1
        baInterfaceNr( 0)       1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         1 Audio
      bInterfaceSubClass      3 MIDI Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      MIDIStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           65
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               1 Embedded
        bJackID                 1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType               2 External
        bJackID                 2
        iJack                  12 UMC204HD 192k MIDI In
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               1 Embedded
        bJackID                 3
        bNrInputPins            1
        baSourceID( 0)          2
        BaSourcePin( 0)         1
        iJack                   0 
      MIDIStreaming Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType               2 External
        bJackID                 4
        bNrInputPins            1
        baSourceID( 0)          1
        BaSourcePin( 0)         1
        iJack                  11 UMC204HD 192k MIDI Out
      Endpoint Descriptor:
        bLength                 9
        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
        bRefresh                0
        bSynchAddress           0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       1
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
        bRefresh                0
        bSynchAddress           0
        MIDIStreaming Endpoint Descriptor:
          bLength                 5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack         1
          baAssocJackID( 0)       3
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface             10 UMC204HD 192k DFU
      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        7
          Will Not Detach
          Manifestation Tolerant
          Upload Supported
          Download Supported
        wDetachTimeout                    250 milliseconds
        wTransferSize                      64 bytes
        bcdDFUVersion                   1.10
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      2
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
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 SMSC9512/9514 Fast Ethernet Adapter
  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 002: ID 0424:9514 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          0x9514 
  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             5
  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.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0503 highspeed power enable connect
   Port 5: 0000.0100 power
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            4.09
  iManufacturer           3 Linux 4.9.36-v7+ dwc_otg_hcd
  iProduct                2 DWC OTG Controller
  iSerial                 1 3f980000.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

A bit more investigation suggests that my USB sound card is probably being affected by a 4.9 kernel regression, discussed in these two issues:

github.com/raspberrypi/linux/issues/2134

github.com/raspberrypi/firmware/issues/753

The issue appears to have been fixed in kernel 4.9.43. I tried updating to the dev build of volumio but that is still only kernel 4.9.41 which is proven to still be bad in issue #2134 above.

Is there any chance that the development branch of Volumio could be updated to use the Raspberry Pi kernel 4.9.43 or later ? I can do a custom build of volumio myself on a Debian 8 arm system (I’m looking at it right now) but I see that the volumio kernel has a number of custom patches so I’m not sure how easy it would be to update the kernel from 4.9.41 to 4.9.43 and maintain those patches.

Any pointers appreciated.

Hi, there are no custom patches to the kernel, so you can build your personal copy with the kernel that suit most of your needs.
And, sure we will update the kernel, but since it usually brings some regressions (as its in your case) we usually stick with a particular version for a while…
Or if you can help test new versions we could move and adopt it…

Hi,

Thanks for the reply. I started to look through the build process last night but I’m not completely sure where it is pulling the kernel from, I was following the instructions here to use build.sh:

github.com/volumio/Build

However it did not seem to build a kernel from source as it was finished far too quickly. It did create an image but it didn’t boot, so there may have been a problem with my build environment, as I was building under Debian Jessie on another arm device instead of Raspbian Jessie on a Pi, I will try again on my Pi 2.

Yes - I was looking at the wrong kernel on github, I was looking at the sparky kernel not your Pi kernel. Whoops. :sunglasses:

I am assuming that this is the kernel the build script should be using ?

github.com/volumio/pi-kernel

So if I just edit the build script to pull the kernel sources straight from github.com/raspberrypi/linux/tree/rpi-4.9.y that should be all that’s needed to build an image with the latest official Pi kernel ?

According to git issue 753 it seems like all USB sound interfaces using Isochronous transfer mode are affected - so there could be many USB sound interfaces suffering from the same problem. As the glitch only occurs about every 5-15 seconds it may not even be noticed on some music but it ruins bit perfect playback which was my main interest in setting up Volumio with a good sound card.

I’m happy to do some testing - at the moment the only sound card I have is this Behringer USB interface. I was going to buy an I2S board like a JustBoom DAC HAT if I was unable to fix this USB glitch but if I can fix it I’d rather save the money and stay with my USB interface.

@DBMandrake, just look here.
You only need to get Hexxeh/rpi-firmware repo commit# for the release you want, and set info accordingly in case statement.

Thanks for the pointer, that’s exactly what I needed. :slight_smile:

just made a PR to move to .51 (stable): you may use that in your tests.

I will build a test image just for you, so you can report if this solves your issues

Hi,

I have merged your PR locally however I am having difficulties with what seems like a bug in build.sh ? I am trying to build on a Pi 2 running Raspbian Stretch, the build directory has been cloned to /home/pi/build. I am switching to root before building with sudo -s. I am running ./build.sh -b arm -d pi -v 2.0

The problem I’m seeing is with this part of the script:

github.com/volumio/Build/blob/m … #L175-L183

su - is changing to root’s home directory of /root hence ./volumioconfig.sh fails to run because it’s actually in /home/pi/build/scripts/

This causes a cascade of failures through the rest of the build script (which continues despite the errors) including dns lookups failing so source from github and the wifi drivers cannot be downloaded.

[code]Build for arm/armv7/armv8 platform, copying qemu
Cloning Volumio Node Backend
Cloning into ‘build/arm/root/volumio’…
Cloning Volumio UI
Cloning into ‘build/arm/root/volumio/http/www’…
Adding os-release infos

  • su -
    stdin: is not a tty
    -su: line 1: ./volumioconfig.sh: No such file or directory
    Base System Installed[/code]

I don’t really understand why su - is being called here when the build script is already running as root ?

A full build log is here: paste.osmc.io/uleyufimop.vhdl as this forum won’t let me attach a .log or .txt extension.

Thanks, that is appreciated.

I’d like to also figure out why my local build is failing as well if possible.

There you go:
let us know how it goes

updates.volumio.org/pi/volumio51 … pi.img.zip

Hi,

Thanks for the test build - I am at work at the moment and although I have the interface with me I only have earphones and don’t have my sinewave test files handy so I will give it thorough testing at home.

Initial signs look promising - I downloaded c304-2.wav from kozco.com/tech/soundtests.html and played it directly using aplay and did not hear any dropouts, but I will know for sure once I have tested with sine waves and other sources.

Most of my initial testing of Volumio has been through the Spotify plugin - I notice on this test build the Search plugins option on the web GUI is not working - is this a known limitation of this test build ?

I tried installing the spotify plugin manually by downloading it from github and uploading via a zip, however when I went into the settings to configure it it triggered a crash of the entire web interface:

Oct 05 14:47:59 volumio volumio[857]: Plugin multiroom or method getMultiroom not found Oct 05 14:47:59 volumio volumio[857]: info: [1507214879257] Listing playlists Oct 05 14:47:59 volumio volumio[857]: info: [1507214879303] ------------------------------ 95ms Oct 05 14:48:02 volumio volumio[857]: info: [{"prettyName":"Spotify","name":"spop","category":"music_service","version":"1.3.3","icon":"fa-spotify","active":false}] Oct 05 14:48:03 volumio volumio[857]: info: Error Parsing Plugins JSON Oct 05 14:48:04 volumio volumio[857]: info: Enabling plugin spop Oct 05 14:48:04 volumio volumio[857]: info: Loading plugin "spop"... Oct 05 14:48:05 volumio volumio[857]: info: Error: Error: Cannot find module 'kew' Oct 05 14:48:06 volumio volumio[857]: info: CoreCommandRouter::getUIConfigOnPlugin Oct 05 14:48:06 volumio volumio[857]: /volumio/app/index.js:1003 Oct 05 14:48:06 volumio volumio[857]: thisPlugin.getUIConfig(data) Oct 05 14:48:06 volumio volumio[857]: ^ Oct 05 14:48:06 volumio volumio[857]: TypeError: Cannot read property 'getUIConfig' of undefined Oct 05 14:48:06 volumio volumio[857]: at CoreCommandRouter.getUIConfigOnPlugin (/volumio/app/index.js:1003:15) Oct 05 14:48:06 volumio volumio[857]: at Socket.<anonymous> (/volumio/app/plugins/user_interface/websocket/index.js:537:36) Oct 05 14:48:06 volumio volumio[857]: at emitTwo (events.js:106:13) Oct 05 14:48:06 volumio volumio[857]: at Socket.emit (events.js:191:7) Oct 05 14:48:06 volumio volumio[857]: at /volumio/node_modules/socket.io/lib/socket.js:503:12 Oct 05 14:48:06 volumio volumio[857]: at _combinedTickCallback (internal/process/next_tick.js:73:7) Oct 05 14:48:06 volumio volumio[857]: at process._tickCallback (internal/process/next_tick.js:104:9) Oct 05 14:48:06 volumio sudo[7025]: pam_unix(sudo:session): session closed for user root Oct 05 14:48:06 volumio sudo[7018]: pam_unix(sudo:session): session closed for user root Oct 05 14:48:06 volumio systemd[1]: volumio.service: main process exited, code=exited, status=1/FAILURE Oct 05 14:48:06 volumio volumio-remote-updater[541]: [2017-10-05 14:48:06] [error] handle_read_frame error: websocketpp.transport:7 (End of File) Oct 05 14:48:06 volumio volumio-remote-updater[541]: [2017-10-05 14:48:06] [disconnect] Disconnect close local:[1006,End of File] remote:[1006] Oct 05 14:48:06 volumio systemd[1]: Unit volumio.service entered failed state.
This seems to be crashing the web interface even if I reboot so I’ve had to manually remove the plugin.

Is there any way to test with spotify on this test build ?

Unfortunately not good news - the new kernel does improve things quite a bit - less than half as many dropouts per minute and they are much shorter duration, but I still get dropouts no matter what I do.

To help compare them properly I also tried copying the new kernel/modules/firmware across to my original installation so I was using the same version of volumio, but while it improved the symptoms still remain.

I’ve also tried overclocking, experimenting with different buffer/period sizes in alsa, nothing seems to solve it.

I think this may just be a USB hardware limitation in the Pi that can’t be solved with software. :confused:

Another choice I have is to run the Cubox-i version - when I tested it I had no dropouts whatsoever, however I note that it is quite a bit older version than the Pi build and lacking in some features. Are there plans to continue development of the cubox-i version and release a new stable version sometime in the near future or is it not widely used and likely to be dropped or left behind ?

PI and X86 are our main platforms, once the current dev version is officially released, the other builds will follow on a best effort basis.
So yes, Cubox-i, as well as a number of other devices, will be updated, but not before the PI version is finished.

A further update, I have done some testing on a standard fresh Raspbian Stretch installation on my Pi 2.

I can play a 60 second long test file (20Hz sinewave sampled at 44.1Khz 16 bit) completely glitch free using aplay.

When I do the same on Volumio also using aplay - both with original or new test kernel I get approximately 3 loud “pops” and maybe 6 more subtle clicks during the same 60 second test file.

The Raspbian installation is using the following kernel and firmware:

Linux version 4.9.41-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1023 SMP Tue Aug 8 16:00:15 BST 2017

pi@pi2:~ $ vcgencmd version
Aug 8 2017 12:02:45
Copyright © 2012 Broadcom
version 196063438d7bb0769861c86f948ae653727adb7e (clean) (release)

This leads me to believe that the kernel is not the issue affecting me. I haven’t checked to see if it is differences in firmware version - I’ll rule that out too shortly, but I’m starting to wonder if it is a userspace problem, such as ALSA config or background CPU use causing a buffer underrun.

One thing I notice is that on Raspbian my hardware shows up as device 1, while on Volumio it shows up as device 5 (eg plughw:5) even though devices 1-4 don’t exist. Might be unrelated though.

I will do a bit of digging to see if I can find what is different between Volumio and Raspbian but if anyone has any suggestions I’d appreciate it. It is at least promising that aplay on Raspbian can play glitch free on this USB interface! :slight_smile:

Thanks for the clarification. I’d much rather get it working on the Pi as well.

More progress - I have narrowed down where the problem is.

I tried booting Volumio and manually stopping all the Volumio specific services that are not present on Raspbian, including volumio.service, spop.service, airplay.service, mpd.service, upmpdcli.service, haveged.service, volumio-remote-updater.

I then tested with a sinewave with aplay - no glitches whatsoever same as Rapbian. I then rebooted and confirmed glitches were occurring again and on a hunch I tried stopping only the main volumio.service - no glitches at all. Start the service up again and I get glitches in aplay again.

In fact I tested starting volumio.service while aplay is already playing the test file and every time the service starts there is an immediate click or pop. Sometimes it is a small click, sometimes a loud pop. So by repeatedly stopping/starting the service while aplay is playing I can produce the pop on demand.

I’ll dig further into volumio.service to see if I can work out how it is interfering with USB playback.

I’ve spent some time testing in the last couple of days, methodically ruling out possibilities - after looking at the volumio service and its resource use I can’t see anything it is doing wrong that should cause sound playback glitches.

If I renice the volumio service to the lowest priority or renice aplay to the highest priority it makes no difference at all to the glitching, and besides, the service is using only a few percent CPU when idle. So it’s not caused by excessive CPU use or competition for CPU time.

I’ve tested different settings of nrpacks for the snd-usb-audio module - the current nrpacks=1 is actually to optimise low latency and a higher number should provide more buffering however increasing it did not help at all. Manually adjusting buffer settings in alsa does not help either.

Finally I tried dwc_otg.speed=1 in cmdline.txt to disable USB2.0 support and the glitches are 100% gone. :slight_smile: I’ve listened to test signals and music for some time tonight without hearing a single glitch.

So I’ve come to the conclusion that the problem I’m seeing is the infamous issue that the Pi has always had with poor and unreliable USB2.0 performance especially on time critical USB devices.

I confirmed that the kernel version whether 36, 41 or 51 makes no difference to the problem - only dwc_otg.speed=1 fixes it.

I have also been able to reproduce glitches without volumio (nodejs) running but very rarely. I suspect that nodejs is making system calls that are either disabling interrupts for too long or are not completing fast enough for the CPU to be able to service the USB controller every 1ms which is required for error free USB2.0 operation on the Pi.

I’m not entirely sure if this is a kernel bug, firmware bug, whether a realtime kernel is required to service the USB controller quickly enough or whether we are just butting heads with a hardware limitation of the Pi.

Using dwc_otg.speed=1 is not ideal of course because it will limit the combined throughput of USB and Ethernet to 12Mbps - and 12Mbps is not quite enough for 192Khz 32 bit stereo PCM.

I already have a Github ticket open with the Raspberry Pi developers so I’ll pass this new information on to them.

Thank you very much for your careful testing. I am looking forward to see what PI kernel developers will say about it. Plz keep us posted