Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: ALSA development <alsa-devel@alsa-project.org>
Subject: [PATCH alsa-lib 0/4] pcm: hw: implement explicit silencing for snd_pcm_drain
Date: Tue,  2 May 2023 13:50:06 +0200	[thread overview]
Message-ID: <20230502115010.986325-1-perex@perex.cz> (raw)

This is a complete API solution for the filling of the silence samples
for the drain operation. The default bahaviour is to aligns the valid
samples to one period with extra silence samples for next 1/10th of second.

Introduce SNDRV_PCM_INFO_PERFECT_DRAIN and SNDRV_PCM_HW_PARAMS_NO_DRAIN_SILENCE
flags to fully control the filling of the silence samples in the snd_pcm_drain
call. Those flags do the bidirectional setup for this operation, so the
silencing may be implemented eventually in the kernel space when there's
a demand in future. Also, some applications may not require to silence the
samples beyond the tail of the ring buffer at all.

There is also a new pcm_hw plugin configuration field allowing the 
overwrite of the default (auto) behaviour.

Related: https://lore.kernel.org/alsa-devel/20230420113324.877164-2-oswald.buddenhagen@gmx.de/
Related: https://lore.kernel.org/alsa-devel/20230405201219.2197789-2-oswald.buddenhagen@gmx.de/

Jaroslav Kysela (4):
  pcm: hw: setup explicit silencing for snd_pcm_drain by default
  pcm: hw: add drain_silence configuration keyword
  pcm: hw: introduce SNDRV_PCM_INFO_PERFECT_DRAIN
  pcm: hw: introduce SNDRV_PCM_HW_PARAMS_DRAIN_SILENCE

 include/pcm.h               |  1 +
 include/sound/uapi/asound.h |  4 ++
 src/pcm/pcm.c               | 88 +++++++++++++++++++++++++++++++------
 src/pcm/pcm_hw.c            | 74 ++++++++++++++++++++++++++++++-
 src/pcm/pcm_local.h         |  7 +++
 5 files changed, 160 insertions(+), 14 deletions(-)

-- 
2.39.2


             reply	other threads:[~2023-05-02 11:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 11:50 Jaroslav Kysela [this message]
2023-05-02 11:50 ` [PATCH alsa-lib 1/4] pcm: hw: setup explicit silencing for snd_pcm_drain by default Jaroslav Kysela
2023-05-03 11:20   ` Oswald Buddenhagen
2023-05-03 20:19     ` Oswald Buddenhagen
2023-05-03 20:31       ` Jaroslav Kysela
2023-05-05 18:56   ` Oswald Buddenhagen
2023-05-02 11:50 ` [PATCH alsa-lib 2/4] pcm: hw: add drain_silence configuration keyword Jaroslav Kysela
2023-05-03 11:24   ` Oswald Buddenhagen
2023-05-03 14:22     ` Jaroslav Kysela
2023-05-03 15:39       ` Oswald Buddenhagen
2023-05-02 11:50 ` [PATCH alsa-lib 3/4] pcm: hw: introduce SNDRV_PCM_INFO_PERFECT_DRAIN Jaroslav Kysela
2023-05-03 11:25   ` Oswald Buddenhagen
2023-05-04  8:18   ` Takashi Iwai
2023-05-04  8:31     ` Jaroslav Kysela
2023-05-04 12:50       ` Takashi Iwai
2023-05-02 11:50 ` [PATCH alsa-lib 4/4] pcm: hw: introduce SNDRV_PCM_HW_PARAMS_DRAIN_SILENCE Jaroslav Kysela
2023-05-03 11:26   ` Oswald Buddenhagen

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=20230502115010.986325-1-perex@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox