Skip to content

Commit

Permalink
[Maintenance] Add support for -W #275 (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 authored Jan 22, 2024
1 parent a368267 commit e3f0455
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 25 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
27 changes: 3 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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`
Expand Down
12 changes: 12 additions & 0 deletions app/bin/run-squeezelite-alsa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions doc/prerequisites.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit e3f0455

Please sign in to comment.