diff --git a/Dockerfile b/Dockerfile index b68bb09..270c7b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,6 +105,9 @@ ENV PUID "" ENV PGID "" ENV AUDIO_GID "" +ENV SELECT_CUSTOM_BINARY_ALSA "" +ENV SELECT_CUSTOM_BINARY_PULSE "" + COPY app/bin/run-squeezelite.sh /app/bin/ COPY app/bin/run-squeezelite-alsa.sh /app/bin/ COPY app/bin/run-squeezelite-pulse.sh /app/bin/ @@ -115,6 +118,7 @@ COPY app/bin/run-presets.sh /app/bin/ RUN chmod +x /app/bin/*.sh VOLUME '/app/assets/additional-presets.conf' +VOLUME '/app/assets/binaries' COPY README.md /app/doc/ COPY doc/* /app/doc/ diff --git a/README.md b/README.md index f3e7072..477b442 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ SQUEEZELITE_VOLUME_CONTROL|-V|From squeezelite's man page for `-V`: Use the give SQUEEZELITE_UNMUTE|-U|From squeezelite's man page for `-U`: Unmute the given ALSA `control` at daemon startup and set it to full volume. Use software volume adjustment for playback. This option is mutually exclusive with the -V option. Only applicable when using ALSA output. SQUEEZELITE_LINEAR_VOLUME|-X|Set to `Y` to enable. From squeezelite's man page for `-X`: Use linear volume adjustments instead of in terms of dB (only for hardware volume control). SQUEEZELITE_VISUALIZER|-v|Set to `Y` to enable. Unfortunately this feature does not really work from inside docker (yet?). From squeezelite's man page for `-v`: Enable visualiser support. This creates a shared memory segment that contains some of the audio being played, so that an external visualiser can read and process this to create visualisations. +SELECT_CUSTOM_BINARY_ALSA||Use for selection of a custom binary for ALSA mode +SELECT_CUSTOM_BINARY_PULSE||Use for selection of a custom binary for PULSE mode SQUEEZELITE_LOG_CATEGORY_ALL|-d|Support for log level on category `all` SQUEEZELITE_LOG_CATEGORY_SLIMPROTO|-d|Support for log level on category `slimproto` SQUEEZELITE_LOG_CATEGORY_STREAM|-d|Support for log level on category `stream` @@ -128,6 +130,7 @@ Possible values for variables `SQUEEZELITE_LOG_CATEGORY_*` are `info`, `debug` o Volume|Description :---|:--- /app/assets/additional-presets.conf|Additional preset file +/app/assets/binaries|Custom binaries should be placed here ### Additional preset file diff --git a/app/bin/run-squeezelite-alsa.sh b/app/bin/run-squeezelite-alsa.sh index cf7ec0a..def67ec 100644 --- a/app/bin/run-squeezelite-alsa.sh +++ b/app/bin/run-squeezelite-alsa.sh @@ -11,6 +11,21 @@ source run-presets.sh echo "=== END-- Loading presets ===" CMD_LINE="/app/bin/squeezelite" + +if [[ -n "${SELECT_CUSTOM_BINARY_ALSA}" ]]; then + if [ -f "$SELECT_CUSTOM_BINARY_ALSA" ]; then + echo "Custom binary [$SELECT_CUSTOM_BINARY_ALSA] exists." + if [ -x "$SELECT_CUSTOM_BINARY_ALSA" ]; then + echo "Custom binary [$SELECT_CUSTOM_BINARY_ALSA] is executable." + CMD_LINE=$SELECT_CUSTOM_BINARY_ALSA + else + echo "Custom binary [$SELECT_CUSTOM_BINARY_ALSA] is not executable, using default." + fi + else + echo "Custom binary [$SELECT_CUSTOM_BINARY_ALSA] does not exist, using default." + fi +fi + echo "Initializing command line: ["$CMD_LINE"]" source cmd-line-builder.sh diff --git a/app/bin/run-squeezelite-pulse.sh b/app/bin/run-squeezelite-pulse.sh index 709cc7d..c1bad93 100644 --- a/app/bin/run-squeezelite-pulse.sh +++ b/app/bin/run-squeezelite-pulse.sh @@ -59,6 +59,21 @@ sed -i 's/PUID/'"$PUID"'/g' $PULSE_CLIENT_CONF cat $PULSE_CLIENT_CONF CMD_LINE="/app/bin/squeezelite-pulseaudio" + +if [[ -n "${SELECT_CUSTOM_BINARY_PULSE}" ]]; then + if [ -f "$SELECT_CUSTOM_BINARY_PULSE" ]; then + echo "Custom binary [$SELECT_CUSTOM_BINARY_PULSE] exists." + if [ -x "$SELECT_CUSTOM_BINARY_PULSE" ]; then + echo "Custom binary [$SELECT_CUSTOM_BINARY_PULSE] is executable." + CMD_LINE=$SELECT_CUSTOM_BINARY_PULSE + else + echo "Custom binary [$SELECT_CUSTOM_BINARY_PULSE] is not executable, using default." + fi + else + echo "Custom binary [$SELECT_CUSTOM_BINARY_PULSE] does not exist, using default." + fi +fi + echo "Initializing command line: ["$CMD_LINE"]" source cmd-line-builder.sh diff --git a/doc/release.md b/doc/release.md index c5484d1..ee9125e 100644 --- a/doc/release.md +++ b/doc/release.md @@ -10,6 +10,7 @@ Older build might be dropped in order to save space on docker-hub and incur in l Date|Type|Description :---|:---|:--- +2023-06-10|Support for custom binaries, see [#181](https://github.com/GioF71/squeezelite-docker/issues/181) 2023-04-20|Update|Sourceforge binaries version bump 2023-04-14|Update|Sourceforge binaries version bump 2023-04-07|Update|Sourceforge binaries version bump