public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* retire_capture_urb: Corrected urb data len
@ 2022-08-26 16:22 Sean Anderson
  2022-08-26 16:36 ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Sean Anderson @ 2022-08-26 16:22 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel; +Cc: Linux Kernel Mailing List

Hi all,

I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
no problems with the audio, but I did notice a large number of message
like 

retire_capture_urb: 4992 callbacks suppressed

in my dmesg [1]. This is caused by the "Corrected urb data len."
warning. The patch adding this warning [2] makes it seem like
this warning should be an uncommon occurance. However, based on the
number of suppressed callbacks, this seems to be happening at a rate of
around 500 Hz.

Is this buggy hardware? Or is this a bug in the driver? Does there need
to be a quirk? Or perhaps the warning above should be a debug instead?

I'm using 5.15.0-46-generic. I know, I know; this is a vendor
kernel. However, I went through the commits for sound/usb/pcm.c and
didn't see any major differences. I also previously saw this issue on
5.4, so this probably isn't a regression.

--Sean

[1] I would have liked to post the actual message, but I was unable to
figure out how to disable ratelimiting. I tried setting
/proc/sys/kernel/printk_ratelimit to 0,
/proc/sys/kernel/printk_ratelimit_burst to 5000, and
/proc/sys/kernel/printk to 8. However, nothing seemed to have any effect
(except that the callbacks suppressed messages were disabled). I find
this very strange, given that the callbacks suppressed message uses
KERN_WARN, and so does dev_warn_ratelimited.
[2] https://lore.kernel.org/all/4B28A659.6070303@ladisch.de/T/
[3]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x1852 GYROCOM C&C Co., LTD
  idProduct          0x7022 
  bcdDevice            0.01
  iManufacturer           1 FiiO
  iProduct                2 DigiHug USB Audio
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0182
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      58
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0012  1x 18 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              3 FiiO USB DAC-E10
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x003e
        bInCollection           2
        baInterfaceNr(0)        2
        baInterfaceNr(1)        3
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             5
        wTerminalType      0x0605 SPDIF interface
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             9
        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             3
        wTerminalType      0x0605 SPDIF interface
        bAssocTerminal          0
        bSourceID              16
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             7
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               5
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                16
        bSourceID               9
        bControlSize            1
        bmaControls(0)       0x01
          Mute Control
        bmaControls(1)       0x02
          Volume Control
        bmaControls(2)       0x02
          Volume Control
        iFeature                0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           7
        bDelay                  0 frames
        wFormatTag         0x0001 PCM
      AudioStreaming Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            6 Discrete
        tSamFreq[ 0]         8000
        tSamFreq[ 1]        16000
        tSamFreq[ 2]        32000
        tSamFreq[ 3]        44100
        tSamFreq[ 4]        48000
        tSamFreq[ 5]        96000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0184  1x 388 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0002
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       2
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           7
        bDelay                  0 frames
        wFormatTag         0x0001 PCM
      AudioStreaming Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           3
        bBitResolution         24
        bSamFreqType            6 Discrete
        tSamFreq[ 0]         8000
        tSamFreq[ 1]        16000
        tSamFreq[ 2]        32000
        tSamFreq[ 3]        44100
        tSamFreq[ 4]        48000
        tSamFreq[ 5]        96000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0246  1x 582 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0002
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           9
        bDelay                  0 frames
        wFormatTag         0x0001 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]        32000
        tSamFreq[ 1]        44100
        tSamFreq[ 2]        48000
        tSamFreq[ 3]        96000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0184  1x 388 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0002
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       2
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           9
        bDelay                  0 frames
        wFormatTag         0x0001 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]        32000
        tSamFreq[ 1]        44100
        tSamFreq[ 2]        48000
        tSamFreq[ 3]        96000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x0246  1x 582 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0002
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       3
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           9
        bDelay                  0 frames
        wFormatTag         0x2001 IEC1937_AC-3
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             3 (FORMAT_TYPE_III)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x00c0  1x 192 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         2 Decoded PCM samples
          wLockDelay         0x0002
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2022-08-26 16:22 retire_capture_urb: Corrected urb data len Sean Anderson
@ 2022-08-26 16:36 ` Takashi Iwai
  2022-08-26 18:57   ` Sean Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2022-08-26 16:36 UTC (permalink / raw)
  To: Sean Anderson
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List

On Fri, 26 Aug 2022 18:22:24 +0200,
Sean Anderson wrote:
> 
> Hi all,
> 
> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
> no problems with the audio, but I did notice a large number of message
> like 
> 
> retire_capture_urb: 4992 callbacks suppressed
> 
> in my dmesg [1]. This is caused by the "Corrected urb data len."
> warning.

What exact values are shown there?  The problem is that your hardware
(likely a buggy firmware) returns the unaligned size of bytes as the
data.  Maybe it's worth to replace dev_warn_ratelimited() there with
dev_warn() and take all warnings once.  Then we can see what kind of
values are delivered from the hardware.

> The patch adding this warning [2] makes it seem like
> this warning should be an uncommon occurance. However, based on the
> number of suppressed callbacks, this seems to be happening at a rate of
> around 500 Hz.
> 
> Is this buggy hardware? Or is this a bug in the driver? Does there need
> to be a quirk? Or perhaps the warning above should be a debug instead?

There is no quirk for that.  As long as the device works with that
workaround (except for messages), we can simply add a quirk to not
warn but always apply the workaround silently for such devices.


thanks,

Takashi

