-
Notifications
You must be signed in to change notification settings - Fork 458
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
Device disappears after being idle for some hours #903
Comments
Thanks for the bug report! i have not seen this before. Could you try to run https://github.com/librespot-org/librespot on its own and see if it still happens, its the depency we use for the spotify connection. |
good point, i will try that |
This comment has been minimized.
This comment has been minimized.
I experience the same issue on OSX 11.2.3 (20D91) and spotifyd 0.3.2 . Im using https://github.com/Rigellute/spotify-tui to connect. |
I have exactly the same problem on raspberry pi 3 with wifi connection |
I'm also experiencing the exact same issue on my Raspberry Pi 3 that runs ArchLinux with spotifyd v0.3.2. I suspect this might be related to #706. Is there any way to add a healtcheck to the spotifyd daemon, to make it query the list of devices on the Spotify API and re-register itself if it's missing from there? |
Same problem here, trying to use spotifyd as my main client and if I stop using it for some hours spotifyd just disappears and stop responding. The spotifyd process keeps running as a zombie. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This bot is so problematic... The issue is still relevant. |
The issue is still relevant I still need to restart the spotifyd before i use 'spt' otherwise i dont have my Mac as output device. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Issue still relevant |
Has anyone ever tried this proposal to track down, what causes this problem? |
I guess I first need to install plain librespot for this, right? I haven't really figured out the relation between spotifyd and librespot |
Yeah, you can have a look at their README on how to do this. As far as I know, librespot provides several things: It can be used as a library, to build a custom spotify client, which is done by e.g. spotifyd, ncspot, spot and many others. Alternatively, it can be installed as a binary and as such be used as a standalone client. This is something that is done by e.g. raspotify or when you install it directly via So in this case, trying |
I found out that my Pi Zero 2 W can't handle building the rust packages. I tried to do it on my PC instead, but obviously I have to cross-compile, because the Pi uses arm architecture. I already spent a lot of time now, I am no closer to a solution and it is obvious that it will have to spend a lot more time to understand rust compilation. At this point it seems more reasonable for me to try my luck with raspotify and see if the issue also happens there. |
Sure, no worries. Thanks for trying! But if it works for you with |
good news, I discovered that when you install raspotify you can also use librespot directly. I will report back when I have tested it for a while to see if the original bug described here surfaces again |
I can confirm that it still happens when using plain librespot. I also found a related issue: librespot-org/librespot#247 |
I have the same problem, but only on 1 of 3 devices. I run spotifd version 0.3.3 . I have used raspotify, which uses librespot, for a few years. In June 2022 with the new version of spotify, the API broke, so I switched to spotfifyd with success. I have 3 raspberry pi's running this software. 2 are running ok, but one device will disapear after somte time in spotify when nothing is played. This pi is behind an extra switch. With raspotify I had exactly the same behaviour. After restarting spotifyd on this pi, everything works ok for a while. The other two pi's never have this problem. |
I have the same issue on a Raspberry Pi 4, running ppotifyd 3.3.0 on nixos connected to a Fritzbox 7362 SL via wifi. |
I actually managed to solve this problem indirectly by turning off a lot of "advanced" features in my router a long time ago. I guess those settings somehow caused spotifyd to disconnect. Unfortunately I don't remember the exact features I turned off, because I didn't think it will have any effect on this issue. But I recommend playing around in your router settings if you have the option. @Quest24 's answer also seems to support this theory as he has an extra switch in front of the problematic spotifyd, so I guess his problem is the same. |
Well, it started disappearing for me very frequently again, since a week or so... And I didn't change a thing, not in my network, nor did I upgrade my spotifyd version. So I suspect something has been changed on the other side of the equation, I think the devs did something at Spotify. Does any of you experience a sudden increase of spotifyd disappearing? |
Well for one Spotify changed it's sdk recently so maybe there are some issues with that. |
I tried it yesterday, but the problem is stil there. After one day, one device will disappear from the list. After restarting it becomes visibable again. Everything will work as long as a play music on that device, but wil disappear after stop playing. |
I experienced this today. Restarting the systemd service makes it reappear, but I don't see anything unusual when I run journalctl |
same here. running on a raspberry pi 4 8GB with docker. after serval hours the device is not listed. |
Can confirm that this happens both with spotifyd and Raspotify when running alongside OSMC |
Thanks for the confirmations, I just found this issue over at the |
For me, this is still a problem. (Raspberry Pi 3B, RaspberryOS) |
@el-calavera My guess is that the reason, why something changed between 0.3.3 and 0.3.4 is that we now only enable discovery on the local network, if you need it. So previously, what you were seeing was the zeroconf-advertised instance - even if the actual spotify session got stale. All that may be completely wrong, because I'm just guessing what your setup might look like. 😅 |
@eladyn Commenting out the credentials has solved the problem. |
@eladyn Commenting out the credentials also worked for me. Thanks for the hint! I wasn't aware this is an option, guess I should have studied the wiki more closely. ;) (PS: my setup is simply a Pi3B running spotifyd, and I use Spotify clients for Android/Linux to connect within the same network.) |
I have partial success with commenting out the credentials. I can now see the device listed when using the spotify desktop app, but on my android phone it keeps disappearing. I don't know if this is a general limitation of the android app, or if zeroconf is not working there for other reasons. Anyway, it seems to not be a problem with spotifyd but with something else. |
librespot-org/librespot#1129 may provide a path to fix this. |
I solved this issue with a workaround: I'm running spotifyd in a Docker container (shout out to https://github.com/hvalev/spotifyd-docker) and I'm periodically polling the Spotify API via Node-RED to see my currently online devices, and if my spotifyd device disappears, I just restart the container. Although it is an "ugly" workaround, it has been working flawlessly since I (finally) implemented this. |
@Semmu Would you be willing to share your polling script? |
Now that librespot-org/librespot#1129 is fixed can't we use a patch to use the master version of librespot until they make a release ? |
@eladyn some news? |
Sorry for taking so long to reply, have been quite busy recently. For release planning on the Regarding just using the master: I'm not sure, if I'd be that confident shipping the unstable dev version of
If you have any thoughts or would like to take a shot at whatever option you like best, that would be appreciated. I'm not sure, when I might get to it myself. |
hey @mabuckman sorry for the veeery late reply, not sure if you still need my workaround, but here it is anyways.
this is the setup in general. and the workaround itself is that i poll the spotify API's getMyDevices endpoint, and whenever i see that my spotifyd device is not included, i simply restart that container. and the docker engine socket exposure looks like this:
this way i can do a simple POST request on its port and the docker engine will do what it needs to do. this is a pretty dangerous solution from security point of view, since my whole docker API is exposed on an HTTP port, but my system is closed off, so i take the risk. the flow looks like this: hope it helps anyone! |
Description
Hi,
I have recently bought a new router (TP-Link Archer AX1800) and since then
spotifyd
always disappears from my Spotify Connect devices list after some hours of being idle (e.g. I leave my home).This is always happening, though the timeout does seem to vary a bit.
Because it happens since the introduction of my new router, I suspect some networking issue, like some TCP connection being closed despite still in use, even if barely.
Unfortunately
spotifyd
does not realize its connection has been closed and does not restart automatically (which would solve the problem), nothing interesting is printed in the logs, so I always have to restart the service manually, which is pretty annoying.Could you please implement some heartbeat check or more pedantic network connection handling, so maybe it can detect connection issues and reconnect if needed?
Thanks in advance!
To Reproduce
0. (buy and use TP-Link Archer AX1800)
spotifyd
, play some musicspotifyd
runningspotifyd
alone for some hoursspotifyd
is not in the Spotify Connect devices list anymore 😞Expected behavior
4. Notice that
spotifyd
is still in the Spotify Connect devices list 😊Logs
Click to show logs
Nothing special in the logs, but I did not run it with
--verbose
. Made the change now, and will include the logs here when I encounter the issue next time.Compilation flags
(Downloaded the binary release from here.)
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: