From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA6E4ECAAD6 for ; Fri, 26 Aug 2022 16:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231379AbiHZQgT (ORCPT ); Fri, 26 Aug 2022 12:36:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244516AbiHZQgJ (ORCPT ); Fri, 26 Aug 2022 12:36:09 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC1345A8A8 for ; Fri, 26 Aug 2022 09:36:06 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5E3831F903; Fri, 26 Aug 2022 16:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661531765; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RPDxr3Ztn4+5QsscdSkEfhq+48P+uTXlFovytZKsRYM=; b=ecrqlTFOWRUBuOoMUe8YsWSYSEps3AMAT7sOl415VwcWA31UvP1xa3itBM3pwouuowMDAw 9ZFL7q5ISTrQ7XT4HH3GV7sg70/EoNpesSynvDWmDEf1TxsKK7Acc6RMWPfnAv0GHdqbLv eiPQOiDpnIGqBV3jWvB0QRU9LVeiT+o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661531765; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RPDxr3Ztn4+5QsscdSkEfhq+48P+uTXlFovytZKsRYM=; b=NvW0ZeaCQ6niEFZsluRpfPCL3U4QkWuDc8rAY0WutFiSXwSeIIci2AC/ow1zh24Py7KK49 mVvri9vyrn3CvLBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3488A13421; Fri, 26 Aug 2022 16:36:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id pWLeC3X2CGNQdgAAMHmgww (envelope-from ); Fri, 26 Aug 2022 16:36:05 +0000 Date: Fri, 26 Aug 2022 18:36:04 +0200 Message-ID: <87ilmfj72j.wl-tiwai@suse.de> From: Takashi Iwai To: Sean Anderson Cc: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, Linux Kernel Mailing List Subject: Re: retire_capture_urb: Corrected urb data len In-Reply-To: <68a97d61-21bf-b45e-f6ed-c0906dd4b197@seco.com> References: <68a97d61-21bf-b45e-f6ed-c0906dd4b197@seco.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) >