Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1711009rdb; Sun, 8 Oct 2023 23:21:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkyGL/2IP3UKrs5243UbfEN/+c9735pJ5YCwT3tX77jLpAVnIHbj9VvaG5W8SQcRaZdkuk X-Received: by 2002:a05:6358:63a1:b0:14c:d9d1:7ac4 with SMTP id k33-20020a05635863a100b0014cd9d17ac4mr13947782rwh.6.1696832462388; Sun, 08 Oct 2023 23:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696832462; cv=none; d=google.com; s=arc-20160816; b=msW+GEIWMqgXHxiSnKXVnR3cQGlMZjlV9PtS0GhR15FqDI2HpE/c9IDvAsGRzngTid Gow/ogCY1kQWpP4zyD3gWM0m6ZRhLjlaNCor78f+AKQXt3frtDhm3iTCpD+IPpo8T60w vBMzlkvW27SkPC8ANckGLs6tdZbHZY53oEP1y646kJxyJUdj/c60Txp4BDHg41fcxxkc eJTDpDotvkiICh4VyorA1ZjXo4enIDKY450L/7srEIjBGFrfTfDkUL+V0cMcwGt4ptfg tb/I9AU6stOijCNt4h2AI6fcmoSMS0acwkZ9LV+z8oGPYRR9No+oMHbzbMmogcrU0oTL NFRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=h811XnhwtJlj1G8lPJ8MVGh3/qIc/tpF0xq+Im1xLZQ=; fh=cELQGCyWwu5xIChomTdFT0H5udisdkRyLmbvuqpUi04=; b=FbzwuoZXyoFZjAXYV3TAGkaFVHGTSjjO5KdDleS7cG5Dic93W+k11qRQOJYk3z6G3i GOK5Dp5nvKg8hnwyOraA8RXY0AaQJcaVWoZl50iyVDr5+24x/PGJ1n13/IhP6SUMTLRI 1Wf3FrqmdOXfzTS7nfqaxQOmqNUiwuZYcPJPMGf+zKnvmYekdhdgoN+6xN90US1jcvqP 3dZYptXcHEEltl2rzkWff8/7vlqJgtoiLOnbOzKFjOUQSnlqt8uevjNqsweXsWc0Dgqo Y7VrzLkZnzhiVcrxXUT1Rl6IH8KDom0CA7iTULghEvSoEkx6f9hu3a/aODISxUh6l7ky qXaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HZLzEyyK; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id x63-20020a638642000000b0058934e7216dsi8932814pgd.751.2023.10.08.23.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 23:21:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=HZLzEyyK; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2188C80613B4; Sun, 8 Oct 2023 23:20:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345169AbjJIGUi (ORCPT + 99 others); Mon, 9 Oct 2023 02:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345217AbjJIGUf (ORCPT ); Mon, 9 Oct 2023 02:20:35 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03FBC9E for ; Sun, 8 Oct 2023 23:20:32 -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 A8DB11F891; Mon, 9 Oct 2023 06:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696832431; 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=h811XnhwtJlj1G8lPJ8MVGh3/qIc/tpF0xq+Im1xLZQ=; b=HZLzEyyK4C+WNVCmBcFAyRTvGtIiIvn/9FrHjOwONOVe39iXrFmVuQLWRlE2ZkKGhyf++p uEGF20fxlmiREkRw9U7gBDj7ZLWJD6Z13rbW1sAAZw4qytod2YJTNSL+vwD0gX/jjhtxNo 2wLX5rcB598IXVkIiXewpPtOoTSkx9k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696832431; 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=h811XnhwtJlj1G8lPJ8MVGh3/qIc/tpF0xq+Im1xLZQ=; b=euh+5flkh8KqUd5XPAUAjD7LfgZMVH1YwabNXk56dkYdcXXqD9euU++m40/ko5pXrnmdmv fzuBcimvd2RZIhDQ== 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 825F013586; Mon, 9 Oct 2023 06:20:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mxp1Hq+bI2X6AgAAMHmgww (envelope-from ); Mon, 09 Oct 2023 06:20:31 +0000 Date: Mon, 09 Oct 2023 08:20:32 +0200 Message-ID: <87mswstiz3.wl-tiwai@suse.de> From: Takashi Iwai To: Christos Skevis Cc: tiwai@suse.com, peter.ujfalusi@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: usb-audio: Fix microphone sound on Nexigo webcam. In-Reply-To: <20231006155330.399393-1-xristos.thes@gmail.com> References: <20231006155330.399393-1-xristos.thes@gmail.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 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 08 Oct 2023 23:20:54 -0700 (PDT) X-Spam-Level: ** On Fri, 06 Oct 2023 17:53:30 +0200, Christos Skevis wrote: > > I own an external usb Webcam, model NexiGo N930AF, which had low mic volume and > inconsistent sound quality. Video works as expected. > > (snip) > [ +0.047857] usb 5-1: new high-speed USB device number 2 using xhci_hcd > [ +0.003406] usb 5-1: New USB device found, idVendor=1bcf, idProduct=2283, bcdDevice=12.17 > [ +0.000007] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > [ +0.000004] usb 5-1: Product: NexiGo N930AF FHD Webcam > [ +0.000003] usb 5-1: Manufacturer: SHENZHEN AONI ELECTRONIC CO., LTD > [ +0.000004] usb 5-1: SerialNumber: 20201217011 > [ +0.003900] usb 5-1: Found UVC 1.00 device NexiGo N930AF FHD Webcam (1bcf:2283) > [ +0.025726] usb 5-1: 3:1: cannot get usb sound sample rate freq at ep 0x86 > [ +0.071482] usb 5-1: 3:2: cannot get usb sound sample rate freq at ep 0x86 > [ +0.004679] usb 5-1: 3:3: cannot get usb sound sample rate freq at ep 0x86 > [ +0.051607] usb 5-1: Warning! Unlikely big volume range (=4096), cval->res is probably wrong. > [ +0.000005] usb 5-1: [7] FU [Mic Capture Volume] ch = 1, val = 0/4096/1 > > Set up quirk cval->res to 16 for 256 levels, > Set GET_SAMPLE_RATE quirk flag to stop trying to get the sample rate. > Confirmed that happened anyway later due to the backoff mechanism, after 3 failures > > All audio stream on device interfaces share the same values, > apart from wMaxPacketSize and tSamFreq : > > (snip) > 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 8 > bDelay 1 frames > wFormatTag 0x0001 PCM > 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] 44100 > Endpoint Descriptor: > bLength 9 > bDescriptorType 5 > bEndpointAddress 0x86 EP 6 IN > bmAttributes 5 > Transfer Type Isochronous > Synch Type Asynchronous > Usage Type Data > wMaxPacketSize 0x005c 1x 92 bytes > bInterval 4 > bRefresh 0 > bSynchAddress 0 > AudioStreaming Endpoint Descriptor: > bLength 7 > bDescriptorType 37 > bDescriptorSubtype 1 (EP_GENERAL) > bmAttributes 0x01 > Sampling Frequency > bLockDelayUnits 0 Undefined > wLockDelay 0x0000 > (snip) > > Based on the usb data about manufacturer, SPCA2281B3 is the most likely controller IC > Manufacturer does not provide link for datasheet nor detailed specs. > No way to confirm if the firmware supports any other way of getting the sample rate. > > Testing patch provides consistent good sound recording quality and volume range. > > (snip) > [ +0.045764] usb 5-1: new high-speed USB device number 2 using xhci_hcd > [ +0.106290] usb 5-1: New USB device found, idVendor=1bcf, idProduct=2283, bcdDevice=12.17 > [ +0.000006] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > [ +0.000004] usb 5-1: Product: NexiGo N930AF FHD Webcam > [ +0.000003] usb 5-1: Manufacturer: SHENZHEN AONI ELECTRONIC CO., LTD > [ +0.000004] usb 5-1: SerialNumber: 20201217011 > [ +0.043700] usb 5-1: set resolution quirk: cval->res = 16 > [ +0.002585] usb 5-1: Found UVC 1.00 device NexiGo N930AF FHD Webcam (1bcf:2283) > > Signed-off-by: Christos Skevis Thanks, applied now. Takashi