> 
> I'm using 5.15.0-46-generic. I know, I know; this is a vendor
> kernel. However, I went through the commits for sound/usb/pcm.c and
> didn't see any major differences. I also previously saw this issue on
> 5.4, so this probably isn't a regression.
> 
> --Sean
> 
> [1] I would have liked to post the actual message, but I was unable to
> figure out how to disable ratelimiting. I tried setting
> /proc/sys/kernel/printk_ratelimit to 0,
> /proc/sys/kernel/printk_ratelimit_burst to 5000, and
> /proc/sys/kernel/printk to 8. However, nothing seemed to have any effect
> (except that the callbacks suppressed messages were disabled). I find
> this very strange, given that the callbacks suppressed message uses
> KERN_WARN, and so does dev_warn_ratelimited.
> [2] https://lore.kernel.org/all/4B28A659.6070303@ladisch.de/T/
> [3]
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.10
>   bDeviceClass            0 
>   bDeviceSubClass         0 
>   bDeviceProtocol         0 
>   bMaxPacketSize0         8
>   idVendor           0x1852 GYROCOM C&C Co., LTD
>   idProduct          0x7022 
>   bcdDevice            0.01
>   iManufacturer           1 FiiO
>   iProduct                2 DigiHug USB Audio
>   iSerial                 0 
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength       0x0182
>     bNumInterfaces          4
>     bConfigurationValue     1
>     iConfiguration          0 
>     bmAttributes         0x80
>       (Bus Powered)
>     MaxPower              500mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           1
>       bInterfaceClass         3 Human Interface Device
>       bInterfaceSubClass      0 
>       bInterfaceProtocol      0 
>       iInterface              0 
>         HID Device Descriptor:
>           bLength                 9
>           bDescriptorType        33
>           bcdHID               1.00
>           bCountryCode            0 Not supported
>           bNumDescriptors         1
>           bDescriptorType        34 Report
>           wDescriptorLength      58
>          Report Descriptors: 
>            ** UNAVAILABLE **
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x81  EP 1 IN
>         bmAttributes            3
>           Transfer Type            Interrupt
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0012  1x 18 bytes
>         bInterval              32
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        1
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      1 Control Device
>       bInterfaceProtocol      0 
>       iInterface              3 FiiO USB DAC-E10
>       AudioControl Interface Descriptor:
>         bLength                10
>         bDescriptorType        36
>         bDescriptorSubtype      1 (HEADER)
>         bcdADC               1.00
>         wTotalLength       0x003e
>         bInCollection           2
>         baInterfaceNr(0)        2
>         baInterfaceNr(1)        3
>       AudioControl Interface Descriptor:
>         bLength                12
>         bDescriptorType        36
>         bDescriptorSubtype      2 (INPUT_TERMINAL)
>         bTerminalID             5
>         wTerminalType      0x0605 SPDIF interface
>         bAssocTerminal          0
>         bNrChannels             2
>         wChannelConfig     0x0003
>           Left Front (L)
>           Right Front (R)
>         iChannelNames           0 
>         iTerminal               0 
>       AudioControl Interface Descriptor:
>         bLength                12
>         bDescriptorType        36
>         bDescriptorSubtype      2 (INPUT_TERMINAL)
>         bTerminalID             9
>         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             3
>         wTerminalType      0x0605 SPDIF interface
>         bAssocTerminal          0
>         bSourceID              16
>         iTerminal               0 
>       AudioControl Interface Descriptor:
>         bLength                 9
>         bDescriptorType        36
>         bDescriptorSubtype      3 (OUTPUT_TERMINAL)
>         bTerminalID             7
>         wTerminalType      0x0101 USB Streaming
>         bAssocTerminal          0
>         bSourceID               5
>         iTerminal               0 
>       AudioControl Interface Descriptor:
>         bLength                10
>         bDescriptorType        36
>         bDescriptorSubtype      6 (FEATURE_UNIT)
>         bUnitID                16
>         bSourceID               9
>         bControlSize            1
>         bmaControls(0)       0x01
>           Mute Control
>         bmaControls(1)       0x02
>           Volume Control
>         bmaControls(2)       0x02
>           Volume Control
>         iFeature                0 
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        2
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      2 Streaming
>       bInterfaceProtocol      0 
>       iInterface              0 
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        2
>       bAlternateSetting       1
>       bNumEndpoints           1
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      2 Streaming
>       bInterfaceProtocol      0 
>       iInterface              0 
>       AudioStreaming Interface Descriptor:
>         bLength                 7
>         bDescriptorType        36
>         bDescriptorSubtype      1 (AS_GENERAL)
>         bTerminalLink           7
>         bDelay                  0 frames
>         wFormatTag         0x0001 PCM
>       AudioStreaming Interface Descriptor:
>         bLength                26
>         bDescriptorType        36
>         bDescriptorSubtype      2 (FORMAT_TYPE)
>         bFormatType             1 (FORMAT_TYPE_I)
>         bNrChannels             2
>         bSubframeSize           2
>         bBitResolution         16
>         bSamFreqType            6 Discrete
>         tSamFreq[ 0]         8000
>         tSamFreq[ 1]        16000
>         tSamFreq[ 2]        32000
>         tSamFreq[ 3]        44100
>         tSamFreq[ 4]        48000
>         tSamFreq[ 5]        96000
>       Endpoint Descriptor:
>         bLength                 9
>         bDescriptorType         5
>         bEndpointAddress     0x82  EP 2 IN
>         bmAttributes            9
>           Transfer Type            Isochronous
>           Synch Type               Adaptive
>           Usage Type               Data
>         wMaxPacketSize     0x0184  1x 388 bytes
>         bInterval               1
>         bRefresh                0
>         bSynchAddress           0
>         AudioStreaming Endpoint Descriptor:
>           bLength                 7
>           bDescriptorType        37
>           bDescriptorSubtype      1 (EP_GENERAL)
>           bmAttributes         0x01
>             Sampling Frequency
>           bLockDelayUnits         2 Decoded PCM samples
>           wLockDelay         0x0002
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        2
>       bAlternateSetting       2
>       bNumEndpoints           1
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      2 Streaming
>       bInterfaceProtocol      0 
>       iInterface              0 
>       AudioStreaming Interface Descriptor:
>         bLength                 7
>         bDescriptorType        36
>         bDescriptorSubtype      1 (AS_GENERAL)
>         bTerminalLink           7
>         bDelay                  0 frames
>         wFormatTag         0x0001 PCM
>       AudioStreaming Interface Descriptor:
>         bLength                26
>         bDescriptorType        36
>         bDescriptorSubtype      2 (FORMAT_TYPE)
>         bFormatType             1 (FORMAT_TYPE_I)
>         bNrChannels             2
>         bSubframeSize           3
>         bBitResolution         24
>         bSamFreqType            6 Discrete
>         tSamFreq[ 0]         8000
>         tSamFreq[ 1]        16000
>         tSamFreq[ 2]        32000
>         tSamFreq[ 3]        44100
>         tSamFreq[ 4]        48000
>         tSamFreq[ 5]        96000
>       Endpoint Descriptor:
>         bLength                 9
>         bDescriptorType         5
>         bEndpointAddress     0x82  EP 2 IN
>         bmAttributes            9
>           Transfer Type            Isochronous
>           Synch Type               Adaptive
>           Usage Type               Data
>         wMaxPacketSize     0x0246  1x 582 bytes
>         bInterval               1
>         bRefresh                0
>         bSynchAddress           0
>         AudioStreaming Endpoint Descriptor:
>           bLength                 7
>           bDescriptorType        37
>           bDescriptorSubtype      1 (EP_GENERAL)
>           bmAttributes         0x01
>             Sampling Frequency
>           bLockDelayUnits         2 Decoded PCM samples
>           wLockDelay         0x0002
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       0
>       bNumEndpoints           0
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      2 Streaming
>       bInterfaceProtocol      0 
>       iInterface              0 
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       1
>       bNumEndpoints           1
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      2 Streaming
>       bInterfaceProtocol      0 
>       iInterface              0 
>       AudioStreaming Interface Descriptor:
>         bLength                 7
>         bDescriptorType        36
>         bDescriptorSubtype      1 (AS_GENERAL)
>         bTerminalLink           9
>         bDelay                  0 frames
>         wFormatTag         0x0001 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]        32000
>         tSamFreq[ 1]        44100
>         tSamFreq[ 2]        48000
>         tSamFreq[ 3]        96000
>       Endpoint Descriptor:
>         bLength                 9
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            9
>           Transfer Type            Isochronous
>           Synch Type               Adaptive
>           Usage Type               Data
>         wMaxPacketSize     0x0184  1x 388 bytes
>         bInterval               1
>         bRefresh                0
>         bSynchAddress           0
>         AudioStreaming Endpoint Descriptor:
>           bLength                 7
>           bDescriptorType        37
>           bDescriptorSubtype      1 (EP_GENERAL)
>           bmAttributes         0x01
>             Sampling Frequency
>           bLockDelayUnits         2 Decoded PCM samples
>           wLockDelay         0x0002
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       2
>       bNumEndpoints           1
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      2 Streaming
>       bInterfaceProtocol      0 
>       iInterface              0 
>       AudioStreaming Interface Descriptor:
>         bLength                 7
>         bDescriptorType        36
>         bDescriptorSubtype      1 (AS_GENERAL)
>         bTerminalLink           9
>         bDelay                  0 frames
>         wFormatTag         0x0001 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]        32000
>         tSamFreq[ 1]        44100
>         tSamFreq[ 2]        48000
>         tSamFreq[ 3]        96000
>       Endpoint Descriptor:
>         bLength                 9
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            9
>           Transfer Type            Isochronous
>           Synch Type               Adaptive
>           Usage Type               Data
>         wMaxPacketSize     0x0246  1x 582 bytes
>         bInterval               1
>         bRefresh                0
>         bSynchAddress           0
>         AudioStreaming Endpoint Descriptor:
>           bLength                 7
>           bDescriptorType        37
>           bDescriptorSubtype      1 (EP_GENERAL)
>           bmAttributes         0x01
>             Sampling Frequency
>           bLockDelayUnits         2 Decoded PCM samples
>           wLockDelay         0x0002
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        3
>       bAlternateSetting       3
>       bNumEndpoints           1
>       bInterfaceClass         1 Audio
>       bInterfaceSubClass      2 Streaming
>       bInterfaceProtocol      0 
>       iInterface              0 
>       AudioStreaming Interface Descriptor:
>         bLength                 7
>         bDescriptorType        36
>         bDescriptorSubtype      1 (AS_GENERAL)
>         bTerminalLink           9
>         bDelay                  0 frames
>         wFormatTag         0x2001 IEC1937_AC-3
>       AudioStreaming Interface Descriptor:
>         bLength                11
>         bDescriptorType        36
>         bDescriptorSubtype      2 (FORMAT_TYPE)
>         bFormatType             3 (FORMAT_TYPE_III)
>         bNrChannels             2
>         bSubframeSize           2
>         bBitResolution         16
>         bSamFreqType            1 Discrete
>         tSamFreq[ 0]        48000
>       Endpoint Descriptor:
>         bLength                 9
>         bDescriptorType         5
>         bEndpointAddress     0x03  EP 3 OUT
>         bmAttributes            9
>           Transfer Type            Isochronous
>           Synch Type               Adaptive
>           Usage Type               Data
>         wMaxPacketSize     0x00c0  1x 192 bytes
>         bInterval               1
>         bRefresh                0
>         bSynchAddress           0
>         AudioStreaming Endpoint Descriptor:
>           bLength                 7
>           bDescriptorType        37
>           bDescriptorSubtype      1 (EP_GENERAL)
>           bmAttributes         0x01
>             Sampling Frequency
>           bLockDelayUnits         2 Decoded PCM samples
>           wLockDelay         0x0002
> can't get debug descriptor: Resource temporarily unavailable
> Device Status:     0x0000
>   (Bus Powered)
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2022-08-26 16:36 ` Takashi Iwai
@ 2022-08-26 18:57   ` Sean Anderson
  2022-08-28  7:49     ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Sean Anderson @ 2022-08-26 18:57 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List



