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 E66F3C77B75 for ; Fri, 21 Apr 2023 11:12:10 +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 3550BE77; Fri, 21 Apr 2023 13:11:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3550BE77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1682075528; bh=kw8DxdAZ4mu0N1r4rN+kzcnPkRdhrumIt6t7h+uTFmY=; 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=bZgts+yzAQQEIwG5qE5QKmvngcdVdX0PDgtZbuLj1ThU7qA6DYJCgthml3gPu08I1 3uJp1KXTqFGcaGZxBcAY+2j3PFJBKGIYImdbviN6Ee1ETvYPsOfXVp+QGll3OhlYbZ JziCM2H+JmGPjLlmMOIvFxkAhdpfqWPLEKY3q5Kw= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C3956F80155; Fri, 21 Apr 2023 13:10:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2332DF80155; Fri, 21 Apr 2023 13:10:50 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (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 D2624F80053 for ; Fri, 21 Apr 2023 13:10:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D2624F80053 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=bVznnPCh; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=S1nPH9JH 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 2B81621A14; Fri, 21 Apr 2023 11:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682075445; 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=dVaFu96Iv+PSDqhb3uTVKddYOe/Jyu+a93TRhbQgD30=; b=bVznnPChTGMcpPf1fasgdF6ldwwzh9pnHvZtK19dfhNrLfX2kTMrmdmJhqY4wcdx5b2gVN JrB3y0WjQDEOhKlT35t2ZGFFB2zCUji8APZUsCRDhe8f4wGEzKX7Ur27id28iDRdyLWGFy 0PsJtpa9wxyFyqvqCRYAAJN+MW3hDX0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682075445; 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=dVaFu96Iv+PSDqhb3uTVKddYOe/Jyu+a93TRhbQgD30=; b=S1nPH9JHpP5XTqeJiwU33arkMur8ewr83PPYs0wXqs7BjZarF/fVNNWfT5ePgKHh9kGDGO x4+7c8uO/+Dx3dBQ== 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 0C64D13456; Fri, 21 Apr 2023 11:10:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4o3yATVvQmQTCgAAMHmgww (envelope-from ); Fri, 21 Apr 2023 11:10:45 +0000 Date: Fri, 21 Apr 2023 13:10:44 +0200 Message-ID: <877cu5sd6z.wl-tiwai@suse.de> From: Takashi Iwai To: Oswald Buddenhagen Subject: Re: [PATCH v2 1/2] ALSA: pcm: rewrite snd_pcm_playback_silence() In-Reply-To: <20230420113324.877164-1-oswald.buddenhagen@gmx.de> References: <20230420113324.877164-1-oswald.buddenhagen@gmx.de> 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: PCLK7BK4SXWY4TMRWNSXZHCPTZZPTVWV X-Message-ID-Hash: PCLK7BK4SXWY4TMRWNSXZHCPTZZPTVWV 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: alsa-devel@alsa-project.org 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 Thu, 20 Apr 2023 13:33:23 +0200, Oswald Buddenhagen wrote: > > The auto-silencer supports two modes: "thresholded" to fill up "just > enough", and "top-up" to fill up "as much as possible". The two modes > used rather distinct code paths, which this patch unifies. The only > remaining distinction is how much we actually want to fill. > > This fixes a bug in thresholded mode, where we failed to use new_hw_ptr, > resulting in under-fill. > > Top-up mode is now more well-behaved and much easier to understand in > corner cases. > > This also updates comments in the proximity of silencing-related data > structures. > > Signed-off-by: Oswald Buddenhagen > > --- > v2: > - removed useless boundary check > - got rid of casts by using a signed type for deltas. > i did not adjust the style of the conditionals, because it's not clear > whether the hangup was actually over that, or merely over the casts. > - dropped use of C99 comments where the surroundings suggest it. > (in the case of the interspersed multi-line comments, that doesn't > look like an improvement to me at all ...) > - swapped the `added` and `hw_avail` calculation blocks to reduce > subsequent churn. it's more logical that way anyway. Applied this one. For the second patch, let's discuss further. thanks, Takashi