Skip to content

Commit

Permalink
181 allow selection of custom binary (#200)
Browse files Browse the repository at this point in the history
* Completed for alsa

* complete for pulse, add release entry
  • Loading branch information
GioF71 committed Jun 10, 2023
1 parent b028b3c commit aaff722
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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/
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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

Expand Down
15 changes: 15 additions & 0 deletions app/bin/run-squeezelite-alsa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions app/bin/run-squeezelite-pulse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions doc/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aaff722

Please sign in to comment.