On 8/26/22 12:36 PM, Takashi Iwai wrote:
> On Fri, 26 Aug 2022 18:22:24 +0200,
> Sean Anderson wrote:
>> 
>> Hi all,
>> 
>> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
>> no problems with the audio, but I did notice a large number of message
>> like 
>> 
>> retire_capture_urb: 4992 callbacks suppressed
>> 
>> in my dmesg [1]. This is caused by the "Corrected urb data len."
>> warning.
> 
> What exact values are shown there?

Unfortunately, as detailed below, I was unable to turn off ratelimiting.

> The problem is that your hardware
> (likely a buggy firmware) returns the unaligned size of bytes as the
> data.  Maybe it's worth to replace dev_warn_ratelimited() there with
> dev_warn() and take all warnings once.  Then we can see what kind of
> values are delivered from the hardware.

I'll have an attempt at that next week

>> The patch adding this warning [2] makes it seem like
>> this warning should be an uncommon occurance. However, based on the
>> number of suppressed callbacks, this seems to be happening at a rate of
>> around 500 Hz.
>> 
>> Is this buggy hardware? Or is this a bug in the driver? Does there need
>> to be a quirk? Or perhaps the warning above should be a debug instead?
> 
> There is no quirk for that.  As long as the device works with that
> workaround (except for messages), we can simply add a quirk to not
> warn but always apply the workaround silently for such devices.

OK. I wasn't sure what the correct resolution would be.

--Sean

