diff --git a/docs/03-customization.md b/docs/03-customization.md index c7235ef1..0f6e8fb5 100644 --- a/docs/03-customization.md +++ b/docs/03-customization.md @@ -50,4 +50,5 @@ The following variables control various aspects of each plugin behavior: | SOUND_SPOTIFY_PASSWORD | Your Spotify login password. Note: most Spotify clients on phones will authenticate via zeroconf so this is not usually required. | --- | --- | | SOUND_SPOTIFY_DISABLE_NORMALISATION | Disable volume normalization in Spotify. | Disabled if the variable exists regardless of its value. | --- | | SOUND_SPOTIFY_ENABLE_CACHE | Enable the audio cache in Spotify. Note that over time the cache can take up large amounts of disk space. | Enabled if the variable exists regardless of its value. | --- | -| SOUND_SPOTIFY_BITRATE | Spotify playback bitrate. | Bitrate in kbps: `96`, `160` or `320` | 160 | +| SOUND_SPOTIFY_BITRATE | Spotify playback bitrate. | Bitrate in kbps: `96`, `160` or `320` | `160` | +| SOUND_SPOTIFY_VOLUME_CTRL | Spotify volume control method. | `cubic`, `fixed`, `linear`, or `log` | `linear` | diff --git a/plugins/spotify/start.sh b/plugins/spotify/start.sh index 1e34a6b2..75672f13 100644 --- a/plugins/spotify/start.sh +++ b/plugins/spotify/start.sh @@ -8,8 +8,10 @@ fi # --- ENV VARS --- # SOUND_DEVICE_NAME: Set the device broadcast name for Spotify # SOUND_SPOTIFY_BITRATE: Set the playback bitrate +# SOUND_SPOTIFY_VOLUME_CTRL: Set the volume control method SOUND_DEVICE_NAME=${SOUND_DEVICE_NAME:-"balenaSound Spotify $(echo "$BALENA_DEVICE_UUID" | cut -c -4)"} SOUND_SPOTIFY_BITRATE=${SOUND_SPOTIFY_BITRATE:-160} +SOUND_SPOTIFY_VOLUME_CTRL=${SOUND_SPOTIFY_VOLUME_CTRL:-linear} # SOUND_SPOTIFY_DISABLE_NORMALISATION: Disable volume normalization if [[ -z ${SOUND_SPOTIFY_DISABLE_NORMALISATION+x} ]]; then @@ -44,7 +46,7 @@ set -- /usr/bin/librespot \ --name "$SOUND_DEVICE_NAME" \ --bitrate "$SOUND_SPOTIFY_BITRATE" \ --cache /var/cache/raspotify \ - --volume-ctrl linear \ + --volume-ctrl "$SOUND_SPOTIFY_VOLUME_CTRL" \ "$@" exec "$@"