From e3f04550c035164e60fc43fd03122ffafd7550eb Mon Sep 17 00:00:00 2001 From: Giovanni Fulco Date: Mon, 22 Jan 2024 19:45:35 +0100 Subject: [PATCH] [Maintenance] Add support for `-W` #275 (#276) --- Dockerfile | 1 + README.md | 27 +++------------------------ app/bin/run-squeezelite-alsa.sh | 12 ++++++++++++ build.sh | 2 +- doc/prerequisites.md | 29 +++++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 doc/prerequisites.md diff --git a/Dockerfile b/Dockerfile index fee79e9..d4029d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,6 +94,7 @@ ENV SQUEEZELITE_UNMUTE "" ENV SQUEEZELITE_VOLUME_CONTROL "" ENV SQUEEZELITE_LINEAR_VOLUME "" ENV SQUEEZELITE_VISUALIZER "" +ENV SQUEEZELITE_READ_FORMATS_FROM_HEADER "" ENV SQUEEZELITE_LOG_CATEGORY_ALL "" ENV SQUEEZELITE_LOG_CATEGORY_SLIMPROTO "" diff --git a/README.md b/README.md index ceaed37..a0b9ac0 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Since 2024-01-19 (see issue [#268](https://github.com/GioF71/squeezelite-docker/ This patched version allows server-side transcoding, also to DSD format, which some users might like to use. These images will inclue `r2-latest-alsa` and `r2-stable-alsa` in their tags. Like to these type of images: [here](https://hub.docker.com/r/giof71/squeezelite/tags?page=1&name=r2). +Since 2024-01-22 we have support for the `-W` command line argument on sourceforge alsa binaries using new variable `SQUEEZELITE_READ_FORMATS_FROM_HEADER`, while AFAIK this should be the default on the `r2` variant. ### Alsa and PulseAudio variants @@ -48,30 +49,7 @@ Configuring the container should be easy through a webapp like [Portainer](https ## Prerequisites -You need to have Docker up and running on a Linux machine, and the current user must be allowed to run containers (this usually means that the current user belongs to the "docker" group). - -You can verify whether your user belongs to the "docker" group with the following command: - -`getent group | grep docker` - -This command will output one line if the current user does belong to the "docker" group, otherwise there will be no output. - -The Dockerfile and the included scripts have been tested on the following setups: - -Hardware|Operating System|Result|Comment -:---|:---|:---|:--- -Generic Amd64|Manjaro Gnome|OK|No issues encountered -Generic Amd64|Linux Mint 20.x|OK|No issues encountered -Raspberry Pi 3|Raspberry Pi OS 32bit/64bit, OSMC|OK|No issues encountered -Raspberry Pi 4|Raspberry Pi OS 32bit/64bit, OSMC, Manjaro KDE 64bit|OK|No issues encountered -Asus Tinkerboard|DietPi Bullseye, DietPi Bookworm|OK|Issues solved! See [here](https://github.com/GioF71/squeezelite-docker/blob/main/doc/asus-tinkerboard.md). - -As I test the Dockerfile on more platforms, I will update this list. - -### Asus Tinkerboard - -The issues I was encountered are solved now. -See [here](https://github.com/GioF71/squeezelite-docker/blob/main/doc/asus-tinkerboard.md) for more information. +See [here](https://github.com/GioF71/squeezelite-docker/blob/main/doc/prerequisites.md) for the prerequisites. ## Get the image @@ -123,6 +101,7 @@ 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. +SQUEEZELITE_READ_FORMATS_FROM_HEADER|-W|Set to `Y` to read wave and aiff format from header, ignoring server parameters 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` diff --git a/app/bin/run-squeezelite-alsa.sh b/app/bin/run-squeezelite-alsa.sh index f427fb0..eb39789 100644 --- a/app/bin/run-squeezelite-alsa.sh +++ b/app/bin/run-squeezelite-alsa.sh @@ -189,6 +189,18 @@ else CMD_LINE="$CMD_LINE -R $(quote_if_needed $SQUEEZELITE_UPSAMPLING)" fi +if [ -z "${SQUEEZELITE_READ_FORMATS_FROM_HEADER}" ]; then + echo "Variable SQUEEZELITE_READ_FORMATS_FROM_HEADER not specified"; +else + echo "Variable SQUEEZELITE_READ_FORMATS_FROM_HEADER specified: $SQUEEZELITE_READ_FORMATS_FROM_HEADER"; + if [[ "${SQUEEZELITE_READ_FORMATS_FROM_HEADER^^}" == "Y" || "${SQUEEZELITE_READ_FORMATS_FROM_HEADER^^}" == "YES" ]]; then + CMD_LINE="$CMD_LINE -W" + elif [[ "${SQUEEZELITE_READ_FORMATS_FROM_HEADER^^}" != "N" && "${SQUEEZELITE_READ_FORMATS_FROM_HEADER^^}" != "NO" ]]; then + echo "Invalid SQUEEZELITE_READ_FORMATS_FROM_HEADER=[${SQUEEZELITE_READ_FORMATS_FROM_HEADER}]" + exit 2 + fi +fi + if [ -z "${SQUEEZELITE_BUFFER_SIZE}" ]; then echo "Variable SQUEEZELITE_BUFFER_SIZE not specified"; if [ -z "${SQUEEZELITE_STREAM_AND_OUTPUT_BUFFER_SIZE}" ]; then diff --git a/build.sh b/build.sh index e31637a..df3c450 100755 --- a/build.sh +++ b/build.sh @@ -79,7 +79,7 @@ if [ -z "${expanded_base_image}" ]; then fi if [ -z "${build_mode}" ]; then - build_mode="Y" + build_mode="std" fi if [[ "${build_mode^^}" == "SF" ]]; then diff --git a/doc/prerequisites.md b/doc/prerequisites.md new file mode 100644 index 0000000..2d3c391 --- /dev/null +++ b/doc/prerequisites.md @@ -0,0 +1,29 @@ +# Prerequisites + +You need to have Docker up and running on a Linux machine, and the current user must be allowed to run containers (this usually means that the current user belongs to the "docker" group). + +You can verify whether your user belongs to the "docker" group with the following command: + +`getent group | grep docker` + +This command will output one line if the current user does belong to the "docker" group, otherwise there will be no output. + +## Supported platforms + +The Dockerfile and the included scripts have been tested on the following setups: + +Hardware|Operating System|Result|Comment +:---|:---|:---|:--- +Generic Amd64|Manjaro Gnome|OK|No issues encountered +Generic Amd64|Linux Mint 20.x|OK|No issues encountered +Raspberry Pi 3|Raspberry Pi OS 32bit/64bit, OSMC|OK|No issues encountered +Raspberry Pi 4|Raspberry Pi OS 32bit/64bit, OSMC, Manjaro KDE 64bit|OK|No issues encountered +Asus Tinkerboard|DietPi Bullseye, DietPi Bookworm|OK|Issues solved! See [here](https://github.com/GioF71/squeezelite-docker/blob/main/doc/asus-tinkerboard.md). + +As I test the Dockerfile on more platforms, I will update this list. + +###Asus Tinkerboard + +The issues I was encountered are solved now. +See [here](https://github.com/GioF71/squeezelite-docker/blob/main/doc/asus-tinkerboard.md) for more information. +