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 0F427C7EE21 for ; Thu, 4 May 2023 06:16:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B962617DE; Thu, 4 May 2023 08:15:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B962617DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683180999; bh=zeDgvbZBNeBWNr0Vyc0mh32TNRQLSYl9hCqDt2gsAQc=; h=Date:From:To:Subject:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=npQ/1szITUW37mTgwIQZ/Dn2ADKaDouNAOkhjaTdIJlC8TYemVLn4kapQXpdyUGi3 gWv6o3uQLowKeqyBiJETNIshN1w9INPPda62rSPwJARRItkfBPFyL1edynFhufq19i ihfvpsI8Lq71NSl6+HTzapUTL3PyeH8Opt2b7sD0= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 301E6F8049E; Thu, 4 May 2023 08:15:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E9E9DF8049E; Thu, 4 May 2023 08:15:17 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 402E6F80114 for ; Thu, 4 May 2023 08:15:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 402E6F80114 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=BXV8Qdqy; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=/fYfg4UA 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 BE1EE208FE; Thu, 4 May 2023 06:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683180909; 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=d0sfME+PPZ5V5RFQCvfOfX+BHGbYKlu9VTktkJ7gxMU=; b=BXV8QdqyhL+5kaPtttVPSi8CPQYetVaPlbq4eJYMMaXbH+ITomk8BPJViddT5nyviPzmf9 EZFur6SewI/FIE6QjPb6t9ZI+vbnF5Y8P8t4EL14nGHFEI1I9X/eOg3kUVNu5/DFHljGuz dtjOjKG2/XufJARI5DrtQmXq1WKFRaQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683180909; 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=d0sfME+PPZ5V5RFQCvfOfX+BHGbYKlu9VTktkJ7gxMU=; b=/fYfg4UAJeiaOrTtwcq5d0o7z64GBeEudmhkv8euCcn7QhTVJJFPYTxxiKfNHk7nXZTl7a S5j81fAFCrirplDA== 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 967EC139C3; Thu, 4 May 2023 06:15:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Nn1nI21NU2TvaQAAMHmgww (envelope-from ); Thu, 04 May 2023 06:15:09 +0000 Date: Thu, 04 May 2023 08:15:09 +0200 Message-ID: <87ttwsmxle.wl-tiwai@suse.de> From: Takashi Iwai To: Oswald Buddenhagen Subject: Re: linux-6.4 alsa sound broken In-Reply-To: References: <87wn1pmm4d.wl-tiwai@suse.de> <7b80ef1e-23dd-c523-0663-4bf311c1823a@perex.cz> 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 Message-ID-Hash: CN4JUP5N5OTLD7B6WPJFBTYGCCNHV5SG X-Message-ID-Hash: CN4JUP5N5OTLD7B6WPJFBTYGCCNHV5SG X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jeff Chua , lkml , Bagas Sanjaya , ALSA development X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 03 May 2023 22:00:37 +0200, Oswald Buddenhagen wrote: > > On Wed, May 03, 2023 at 09:32:02PM +0200, Jaroslav Kysela wrote: > > On 03. 05. 23 18:10, Takashi Iwai wrote: > >> The dmix uses the silence_size=boundary as a fill-all operation, and > >> it's a free-wheel mode, so supposedly something was overlooked in your > >> code refactoring. > >> > >> Could you check it and address quickly? I'd like to fix it before > >> 6.4-rc1 release, so if no fix comes up in a couple of days, I'll have > >> to revert the change for 6.4-rc1. > > > > I would revert this patch. > > > It seems that this "do silence right after the playback is finished" > > mechanism is not handled in the updated code (and I overlooked that, > > too): > > > no, there is nothing wrong with the code _per se_. > > what's happening is that the dmix plugin doesn't update the > application pointer, and somehow gets away with it. > > that means that it would have never worked with thresholded silencing > mode, either, but, well, it uses top-up mode. Well, the code made just a wrong interpretation for the behavior with silence_size == boundary. This mode is actually a kind of tailored operation for dmix. In the description of alsa-lib snd_pcm_sw_params_set_silence_size(), you can find it: /** * \brief Set silence size inside a software configuration container * \param pcm PCM handle * \param params Software configuration container * \param val Silence size in frames (0 for disabled) * \return 0 otherwise a negative error code * * A portion of playback buffer is overwritten with silence when playback * underrun is nearer than silence threshold (see * #snd_pcm_sw_params_set_silence_threshold) * * The special case is when silence size value is equal or greater than * boundary. The unused portion of the ring buffer (initial written samples * are untouched) is filled with silence at start. Later, only just processed * sample area is filled with silence. Note: silence_threshold must be set to zero. */ So, the "top-up" silencing happens only at start, but not after that. In the code path of hw_ptr update, it doesn't check the appl_ptr any longer, but fills the processed area by the hw_ptr update with silence. That's the intended behavior for use cases of free-wheel mode without appl_ptr updates like dmix. Takashi