Skip to content

Commit 970100b

Browse files
authored
[Feature] Drop support for PULSE as OUTPUT_MODE (already deprecated) #224 (#226)
1 parent cb82380 commit 970100b

File tree

6 files changed

+22
-67
lines changed

6 files changed

+22
-67
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,11 @@ ENV INTEGER_UPSAMPLING ""
8888
ENV ALSA_AUTO_FIND_MIXER ""
8989

9090
ENV OUTPUT_MODE ""
91-
ENV PULSEAUDIO_OUTPUT_NAME ""
92-
ENV PULSEAUDIO_OUTPUT_ENABLED ""
93-
ENV PULSEAUDIO_OUTPUT_MEDIA_ROLE ""
94-
ENV PULSEAUDIO_OUTPUT_SCALE_FACTOR ""
9591

9692
ENV NULL_OUTPUT_NAME ""
9793
ENV NULL_OUTPUT_SYNC ""
9894

95+
# ALSA Outputs
9996
ENV ALSA_OUTPUT_CREATE ""
10097
ENV ALSA_OUTPUT_ENABLED ""
10198
ENV ALSA_OUTPUT_NAME ""
@@ -116,13 +113,15 @@ ENV ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED ""
116113
ENV ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED_PRESET ""
117114
ENV ALSA_OUTPUT_DOP ""
118115

116+
# PulseAudio Outputs
119117
ENV PULSE_AUDIO_OUTPUT_CREATE ""
120118
ENV PULSE_AUDIO_OUTPUT_ENABLED ""
121119
ENV PULSE_AUDIO_OUTPUT_NAME ""
122120
ENV PULSE_AUDIO_OUTPUT_SINK ""
123121
ENV PULSE_AUDIO_OUTPUT_MEDIA_ROLE ""
124122
ENV PULSE_AUDIO_OUTPUT_SCALE_FACTOR ""
125123

124+
# HTTPD Outputs
126125
ENV HTTPD_OUTPUT_CREATE ""
127126
ENV HTTPD_OUTPUT_ENABLED ""
128127
ENV HTTPD_OUTPUT_NAME ""
@@ -135,6 +134,7 @@ ENV HTTPD_OUTPUT_TAGS ""
135134
ENV HTTPD_OUTPUT_FORMAT ""
136135
ENV HTTPD_MIXER_TYPE ""
137136

137+
# ShoutCast/IceCast Outputs
138138
ENV SHOUT_OUTPUT_CREATE ""
139139
ENV SHOUT_OUTPUT_ENABLED ""
140140
ENV SHOUT_OUTPUT_NAME ""
@@ -154,6 +154,7 @@ ENV SHOUT_MIXER_TYPE ""
154154

155155
ENV INPUT_CACHE_SIZE ""
156156

157+
# Qobuz Input Plugin
157158
ENV QOBUZ_PLUGIN_ENABLED ""
158159
ENV QOBUZ_APP_ID ""
159160
ENV QOBUZ_APP_SECRET ""

README.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# mpd-alsa-docker
22

