[PATCH] Fix mic sound on Jieli webcam
Takashi Iwai
tiwai at suse.de
Thu Dec 17 15:12:19 CET 2020
On Thu, 17 Dec 2020 14:24:58 +0100,
Marco Giunta wrote:
>
> On Thu, Dec 17, 2020 at 1:17 PM Takashi Iwai <tiwai at suse.de> wrote:
> >
> > bInterval in the descriptor should show the value.
> > At best, give the output of lsusb -v for the device.
>
> Here my lsusb:
Thanks.
> Interface Association:
> bLength 8
> bDescriptorType 11
> bFirstInterface 2
> bInterfaceCount 2
> bFunctionClass 1 Audio
> bFunctionSubClass 2 Streaming
> bFunctionProtocol 0
> iFunction 5 USB Microphone
> Interface Descriptor:
(snip)
> AudioStreaming Interface Descriptor:
> bLength 11
> bDescriptorType 36
> bDescriptorSubtype 2 (FORMAT_TYPE)
> bFormatType 1 (FORMAT_TYPE_I)
> bNrChannels 1
> bSubframeSize 2
> bBitResolution 16
> bSamFreqType 1 Discrete
> tSamFreq[ 0] 8000
> Endpoint Descriptor:
> bLength 9
> bDescriptorType 5
> bEndpointAddress 0x82 EP 2 IN
> bmAttributes 1
> Transfer Type Isochronous
> Synch Type None
> Usage Type Data
> wMaxPacketSize 0x0100 1x 256 bytes
> bInterval 4
It's 4, and the same is set for all sample rates (8000, 16000, 44100,
48000).
If you don't tweak the datainterval, which error do you get?
The actual error message should appear before "... xx callbacks
suppressed" line.
BTW, the errors at the current sample rate checks could be better
avoided by treating the return value 0 specially, something like
below.
Takashi
-- 8< --
From: Takashi Iwai <tiwai at suse.de>
Subject: [PATCH] ALSA: usb-audio: Disable sample read check if firmware
doesn't give back
Some buggy firmware don't give the current sample rate but leaves
zero. Handle this case more gracefully without warning but just skip
the current rate verification from the next time.
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
sound/usb/clock.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index e940dcee792b..31051f2be46d 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -534,6 +534,12 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip,
}
crate = data[0] | (data[1] << 8) | (data[2] << 16);
+ if (!crate) {
+ dev_info(&dev->dev, "failed to read current rate; disabling the check\n");
+ chip->sample_rate_read_error = 3; /* three strikes, see above */
+ return 0;
+ }
+
if (crate != rate) {
dev_warn(&dev->dev, "current rate %d is different from the runtime rate %d\n", crate, rate);
// runtime->rate = crate;
--
2.26.2
More information about the Alsa-devel
mailing list