Skip to content

Commit

Permalink
#317 Add support for -S and -G (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 authored Nov 25, 2024
1 parent c7b2044 commit 37b3e7e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ ENV SQUEEZELITE_LOG_CATEGORY_DECODE ""
ENV SQUEEZELITE_LOG_CATEGORY_OUTPUT ""
ENV SQUEEZELITE_LOG_CATEGORY_IR ""

ENV SQUEEZELITE_POWER_SCRIPT=""
ENV SQUEEZELITE_RPI_GPIO=""

ENV DISPLAY_PRESETS ""

ENV PUID ""
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ SQUEEZELITE_UNMUTE|-U|From squeezelite's man page for `-U`: Unmute the given ALS
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.
SQUEEZELITE_READ_FORMATS_FROM_HEADER|-W|Set to `Y` to read wave and aiff format from header, ignoring server parameters
SQUEEZELITE_POWER_SCRIPT|-S|Absolute path to script to launch on power commands from LMS. This cannot be used in combination with the SQUEEZELITE_RPI_GPIO variable
SQUEEZELITE_RPI_GPIO|-G|Specify the BCM GPIO# to use for Amp Power Relay and if the output should be Active High or Low. This cannot be used in combination with SQUEEZELITE_POWER_SCRIPT
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`
Expand Down
30 changes: 30 additions & 0 deletions app/bin/cmd-line-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,36 @@ function cmdline-rates() {
fi
}

function cmdline-power-script() {
if [ -z "${SQUEEZELITE_POWER_SCRIPT}" ]; then
echo "Variable SQUEEZELITE_POWER_SCRIPT not specified"
else
# cannot combine with SQUEEZELITE_RPI_GPIO
if [ -n "${SQUEEZELITE_RPI_GPIO}" ]; then
echo "Cannot use SQUEEZELITE_POWER_SCRIPT along with SQUEEZELITE_RPI_GPIO"
exit 1
else
echo "Variable SQUEEZELITE_POWER_SCRIPT specified: ${SQUEEZELITE_POWER_SCRIPT}"
CMD_LINE="$CMD_LINE -S "$(quote_if_needed "${SQUEEZELITE_POWER_SCRIPT}")
fi
fi
}

function cmdline-rpi-gpio() {
if [ -z "${SQUEEZELITE_RPI_GPIO}" ]; then
echo "Variable SQUEEZELITE_RPI_GPIO not specified"
else
# cannot combine with SQUEEZELITE_RPI_GPIO
if [ -n "${SQUEEZELITE_POWER_SCRIPT}" ]; then
echo "Cannot use SQUEEZELITE_RPI_GPIO along with SQUEEZELITE_POWER_SCRIPT"
exit 1
else
echo "Variable SQUEEZELITE_RPI_GPIO specified: ${SQUEEZELITE_RPI_GPIO}"
CMD_LINE="$CMD_LINE -G "$(quote_if_needed "${SQUEEZELITE_RPI_GPIO}")
fi
fi
}

function handle_mac_address() {
mac_gen_disabled=0
if [[ "${DISABLE_MAC_ADDRESS_GENERATION^^}" == "YES" ]] || [[ "${DISABLE_MAC_ADDRESS_GENERATION^^}" == "Y" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions app/bin/run-squeezelite-alsa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ cmdline-linear-volume
cmdline-codecs
cmdline-exclude-codecs
cmdline-rates
cmdline-power-script
cmdline-rpi-gpio

if [ -z "${SQUEEZELITE_PRIORITY}" ]; then
echo "Variable SQUEEZELITE_PRIORITY has not been specified";
Expand Down
5 changes: 5 additions & 0 deletions app/bin/run-squeezelite-pulse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ cmdline-timeout
cmdline-audio-device
cmdline-params
cmdline-codecs
cmdline-power-script
cmdline-rpi-gpio

if [ -z "${SQUEEZELITE_RATES}" ]; then
# default to 44.1kHz
Expand All @@ -114,6 +116,9 @@ source logging.sh

add_log_categories

cmdline-power-script
cmdline-rpi-gpio

handle_mac_address
cmdline_mac_address

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
:---|:---|:---
2024-11-25|Improvement|Add support for -S and -G (see [#317](https://github.com/GioF71/squeezelite-docker/discussions/317))
2024-09-21|Improvement|Use exec instead of eval, avoid bash process
2024-06-01|Update|Sourceforge binaries version bump (see [#313](https://github.com/GioF71/squeezelite-docker/issues/313))
2024-06-01|Update|Sourceforge binaries version bump (see [#311](https://github.com/GioF71/squeezelite-docker/issues/311))
Expand Down

0 comments on commit 37b3e7e

Please sign in to comment.