3-
A Docker image for mpd with support for both Alsa (`alsa`) and PulseAudio (`pulse`).
3+
A Docker image for mpd with support for both Alsa and PulseAudio.
44
It also includes `mpdscribble`. In alternative, you can use [mpd-scrobbler-docker](https://github.com/GioF71/mpd-scrobbler-docker) as the scrobbler for this image.
55
User mode is now possible when using `alsa` outputs, and of course it is mandatory (enforced) when using `pulse` outputs.
66
Upsampling (even in integer mode) is now available via a patched version of MPD (upstream version available as well).
@@ -54,14 +54,18 @@ Getting the image from DockerHub is as simple as typing:
5454

5555
## Usage
5656

57+
### Important changes
58+
59+
Starting with release `2023-02-04`, you will not be able to use the deprecated `PULSE` as `OUTPUT_MODE`. Refer to the next chapter for more information about how to change the configuration.
60+
In case of difficulties, you can fall back to any image before `2023-02-04`, as those will still work with this deprecated configuration.
61+
5762
### What is about to change
5863

5964
If you have been using this container image for a while, you might have seen that the output might contain some warnings, telling you that you are using a `deprecated` configuration. The message usually tries to suggest how to switch to a `recommended` configuration.
6065
This is happening because this whole project started with the idea of supporting ALSA only (hence the name `mpd-alsa-docker`). Down the road, I added PulseAudio support, and eventually HTTPD outputs, SHOUTCAST outputs, also in multiple instances.
6166
So now a few variables have a misleading name: the most misleading being `ALSA_DEVICE_NAME` which, despite the name, refers to the output name, and not to the device name.
6267
So currently, `OUTPUT_MODE` still defaults to `ALSA` for compatibility and will yield the creation of a ALSA *main* player, but the default for this variable will eventually become `NONE` (no *main* player). At the end of the process, the variable `OUTPUT_MODE` will completely disappear.
63-
You can still use `OUTPUT_MODE` set to `PULSE`, which creates a PulseAudio *main* output.
64-
In both cases, I suggest you change the configuration as suggested, and use the variables from the appropriate sections below for [Alsa](https://github.com/GioF71/mpd-alsa-docker#alsa-additional-outputs) and [PulseAudio](https://github.com/GioF71/mpd-alsa-docker#pulseaudio-additional-outputs), otherwise, in time, your configurations will not be functional anymore.
68+
In any case, I suggest you change the configuration as suggested, and use the variables from the appropriate sections below for [Alsa](https://github.com/GioF71/mpd-alsa-docker#alsa-additional-outputs) and [PulseAudio](https://github.com/GioF71/mpd-alsa-docker#pulseaudio-additional-outputs), otherwise, in time, your configurations will not be functional anymore.
6569
Feel free to contact me with an issue if you need support. I cannot guarantee a timing, but I will try to help if I can.
6670

6771
### User mode
@@ -105,13 +109,13 @@ DATABASE_MODE|Can be `simple` (default) or `proxy`
105109
DATABASE_PROXY_HOST|MPD server hostname, only used when `DATABASE_MODE` is set to `proxy`
106110
DATABASE_PROXY_PORT|MPD server port, only used when `DATABASE_MODE` is set to `proxy`
107111
MUSIC_DIRECTORY|Location of music files, defaults to `/music`
108-
OUTPUT_MODE|Output mode, can be `alsa` (still default but **deprecated**, you should use `ALSA_OUTPUT_CREATE` set to `yes`), `pulse` (**deprecated**, you should use `PULSE_AUDIO_OUTPUT_CREATE` set to `yes`), `null` or `none`. For `pulse` mode, running in `user` mode is required. Note that `none` does not create any output, leaving the task to the variables dedicated to additional outputs
112+
OUTPUT_MODE|Output mode, can be `alsa` (still default but **deprecated**, you should use `ALSA_OUTPUT_CREATE` set to `yes`), `null` or `none`.
109113
MPD_BIND_ADDRESS|The MPD listen address, defaults to `0.0.0.0`
110114
MPD_PORT|The MPD port, defaults to `6600`
111-
USER_MODE|Set to `Y` or `YES` for user mode. Case insensitive. See [User mode](#user-mode). Enforced when `OUTPUT_MODE` is set to `pulse` (**deprecated** value) or when `PULSE_AUDIO_OUTPUT_CREATE` is set to `yes`
112-
PUID|User id. Defaults to `1000`. The user/group will be created for `pulse` mode regardless of the `USER_MODE` variable.
113-
PGID|Group id. Defaults to `1000`. The user/group will be created for `pulse` mode regardless of the `USER_MODE` variable.
114-
AUDIO_GID|`audio` group id from the host machine. Mandatory for `alsa` output in user mode. See [User mode](#user-mode).
115+
USER_MODE|Set to `Y` or `YES` for user mode. Case insensitive. See [User mode](#user-mode). Required when using any PulseAudio outputs (so when `PULSE_AUDIO_OUTPUT_CREATE` is set to `yes`)
116+
PUID|User id. Defaults to `1000`. The user/group will be created when a PulseAudio output is created regardless of the `USER_MODE` variable.
117+
PGID|Group id. Defaults to `1000`. The user/group will be created when a PulseAudio output is created regardless of the `USER_MODE` variable.
118+
AUDIO_GID|`audio` group id from the host machine. Mandatory for `alsa` output in user mode. See [User mode](https://github.com/GioF71/mpd-alsa-docker/blob/main/doc/user-mode.md).
115119
INPUT_CACHE_SIZE|Sets the input cache size. Example value: `1 GB`
116120
NULL_OUTPUT_NAME|Name of the `null` output
117121
NULL_OUTPUT_SYNC|Sync mode for the `null` output, can be `yes` (default) or `no`
@@ -120,7 +124,7 @@ MPD_ENABLE_LOGGING|Defaults to `yes`, set to `no` to disable
120124
MPD_LOG_LEVEL|Can be `default` or `verbose`
121125
ZEROCONF_ENABLED|Set to `yes` to enable. Disabled by default.
122126
ZEROCONF_NAME|Set zeroconf name, used only if `ZEROCONF_ENABLED` is set to `yes`
123-
HYBRID_DSD_ENABLED|Hybrid dsd is enabled by default, set to `no` to disable. Disabled when using Pulse mode.
127+
HYBRID_DSD_ENABLED|Hybrid dsd is enabled by default, set to `no` to disable. Disabled when at least one PulseAudio output is created.
124128
MAX_OUTPUT_BUFFER_SIZE|The maximum size of the output buffer to a client (maximum response size). Default is 8192 (8 MiB). Value in KBytes.
125129
AUDIO_BUFFER_SIZE|Adjust the size of the internal audio buffer. Default is `4 MB` (4 MiB).
126130
MAX_ADDITIONAL_OUTPUTS_BY_TYPE|The maximum number of outputs by type, defaults to `20`
@@ -151,21 +155,7 @@ THESYCON_DSD_WORKAROUND|If enabled, enables a workaround for a bug in Thesycon U
151155
ALSA_ALLOWED_FORMATS_PRESET|Alternative to `ALSA_ALLOWED_FORMATS`. Possible values: `8x`, `4x`, `2x`, `8x-nodsd`, `4x-nodsd`, `2x-nodsd`
152156
INTEGER_UPSAMPLING|If one or more `ALSA_ALLOWED_FORMATS` are set and `INTEGER_UPSAMPLING` is set to `yes`, the formats which are evenly divided by the source sample rate are preferred. The `ALSA_ALLOWED_FORMATS` list is processed in order as provided to the container. So if you want to upsample, put higher sampling rates first. Using this feature causes a patched version of mpd to be run. Use at your own risk.
153157

154-
Avoid deprecated configurations and refer to [this](#alsa-additional-outputs) section.
155-
156-
#### Main output as PULSE (**Deprecated**)
157-
158-
Please find here the relevant (but *deprecated*) variables when OUTPUT_MODE is set to `PULSE`
159-
160-
VARIABLE|DESCRIPTION
161-
:---|:---
162-
PULSEAUDIO_OUTPUT_NAME|PulseAudio output name, defaults to `PulseAudio`
163-
PULSEAUDIO_OUTPUT_ENABLED|Sets the output as enabled if set to `yes`, otherwise mpd's default behavior applies
164-
PULSEAUDIO_OUTPUT_SINK|Specifies the name of the PulseAudio sink MPD should play on
165-
PULSEAUDIO_OUTPUT_MEDIA_ROLE|Specifies a custom media role that MPD reports to PulseAudio, defaults to `music`
166-
PULSEAUDIO_OUTPUT_SCALE_FACTOR|Specifies a linear scaling coefficient (ranging from `0.5` to `5.0`) to apply when adjusting volume through MPD. For example, chosing a factor equal to `0.7` means that setting the volume to 100 in MPD will set the PulseAudio volume to 70%, and a factor equal to `3.5` means that volume 100 in MPD corresponds to a 350% PulseAudio volume.
167-
168-
Avoid deprecated configurations and refer to [this](#pulseaudio-additional-outputs) section.
158+
Avoid deprecated configurations and refer to [this](https://github.com/GioF71/mpd-alsa-docker/blob/main/README.md#alsa-additional-outputs) section.
169159

170160
#### SOXR Plugin
171161

@@ -258,6 +248,7 @@ Note that you can add up to 20 (or what is specified for the variable `MAX_ADDIT
258248

259249
#### PulseAudio additional outputs
260250

251+
Remember to setup [user mode](https://github.com/GioF71/mpd-alsa-docker/blob/main/doc/user-mode.md) when using PulseAudio outputs, otherwise they won't work.
261252
Additional PulseAudio outputs can be configured using the following variables:
262253

263254
VARIABLE|OPTIONAL|DESCRIPTION

app/bin/any-of.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
any_pulse() {
44
result=0
5-
if [ "${OUTPUT_MODE^^}" == "PULSE" ]; then
6-
result=1
7-
fi
85
if [[ $result -eq 0 ]]; then
96
# if at least one additional pulse audio output is requested
107
if [[ "${PULSE_AUDIO_OUTPUT_CREATE^^}" == "YES" ]]; then

app/bin/run-mpd.sh

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ if [ -n "${ZEROCONF_NAME}" ]; then
259259
echo "zeroconf_name \"${ZEROCONF_NAME}\"" >> $MPD_ALSA_CONFIG_FILE
260260
fi
261261

262-
263262
## disable wildmidi decoder
264263
echo "decoder {" >> $MPD_ALSA_CONFIG_FILE
265264
echo " plugin \"wildmidi\"" >> $MPD_ALSA_CONFIG_FILE
@@ -461,40 +460,6 @@ if [ "${OUTPUT_MODE^^}" == "ALSA" ]; then
461460
fi
462461
echo " enabled \"yes\"" >> $MPD_ALSA_CONFIG_FILE
463462
echo "}" >> $MPD_ALSA_CONFIG_FILE
464-
elif [ "${OUTPUT_MODE^^}" == "PULSE" ]; then
465-
echo "OUTPUT_MODE [$OUTPUT_MODE] is deprecated and will be removed in the future"
466-
echo "You should use PULSE_AUDIO_OUTPUT_CREATE=yes instead"
467-
echo "audio_output {" >> $MPD_ALSA_CONFIG_FILE
468-
echo " type \"pulse\"" >> $MPD_ALSA_CONFIG_FILE
469-
if [ -z "${PULSEAUDIO_OUTPUT_NAME}" ]; then
470-
PULSEAUDIO_OUTPUT_NAME="PulseAudio"
471-
fi
472-
echo " name \"${PULSEAUDIO_OUTPUT_NAME}\"" >> $MPD_ALSA_CONFIG_FILE
473-
pulse_enabled=""
474-
if [ -n "${PULSEAUDIO_OUTPUT_ENABLED}" ]; then
475-
if [[ "${PULSEAUDIO_OUTPUT_ENABLED^^}" == "YES" || "${PULSEAUDIO_OUTPUT_ENABLED^^}" == "Y" ]]; then
476-
pulse_enabled=yes
477-
elif [[ "${PULSEAUDIO_OUTPUT_ENABLED^^}" == "NO" || "${PULSEAUDIO_OUTPUT_ENABLED^^}" == "N" ]]; then
478-
pulse_enabled=no
479-
else
480-
echo "Invalid PULSEAUDIO_OUTPUT_ENABLED=[${PULSEAUDIO_OUTPUT_ENABLED}]"
481-
exit 9
482-
fi
483-
fi
484-
if [ -n "${pulse_enabled}" ]; then
485-
echo " enabled \"${pulse_enabled}\"" >> $MPD_ALSA_CONFIG_FILE
486-
fi
487-
unset pulse_enabled
488-
if [ -n "${PULSEAUDIO_OUTPUT_MEDIA_ROLE}" ]; then
489-
echo " media_role \"${PULSEAUDIO_OUTPUT_MEDIA_ROLE}\"" >> $MPD_ALSA_CONFIG_FILE
490-
fi
491-
if [ -n "${PULSEAUDIO_OUTPUT_SINK}" ]; then
492-
echo " sink \"${PULSEAUDIO_OUTPUT_SINK}\"" >> $MPD_ALSA_CONFIG_FILE
493-
fi
494-
if [ -n "${PULSEAUDIO_OUTPUT_SCALE_FACTOR}" ]; then
495-
echo " scale_factor \"${PULSEAUDIO_OUTPUT_SCALE_FACTOR}\"" >> $MPD_ALSA_CONFIG_FILE
496-
fi
497-
echo "}" >> $MPD_ALSA_CONFIG_FILE
498463
elif [ "${OUTPUT_MODE^^}" == "NULL" ]; then
499464
echo "audio_output {" >> $MPD_ALSA_CONFIG_FILE
500465
echo " enabled \"yes\"" >> $MPD_ALSA_CONFIG_FILE

doc/change-history.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Date|Major Changes
44
:---|:---
5+
2023-02-04|Dropped support for `PULSE` as `OUTPUT_MODE`
56
2023-02-03|Add support for `ALSA_OUTPUT_INTEGER_UPSAMPLING_ALLOWED`
67
2023-02-03|Bump to mpd version `v0.23.12`
78
2023-01-30|Add support for `AUDIO_BUFFER_SIZE`

doc/example-configurations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ services:
101101

102102
This configuration uses a custom soxr resampling configuration, inspired from this article: [Archimago - MUSINGS: More fun with digital filters!](https://archimago.blogspot.com/2018/01/musings-more-fun-with-digital-filters.html).
103103
This particular configuration will upsample 44.1kHz, 88.2kHz, 176.4kHz streams to 352.8kHz and 48kHz, 96kHz, 192kHz to 384kHz, leaving dsd streams as they are.
104-
AUDIO_GID here is 29, but you will need to find the gid of the `audio` group on your specific installation as described in [user mode](user-mode.md).
104+
AUDIO_GID here is 29, but you will need to find the gid of the `audio` group on your specific installation as described in [user mode](https://github.com/GioF71/mpd-alsa-docker/blob/main/doc/user-mode.md).
105105

106106
## Requirements for alsa mode
107107

0 commit comments

Comments
 (0)