Closed moranbw closed 3 months ago
Building from source for the Raspberry Pi Zero W is quite complicated because of missing support for Thumb instructions, you can have a look at how the binary is built with a custom toolchain here.
Regarding the errors you see, I think that the ALSA issue might be related to limited software support and/or network problems. I have go-librespot running on a Raspberry Pi Zero W v1.1 with the Volumio OS.
Thanks for the response, @devgianlu.
I actually was able to figure out what was going on. I was perusing the spotifyd
config options and saw this, which correlated with my snd_pcm_hw_params_set_format
error.
# The PCM sample format to use. Possible values
# are F32, S32, S24, S24_3, S16.
# Change this value if you encounter errors like
# "Alsa error PCM open ALSA function 'snd_pcm_hw_params_set_format' failed with error 'EINVAL: Invalid argument'"
audio_format = "S16"
It seems like there is not a similar config option in go-librespot
. So I figured out a way to force the PCM format to S16_LE
by adding this to /etc/asound.conf
:
pcm.formatS16 {
type plug
slave {
pcm "hw:0,0"
format S16_LE
}
}
[!NOTE]
Users with multiple cards/devices may need to adjust thepcm "hw:0,0"
line.
Then updated my go-librespot
config.yml
:
audio_device: formatS16
And we have music! Perhaps Volumio OS is doing some of this by default? It is just based on Raspbian (like DietPi), so nothing too special should be going on.
I am glad you figured it out! I am not sure whether an option to tweak the output format from go-librespot
is really necessary considering that ALSA can do the heavy lifting.
Does this support Raspberry Pi Zero W? It is
armv6l
. I am running DietPiv9.2
. I tried building, but got the following errors:I tried the prebuild binary:
go-librespot_linux_armv6_rpi.tar.gz
but got the following: