dtcooper / raspotify

A Spotify Connect client that mostly Just Works™
https://dtcooper.github.io/raspotify
MIT License
4.65k stars 216 forks source link

Not able to play tracks #682

Open Wollert opened 2 hours ago

Wollert commented 2 hours ago

Compatible Device

Are you sure?

Compatible OS

Compatible Configuration

Latest Version

Are you sure?

Due Diligence

What happened?

Clean install on a RPi 3B.

Raspotify shows up as speaker in Spotify app on phone (and in Spotify player on Windows computer), and I am able to connect to it. But I am unable to play any tracks. When I press play nothing happens. When I change tracks and press play multiple times raspotify crashes.

Relevant log output and/or the contents of /etc/raspotify/crash_report if any ( sudo journalctl -u raspotify -b and sudo cat /etc/raspotify/crash_report )

-- System Info --

Linux kurer 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

-- Logs --

Oct 22 12:47:01 kurer librespot[22247]: [2024-10-22T10:47:01Z WARN  librespot_core::cdn_url] Cannot parse CDN URL expiry timestamp 'verify=1729680421-hHw6CuunbdsfCCyJW%2FHUxO7zViEK0byjM3JTlCelFhE%3D' from 'https://audio-cf-del-574.spotifycdn.com/audio/5c8ed42de32a27f84170e3fd494becc01ad1d3bd?verify=1729680421-hHw6CuunbdsfCCyJW%2FHUxO7zViEK0byjM3JTlCelFhE%3D'
Oct 22 12:47:03 kurer librespot[22247]: [2024-10-22T10:47:03Z WARN  librespot_core::cdn_url] Cannot parse CDN URL expiry timestamp 'verify=1729680423-tkp%2FU5XOMZoVjtEW6Nj58zKrmhH1n3jRdnPfwqh4Kr4%3D' from 'https://audio-cf-del-574.spotifycdn.com/audio/295e84c54f406bfcb8654e4cb3159d8993115d3c?verify=1729680423-tkp%2FU5XOMZoVjtEW6Nj58zKrmhH1n3jRdnPfwqh4Kr4%3D'
Oct 22 12:47:04 kurer librespot[22247]: [2024-10-22T10:47:04Z WARN  librespot_core::cdn_url] Cannot parse CDN URL expiry timestamp 'verify=1729680424-69x0zCOUiswU5rKHpI5JPnW9W%2BqNnIFVGGSpgwdPr9M%3D' from 'https://audio-cf-del-574.spotifycdn.com/audio/984470bd039456fbebcb0e48b9eedeb55c76cce7?verify=1729680424-69x0zCOUiswU5rKHpI5JPnW9W%2BqNnIFVGGSpgwdPr9M%3D'
Oct 22 12:47:06 kurer librespot[22247]: [2024-10-22T10:47:06Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:07 kurer librespot[22247]: [2024-10-22T10:47:07Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:08 kurer librespot[22247]: [2024-10-22T10:47:08Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:10 kurer librespot[22247]: [2024-10-22T10:47:10Z WARN  librespot_core::cdn_url] Cannot parse CDN URL expiry timestamp 'verify=1729680430-%2BUHEMe8a7TvClrLQ6g9Fn1Qo2sDvdXkGgL0fub3jVw8%3D' from 'https://audio-cf-del-574.spotifycdn.com/audio/eb4235e2ecbd751a3def02b609a6b115a8b0be21?verify=1729680430-%2BUHEMe8a7TvClrLQ6g9Fn1Qo2sDvdXkGgL0fub3jVw8%3D'
Oct 22 12:47:11 kurer librespot[22247]: [2024-10-22T10:47:11Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:12 kurer librespot[22247]: [2024-10-22T10:47:12Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:14 kurer librespot[22247]: [2024-10-22T10:47:14Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:15 kurer librespot[22247]: [2024-10-22T10:47:15Z WARN  librespot_core::cdn_url] Cannot parse CDN URL expiry timestamp 'verify=1729680435-13%2FWYGKveHcOTwVXVWa1%2BJjC87cutROH4l4jQ%2B6AxYA%3D' from 'https://audio-cf-del-574.spotifycdn.com/audio/4d030967fe7191c5992da68afc18383a74080ca9?verify=1729680435-13%2FWYGKveHcOTwVXVWa1%2BJjC87cutROH4l4jQ%2B6AxYA%3D'
Oct 22 12:47:17 kurer librespot[22247]: [2024-10-22T10:47:17Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:18 kurer librespot[22247]: [2024-10-22T10:47:18Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:20 kurer librespot[22247]: [2024-10-22T10:47:20Z WARN  librespot_core::cdn_url] Cannot parse CDN URL expiry timestamp 'verify=1729680440-M357DsUMtqdHu89i0eDYCUbVLoafItMj9poOuYD4P1I%3D' from 'https://audio-cf-del-574.spotifycdn.com/audio/a6c726982b70d5b6794ad3b3e23fe46c23ab00b2?verify=1729680440-M357DsUMtqdHu89i0eDYCUbVLoafItMj9poOuYD4P1I%3D'
Oct 22 12:47:23 kurer librespot[22247]: [2024-10-22T10:47:23Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:23 kurer librespot[22247]: [2024-10-22T10:47:23Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'
Oct 22 12:47:23 kurer librespot[22247]: [2024-10-22T10:47:23Z ERROR librespot_playback::player] PlayerInternal poll: Invalid PlayerState
Oct 22 12:47:23 kurer systemd[1]: raspotify.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 12:47:23 kurer systemd[1]: raspotify.service: Failed with result 'exit-code'.
Oct 22 12:47:23 kurer systemd[1]: raspotify.service: Triggering OnFailure= dependencies.
Oct 22 12:47:23 kurer systemd[1]: raspotify.service: Consumed 1.616s CPU time.

-- Config --

LIBRESPOT_QUIET=on
LIBRESPOT_DISABLE_AUDIO_CACHE=on
LIBRESPOT_DISABLE_CREDENTIAL_CACHE=on
LIBRESPOT_ENABLE_VOLUME_NORMALISATION=on

-- Ouput of aplay -l --

**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7

-- Ouput of aplay -L --

null
    Discard all samples (playback) or generate zero samples (capture)
default
    Default Audio Device
sysdefault
    Default Audio Device
lavrate
    Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
speex
    Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
hw:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    Direct hardware device without any conversions
plughw:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    Hardware device with all software conversions
default:CARD=vc4hdmi
    vc4-hdmi, MAI PCM i2s-hifi-0
    Default Audio Device
sysdefault:CARD=vc4hdmi
    vc4-hdmi, MAI PCM i2s-hifi-0
    Default Audio Device
hdmi:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    HDMI Audio Output
dmix:CARD=vc4hdmi,DEV=0
    vc4-hdmi, MAI PCM i2s-hifi-0
    Direct sample mixing device
usbstream:CARD=vc4hdmi
    vc4-hdmi
    USB Stream Output
hw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct hardware device without any conversions
plughw:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Hardware device with all software conversions
default:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
sysdefault:CARD=Headphones
    bcm2835 Headphones, bcm2835 Headphones
    Default Audio Device
dmix:CARD=Headphones,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
    Direct sample mixing device
usbstream:CARD=Headphones
    bcm2835 Headphones
    USB Stream Output

-- Ouput of librespot -d ? --

    Compatible alsa device(s):

    ------------------------------------------------------

    Device:

        hw:CARD=Headphones,DEV=0

    Description:

        bcm2835 Headphones, bcm2835 Headphones
        Direct hardware device without any conversions

    Supported Format(s):

        S16

    ------------------------------------------------------

    Device:

        plughw:CARD=Headphones,DEV=0

    Description:

        bcm2835 Headphones, bcm2835 Headphones
        Hardware device with all software conversions

    Supported Format(s):

        S16 S24 S24_3 S32 F32 F64

    ------------------------------------------------------

    Device:

        default:CARD=Headphones

    Description:

        bcm2835 Headphones, bcm2835 Headphones
        Default Audio Device

    Supported Format(s):

        S16 S24 S24_3 S32 F32 F64

    ------------------------------------------------------

    Device:

        sysdefault:CARD=Headphones

    Description:

        bcm2835 Headphones, bcm2835 Headphones
        Default Audio Device

    Supported Format(s):

        S16 S24 S24_3 S32 F32 F64

    ------------------------------------------------------
kimtore commented 2 hours ago

Audio Sink Error Connection Refused: \<AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'

It looks like your sound card is already in use by another application?

Wollert commented 1 hour ago

Audio Sink Error Connection Refused: Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Unknown errno (524)'

It looks like your sound card is already in use by another application?

I tried sudo lsof /dev/snd/* and got only pipewire and wireplumb. I killed these processes and restarted the raspotify service, but I still get the same error. Is there any other way to find the application(-s) that might be causing the problem?

Please note that I have not installed any additional applications on this version of Raspbian, I downloaded the image and flashed it just before installing raspotify.

kimtore commented 1 hour ago

How about installing the pipewire-alsa package and restarting Raspotify?

You could also try the same approach with the pipewire-pulse package and pulseaudio backend.

Wollert commented 28 minutes ago

Installing the pipewire-alsa package and restarting Raspotify resulted in a new error message. I understand that something might not be running that should be, but I don't know how to fix the issue.

Oct 22 14:38:02 kurer librespot[678]: [2024-10-22T12:38:02Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device default May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'Host is down (112)'