balena-io-experimental / balena-sound

Build a single or multi-room streamer for an existing audio device using a Raspberry Pi! Supports Bluetooth, Airplay and Spotify Connect
https://balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/
MIT License
2.39k stars 427 forks source link

Spotify cache and normalization customization variables don't work if their value is not defined #626

Closed laytonhayes closed 1 year ago

laytonhayes commented 1 year ago

The configuration variables SOUND_SPOTIFY_DISABLE_NORMALISATION and SOUND_SPOTIFY_ENABLE_CACHE only work if their value is defined. It is not clear in the support docs that any value has to be declared.

Additional context In /plugins/spotify/start.sh these variable values are checked for null or not null using -z. If the variable is set but no value declared it functions as if there is no variable at all.

if [[ -z "$SOUND_SPOTIFY_DISABLE_NORMALISATION" ]]; then
  set -- "$@" \
    --enable-volume-normalisation
fi 

Suggestions Update the support docs to reflect that a value has to be set to something OR check to see if that variable exist, even if it's set to null

maggie44 commented 1 year ago

Great catch. Do you think that is what could be happening here: https://github.com/balena-labs-projects/balena-sound/issues/620?

Would you be able to submit a PR?

laytonhayes commented 1 year ago

@maggie0002, I'll test and see if that's what's causing the issue with #620. I should be able to submit a PR in the next few days.

laytonhayes commented 1 year ago

@maggie0002 - I've created PR #628 for the Spotify variable fixes.