> 
>> 
>> I'm using 5.15.0-46-generic. I know, I know; this is a vendor
>> kernel. However, I went through the commits for sound/usb/pcm.c and
>> didn't see any major differences. I also previously saw this issue on
>> 5.4, so this probably isn't a regression.
>> 
>> --Sean
>> 
>> [1] I would have liked to post the actual message, but I was unable to
>> figure out how to disable ratelimiting. I tried setting
>> /proc/sys/kernel/printk_ratelimit to 0,
>> /proc/sys/kernel/printk_ratelimit_burst to 5000, and
>> /proc/sys/kernel/printk to 8. However, nothing seemed to have any effect
>> (except that the callbacks suppressed messages were disabled). I find
>> this very strange, given that the callbacks suppressed message uses
>> KERN_WARN, and so does dev_warn_ratelimited.
>> [2] https://lore.kernel.org/all/4B28A659.6070303@ladisch.de/T/
>> [3]
>> Device Descriptor:
>>   bLength                18
>>   bDescriptorType         1
>>   bcdUSB               1.10
>>   bDeviceClass            0 
>>   bDeviceSubClass         0 
>>   bDeviceProtocol         0 
>>   bMaxPacketSize0         8
>>   idVendor           0x1852 GYROCOM C&C Co., LTD
>>   idProduct          0x7022 
>>   bcdDevice            0.01
>>   iManufacturer           1 FiiO
>>   iProduct                2 DigiHug USB Audio
>>   iSerial                 0 
>>   bNumConfigurations      1
>>   Configuration Descriptor:
>>     bLength                 9
>>     bDescriptorType         2
>>     wTotalLength       0x0182
>>     bNumInterfaces          4
>>     bConfigurationValue     1
>>     iConfiguration          0 
>>     bmAttributes         0x80
>>       (Bus Powered)
>>     MaxPower              500mA
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        0
>>       bAlternateSetting       0
>>       bNumEndpoints           1
>>       bInterfaceClass         3 Human Interface Device
>>       bInterfaceSubClass      0 
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>         HID Device Descriptor:
>>           bLength                 9
>>           bDescriptorType        33
>>           bcdHID               1.00
>>           bCountryCode            0 Not supported
>>           bNumDescriptors         1
>>           bDescriptorType        34 Report
>>           wDescriptorLength      58
>>          Report Descriptors: 
>>            ** UNAVAILABLE **
>>       Endpoint Descriptor:
>>         bLength                 7
>>         bDescriptorType         5
>>         bEndpointAddress     0x81  EP 1 IN
>>         bmAttributes            3
>>           Transfer Type            Interrupt
>>           Synch Type               None
>>           Usage Type               Data
>>         wMaxPacketSize     0x0012  1x 18 bytes
>>         bInterval              32
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        1
>>       bAlternateSetting       0
>>       bNumEndpoints           0
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      1 Control Device
>>       bInterfaceProtocol      0 
>>       iInterface              3 FiiO USB DAC-E10
>>       AudioControl Interface Descriptor:
>>         bLength                10
>>         bDescriptorType        36
>>         bDescriptorSubtype      1 (HEADER)
>>         bcdADC               1.00
>>         wTotalLength       0x003e
>>         bInCollection           2
>>         baInterfaceNr(0)        2
>>         baInterfaceNr(1)        3
>>       AudioControl Interface Descriptor:
>>         bLength                12
>>         bDescriptorType        36
>>         bDescriptorSubtype      2 (INPUT_TERMINAL)
>>         bTerminalID             5
>>         wTerminalType      0x0605 SPDIF interface
>>         bAssocTerminal          0
>>         bNrChannels             2
>>         wChannelConfig     0x0003
>>           Left Front (L)
>>           Right Front (R)
>>         iChannelNames           0 
>>         iTerminal               0 
>>       AudioControl Interface Descriptor:
>>         bLength                12
>>         bDescriptorType        36
>>         bDescriptorSubtype      2 (INPUT_TERMINAL)
>>         bTerminalID             9
>>         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             3
>>         wTerminalType      0x0605 SPDIF interface
>>         bAssocTerminal          0
>>         bSourceID              16
>>         iTerminal               0 
>>       AudioControl Interface Descriptor:
>>         bLength                 9
>>         bDescriptorType        36
>>         bDescriptorSubtype      3 (OUTPUT_TERMINAL)
>>         bTerminalID             7
>>         wTerminalType      0x0101 USB Streaming
>>         bAssocTerminal          0
>>         bSourceID               5
>>         iTerminal               0 
>>       AudioControl Interface Descriptor:
>>         bLength                10
>>         bDescriptorType        36
>>         bDescriptorSubtype      6 (FEATURE_UNIT)
>>         bUnitID                16
>>         bSourceID               9
>>         bControlSize            1
>>         bmaControls(0)       0x01
>>           Mute Control
>>         bmaControls(1)       0x02
>>           Volume Control
>>         bmaControls(2)       0x02
>>           Volume Control
>>         iFeature                0 
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        2
>>       bAlternateSetting       0
>>       bNumEndpoints           0
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      2 Streaming
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        2
>>       bAlternateSetting       1
>>       bNumEndpoints           1
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      2 Streaming
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>       AudioStreaming Interface Descriptor:
>>         bLength                 7
>>         bDescriptorType        36
>>         bDescriptorSubtype      1 (AS_GENERAL)
>>         bTerminalLink           7
>>         bDelay                  0 frames
>>         wFormatTag         0x0001 PCM
>>       AudioStreaming Interface Descriptor:
>>         bLength                26
>>         bDescriptorType        36
>>         bDescriptorSubtype      2 (FORMAT_TYPE)
>>         bFormatType             1 (FORMAT_TYPE_I)
>>         bNrChannels             2
>>         bSubframeSize           2
>>         bBitResolution         16
>>         bSamFreqType            6 Discrete
>>         tSamFreq[ 0]         8000
>>         tSamFreq[ 1]        16000
>>         tSamFreq[ 2]        32000
>>         tSamFreq[ 3]        44100
>>         tSamFreq[ 4]        48000
>>         tSamFreq[ 5]        96000
>>       Endpoint Descriptor:
>>         bLength                 9
>>         bDescriptorType         5
>>         bEndpointAddress     0x82  EP 2 IN
>>         bmAttributes            9
>>           Transfer Type            Isochronous
>>           Synch Type               Adaptive
>>           Usage Type               Data
>>         wMaxPacketSize     0x0184  1x 388 bytes
>>         bInterval               1
>>         bRefresh                0
>>         bSynchAddress           0
>>         AudioStreaming Endpoint Descriptor:
>>           bLength                 7
>>           bDescriptorType        37
>>           bDescriptorSubtype      1 (EP_GENERAL)
>>           bmAttributes         0x01
>>             Sampling Frequency
>>           bLockDelayUnits         2 Decoded PCM samples
>>           wLockDelay         0x0002
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        2
>>       bAlternateSetting       2
>>       bNumEndpoints           1
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      2 Streaming
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>       AudioStreaming Interface Descriptor:
>>         bLength                 7
>>         bDescriptorType        36
>>         bDescriptorSubtype      1 (AS_GENERAL)
>>         bTerminalLink           7
>>         bDelay                  0 frames
>>         wFormatTag         0x0001 PCM
>>       AudioStreaming Interface Descriptor:
>>         bLength                26
>>         bDescriptorType        36
>>         bDescriptorSubtype      2 (FORMAT_TYPE)
>>         bFormatType             1 (FORMAT_TYPE_I)
>>         bNrChannels             2
>>         bSubframeSize           3
>>         bBitResolution         24
>>         bSamFreqType            6 Discrete
>>         tSamFreq[ 0]         8000
>>         tSamFreq[ 1]        16000
>>         tSamFreq[ 2]        32000
>>         tSamFreq[ 3]        44100
>>         tSamFreq[ 4]        48000
>>         tSamFreq[ 5]        96000
>>       Endpoint Descriptor:
>>         bLength                 9
>>         bDescriptorType         5
>>         bEndpointAddress     0x82  EP 2 IN
>>         bmAttributes            9
>>           Transfer Type            Isochronous
>>           Synch Type               Adaptive
>>           Usage Type               Data
>>         wMaxPacketSize     0x0246  1x 582 bytes
>>         bInterval               1
>>         bRefresh                0
>>         bSynchAddress           0
>>         AudioStreaming Endpoint Descriptor:
>>           bLength                 7
>>           bDescriptorType        37
>>           bDescriptorSubtype      1 (EP_GENERAL)
>>           bmAttributes         0x01
>>             Sampling Frequency
>>           bLockDelayUnits         2 Decoded PCM samples
>>           wLockDelay         0x0002
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        3
>>       bAlternateSetting       0
>>       bNumEndpoints           0
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      2 Streaming
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        3
>>       bAlternateSetting       1
>>       bNumEndpoints           1
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      2 Streaming
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>       AudioStreaming Interface Descriptor:
>>         bLength                 7
>>         bDescriptorType        36
>>         bDescriptorSubtype      1 (AS_GENERAL)
>>         bTerminalLink           9
>>         bDelay                  0 frames
>>         wFormatTag         0x0001 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]        32000
>>         tSamFreq[ 1]        44100
>>         tSamFreq[ 2]        48000
>>         tSamFreq[ 3]        96000
>>       Endpoint Descriptor:
>>         bLength                 9
>>         bDescriptorType         5
>>         bEndpointAddress     0x03  EP 3 OUT
>>         bmAttributes            9
>>           Transfer Type            Isochronous
>>           Synch Type               Adaptive
>>           Usage Type               Data
>>         wMaxPacketSize     0x0184  1x 388 bytes
>>         bInterval               1
>>         bRefresh                0
>>         bSynchAddress           0
>>         AudioStreaming Endpoint Descriptor:
>>           bLength                 7
>>           bDescriptorType        37
>>           bDescriptorSubtype      1 (EP_GENERAL)
>>           bmAttributes         0x01
>>             Sampling Frequency
>>           bLockDelayUnits         2 Decoded PCM samples
>>           wLockDelay         0x0002
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        3
>>       bAlternateSetting       2
>>       bNumEndpoints           1
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      2 Streaming
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>       AudioStreaming Interface Descriptor:
>>         bLength                 7
>>         bDescriptorType        36
>>         bDescriptorSubtype      1 (AS_GENERAL)
>>         bTerminalLink           9
>>         bDelay                  0 frames
>>         wFormatTag         0x0001 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]        32000
>>         tSamFreq[ 1]        44100
>>         tSamFreq[ 2]        48000
>>         tSamFreq[ 3]        96000
>>       Endpoint Descriptor:
>>         bLength                 9
>>         bDescriptorType         5
>>         bEndpointAddress     0x03  EP 3 OUT
>>         bmAttributes            9
>>           Transfer Type            Isochronous
>>           Synch Type               Adaptive
>>           Usage Type               Data
>>         wMaxPacketSize     0x0246  1x 582 bytes
>>         bInterval               1
>>         bRefresh                0
>>         bSynchAddress           0
>>         AudioStreaming Endpoint Descriptor:
>>           bLength                 7
>>           bDescriptorType        37
>>           bDescriptorSubtype      1 (EP_GENERAL)
>>           bmAttributes         0x01
>>             Sampling Frequency
>>           bLockDelayUnits         2 Decoded PCM samples
>>           wLockDelay         0x0002
>>     Interface Descriptor:
>>       bLength                 9
>>       bDescriptorType         4
>>       bInterfaceNumber        3
>>       bAlternateSetting       3
>>       bNumEndpoints           1
>>       bInterfaceClass         1 Audio
>>       bInterfaceSubClass      2 Streaming
>>       bInterfaceProtocol      0 
>>       iInterface              0 
>>       AudioStreaming Interface Descriptor:
>>         bLength                 7
>>         bDescriptorType        36
>>         bDescriptorSubtype      1 (AS_GENERAL)
>>         bTerminalLink           9
>>         bDelay                  0 frames
>>         wFormatTag         0x2001 IEC1937_AC-3
>>       AudioStreaming Interface Descriptor:
>>         bLength                11
>>         bDescriptorType        36
>>         bDescriptorSubtype      2 (FORMAT_TYPE)
>>         bFormatType             3 (FORMAT_TYPE_III)
>>         bNrChannels             2
>>         bSubframeSize           2
>>         bBitResolution         16
>>         bSamFreqType            1 Discrete
>>         tSamFreq[ 0]        48000
>>       Endpoint Descriptor:
>>         bLength                 9
>>         bDescriptorType         5
>>         bEndpointAddress     0x03  EP 3 OUT
>>         bmAttributes            9
>>           Transfer Type            Isochronous
>>           Synch Type               Adaptive
>>           Usage Type               Data
>>         wMaxPacketSize     0x00c0  1x 192 bytes
>>         bInterval               1
>>         bRefresh                0
>>         bSynchAddress           0
>>         AudioStreaming Endpoint Descriptor:
>>           bLength                 7
>>           bDescriptorType        37
>>           bDescriptorSubtype      1 (EP_GENERAL)
>>           bmAttributes         0x01
>>             Sampling Frequency
>>           bLockDelayUnits         2 Decoded PCM samples
>>           wLockDelay         0x0002
>> can't get debug descriptor: Resource temporarily unavailable
>> Device Status:     0x0000
>>   (Bus Powered)
>> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2022-08-26 18:57   ` Sean Anderson
@ 2022-08-28  7:49     ` Takashi Iwai
  2022-09-01 15:25       ` Sean Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2022-08-28  7:49 UTC (permalink / raw)
  To: Sean Anderson
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List

On Fri, 26 Aug 2022 20:57:53 +0200,
Sean Anderson wrote:
> 
> On 8/26/22 12:36 PM, Takashi Iwai wrote:
> > On Fri, 26 Aug 2022 18:22:24 +0200,
> > Sean Anderson wrote:
> >> 
> >> Hi all,
> >> 
> >> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
> >> no problems with the audio, but I did notice a large number of message
> >> like 
> >> 
> >> retire_capture_urb: 4992 callbacks suppressed
> >> 
> >> in my dmesg [1]. This is caused by the "Corrected urb data len."
> >> warning.
> > 
> > What exact values are shown there?
> 
> Unfortunately, as detailed below, I was unable to turn off ratelimiting.
> 
> > The problem is that your hardware
> > (likely a buggy firmware) returns the unaligned size of bytes as the
> > data.  Maybe it's worth to replace dev_warn_ratelimited() there with
> > dev_warn() and take all warnings once.  Then we can see what kind of
> > values are delivered from the hardware.
> 
> I'll have an attempt at that next week
> 
> >> The patch adding this warning [2] makes it seem like
> >> this warning should be an uncommon occurance. However, based on the
> >> number of suppressed callbacks, this seems to be happening at a rate of
> >> around 500 Hz.
> >> 
> >> Is this buggy hardware? Or is this a bug in the driver? Does there need
> >> to be a quirk? Or perhaps the warning above should be a debug instead?
> > 
> > There is no quirk for that.  As long as the device works with that
> > workaround (except for messages), we can simply add a quirk to not
> > warn but always apply the workaround silently for such devices.
> 
> OK. I wasn't sure what the correct resolution would be.

Actually I was wrong: the existing quirk QUIRK_FLAG_ALIGN_TRANSFER
should cover that.

Could you try to pass quirk_flags=0x04 for the corresponding card slot
(the option takes an array) to snd-usb-audio module?  Alternatively,
try to pass quirk_alias=18557022:0e510408 to snd-usb-audio?


thanks,

Takashi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2022-08-28  7:49     ` Takashi Iwai
@ 2022-09-01 15:25       ` Sean Anderson
  2022-09-02  5:52         ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Sean Anderson @ 2022-09-01 15:25 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List



On 8/28/22 3:49 AM, Takashi Iwai wrote:
> On Fri, 26 Aug 2022 20:57:53 +0200,
> Sean Anderson wrote:
>> 
>> On 8/26/22 12:36 PM, Takashi Iwai wrote:
>> > On Fri, 26 Aug 2022 18:22:24 +0200,
>> > Sean Anderson wrote:
>> >> 
>> >> Hi all,
>> >> 
>> >> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
>> >> no problems with the audio, but I did notice a large number of message
>> >> like 
>> >> 
>> >> retire_capture_urb: 4992 callbacks suppressed
>> >> 
>> >> in my dmesg [1]. This is caused by the "Corrected urb data len."
>> >> warning.
>> > 
>> > What exact values are shown there?
>> 
>> Unfortunately, as detailed below, I was unable to turn off ratelimiting.
>> 
>> > The problem is that your hardware
>> > (likely a buggy firmware) returns the unaligned size of bytes as the
>> > data.  Maybe it's worth to replace dev_warn_ratelimited() there with
>> > dev_warn() and take all warnings once.  Then we can see what kind of
>> > values are delivered from the hardware.
>> 
>> I'll have an attempt at that next week
>> 
>> >> The patch adding this warning [2] makes it seem like
>> >> this warning should be an uncommon occurance. However, based on the
>> >> number of suppressed callbacks, this seems to be happening at a rate of
>> >> around 500 Hz.
>> >> 
>> >> Is this buggy hardware? Or is this a bug in the driver? Does there need
>> >> to be a quirk? Or perhaps the warning above should be a debug instead?
>> > 
>> > There is no quirk for that.  As long as the device works with that
>> > workaround (except for messages), we can simply add a quirk to not
>> > warn but always apply the workaround silently for such devices.
>> 
>> OK. I wasn't sure what the correct resolution would be.
> 
> Actually I was wrong: the existing quirk QUIRK_FLAG_ALIGN_TRANSFER
> should cover that.
> 
> Could you try to pass quirk_flags=0x04 for the corresponding card slot
> (the option takes an array) to snd-usb-audio module?  Alternatively,
> try to pass quirk_alias=18557022:0e510408 to snd-usb-audio?

I tried both options, but neither worked.

--Sean

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2022-09-01 15:25       ` Sean Anderson
@ 2022-09-02  5:52         ` Takashi Iwai
  2025-07-31 21:49           ` Sean Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2022-09-02  5:52 UTC (permalink / raw)
  To: Sean Anderson
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List

On Thu, 01 Sep 2022 17:25:41 +0200,
Sean Anderson wrote:
> 
> 
> 
> On 8/28/22 3:49 AM, Takashi Iwai wrote:
> > On Fri, 26 Aug 2022 20:57:53 +0200,
> > Sean Anderson wrote:
> >> 
> >> On 8/26/22 12:36 PM, Takashi Iwai wrote:
> >> > On Fri, 26 Aug 2022 18:22:24 +0200,
> >> > Sean Anderson wrote:
> >> >> 
> >> >> Hi all,
> >> >> 
> >> >> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
> >> >> no problems with the audio, but I did notice a large number of message
> >> >> like 
> >> >> 
> >> >> retire_capture_urb: 4992 callbacks suppressed
> >> >> 
> >> >> in my dmesg [1]. This is caused by the "Corrected urb data len."
> >> >> warning.
> >> > 
> >> > What exact values are shown there?
> >> 
> >> Unfortunately, as detailed below, I was unable to turn off ratelimiting.
> >> 
> >> > The problem is that your hardware
> >> > (likely a buggy firmware) returns the unaligned size of bytes as the
> >> > data.  Maybe it's worth to replace dev_warn_ratelimited() there with
> >> > dev_warn() and take all warnings once.  Then we can see what kind of
> >> > values are delivered from the hardware.
> >> 
> >> I'll have an attempt at that next week
> >> 
> >> >> The patch adding this warning [2] makes it seem like
> >> >> this warning should be an uncommon occurance. However, based on the
> >> >> number of suppressed callbacks, this seems to be happening at a rate of
> >> >> around 500 Hz.
> >> >> 
> >> >> Is this buggy hardware? Or is this a bug in the driver? Does there need
> >> >> to be a quirk? Or perhaps the warning above should be a debug instead?
> >> > 
> >> > There is no quirk for that.  As long as the device works with that
> >> > workaround (except for messages), we can simply add a quirk to not
> >> > warn but always apply the workaround silently for such devices.
> >> 
> >> OK. I wasn't sure what the correct resolution would be.
> > 
> > Actually I was wrong: the existing quirk QUIRK_FLAG_ALIGN_TRANSFER
> > should cover that.
> > 
> > Could you try to pass quirk_flags=0x04 for the corresponding card slot
> > (the option takes an array) to snd-usb-audio module?  Alternatively,
> > try to pass quirk_alias=18557022:0e510408 to snd-usb-audio?
> 
> I tried both options, but neither worked.

