output/alsa: add option "close_on_pause"

This allows keeping the ALSA PCM open even if playback is paused.  As
a side effect, this allows using the "always_on" option with ALSA
outputs, because "always_on" pauses the output.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1623
This commit is contained in:
Max Kellermann
2024-07-29 16:04:23 +02:00
parent 7ab789fbaf
commit 0a035f3ce0
4 changed files with 43 additions and 8 deletions

View File

@@ -896,6 +896,11 @@ The `Advanced Linux Sound Architecture (ALSA) <http://www.alsa-project.org/>`_ p
Example: "96000:16:* 192000:24:* dsd64:*=dop *:dsd:*".
* - **close_on_pause yes|no**
- Close the ALSA device while playback is paused? This defaults
to *yes* because this allows other applications to use the
device while MPD is paused.
The according hardware mixer plugin understands the following settings:
.. list-table::

View File

@@ -532,7 +532,8 @@ The following table lists the audio_output options valid for all plugins:
- If set to yes, then :program:`MPD` attempts to keep this audio
output always open. Instead of closing at the end
of playback, it puts the device in "pause" mode. This works
only with output plugins that suport "pause" mode.
only with output plugins that suport "pause" mode (see
:ref:`ALSA option "close_on_pause" <alsa_plugin>`).
This may be useful for streaming servers, when you don't want
to disconnect all listeners even when playback is accidentally
stopped.