New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection drops invalidate session #628
Comments
|
Does this also happen with versions <0.9.0? |
I'll try on one. |
|
Thanks for checking. I am wondering if the last PortAudio releases caused this. |
|
I have pushed a small fix that could help. Could you recompile ncspot and see if that fixes it for you? So far I'm only able to reproduce this error when closing ncspot, so the scenario may not be the same, but it prints the same error. My guess is that this happens when ncspot tries to renew the session. Stopping the player before shutting down seems to alleviate this problem with the PortAudio backend. |
|
Not really - it does what it's told i.e. stop playing when connection is down, but nothing more. Reading the log again one thing came to my attention that, when a session went out, two following tries would fail, saying |
|
How long does it usually take for your session to expire? Are you able to provoke it somehow, e.g. by reconnecting to the internet? Reason I'm asking is because I can't reproduce this problem locally, I only saw the same error when I closed ncspot and a song was playing and the previously committed fix seems to help with that at least. |
|
Less than half a song 🤷♂️ Someone pointed out that proxy timeout makes long connections close, hence the error. But the official iOS app isn't affected. |
|
FWIW I have recently (as of today) starting getting these error messages. macOS, ncspot 0.9.0 installed via Homebrew. Have had ncspot installed for months without issues previously. Have been able to listen for hours on end. Now it won't make it past half a tune, ending playback with that same error message printed. |
|
@hellquist Sorry to hear that. Do you connect through a proxy too? |
Actually I may have spoken too soon. I did two separate update runs for "everything" (i.e. both Homebrew and also general apps) and ensured I rebooted properly between both. Today it has been playing for a hour so far without generating the error. But no, I don't have a proxy connection. |
|
Unfortunately, I'm seeing the same issue as @hellquist. I just started using System Info: I did a full I'll look and see if I can find/generate the debug logs - I'll attach them to this comment once I find them. Edit: Ran and got a few debug logs, this is what I was able to gather: debug.logthe stderr log only shows the "Stream drop error: PortAudio not initialized" the timing of when the error occurred makes it seem like it coincided with preloading of the next track? could be a coincidence, but that would explain why it occurs near the end of the song. I'll do some more debugging and see what I can find out. |
|
after playing around with it some more, this does seem to be related more closely to an issue in librespot, rather than an issue with ncspot itself - seeing Edit: It's definitely an issue with librespot - I found out my ISP is routing traffic through a NAT, making my external IP change every so few minutes. This causes the connection to Spotify to disconnect, which pauses the stream playback. |
|
Checked back and saw 0.12 playing full songs, but switching proxies still cut it down. Hopefully the librespot overhaul would solve this. |
|
Also noticed that rather than crashing it now just stops playing. Maybe go further and make it recover from this sort of errors and carry on? Would love to implement this myself, but need to find some time. |
|
As of #1057 there is a reconnect command that could help with this |
…n#1057) * commands: Adding "disconnect" command to force socket shutdown * Rename to `reconnect` * Add documentation to README Related to: hrkfdn#628 hrkfdn#1033 --------- Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
Describe the bug
Run ncspot, start playing for a while, and it will stop playing, with the error message "Stream drop error: PortAudio not initialized".
Expected behavior
Continued playing.
Screenshots

System (please complete the following information):
Backtrace/Debug log
ncspot-debug.log
ncspot-debug-2.log
ncspot-debug-3.log
The text was updated successfully, but these errors were encountered: