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 X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A78DC4361B for ; Thu, 17 Dec 2020 14:13:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AAFF523975 for ; Thu, 17 Dec 2020 14:13:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAFF523975 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DFDE21881; Thu, 17 Dec 2020 15:12:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DFDE21881 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1608214406; bh=H40lsUaFnc8JSTLjOS3SLvUQLh4Aew3okOLmyKsBEaI=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sxJJ1orAAFIJk+48NO38Xo3XeChsku/RkeFvf5wSBOrYQqSxuVcuP8Ih2AM2XHrPk vHw5crCSCMUwMtu0yMNhP3KaIGx6fakMHB9KbVJwQZb9DzapLd+srYu0a6s0bNlyao sx9mTY8ZdNzv7W85BICDibWAPmcMRMqfyDZDzezE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6C44FF80259; Thu, 17 Dec 2020 15:12:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75EBCF80260; Thu, 17 Dec 2020 15:12:33 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 69999F8014B for ; Thu, 17 Dec 2020 15:12:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 69999F8014B X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id ABD0EAE93; Thu, 17 Dec 2020 14:12:19 +0000 (UTC) Date: Thu, 17 Dec 2020 15:12:19 +0100 Message-ID: From: Takashi Iwai To: Marco Giunta Subject: Re: [PATCH] Fix mic sound on Jieli webcam In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Thu, 17 Dec 2020 14:24:58 +0100, Marco Giunta wrote: > > On Thu, Dec 17, 2020 at 1:17 PM Takashi Iwai 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 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 --- 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