question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2nd time starting / connecting music after a reboot results in no sound (DAC)

See original GitHub issue

Describe the bug When librespot / spocon stops playback, I believe the device is left open and is not forcefully reopened or killed when a new playback attempt is made. There are no clear logs that describe this. Spotify continues to play back, but no audio is heard.

To Reproduce

  • Reboot Raspberry Pi Zero W
  • Connect to Spotify, and play music.
  • Stop music by disconnecting / switching to another device, pausing, or manually playing a podcast.
  • Try to reconnect, no audio.

Additionally:

  • The same behaviour can be found by now running speaker-test.

Expected behavior

  • Starting and stopping audio should work.
  • Being interrupted by another user on spotify should play their music, rather than bricking audio playback until reboot.

Screenshots/Stracktraces/Logs

pi@spotipi:~ $ speaker-test -dcard:Device

speaker-test 1.1.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Playback open error: -16,Device or resource busy

Version/Commit 1.5.3

Using alsa.

I did see this in the logs, not sure if it helps.

Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,437 DEBUG PlayerQueueEntry:209 - PlayerQueueEntry{0178c7756e730278d60e63eddecdf07c} has been removed from output.
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,461 TRACE PlayerQueueEntry:325 - PlayerQueueEntry{0178c7756e730278d60e63eddecdf07c} terminated.
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,467 TRACE PlayerQueue:141 - Queue has been cleared.
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,476 TRACE AsyncProcessor:57 - AsyncProcessor{put-state-worker} is shutting down
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,490 INFO  Session:417 - Closing session. {deviceId: 504c79f310ca50f51a6c0400ff9432d5b4fa2206}
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,496 TRACE AsyncProcessor:57 - AsyncProcessor{dealer-worker} is shutting down
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,517 DEBUG DealerClient:319 - Did not dispatch connection invalidated: null != xyz.gianlu.librespot.dealer.DealerClient$ConnectionHolder@ed20b7
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,526 TRACE AsyncProcessor:57 - AsyncProcessor{event-service-sender} is shutting down
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,566 TRACE MercuryClient:183 - Handling packet, cmd: MercuryReq, seq: 82, flags: 1, parts: 1
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,571 DEBUG EventService:35 - Event sent. {body: 12|37|13|504c79f310ca50f51a6c0400ff9432d5b4fa2206|0178c7756e730278d60e63eddecdf07c|00000000000000000000
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,578 TRACE MercuryClient:140 - Send Mercury request, seq: 83, uri: hm://event-service/v1/events, method: POST
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,727 TRACE MercuryClient:183 - Handling packet, cmd: MercuryReq, seq: 83, flags: 1, parts: 1
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,730 DEBUG EventService:35 - Event sent. {body: 10|20|cb14f1eac699da36ffbf0163c5123494892b54c9|0178c7756e730278d60e63eddecdf07c|0|0|0|0|0|0|5242880|117
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,746 TRACE MercuryClient:140 - Send Mercury request, seq: 84, uri: hm://event-service/v1/events, method: POST
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,890 TRACE MercuryClient:183 - Handling packet, cmd: MercuryReq, seq: 84, flags: 1, parts: 1
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,895 DEBUG EventService:35 - Event sent. {body: 372|1|0178c7756e730278d60e63eddecdf07c|spotify:track:5mAitcAt2Z23HIIINIcY0h|0|[[148,123169]], result: 2
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,901 TRACE AsyncProcessor:48 - AsyncProcessor{event-service-sender} is shut down
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,909 TRACE Session:1368 - Session.Receiver stopped
Dec 29 23:55:06 spotipi java[444]: 2020-12-29 23:55:06,931 INFO  Session:476 - Closed session. {deviceId: 504c79f310ca50f51a6c0400ff9432d5b4fa2206}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
devgianlucommented, Dec 30, 2020

As you can see there is no clear pattern in what’s happening. The fact is that a Raspberry Pi Zero can’t run a Java program properly and in a reliable way. You’ll see many of this problems disappear on the Raspberry Pi 4 (hopefully).

1reaction
devgianlucommented, Dec 30, 2020

Can you try starting the playback, pausing, waiting 30 seconds and then executing speaker-test -dcard:Device. The device should be released after 20 seconds of inactivity (and also when the session is closed).

Read more comments on GitHub >

github_iconTop Results From Across the Web

No sound after rebooting PC without re-attaching HIFI plus DAC
I have to like re-connect my hifi DAC each time I have rebooted computer or otherwise no sound even though windows now recognizes...
Read more >
Now I need to reboot DAC on every startup - Support
The PS Audio DAC requires a reboot (takes about 1+ minute), then it will play. Once both outputs are playing, I can switch...
Read more >
Troubleshooting DAC issues - SoundGuys
What to do if your DAC keeps disconnecting or is not recognized · Your DAC may be plugged into a low-power USB port....
Read more >
USB DAC No sound When Computer Wakes up from Sleep
First thing I would check is power management. Assuming you're on Windows 7, start Power Options in Control Panel and go to Advanced...
Read more >
Resolving Audio Interface Issues on Windows 10 - Sweetwater
Read this article to learn how to resolve audio interface issues like no sound, USB ports not working, or your output device not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found