I have no further idea.  You should try the latest kernel without
modification before checking further.

And, looking at the code again, it's really strange that you get those
messages.  Actually the transfer size *is* aligned to the audio frames
as default *unless* QUIRK_FLAG_ALIGN_TRANSFER is passed.  And the
check is done rather the audio sample size alignment -- which must fit
within the audio frame alignment.

So, QUIRK_FLAG_ALIGN_TRANSFER is already set for your device by some
reason incorrectly, or the code is doing wrong on your kernel.
We need to check what values are shown there actually, then check
whether the problem happens with the latest vanilla kernel.


Takashi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2022-09-02  5:52         ` Takashi Iwai
@ 2025-07-31 21:49           ` Sean Anderson
  2025-08-01  8:50             ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: Sean Anderson @ 2025-07-31 21:49 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List

Hi,

On 9/2/22 01:52, Takashi Iwai wrote:
> On Thu, 01 Sep 2022 17:25:41 +0200,
> Sean Anderson wrote:
>> 
>> 
>> 
>> On 8/28/22 3:49 AM, Takashi Iwai wrote:
>> > On Fri, 26 Aug 2022 20:57:53 +0200,
>> > Sean Anderson wrote:
>> >> 
>> >> On 8/26/22 12:36 PM, Takashi Iwai wrote:
>> >> > On Fri, 26 Aug 2022 18:22:24 +0200,
>> >> > Sean Anderson wrote:
>> >> >> 
>> >> >> Hi all,
>> >> >> 
>> >> >> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
>> >> >> no problems with the audio, but I did notice a large number of message
>> >> >> like 
>> >> >> 
>> >> >> retire_capture_urb: 4992 callbacks suppressed
>> >> >> 
>> >> >> in my dmesg [1]. This is caused by the "Corrected urb data len."
>> >> >> warning.
>> >> > 
>> >> > What exact values are shown there?
>> >> 
>> >> Unfortunately, as detailed below, I was unable to turn off ratelimiting.
>> >> 
>> >> > The problem is that your hardware
>> >> > (likely a buggy firmware) returns the unaligned size of bytes as the
>> >> > data.  Maybe it's worth to replace dev_warn_ratelimited() there with
>> >> > dev_warn() and take all warnings once.  Then we can see what kind of
>> >> > values are delivered from the hardware.
>> >> 
>> >> I'll have an attempt at that next week
>> >> 
>> >> >> The patch adding this warning [2] makes it seem like
>> >> >> this warning should be an uncommon occurance. However, based on the
>> >> >> number of suppressed callbacks, this seems to be happening at a rate of
>> >> >> around 500 Hz.
>> >> >> 
>> >> >> Is this buggy hardware? Or is this a bug in the driver? Does there need
>> >> >> to be a quirk? Or perhaps the warning above should be a debug instead?
>> >> > 
>> >> > There is no quirk for that.  As long as the device works with that
>> >> > workaround (except for messages), we can simply add a quirk to not
>> >> > warn but always apply the workaround silently for such devices.
>> >> 
>> >> OK. I wasn't sure what the correct resolution would be.
>> > 
>> > Actually I was wrong: the existing quirk QUIRK_FLAG_ALIGN_TRANSFER
>> > should cover that.
>> > 
>> > Could you try to pass quirk_flags=0x04 for the corresponding card slot
>> > (the option takes an array) to snd-usb-audio module?  Alternatively,
>> > try to pass quirk_alias=18557022:0e510408 to snd-usb-audio?
>> 
>> I tried both options, but neither worked.
> 
> I have no further idea.  You should try the latest kernel without
> modification before checking further.
> 
> And, looking at the code again, it's really strange that you get those
> messages.  Actually the transfer size *is* aligned to the audio frames
> as default *unless* QUIRK_FLAG_ALIGN_TRANSFER is passed.  And the
> check is done rather the audio sample size alignment -- which must fit
> within the audio frame alignment.
> 
> So, QUIRK_FLAG_ALIGN_TRANSFER is already set for your device by some
> reason incorrectly, or the code is doing wrong on your kernel.
> We need to check what values are shown there actually, then check
> whether the problem happens with the latest vanilla kernel.

Sorry for the very long hiatus. I have reproduced this issue on kernel
6.15.8.

From closer inspection this message seems to be from the first print and
not the second one:

if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
	dev_dbg(&subs->dev->dev, "frame %d active: %d\n",
		i, urb->iso_frame_desc[i].status);
	// continue;
}

This probably be a dev_dbg_ratelimited. Indeed, that suppresses these
messages.

The actual message that's being ratelimited is

usb 3-11.2: frame 0 active: -71

which is EPROTO. Looks like that comes from xhci_hcd. With debug enabled
I get a lot of

xhci_hcd 0000:80:14.0: Transfer error for slot 36 ep 4 on endpoint

The spec says this is 

| Asserted in the case where the host did not receive a valid response
| from the device (Timeout, CRC, Bad PID, unexpected NYET, etc.).

and I don't really know what to make of that. Should I send a patch to
convert that dev_dbg to dev_dbg_ratelimited? Or do you want to debug
this further?

--Sean

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2025-07-31 21:49           ` Sean Anderson
@ 2025-08-01  8:50             ` Takashi Iwai
  2025-08-01 15:35               ` Sean Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2025-08-01  8:50 UTC (permalink / raw)
  To: Sean Anderson
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List

On Thu, 31 Jul 2025 23:49:11 +0200,
Sean Anderson wrote:
> 
> Hi,
> 
> On 9/2/22 01:52, Takashi Iwai wrote:
> > On Thu, 01 Sep 2022 17:25:41 +0200,
> > Sean Anderson wrote:
> >> 
> >> 
> >> 
> >> On 8/28/22 3:49 AM, Takashi Iwai wrote:
> >> > On Fri, 26 Aug 2022 20:57:53 +0200,
> >> > Sean Anderson wrote:
> >> >> 
> >> >> On 8/26/22 12:36 PM, Takashi Iwai wrote:
> >> >> > On Fri, 26 Aug 2022 18:22:24 +0200,
> >> >> > Sean Anderson wrote:
> >> >> >> 
> >> >> >> Hi all,
> >> >> >> 
> >> >> >> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
> >> >> >> no problems with the audio, but I did notice a large number of message
> >> >> >> like 
> >> >> >> 
> >> >> >> retire_capture_urb: 4992 callbacks suppressed
> >> >> >> 
> >> >> >> in my dmesg [1]. This is caused by the "Corrected urb data len."
> >> >> >> warning.
> >> >> > 
> >> >> > What exact values are shown there?
> >> >> 
> >> >> Unfortunately, as detailed below, I was unable to turn off ratelimiting.
> >> >> 
> >> >> > The problem is that your hardware
> >> >> > (likely a buggy firmware) returns the unaligned size of bytes as the
> >> >> > data.  Maybe it's worth to replace dev_warn_ratelimited() there with
> >> >> > dev_warn() and take all warnings once.  Then we can see what kind of
> >> >> > values are delivered from the hardware.
> >> >> 
> >> >> I'll have an attempt at that next week
> >> >> 
> >> >> >> The patch adding this warning [2] makes it seem like
> >> >> >> this warning should be an uncommon occurance. However, based on the
> >> >> >> number of suppressed callbacks, this seems to be happening at a rate of
> >> >> >> around 500 Hz.
> >> >> >> 
> >> >> >> Is this buggy hardware? Or is this a bug in the driver? Does there need
> >> >> >> to be a quirk? Or perhaps the warning above should be a debug instead?
> >> >> > 
> >> >> > There is no quirk for that.  As long as the device works with that
> >> >> > workaround (except for messages), we can simply add a quirk to not
> >> >> > warn but always apply the workaround silently for such devices.
> >> >> 
> >> >> OK. I wasn't sure what the correct resolution would be.
> >> > 
> >> > Actually I was wrong: the existing quirk QUIRK_FLAG_ALIGN_TRANSFER
> >> > should cover that.
> >> > 
> >> > Could you try to pass quirk_flags=0x04 for the corresponding card slot
> >> > (the option takes an array) to snd-usb-audio module?  Alternatively,
> >> > try to pass quirk_alias=18557022:0e510408 to snd-usb-audio?
> >> 
> >> I tried both options, but neither worked.
> > 
> > I have no further idea.  You should try the latest kernel without
> > modification before checking further.
> > 
> > And, looking at the code again, it's really strange that you get those
> > messages.  Actually the transfer size *is* aligned to the audio frames
> > as default *unless* QUIRK_FLAG_ALIGN_TRANSFER is passed.  And the
> > check is done rather the audio sample size alignment -- which must fit
> > within the audio frame alignment.
> > 
> > So, QUIRK_FLAG_ALIGN_TRANSFER is already set for your device by some
> > reason incorrectly, or the code is doing wrong on your kernel.
> > We need to check what values are shown there actually, then check
> > whether the problem happens with the latest vanilla kernel.
> 
> Sorry for the very long hiatus. I have reproduced this issue on kernel
> 6.15.8.
> 
> From closer inspection this message seems to be from the first print and
> not the second one:
> 
> if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
> 	dev_dbg(&subs->dev->dev, "frame %d active: %d\n",
> 		i, urb->iso_frame_desc[i].status);
> 	// continue;
> }
> 
> This probably be a dev_dbg_ratelimited. Indeed, that suppresses these
> messages.

The use or printk_ratelimit() like the above is already discouraged,
so it makes more sense to switch to dev_dbg_ratelimited() if it
works.

> The actual message that's being ratelimited is
> 
> usb 3-11.2: frame 0 active: -71
> 
> which is EPROTO. Looks like that comes from xhci_hcd. With debug enabled
> I get a lot of
> 
> xhci_hcd 0000:80:14.0: Transfer error for slot 36 ep 4 on endpoint
> 
> The spec says this is 
> 
> | Asserted in the case where the host did not receive a valid response
> | from the device (Timeout, CRC, Bad PID, unexpected NYET, etc.).
> 
> and I don't really know what to make of that. Should I send a patch to
> convert that dev_dbg to dev_dbg_ratelimited? Or do you want to debug
> this further?

Usually EPROTO means something the USB controller doesn't like :)
It's often a device firmware problem, but can be other means, too.
You can try to connect to a different port or a machine, and see
whether the problem is seen consistently.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: retire_capture_urb: Corrected urb data len
  2025-08-01  8:50             ` Takashi Iwai
