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 9ADBCE95A8E for ; Mon, 9 Oct 2023 06:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345195AbjJIGUk (ORCPT ); Mon, 9 Oct 2023 02:20:40 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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