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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 89305ECAAD3 for ; Wed, 31 Aug 2022 05:19:57 +0000 (UTC) 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 C215415F2; Wed, 31 Aug 2022 07:19:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C215415F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661923194; bh=yqSSwDN1DuhauwVaqV4pfajDuIl/nPkcKQriaeIPC18=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vgmQqRGFiBocNENczn2vYy+Bqcq8Iez8HAqJkIORHEGoDd47ZrpP40YCIUnh5E2It TzwoyCvVt04X2ZQ8gjcMh3LlZAGNOFQxWbEg1xRBP9/L7JlGa9ZbTMV1rRbHweB/eE q793qjH6I7COL2gyv0rQE5Sx2Br4mc9sTIIaQTLY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4FF52F8012A; Wed, 31 Aug 2022 07:19:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0D634F8042F; Wed, 31 Aug 2022 07:18:56 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D5380F8012A for ; Wed, 31 Aug 2022 07:18:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D5380F8012A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="RdUjfD2M"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="TCtCmqXO" 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-out1.suse.de (Postfix) with ESMTPS id 59D2121ACD; Wed, 31 Aug 2022 05:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661923128; 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=64slhFb5nPzQzF60r0fyZBfd1V67iUiNhEcECNMBazY=; b=RdUjfD2MQY/x1h324A4w8s/Y48WA50YQAkYAJ6P/B8SV86e0/mFAR+Ig0YqResqwTd7L1t CA4JxOcS/pqa0GyCQfYulva+vHuBMNMkV612oTiQPOeLKD2WsJWbHK5MCF1upyxQuNhFdi nIf0/rlJ4Jy50uEH0NR/EqzncAy3uGk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661923128; 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=64slhFb5nPzQzF60r0fyZBfd1V67iUiNhEcECNMBazY=; b=TCtCmqXO12CWMT5XJhp55P2x2LegtzP6Vv1fHLit2pwEFm21ZvNt+yfpC9ye9TMpYS50pO eGJK4r7Bes0cKBAg== 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 338651332D; Wed, 31 Aug 2022 05:18:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id k0mhCzjvDmOVYAAAMHmgww (envelope-from ); Wed, 31 Aug 2022 05:18:48 +0000 Date: Wed, 31 Aug 2022 07:18:47 +0200 Message-ID: <871qsxxa6g.wl-tiwai@suse.de> From: Takashi Iwai To: chihhao chen Subject: Re: missing sound on kernel-5.15 In-Reply-To: <737b992a1546486fa622c83831209f935e45ffd2.camel@mediatek.com> References: <87e6d6ae69d68dc588ac9acc8c0f24d6188375c3.camel@mediatek.com> <120e52d94c00aab2cf1f3d611b06f03356e8229f.camel@mediatek.com> <87r10zxyml.wl-tiwai@suse.de> <87a67nb5yc.wl-tiwai@suse.de> <87r10y9are.wl-tiwai@suse.de> <87ilma8edo.wl-tiwai@suse.de> <0f36385ad917ac5ec1fdf4fedd8acd6bb3494bdf.camel@mediatek.com> <87bks28b8c.wl-tiwai@suse.de> <04ecea78ade006c6c7f4575158d1973feb9a6062.camel@mediatek.com> <875yia87gu.wl-tiwai@suse.de> <737b992a1546486fa622c83831209f935e45ffd2.camel@mediatek.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 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 Wed, 31 Aug 2022 05:39:56 +0200, chihhao chen wrote: > > Hi Takashi, > > Yes they all show the same phenomenon : missing first sound randomly > when users start playback. Ah, that's what I misunderstood: I thought the output were completely missing. > I tried to run alsa-info.sh but got "This script requires amixer > utility to continue" message. Too bad. Any chance to install those standard ALSA tools? > For Samsung USB C Earphone UAC1 device, I tested not to set > 96000(highest rate) but 48000 twice and this issue still > happened.(Original behavior : set 96000 then set 48000 -> Try to set > 48000 then set 48000 instead) So I think the problem might be related > to setting frequency multiple times. > > For Apple USB-C to 3.5mm Headphone Jack Adapter UAC3 device, I > confirmed its badd_profile is UAC3_FUNCTION_SUBCLASS_HEADPHONE so it > will not go into QUIRK_FLAG_VALIDATE_RATES quirk function. > Besides its initialization sequence in k5.15 is to set 48000 twice and > because this rate works well in k5.10, do I still need to set lower > rate to test? In that case, better to test a few other options. But before going in that way, let's check whether the problem depends on the host or not. Which host are you testing? An ARM system? Does the problem happen with the same USB-audio device on another machine (e.g. x86 laptop)? Takashi > > Thanks > > On Tue, 2022-08-30 at 10:24 +0200, Takashi Iwai wrote: > > On Tue, 30 Aug 2022 10:08:51 +0200, > > chihhao chen wrote: > > > > > > Hi Takashi, > > > > > > I also think it should be a firmware problem but it happens with > > > many > > > different devices because of new set sampling rate behavior in > > > k5.15. > > > > > > Device 1 UAC1 > > > [ 134.924359][T1000005] kworker/0:0: usb 1-1: [name:usbcore&]New > > > USB > > > device found, idVendor=04e8, idProduct=a04f, bcdDevice= 1.00 > > > [ 134.925944][T1000005] kworker/0:0: usb 1-1: [name:usbcore&]New > > > USB > > > device strings: Mfr=1, Product=2, SerialNumber=3 > > > [ 134.927338][T1000005] kworker/0:0: usb 1-1: > > > [name:usbcore&]Product: > > > Samsung USB C Earphone > > > [ 134.928426][T1000005] kworker/0:0: usb 1-1: > > > [name:usbcore&]Manufacturer: bestechnic > > > [ 134.929432][T1000005] kworker/0:0: usb 1-1: > > > [name:usbcore&]SerialNumber: 20160406.1 > > > > Does this show the same problem? If so, that's interesting because > > UAC1 has a completely different way of setting the sample rate. > > > > > Device 2 UAC3 > > > [ 779.645324][T1003414] kworker/0:1: usb 1-1: [name:usbcore&]New > > > USB > > > device found, idVendor=05ac, idProduct=110a, bcdDevice=26.11 > > > [ 779.647376][T1003414] kworker/0:1: usb 1-1: [name:usbcore&]New > > > USB > > > device strings: Mfr=1, Product=2, SerialNumber=3 > > > [ 779.649492][T1003414] kworker/0:1: usb 1-1: > > > [name:usbcore&]Product: > > > USB-C to 3.5mm Headphone Jack Adapter > > > [ 779.652262][T1003414] kworker/0:1: usb 1-1: > > > [name:usbcore&]Manufacturer: Apple, Inc. > > > [ 779.652273][T1003414] kworker/0:1: usb 1-1: > > > [name:usbcore&]SerialNumber: DWH126301CLJKLTAF > > > Device 3 > > > A XiaoMi adapter but it not in my hand now. > > > > > > I will try to integrate k5.19 into my codebase. > > > > At best, please give the alsa-info.sh output from each device. > > Run the script with --no-upload option and attach the output. > > > > Then try to test whether the reported highest sample rate actually > > works as-is. That is, to see whether the problem is really about > > issuing the frequency change multiple times for different rates, or > > it's because issuing the highest rate screws up the device. > > > > And, for UAC2/3 devices, it might be worth to try some known quirks, > > e.g. QUIRK_FLAG_VALIDATE_RATES, which was needed for MOTU (UAC2) > > devices. It's a bit 12 of quirk_flags option value. > > > > > > Takashi > > > > > > > > Thanks > > > > > > > > > On Tue, 2022-08-30 at 09:02 +0200, Takashi Iwai wrote: > > > > On Tue, 30 Aug 2022 08:13:44 +0200, > > > > chihhao chen wrote: > > > > > > > > > > Hi Takashi, > > > > > > > > > > I tried the patch but this problem still happens. > > > > > > > > > > I add some logs in snd_usb_init_sample_rate() in kernel-5.10 > > > > > [ 146.260105][T1702328] writer: usb 1-1: > > > > > [name:snd_usb_audio&]2:2 > > > > > Set > > > > > sample rate 96000, clock 0 protocol 0 > > > > > [ 146.289892][T1002328] writer: usb 1-1: > > > > > [name:snd_usb_audio&]2:2 > > > > > Set > > > > > sample rate 48000, clock 0 protocol 0 > > > > > > > > > > Because TinyAlsa tends to set highest rate for initialization > > > > > and > > > > > real > > > > > rate for playback, it will still trigger two-times > > > > > SAMPLING_FREQ_CONTROL USB requests. > > > > > > > > Then this is a firmware problem of your device. > > > > The same problem would happen even with the old kernel if you run > > > > the > > > > application with different sample rates. Does the device work > > > > with > > > > 96kHz at all? > > > > > > > > Could you give the lsusb -v output of the device, too? > > > > > > > > > Which kernel version should I try? kernel-5.19 or? > > > > > > > > Yes, 5.19 should suffice. > > > > > > > > > > > > Takashi >