@ 2025-08-01 15:35               ` Sean Anderson
  0 siblings, 0 replies; 9+ messages in thread
From: Sean Anderson @ 2025-08-01 15:35 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 16022 bytes --]

On 8/1/25 04:50, Takashi Iwai wrote:
> On Thu, 31 Jul 2025 23:49:11 +0200,
> Sean Anderson wrote:
>> 
>> Hi,
>> 
>> On 9/2/22 01:52, Takashi Iwai wrote:
>> > On Thu, 01 Sep 2022 17:25:41 +0200,
>> > Sean Anderson wrote:
>> >> 
>> >> 
>> >> 
>> >> On 8/28/22 3:49 AM, Takashi Iwai wrote:
>> >> > On Fri, 26 Aug 2022 20:57:53 +0200,
>> >> > Sean Anderson wrote:
>> >> >> 
>> >> >> On 8/26/22 12:36 PM, Takashi Iwai wrote:
>> >> >> > On Fri, 26 Aug 2022 18:22:24 +0200,
>> >> >> > Sean Anderson wrote:
>> >> >> >> 
>> >> >> >> Hi all,
>> >> >> >> 
>> >> >> >> I have a "FiiO DigiHug USB Audio" sound card (1852:7022) [3]. I have had
>> >> >> >> no problems with the audio, but I did notice a large number of message
>> >> >> >> like 
>> >> >> >> 
>> >> >> >> retire_capture_urb: 4992 callbacks suppressed
>> >> >> >> 
>> >> >> >> in my dmesg [1]. This is caused by the "Corrected urb data len."
>> >> >> >> warning.
>> >> >> > 
>> >> >> > What exact values are shown there?
>> >> >> 
>> >> >> Unfortunately, as detailed below, I was unable to turn off ratelimiting.
>> >> >> 
>> >> >> > The problem is that your hardware
>> >> >> > (likely a buggy firmware) returns the unaligned size of bytes as the
>> >> >> > data.  Maybe it's worth to replace dev_warn_ratelimited() there with
>> >> >> > dev_warn() and take all warnings once.  Then we can see what kind of
>> >> >> > values are delivered from the hardware.
>> >> >> 
>> >> >> I'll have an attempt at that next week
>> >> >> 
>> >> >> >> The patch adding this warning [2] makes it seem like
>> >> >> >> this warning should be an uncommon occurance. However, based on the
>> >> >> >> number of suppressed callbacks, this seems to be happening at a rate of
>> >> >> >> around 500 Hz.
>> >> >> >> 
>> >> >> >> Is this buggy hardware? Or is this a bug in the driver? Does there need
>> >> >> >> to be a quirk? Or perhaps the warning above should be a debug instead?
>> >> >> > 
>> >> >> > There is no quirk for that.  As long as the device works with that
>> >> >> > workaround (except for messages), we can simply add a quirk to not
>> >> >> > warn but always apply the workaround silently for such devices.
>> >> >> 
>> >> >> OK. I wasn't sure what the correct resolution would be.
>> >> > 
>> >> > Actually I was wrong: the existing quirk QUIRK_FLAG_ALIGN_TRANSFER
>> >> > should cover that.
>> >> > 
>> >> > Could you try to pass quirk_flags=0x04 for the corresponding card slot
>> >> > (the option takes an array) to snd-usb-audio module?  Alternatively,
>> >> > try to pass quirk_alias=18557022:0e510408 to snd-usb-audio?
>> >> 
>> >> I tried both options, but neither worked.
>> > 
>> > I have no further idea.  You should try the latest kernel without
>> > modification before checking further.
>> > 
>> > And, looking at the code again, it's really strange that you get those
>> > messages.  Actually the transfer size *is* aligned to the audio frames
>> > as default *unless* QUIRK_FLAG_ALIGN_TRANSFER is passed.  And the
>> > check is done rather the audio sample size alignment -- which must fit
>> > within the audio frame alignment.
>> > 
>> > So, QUIRK_FLAG_ALIGN_TRANSFER is already set for your device by some
>> > reason incorrectly, or the code is doing wrong on your kernel.
>> > We need to check what values are shown there actually, then check
>> > whether the problem happens with the latest vanilla kernel.
>> 
>> Sorry for the very long hiatus. I have reproduced this issue on kernel
>> 6.15.8.
>> 
>> From closer inspection this message seems to be from the first print and
>> not the second one:
>> 
>> if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
>> 	dev_dbg(&subs->dev->dev, "frame %d active: %d\n",
>> 		i, urb->iso_frame_desc[i].status);
>> 	// continue;
>> }
>> 
>> This probably be a dev_dbg_ratelimited. Indeed, that suppresses these
>> messages.
> 
> The use or printk_ratelimit() like the above is already discouraged,
> so it makes more sense to switch to dev_dbg_ratelimited() if it
> works.

OK, I'll send a patch.

>> The actual message that's being ratelimited is
>> 
>> usb 3-11.2: frame 0 active: -71
>> 
>> which is EPROTO. Looks like that comes from xhci_hcd. With debug enabled
>> I get a lot of
>> 
>> xhci_hcd 0000:80:14.0: Transfer error for slot 36 ep 4 on endpoint
>> 
>> The spec says this is 
>> 
>> | Asserted in the case where the host did not receive a valid response
>> | from the device (Timeout, CRC, Bad PID, unexpected NYET, etc.).
>> 
>> and I don't really know what to make of that. Should I send a patch to
>> convert that dev_dbg to dev_dbg_ratelimited? Or do you want to debug
>> this further?
> 
> Usually EPROTO means something the USB controller doesn't like :)
> It's often a device firmware problem, but can be other means, too.
> You can try to connect to a different port or a machine, and see
> whether the problem is seen consistently.

As it happens, this with a different motherboard than before. So I guess
this is a problem with the device?

I attached a pcap. From looking through it, it seems like many of the
"URB_ISOCHRONOUS in" are failing. But this is sort of strange, since the
card is just a DAC+headphone amp and there is no physical input.

In pactl [1] I see there is an input. It doesn't seem to function no
matter what profile I use. So maybe the quirk should be that this card
does not actually have an input?

--Sean

[1] Output of "pactl list" excluding sections not containing "FiiO"

Module #49
        Name: module-alsa-card
        Argument: device_id="0" name="usb-FiiO_DigiHug_USB_Audio-01" card_name="alsa_card.usb-FiiO_DigiHug_USB_Audio-01" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
        Usage counter: 9
        Properties:
                module.author = "Lennart Poettering"
                module.description = "ALSA Card"
                module.version = "13.99.1"

Sink #22
        State: IDLE
        Name: alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo
        Description: DigiHug USB Audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 49
        Mute: no
        Volume: front-left: 30419 /  46% / -20.00 dB,   front-right: 30419 /  46% / -20.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor Source: alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo.monitor
        Latency: 54206 usec, configured 40000 usec
        Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "DigiHug USB Audio"
                alsa.long_card_name = "FiiO DigiHug USB Audio at usb-0000:80:14.0-11.2, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:80:14.0-usb-0:11.2:1.1"
                sysfs.path = "/devices/pci0000:80/0000:80:14.0/usb3/3-11/3-11.2/3-11.2:1.1/sound/card0"
                udev.id = "usb-FiiO_DigiHug_USB_Audio-01"
                device.bus = "usb"
                device.vendor.id = "1852"
                device.vendor.name = "GYROCOM C&C Co., LTD"
                device.product.id = "7022"
                device.product.name = "DigiHug USB Audio"
                device.serial = "FiiO_DigiHug_USB_Audio"
                device.string = "front:0"
                device.buffering.buffer_size = "352800"
                device.buffering.fragment_size = "176400"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "DigiHug USB Audio Analog Stereo"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Ports:
                analog-output: Analog Output (priority: 9900)
        Active Port: analog-output
        Formats:
                pcm

Source #44
        State: RUNNING
        Name: alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo.monitor
        Description: Monitor of DigiHug USB Audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 49
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: alsa_output.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo
        Latency: 0 usec, configured 40000 usec
        Flags: DECIBEL_VOLUME LATENCY 
        Properties:
                device.description = "Monitor of DigiHug USB Audio Analog Stereo"
                device.class = "monitor"
                alsa.card = "0"
                alsa.card_name = "DigiHug USB Audio"
                alsa.long_card_name = "FiiO DigiHug USB Audio at usb-0000:80:14.0-11.2, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:80:14.0-usb-0:11.2:1.1"
                sysfs.path = "/devices/pci0000:80/0000:80:14.0/usb3/3-11/3-11.2/3-11.2:1.1/sound/card0"
                udev.id = "usb-FiiO_DigiHug_USB_Audio-01"
                device.bus = "usb"
                device.vendor.id = "1852"
                device.vendor.name = "GYROCOM C&C Co., LTD"
                device.product.id = "7022"
                device.product.name = "DigiHug USB Audio"
                device.serial = "FiiO_DigiHug_USB_Audio"
                device.string = "0"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Formats:
                pcm

Source #45
        State: RUNNING
        Name: alsa_input.usb-FiiO_DigiHug_USB_Audio-01.analog-stereo
        Description: DigiHug USB Audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Owner Module: 49
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Base Volume: 65536 / 100% / 0.00 dB
        Monitor of Sink: n/a
        Latency: 1497109 usec, configured 40000 usec
        Flags: HARDWARE DECIBEL_VOLUME LATENCY 
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "DigiHug USB Audio"
                alsa.long_card_name = "FiiO DigiHug USB Audio at usb-0000:80:14.0-11.2, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:80:14.0-usb-0:11.2:1.1"
                sysfs.path = "/devices/pci0000:80/0000:80:14.0/usb3/3-11/3-11.2/3-11.2:1.1/sound/card0"
                udev.id = "usb-FiiO_DigiHug_USB_Audio-01"
                device.bus = "usb"
                device.vendor.id = "1852"
                device.vendor.name = "GYROCOM C&C Co., LTD"
                device.product.id = "7022"
                device.product.name = "DigiHug USB Audio"
                device.serial = "FiiO_DigiHug_USB_Audio"
                device.string = "front:0"
                device.buffering.buffer_size = "352800"
                device.buffering.fragment_size = "176400"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "DigiHug USB Audio Analog Stereo"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Ports:
                analog-input: Analog Input (priority: 10000)
        Active Port: analog-input
        Formats:
                pcm

Card #24
        Name: alsa_card.usb-FiiO_DigiHug_USB_Audio-01
        Driver: module-alsa-card.c
        Owner Module: 49
        Properties:
                alsa.card = "0"
                alsa.card_name = "DigiHug USB Audio"
                alsa.long_card_name = "FiiO DigiHug USB Audio at usb-0000:80:14.0-11.2, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "pci-0000:80:14.0-usb-0:11.2:1.1"
                sysfs.path = "/devices/pci0000:80/0000:80:14.0/usb3/3-11/3-11.2/3-11.2:1.1/sound/card0"
                udev.id = "usb-FiiO_DigiHug_USB_Audio-01"
                device.bus = "usb"
                device.vendor.id = "1852"
                device.vendor.name = "GYROCOM C&C Co., LTD"
                device.product.id = "7022"
                device.product.name = "DigiHug USB Audio"
                device.serial = "FiiO_DigiHug_USB_Audio"
                device.string = "0"
                device.description = "DigiHug USB Audio"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Profiles:
                input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 65, available: yes)
                input:iec958-stereo: Digital Stereo (IEC958) Input (sinks: 0, sources: 1, priority: 55, available: yes)
                output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6500, available: yes)
                output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6565, available: yes)
                output:analog-stereo+input:iec958-stereo: Analog Stereo Output + Digital Stereo (IEC958) Input (sinks: 1, sources: 1, priority: 6555, available: yes)
                output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority: 5500, available: yes)
                output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5565, available: yes)
                output:iec958-stereo+input:iec958-stereo: Digital Stereo Duplex (IEC958) (sinks: 1, sources: 1, priority: 5555, available: yes)
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
        Active Profile: output:analog-stereo+input:analog-stereo
        Ports:
                analog-input: Analog Input (priority: 10000, latency offset: 0 usec)
                        Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:iec958-stereo+input:analog-stereo
                iec958-stereo-input: Digital Input (S/PDIF) (priority: 0, latency offset: 0 usec)
                        Part of profile(s): input:iec958-stereo, output:analog-stereo+input:iec958-stereo, output:iec958-stereo+input:iec958-stereo
                analog-output: Analog Output (priority: 9900, latency offset: 0 usec)
                        Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-stereo+input:iec958-stereo
                iec958-stereo-output: Digital Output (S/PDIF) (priority: 0, latency offset: 0 usec)
                        Part of profile(s): output:iec958-stereo, output:iec958-stereo+input:analog-stereo, output:iec958-stereo+input:iec958-stereo

[-- Attachment #2: fiio.pcapng.gz --]
[-- Type: application/gzip, Size: 13075 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-01 15:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-26 16:22 retire_capture_urb: Corrected urb data len Sean Anderson
2022-08-26 16:36 ` Takashi Iwai
2022-08-26 18:57   ` Sean Anderson
2022-08-28  7:49     ` Takashi Iwai
2022-09-01 15:25       ` Sean Anderson
2022-09-02  5:52         ` Takashi Iwai
2025-07-31 21:49           ` Sean Anderson
2025-08-01  8:50             ` Takashi Iwai
2025-08-01 15:35               ` Sean Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox