Closed pdpbjorn closed 1 year ago
Are you trying to use Raspotify on a desktop system? Raspotify is intended to be used on headless systems only, as clearly stated in the readme.
I'm using Raspotify on a RaspberryPi - as clearly stated in first line of the log :-) It has been working flawlessly for a couple of years - this behavior is new since the last few weeks
Cheers /per
What does your asound.conf look like if there is one?
I'm using Raspotify on a RaspberryPi - as clearly stated in first line of the log :-)
Raspberry Pi OS comes in desktop and headless versions.
I have no asound.conf
in /etc
, where I suppose it should be and I cannot seem to find it anywhere else.
I have a folder -/etc/alsa/conf.d
- with a number of .conf files:
10-rate-lav.conf 50-oss.conf 98-usb-stream.conf
10-samplerate.conf 50-pulseaudio.conf 99-pulseaudio-default.conf.example
10-speexrate.conf 60-a52-encoder.conf 99-pulse.conf
50-arcam-av-ctl.conf 60-upmix.conf
50-jack.conf 60-vdownmix.conf
My /boot/config.txt
is modifyed for Raspotify to work with my sound-card and disable on-board audio:
#dtparam=audio=on
dtoverlay=iqaudio-dacplus
dtparam=i2s=on
Setting these back to default:
dtparam=audio=on
#dtoverlay=iqaudio-dacplus
#dtparam=i2s=on
will actually let Raspotify work, and output through the RaspberryPi onboard Jack-socket. There seems to be some solution here, but I would actually prefer to use the sound-card and ist phono connectors Any possibilities?
I have no asound.conf in /etc, where I suppose it should be and I cannot seem to find it anywhere else.
It doesn't exist by default. It's Ok to not have one.
dtparam=audio=on
dtoverlay=iqaudio-dacplus dtparam=i2s=on
Maybe try commenting out the i2s line?
Unfortunately no luck - the connection still drops. Log:
Jan 19 22:45:59 raspberrypi systemd[1]: Started Raspotify (Spotify Connect Client).
Jan 19 22:47:01 raspberrypi librespot[525]: [2023-01-19T21:47:01Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:4070
Jan 19 22:47:01 raspberrypi librespot[525]: [2023-01-19T21:47:01Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:443
Jan 19 22:47:01 raspberrypi librespot[525]: [2023-01-19T21:47:01Z WARN librespot_core::apresolve] Ignoring blacklisted access point ap-gew4.spotify.com:80
Jan 19 22:47:05 raspberrypi librespot[525]: Failed to get home directory.
Jan 19 22:47:05 raspberrypi librespot[525]: [2023-01-19T21:47:05Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device d>
Jan 19 22:47:05 raspberrypi systemd[1]: raspotify.service: Main process exited, code=exited, status=1/FAILURE
Jan 19 22:47:05 raspberrypi systemd[1]: raspotify.service: Failed with result 'exit-code'.
Jan 19 22:47:05 raspberrypi systemd[1]: raspotify.service: Triggering OnFailure= dependencies.
Jan 19 22:47:18 raspberrypi systemd[1]: Started Raspotify (Spotify Connect Client).
Jan 19 22:47:05 raspberrypi librespot[525]: Failed to get home directory.
This is a very strange line. There's no reason the Raspotify service should be looking for /home
. It's ran under a dynamic user that has no home
and it's locked down so that it can not access /home
. The only folders/files the service can see are it's own. It has basically no access to the file system.
The line still appears in log, when raspotify use internal sound, but not the following line on Audio Sink Error
:
dtparam=audio=on
-- Journal begins at Mon 2022-04-04 14:17:02 CEST, ends at Fri 2023-01-20 08:59>
Jan 20 08:55:24 raspberrypi systemd[1]: Started Raspotify (Spotify Connect Clie>
Jan 20 08:58:09 raspberrypi librespot[502]: [2023-01-20T07:58:09Z WARN libresp>
Jan 20 08:58:09 raspberrypi librespot[502]: [2023-01-20T07:58:09Z WARN libresp>
Jan 20 08:58:09 raspberrypi librespot[502]: [2023-01-20T07:58:09Z WARN libresp>
Jan 20 08:58:09 raspberrypi librespot[502]: [2023-01-20T07:58:09Z WARN libresp>
Jan 20 08:58:16 raspberrypi librespot[502]: [2023-01-20T07:58:16Z WARN libresp>
Jan 20 08:58:19 raspberrypi librespot[502]: Failed to get home directory.
Enabling both sound outputs at the same time,
dtparam=audio=on
dtoverlay=iqaudio-dacplus
dtparam=i2s=on
seems to work
$ cat /proc/asound/modules
0 snd_bcm2835
1 vc4
2 snd_soc_iqaudio_dac
I can produce sound on 0 and 2, using these:
$ speaker-test -c2 -twav -l7 -D plughw:0,0
$ speaker-test -c2 -twav -l7 -D plughw:2,0
1 will fail:
$ speaker-test -c2 -twav -l7 -D plughw:1,0
speaker-test 1.2.4
Playback device is plughw:1,0
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Playback open error: -524,Unknown error 524
Raspotify still works; producing sound on the build in device ( 0 snd_bcm2835):
Can I somehow direct Raspotify to use 2 snd_soc_iqaudio_dac
?
Can I somehow direct Raspotify to use
2 snd_soc_iqaudio_dac
?
If your DAC hat supports 44100 you can tell librespot to address it directly by changing:
# Audio device to use, use `librespot --device ?` to list options.
# Defaults to the system's default.
#LIBRESPOT_DEVICE="default"
To:
# Audio device to use, use `librespot --device ?` to list options.
# Defaults to the system's default.
LIBRESPOT_DEVICE="hw:CARD=IQaudIODAC,DEV=0"
In /etc/raspotify/conf
.
Be sure to restart the Raspotify service with sudo systemctl restart raspotify
Do note that only one program can access the raw device at a time.
You can disable all other audio cards on Raspberry to have only IQAudioDAC as default device.
Add below to /boot/config.txt dtoverlay=vc4-kms-v3d,noaudio Ensure below is commented
pi@raspberrypi:~ $ aplay -l List of PLAYBACK Hardware Devices card 0: IQaudIODAC [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 [IQaudIO DAC HiFi pcm512x-hifi-0] Subdevices: 1/1 Subdevice #0: subdevice #0 pi@raspberrypi:~ $
I know this but clearly that's not working correctly for some reason.
# Audio device to use, use `librespot --device ?` to list options. # Defaults to the system's default. LIBRESPOT_DEVICE="hw:CARD=IQaudIODAC,DEV=0"
YES! That did it! Thank you so much!!!
You're very welcome. Glad I could help.
Compatible Device
Are you sure?
Compatible OS
Compatible Configuration
Latest Version
Are you sure?
Due Diligence
What happened?
The Phone Spotify sees Raspotify on the network an does connect - icon turns green. But immediately after Play is pressed, the connection is dropped. I see some error message in the log, but I do not have the knowledge to troubleshoot
Relevant log output and/or the contents of /etc/raspotify/crash_report if any