From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To: Jaroslav Kysela <perex@perex.cz>
Cc: alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.de>
Subject: Re: [PATCH v2 2/2] ALSA: pcm: auto-fill buffer with silence when draining playback
Date: Fri, 21 Apr 2023 12:04:59 +0200 [thread overview]
Message-ID: <ZEJfyzFXVuLHPs+S@ugly> (raw)
In-Reply-To: <6b7275c2-4f88-46ed-3b8b-076298c7562a@perex.cz>
On Fri, Apr 21, 2023 at 11:33:35AM +0200, Jaroslav Kysela wrote:
>On 20. 04. 23 13:33, Oswald Buddenhagen wrote:
>> Draining will always playback somewhat beyond the end of the filled
>> buffer. This would produce artifacts if the user did not set up the
>> auto-silencing machinery, which is an extremely easy mistake to make, as
>> the API strongly suggests convenient fire-and-forget semantics. This
>> patch makes it work out of the box.
>
>NACK. The initial implementation should be put to alsa-lib as discussed.
>
as discussed, a user-space only implementation based on the current
kernel api is not reasonable:
it could either enable auto-silencing on device open (which would be
unreasonably expensive) or it could enable it on drain (and disable it
once draining is done, which would be unreasonably complex due to
needing to handle asynchronous draining completion).
so we would at least need a kernel api to enable silence-on-drain, which
user space could apply on device open.
this would be easy enough to do, but i really don't see a point in
adding that complexity, given that it should be always enabled, lest it
won't have much of a real-world impact.
fwiw, i just realized that the argument against touching the mmap'd
buffer is even weaker with the updated implementation, as it only clears
as much as user space would have to clear anyway (pedantically, i could
round it down to the end of a period rather than filling two whole
periods, if that's the bit that convinces you).
regards
next prev parent reply other threads:[~2023-04-21 10:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 11:33 [PATCH v2 1/2] ALSA: pcm: rewrite snd_pcm_playback_silence() Oswald Buddenhagen
2023-04-20 11:33 ` [PATCH v2 2/2] ALSA: pcm: auto-fill buffer with silence when draining playback Oswald Buddenhagen
2023-04-21 9:33 ` Jaroslav Kysela
2023-04-21 10:04 ` Oswald Buddenhagen [this message]
2023-04-21 13:29 ` Jaroslav Kysela
2023-04-21 9:20 ` [PATCH v2 1/2] ALSA: pcm: rewrite snd_pcm_playback_silence() Jaroslav Kysela
2023-04-21 11:10 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZEJfyzFXVuLHPs+S@ugly \
--to=oswald.buddenhagen@gmx.de \
--cc=alsa-devel@alsa-project.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.