Skip to content

pcm: hw: implement explicit silencing for snd_pcm_drain

Jaroslav Kysela alsa-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4pcm: hw: setup explicit silencing for snd_pcm_drain by defaultsrc/pcm/pcm.c src/pcm/pcm_hw.c src/pcm/pcm_local.h+71 -134 replies
2/4pcm: hw: add drain_silence configuration keywordsrc/pcm/pcm_hw.c+24 -23 replies
3/4pcm: hw: introduce SNDRV_PCM_INFO_PERFECT_DRAINinclude/pcm.h include/sound/uapi/asound.h src/pcm/pcm.c +2 more+30 -14 replies
4/4pcm: hw: introduce SNDRV_PCM_HW_PARAMS_DRAIN_SILENCEinclude/sound/uapi/asound.h src/pcm/pcm.c src/pcm/pcm_hw.c +1 more+38 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH alsa-lib 0/4] pcm: hw: implement explicit silencing for snd_pcm_drain

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/[email protected]/
Related: https://lore.kernel.org/alsa-devel/[email protected]/

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(-)
Signature · 1 line
2.39.2