0

I installed raspotify on my raspberry pi 3 as per this guide hoping that my phone can use Spotify Connect to output to the speakers which are connected to the pi.

curl -sSL https://dtcooper.github.io/raspotify/key.asc | sudo tee /usr/share/keyrings/raspotify-archive-keyrings.asc >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/raspotify-archive-keyrings.asc] https://dtcooper.github.io/raspotify raspotify main' | sudo tee /etc/apt/sources.list.d/raspotify.list
sudo apt install raspotify

This seems to have installed correctly.

By setting LIBRESPOT_NAME="pi_spotify" in /etc/raspotify/conf and rebooting the pi, I can go to Spotify on my phone, Settings / Connect to a device, and pi_spotify is available. Touching it, it seems to connect, as shown by this feedback at the bottom of the screen:

enter image description here

However, the playback pauses and no sound comes out. When I touch the play button, @pi_spotify seems to disconnect.

enter image description here

Sound on the pi otherwise works. If I ssh to it and aplay /foo/bar.wav, it plays through the speakers.

I found this via journalctl --system | grep spotify

Jan 17 09:45:07 raspberrypi systemd[1]: Started raspotify.service - Raspotify (Spotify Connect Client).
Jan 17 09:45:07 raspberrypi systemd[1]: raspotify-crash-report-generator.service: Deactivated successfully.
Jan 17 09:45:07 raspberrypi systemd[1]: Finished raspotify-crash-report-generator.service - Raspotify Crash Report Generator.
Jan 17 09:45:07 raspberrypi systemd[1]: raspotify-crash-report-generator.service: Consumed 1.697s CPU time.
Jan 17 09:45:19 raspberrypi librespot[4364]: [2024-01-17T09:45:19Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:4070
Jan 17 09:45:19 raspberrypi librespot[4364]: [2024-01-17T09:45:19Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:443
Jan 17 09:45:20 raspberrypi systemd[1]: raspotify.service: Main process exited, code=exited, status=1/FAILURE
Jan 17 09:45:20 raspberrypi systemd[1]: raspotify.service: Failed with result 'exit-code'.
Jan 17 09:45:20 raspberrypi systemd[1]: raspotify.service: Triggering OnFailure= dependencies.
Jan 17 09:45:20 raspberrypi systemd[1]: Starting raspotify-crash-report-generator.service - Raspotify Crash Report Generator...

I'm not sure how to read this exactly but naively taking the first two messages

Started raspotify.service - Raspotify (Spotify Connect Client).
raspberrypi systemd[1]: raspotify-crash-report-generator.service: Deactivated successfully.

it looks to me as if it is deactivating immediately after connecting.

I read somewhere to try journalctl -u raspotify.service -b and the output is a little different:

Jan 17 09:45:07 raspberrypi systemd[1]: Started raspotify.service - Raspotify (Spotify Connect Client).
Jan 17 09:45:19 raspberrypi librespot[4364]: [2024-01-17T09:45:19Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gue1.spotify.com:4070
Jan 17 09:45:19 raspberrypi librespot[4364]: [2024-01-17T09:45:19Z WARN  librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:443
Jan 17 09:45:20 raspberrypi librespot[4364]: Failed to get home directory.
Jan 17 09:45:20 raspberrypi librespot[4364]: [2024-01-17T09:45:20Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA>
Jan 17 09:45:20 raspberrypi systemd[1]: raspotify.service: Main process exited, code=exited, status=1/FAILURE
Jan 17 09:45:20 raspberrypi systemd[1]: raspotify.service: Failed with result 'exit-code'.
Jan 17 09:45:20 raspberrypi systemd[1]: raspotify.service: Triggering OnFailure= dependencies.
Jan 17 09:45:32 raspberrypi systemd[1]: Started raspotify.service - Raspotify (Spotify Connect Client).

Here I notice

librespot[4364]: Failed to get home directory.
librespot[4364]: [2024-01-17T09:45:20Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA>

I don't know if these are related.

speaker-test -t wav -c 2 when run on the pi produces the expected sounds on the connected speakers, so alsa works.

1 Answer 1

1

Try changing the default device. For me

LIBRESPOT_DEVICE=hw:CARD=Headphones,DEV=0 in /etc/conf

resolved the issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .