mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #676] Librespot device does not disappear when exiting #387
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#387
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Johannesd3 on GitHub (Mar 20, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/676
The official Spotify clients disappear immediately from the list of available devices in other Spotify clients when they are exitted. Librespot does not disappear.
First I thought it has something to do with the
kMessageTypeGoodbyethat is sent on shutdown. It doesn't seem to reach another Librespot instance (with log level debug so I can see the incoming messages). But only the web player's goodbye shows up. When I close the desktop client, no goodbye message is shown in Librespot, but it disappears from the web player's device list nevertheless.I don't really understand what's going on, so maybe someone else can take a look.
This applies to the
devbranch as well as totokio_migration.@roderickvd commented on GitHub (Mar 21, 2021):
Maybe the official clients keep a particular port alive to a Spotify server, that librespot doesn't?
@Johannesd3 commented on GitHub (Mar 23, 2021):
I believe you understood it the other way round. But the librespot device does not disappear although it should.
@roderickvd commented on GitHub (Mar 23, 2021):
No I do mean what I said. Perhaps there’s no messaging mechanism but just an established keep-alive connection by which the official clients signal they are available. And on shutdown when they close the connection, that’s their offline signal. Just theorizing here.
@Johannesd3 commented on GitHub (Mar 23, 2021):
Ah ok. Would seem odd to use an extra connection to signal shutdown, but maybe it's related to the new api.
@devgianlu Does the same issue exist for librespot-java?
@devgianlu commented on GitHub (Mar 23, 2021):
The new API doesn't seem to have a command to signal shutdown. All it has is these, but I am not having any issue with it not disappearing. I suppose they are detecting the websocket connection closing.
@roderickvd commented on GitHub (Mar 23, 2021):
Here's a quick and abbreviated comparison of
lsof -i.Official Spotify client on macOS, controlling librespot on another host:
And on the librespot host it is controlling:
Where
xxx.xxx.xxx.xxxis the macOS host,yyy.yyy.yyy.yyysome other Spotify Connect-capable host, andzzz.zzz.zzz.zzzthe host running librespot.@kingosticks commented on GitHub (Mar 24, 2021):
I've noticed two things while controlling with my Android client and stopping the librespot process:
I think it's just the second issue you are discussing here, correct? Doesn't this sound like an mDNS problem? I've found my build using
--feature with-dns-sdbehaves correctly and librespot is removed from the list straight away. Have you tried that? I tried to hack about with libmdns but I got a load of tokio build problems when trying to build librespot (master) using my checkout of libmdns (master) and so I've lost interest in that. Comparing Wireshark traces of both discovery libraries would probably reveal the problem.So potentially off topic... but for the first issue I described I found the following hack works better, but I don't understand why!
@kingosticks commented on GitHub (Mar 24, 2021):
Just to add, I did the Wireshark trace and I see when stopping librespot with dns-sd there is a goodbye message sent but not when using libmdns. libmdns seems to create a goodbye message but it doesn't make it out onto the wire. This looks pretty suspicious!
@roderickvd commented on GitHub (May 24, 2021):
I'm tagging this with
new-apibecause this might be fixed when we introduce web socket support.@kingosticks commented on GitHub (May 24, 2021):
No, it's a bug in libmdns as per the proposed fix in https://github.com/librespot-org/libmdns/pull/28. I don't believe this has anything to do with how librespot works, new-api or otherwise.
@roderickvd commented on GitHub (May 25, 2021):
Ah I see, I was thrown off by @devgianlu earlier https://github.com/librespot-org/librespot/issues/676#issuecomment-805188815