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 2119CECAAD4 for ; Mon, 29 Aug 2022 08:07:08 +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 DB86F822; Mon, 29 Aug 2022 10:06:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB86F822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661760426; bh=tTUGWviGu/fgzYr0Ra2FgXLqSail299g0w/MqM5Z7k0=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DgVr8ypi+3lHvUgD4PD/bm+J9dvSq6FKq4nJ2XqvNTWzk9JZpPrmV9Stfe9nFH5NE 6x2QEPHmSiRQ/G983H7j6iOALRyipDKrYjh4n2/ckZdfDGeQ/RQIbJ+A7n5F7xV2xD jR/Dcrg39jZLXxu+IuErpX8laUKlfVtqy/07HeKc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8155CF8012A; Mon, 29 Aug 2022 10:06:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D5B7F801F7; Mon, 29 Aug 2022 10:06:14 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 DD471F8012A for ; Mon, 29 Aug 2022 10:06:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DD471F8012A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="QUKz76JM"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6GqeYUDo" 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 5AFF43375A; Mon, 29 Aug 2022 08:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661760371; 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=XIj1KM6kndSpT9lxXTmoOEGFYxhFrwjsv5Bv6PB6wKo=; b=QUKz76JMCGTuhCVpeR3AiObDFB+gnd+IG8StcJE93eSwtegp/knEBEqcXeov0hemh4W+/z 1aC3WPO8II596hUbY0cZXF1HhJQKTdv6pJgIifREYl8wkShonwvL5rPN0VG7FGfcdh9w1n H83Q5W3NHKLFoMzTbDeZM60XFym8B3Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661760371; 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=XIj1KM6kndSpT9lxXTmoOEGFYxhFrwjsv5Bv6PB6wKo=; b=6GqeYUDoDvi/4UxJ74szY3Av+JLhJ4IK/J2vML0KXLkIQX9c3yRctmqutL6nhK3qtvWA7F wY2Ae5fTdwUtMmAA== 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 3FD70133A6; Mon, 29 Aug 2022 08:06:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZebzDnNzDGPNAgAAMHmgww (envelope-from ); Mon, 29 Aug 2022 08:06:11 +0000 Date: Mon, 29 Aug 2022 10:06:10 +0200 Message-ID: <87r10zxyml.wl-tiwai@suse.de> From: Takashi Iwai To: chihhao chen Subject: Re: missing sound on kernel-5.15 In-Reply-To: <120e52d94c00aab2cf1f3d611b06f03356e8229f.camel@mediatek.com> References: <87e6d6ae69d68dc588ac9acc8c0f24d6188375c3.camel@mediatek.com> <120e52d94c00aab2cf1f3d611b06f03356e8229f.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 Mon, 29 Aug 2022 09:56:42 +0200, chihhao chen wrote: > > Hi Takashi, > > Because of this problem, is it okay to remove configure_endpoints > function call in snd_usb_hw_params? > > Then configure_endpoints would be called in snd_usb_pcm_prepare and USB > control transfers become the same as which in kernel-5.10. There will > be only one SAMPLING_FREQ_CONTROL request and no sound-missing > phenomenon. Are you sure that removing the configure_endpoints() fixes the problem? Takashi > > Thanks > > > On Mon, 2022-08-22 at 08:57 -0300, Geraldo Nascimento wrote: > > On Mon, Aug 22, 2022 at 04:06:58PM +0800, chihhao chen wrote: > > > I am testing many headsets on Android platform with different > > > kernel > > > versions. > > > > > > On kernel-5.10, calling sequence for playback is > > > 1. snd_usb_hw_params -> set highest sampling rate, no > > > SAMPLING_FREQ_CONTROL USB request sent in this stage > > > 2. snd_pcm_release > > > 3. snd_usb_hw_params -> set proper sampling rate, still no > > > SAMPLING_FREQ_CONTROL USB request > > > 4. snd_usb_pcm_parepare -> in configure_endpoint > > > SAMPLING_FREQ_CONTROL > > > USB request was sent on USB bus > > > > > > With the same calling sequence, a slightly behavior change on > > > kernel- > > > 5.15 is > > > 1. snd_usb_hw_params -> set highest sampling rate, > > > SAMPLING_FREQ_CONTROL USB request was sent on USB bus > > > 2. snd_pcm_release > > > 3. snd_usb_hw_params -> set proper sampling rate, > > > SAMPLING_FREQ_CONTROL > > > USB request was sent too > > > (because configure_endpoint was moved to snd_usb_hw_params > > > function) > > > 4. snd_usb_pcm_parepare -> no SAMPLING_FREQ_CONTROL USB > > > request because of USB EP flag check > > > > > > I checked all USB packets and confirmed audio data output was > > > correct. > > > But there may be missing sound problem for the first sound with > > > many > > > headsets (for example Samsung headset). > > > I found this issue is related to two-times sampling rate set > > > request. > > > (I tried to forcibly skip first USB request, everything became > > > okay.) > > > So do you guys know why configure_endpoint was moved to > > > snd_usb_hw_params? > > > > Hi Chihhao, > > > > the commit you're looking for is > > bf6313a0ff766925462e97b4e733d5952de02367 > > ("ALSA: usb-audio: Refactor endpoint management") > > > > Good luck, > > Geraldo Nascimento > > > > > Or could you provide patch for this problem? > > > > > > Many thanks > > > Chihhao > > > >