Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Spotify unreachable after DAC input change
#8
(08-31-2022, 11:55 PM)tdubb Wrote: As you expected. If I change the DAC's input (remove the audio device), I get:

Code:
[2022-08-31T22:09:38Z WARN  librespot_playback::audio_backend::alsa] Error writing from AlsaSink buffer to PCM, trying to recover, ALSA function 'snd_pcm_writei' failed with error 'EIO: I/O error'
[2022-08-31T22:09:38Z ERROR librespot_playback::player] Audio Sink Error On Write: <AlsaSink> ALSA function 'snd_pcm_recover' failed with error 'EIO: I/O error'
pi@moode:~ $

If I try to connect to the Spotify device when the USB audio is not there, i get:

Code:
[2022-08-31T22:07:05Z TRACE librespot_playback::player] == Starting sink ==
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
[2022-08-31T22:07:05Z ERROR librespot_playback::player] Audio Sink Error Connection Refused: <AlsaSink> Device _audioout May be Invalid, Busy, or Already in Use, ALSA function 'snd_pcm_open' failed with error 'ENOENT: No such file or directory'
pi@moode:~ $


I noticed that if librespot is run and killed from the command line, even though it says it is being killed "gracefully".
Code:
[2022-08-31T23:06:05Z INFO  librespot::player_event_handler] Running ["/var/local/www/commandw/spotevent.sh"] with environment variables {"POSITION_MS": "5", "PLAYER_EVENT": "paused", "TRACK_ID": "4USztpjKZRDx6XQmxWZkDN", "DURATION_MS": "301693"}
amixer: Unable to find simple control 'PCM',0

^C[2022-08-31T23:06:15Z INFO  librespot] Gracefully shutting down
pi@moode:~ $

In all of these modes, librespot is dying and not sending events or messages back to spotevent.sh, so moode stays stuck thinking it is playing Spotify. This may lead to more philisophical questions:
  • Should librespot, or other renderers announce when they are shutting down? What about if something external kills it for some reason?
  • Should moode track the renderers (processes) it has spun up? If they have gone away, should they be restarted?

Ideally the app should not abort or hang when the audio interface goes away but instead it should clean up it's side of the interface and then wait for a "play" command. When that happens it should try to open the interface and then either start playing or go back into the cleanup and wait state.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
RE: Spotify unreachable after DAC input change - by Tim Curtis - 09-01-2022, 01:00 PM

Forum Jump: