From d5521ead56c11e671c87467418464b90371e8730 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2019 22:36:17 +0200 Subject: [PATCH 1/8] doc/user.rst: add missing space --- doc/user.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user.rst b/doc/user.rst index ea65442b2..ff43c4f6d 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -885,7 +885,7 @@ To verify if :program:`MPD` converts the audio format, enable verbose logging, a .. code-block:: none decoder: audio_format=44100:24:2, seekable=true - output: opened plugin=alsa name="An ALSA output"audio_format=44100:16:2 + output: opened plugin=alsa name="An ALSA output" audio_format=44100:16:2 output: converting from 44100:24:2 This example shows that a 24 bit file is being played, but the sound chip cannot play 24 bit. It falls back to 16 bit, discarding 8 bit. From 040e87ad8d0e35e7d1ad3ca421ed35a521958f35 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2019 22:33:08 +0200 Subject: [PATCH 2/8] doc/user.rst: more markup --- doc/user.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/user.rst b/doc/user.rst index ff43c4f6d..a4724ebe4 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -507,7 +507,10 @@ Audio Format Settings Global Audio Format ~~~~~~~~~~~~~~~~~~~ -The setting audio_output_format forces :program:`MPD` to use one audio format for all outputs. Doing that is usually not a good idea. The values are the same as in format in the audio_output section. +The setting ``audio_output_format`` forces :program:`MPD` to use one +audio format for all outputs. Doing that is usually not a good idea. +The values are the same as in ``format`` in the :ref:`audio_output +section `. Resampler ~~~~~~~~~ From c6b08a4d48ad3d20d0604dabac0d3074d9441e84 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2019 22:39:44 +0200 Subject: [PATCH 3/8] doc/user.rst: add reference to audio_output_format --- doc/user.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/user.rst b/doc/user.rst index a4724ebe4..b678b9535 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -504,6 +504,8 @@ reference. Audio Format Settings --------------------- +.. _audio_output_format: + Global Audio Format ~~~~~~~~~~~~~~~~~~~ @@ -915,7 +917,7 @@ Check list for bit-perfect playback: device (:samp:`hw:0,0` or similar). * Don't use software volume (setting :code:`mixer_type`). * Don't force :program:`MPD` to use a specific audio format (settings - :code:`format`, :code:`audio_output_format`). + :code:`format`, :ref:`audio_output_format `). * Verify that you are really doing bit-perfect playback using :program:`MPD`'s verbose log and :file:`/proc/asound/card*/pcm*p/sub*/hw_params`. Some DACs can also indicate the audio format. Direct Stream Digital (DSD) From fb07a7cecc1932beb711550b2fecce841af354cd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2019 22:36:41 +0200 Subject: [PATCH 4/8] doc/user.rst: move audio format spec to section "Global Audio Format" --- doc/user.rst | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/doc/user.rst b/doc/user.rst index b678b9535..c92a3de55 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -402,14 +402,9 @@ The following table lists the audio_output options valid for all plugins: - The name of the plugin * - **name** - The name of the audio output. It is visible to the client. Some plugins also use it internally, e.g. as a name registered in the PULSE server. - * - **format** - - Always open the audio output with the specified audio format samplerate:bits:channels), regardless of the format of the input file. This is optional for most plugins. - - Any of the three attributes may be an asterisk to specify that this attribute should not be enforced, example: 48000:16:*. *:*:* is equal to not having a format specification. - - The following values are valid for bits: 8 (signed 8 bit integer samples), 16, 24 (signed 24 bit integer samples padded to 32 bit), 32 (signed 32 bit integer samples), f (32 bit floating point, -1.0 to 1.0), "dsd" means DSD (Direct Stream Digital). For DSD, there are special cases such as "dsd64", which allows you to omit the sample rate (e.g. dsd512:2 for stereo DSD512, i.e. 22.5792 MHz). - - The sample rate is special for DSD: :program:`MPD` counts the number of bytes, not bits. Thus, a DSD "bit" rate of 22.5792 MHz (DSD512) is 2822400 from :program:`MPD`'s point of view (44100*512/8). + * - **format samplerate:bits:channels** + - Always open the audio output with the specified audio format, regardless of the format of the input file. This is optional for most plugins. + See :ref:`audio_output_format` for a detailed description of the value. * - **enabed yes|no** - Specifies whether this audio output is enabled when :program:`MPD` is started. By default, all audio outputs are enabled. This is just the default setting when there is no state file; with a state file, the previous state is restored. * - **tags yes|no** @@ -511,8 +506,24 @@ Global Audio Format The setting ``audio_output_format`` forces :program:`MPD` to use one audio format for all outputs. Doing that is usually not a good idea. -The values are the same as in ``format`` in the :ref:`audio_output -section `. + +The value is specified as ``samplerate:bits:channels``. + +Any of the three attributes may be an asterisk to specify that this +attribute should not be enforced, example: ``48000:16:*``. +``*:*:*`` is equal to not having a format specification. + +The following values are valid for bits: ``8`` (signed 8 bit integer +samples), ``16``, ``24`` (signed 24 bit integer samples padded to 32 +bit), ``32`` (signed 32 bit integer samples), ``f`` (32 bit floating +point, -1.0 to 1.0), ``dsd`` means DSD (Direct Stream Digital). For +DSD, there are special cases such as ``dsd64``, which allows you to +omit the sample rate (e.g. ``dsd512:2`` for stereo DSD512, +i.e. 22.5792 MHz). + +The sample rate is special for DSD: :program:`MPD` counts the number +of bytes, not bits. Thus, a DSD "bit" rate of 22.5792 MHz (DSD512) is +2822400 from :program:`MPD`'s point of view (44100*512/8). Resampler ~~~~~~~~~ From f0d3227d7bbd291d2838f11aef72ca931bdabca8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2019 22:46:23 +0200 Subject: [PATCH 5/8] doc/protocol.rst: add references to audio_output_format --- doc/protocol.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/protocol.rst b/doc/protocol.rst index a9d757194..e67a60145 100644 --- a/doc/protocol.rst +++ b/doc/protocol.rst @@ -178,8 +178,9 @@ of: file's time stamp with the given value (ISO 8601 or UNIX time stamp). -- ``(AudioFormat == 'SAMPLERATE:BITS:CHANNELS')``: - compares the audio format with the given value. +- ``(AudioFormat == 'SAMPLERATE:BITS:CHANNELS')``: compares the audio + format with the given value. See :ref:`audio_output_format` for a + detailed explanation. - ``(AudioFormat =~ 'SAMPLERATE:BITS:CHANNELS')``: matches the audio format with the given mask (i.e. one @@ -423,7 +424,9 @@ Querying :program:`MPD`'s status - ``xfade``: ``crossfade`` in seconds - ``mixrampdb``: ``mixramp`` threshold in dB - ``mixrampdelay``: ``mixrampdelay`` in seconds - - ``audio``: The format emitted by the decoder plugin during playback, format: ``*samplerate:bits:channels*``. Check the user manual for a detailed explanation. + - ``audio``: The format emitted by the decoder plugin during + playback, format: ``samplerate:bits:channels``. See + :ref:`audio_output_format` for a detailed explanation. - ``updating_db``: ``job id`` - ``error``: if there is an error, returns message here From de0afa0e08bababdaa0f47665f703efd25b8def5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2019 22:51:45 +0200 Subject: [PATCH 6/8] doc/mpd.conf.5: fix section indent --- doc/mpd.conf.5 | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/mpd.conf.5 b/doc/mpd.conf.5 index ce539b895..dba94de5a 100644 --- a/doc/mpd.conf.5 +++ b/doc/mpd.conf.5 @@ -140,7 +140,6 @@ of database. .B auto_update_depth Limit the depth of the directories being watched, 0 means only watch the music directory itself. There is no limit by default. -.TP .SH REQUIRED AUDIO OUTPUT PARAMETERS .TP .B type From ed2db04f4350715a8535a1cb734015e7d9acdd48 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 May 2019 22:49:58 +0200 Subject: [PATCH 7/8] doc/mpd.conf.5: remove ALSA specific documentation ALSA is just one out of many output plugins, and detailed plugin documentation should only live in the user manual, without having duplicates in the (brief) manpage. Also move "mixer_type" to the "optional audio output parameters" section; it is a generic option, not specific to ALSA. Closes https://github.com/MusicPlayerDaemon/MPD/issues/552 --- doc/mpd.conf.5 | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/doc/mpd.conf.5 b/doc/mpd.conf.5 index dba94de5a..58d951b53 100644 --- a/doc/mpd.conf.5 +++ b/doc/mpd.conf.5 @@ -163,57 +163,12 @@ Specifies how replay gain is applied. The default is "software", which uses an internal software volume control. "mixer" uses the configured (hardware) mixer control. "none" disables replay gain on this audio output. -.SH OPTIONAL ALSA OUTPUT PARAMETERS -.TP -.B device -This specifies the device to use for audio output. The default is "default". .TP .B mixer_type Specifies which mixer should be used for this audio output: the hardware mixer (available for ALSA, OSS and PulseAudio), the software mixer or no mixer ("none"). By default, the hardware mixer is used for devices which support it, and none for the others. -.TP -.B mixer_device -This specifies which mixer to use. The default is "default". To use -the second sound card in a system, use "hw:1". -.TP -.B mixer_control -This specifies which mixer control to use (sometimes referred to as -the "device"). The default is "PCM". Use "amixer scontrols" to see -the list of possible controls. -.TP -.B mixer_index -A number identifying the index of the named mixer control. This is -probably only useful if your alsa device has more than one -identically\-named mixer control. The default is "0". Use "amixer -scontrols" to see the list of controls with their indexes. -.TP -.B auto_resample -Setting this to "no" disables ALSA's software resampling, if the -hardware does not support a specific sample rate. This lets MPD do -the resampling. "yes" is the default and allows ALSA to resample. -.TP -.B auto_channels -Setting this to "no" disables ALSA's channel conversion, if the -hardware does not support a specific number of channels. Default: "yes". -.TP -.B auto_format -Setting this to "no" disables ALSA's sample format conversion, if the -hardware does not support a specific sample format. Default: "yes". -.TP -.B buffer_time