[GH-ISSUE #14] Support "discovery mode" like in librespot #7

Closed
opened 2026-02-28 14:24:37 +03:00 by kerem · 20 comments
Owner

Originally created by @phts on GitHub (Nov 14, 2023).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/14

https://github.com/plietar/librespot/blob/master/README.md#discovery-mode

This mode allows to connect to the device by any user, not only currently logged in. So everybody in the netwrok can use the device.

Originally created by @phts on GitHub (Nov 14, 2023). Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/14 https://github.com/plietar/librespot/blob/master/README.md#discovery-mode This mode allows to connect to the device by any user, not only currently logged in. So everybody in the netwrok can use the device.
kerem 2026-02-28 14:24:37 +03:00
Author
Owner

@devgianlu commented on GitHub (Nov 15, 2023):

This mode is already supported and is called zeroconf. It can be used with a configuration like this one:

device_name: go-librespot
credentials:
  type: zeroconf

I realise that a lot of documentation is still missing!

<!-- gh-comment-id:1811952171 --> @devgianlu commented on GitHub (Nov 15, 2023): This mode is already supported and is called `zeroconf`. It can be used with a configuration like this one: ```yaml device_name: go-librespot credentials: type: zeroconf ``` I realise that a lot of documentation is still missing!
Author
Owner

@phts commented on GitHub (Nov 15, 2023):

Is it possible to have it simultaneously with normal authentification?

Use case: I logged in on the device with spotify integration and get token, and this device uses my token to show my content in its UI, e.g. I can see my artists,albums, etc. And in the same time, "connect" is available for any device in the network, because in fact my token not required to make "connect" available for any device.

librespot I believe has this option separatelly from main authentification

<!-- gh-comment-id:1812108215 --> @phts commented on GitHub (Nov 15, 2023): Is it possible to have it simultaneously with normal authentification? Use case: I logged in on the device with spotify integration and get token, and this device uses my token to show my content in its UI, e.g. I can see my artists,albums, etc. And in the same time, "connect" is available for any device in the network, because in fact my token not required to make "connect" available for any device. `librespot` I believe has this option separatelly from main authentification
Author
Owner

@devgianlu commented on GitHub (Nov 15, 2023):

Having one instance handle two sessions simultaneously seems a very specific and uncommon case. Perhaps you could have two instances of go-librespot: one that handles the UI and is logged in and one that does the playback and uses Spotify Connect. What do you think? A reasonable change would be to allow go-librespot to run without showing up as a connectable device.

<!-- gh-comment-id:1812336764 --> @devgianlu commented on GitHub (Nov 15, 2023): Having one instance handle two sessions simultaneously seems a very specific and uncommon case. Perhaps you could have two instances of go-librespot: one that handles the UI and is logged in and one that does the playback and uses Spotify Connect. What do you think? A reasonable change would be to allow go-librespot to run without showing up as a connectable device.
Author
Owner

@phts commented on GitHub (Nov 15, 2023):

Actually not quite uncommon.

There is community page regarding volumio's new spotify plugin which was migrated from rust librespot to go-librespot, users complaining about this missing feature, now it requires to log out to allow other users to use "connect". Then log in to use UI. Which is quite inconvenient.

<!-- gh-comment-id:1812354513 --> @phts commented on GitHub (Nov 15, 2023): Actually not quite uncommon. There is [community page](https://community.volumio.com/t/new-2023-spotify-plugin/63381/82) regarding volumio's new spotify plugin which was migrated from rust librespot to go-librespot, users complaining about this missing feature, now it requires to log out to allow other users to use "connect". Then log in to use UI. Which is quite inconvenient.
Author
Owner

@phts commented on GitHub (Nov 15, 2023):

What do you think? A reasonable change would be to allow go-librespot to run without showing up as a connectable device.

yes, theoretically could work 👍

<!-- gh-comment-id:1812363959 --> @phts commented on GitHub (Nov 15, 2023): > What do you think? A reasonable change would be to allow go-librespot to run without showing up as a connectable device. yes, theoretically could work 👍
Author
Owner

@devgianlu commented on GitHub (Feb 7, 2024):

This is being worked on with github.com/devgianlu/go-librespot@8a2cb3b5a4, I have tested it somewhat, but not extensively.

<!-- gh-comment-id:1931976185 --> @devgianlu commented on GitHub (Feb 7, 2024): This is being worked on with https://github.com/devgianlu/go-librespot/commit/8a2cb3b5a4d47ed386fee6e83dd005dea130d11f, I have tested it somewhat, but not extensively.
Author
Owner

@phts commented on GitHub (Feb 7, 2024):

@devgianlu great,! thanks Please create a new version to be able test it

Cc @volumio

<!-- gh-comment-id:1932162705 --> @phts commented on GitHub (Feb 7, 2024): @devgianlu great,! thanks Please create a new version to be able test it Cc @volumio
Author
Owner

@volumio commented on GitHub (Feb 7, 2024):

@phts synced with @devgianlu let's test by compiling and testing it, so then we can provide feebdacks to @devgianlu if that works. Note, to make it work we shall always keep zeroconf_enabled = true

<!-- gh-comment-id:1932274225 --> @volumio commented on GitHub (Feb 7, 2024): @phts synced with @devgianlu let's test by compiling and testing it, so then we can provide feebdacks to @devgianlu if that works. Note, to make it work we shall always keep zeroconf_enabled = true
Author
Owner

@phts commented on GitHub (Feb 9, 2024):

@devgianlu

still need new release to try it 🙏

<!-- gh-comment-id:1935430452 --> @phts commented on GitHub (Feb 9, 2024): @devgianlu still need new release to try it 🙏
Author
Owner

@devgianlu commented on GitHub (Feb 9, 2024):

I have released v0.0.13 with some other features and fixes: https://github.com/devgianlu/go-librespot/releases/tag/v0.0.13

<!-- gh-comment-id:1935969377 --> @devgianlu commented on GitHub (Feb 9, 2024): I have released v0.0.13 with some other features and fixes: https://github.com/devgianlu/go-librespot/releases/tag/v0.0.13
Author
Owner

@phts commented on GitHub (Feb 11, 2024):

With 0.13.0 version:

Playing using signed in mode, stopped, and after some time of inactivity (I tried half of day) app does not play anymore, after sending /player/play it does not produce any events:

Screenshot_20240211-110556~2

Need to restart consumer app (means ws connection) to make it work.

With 0.12.0 it never happened :

Screenshot_20240211-112639

<!-- gh-comment-id:1937777544 --> @phts commented on GitHub (Feb 11, 2024): With 0.13.0 version: Playing using signed in mode, stopped, and after some time of inactivity (I tried half of day) app does not play anymore, after sending /player/play it does not produce any events: ![Screenshot_20240211-110556~2](https://github.com/devgianlu/go-librespot/assets/598919/efe9752e-23bc-42cf-aefe-f77f5eb3db37) Need to restart consumer app (means ws connection) to make it work. With 0.12.0 it never happened : ![Screenshot_20240211-112639](https://github.com/devgianlu/go-librespot/assets/598919/d0e2eafb-a997-4d39-a626-c3fecaa700e0)
Author
Owner

@devgianlu commented on GitHub (Feb 11, 2024):

Did you try playing from the Spotify app (via Connect)? Also, do you have the logs from go-librespot?

<!-- gh-comment-id:1937794304 --> @devgianlu commented on GitHub (Feb 11, 2024): Did you try playing from the Spotify app (via Connect)? Also, do you have the logs from go-librespot?
Author
Owner

@phts commented on GitHub (Feb 11, 2024):

How to make it producing log file and where to find it?

<!-- gh-comment-id:1937797883 --> @phts commented on GitHub (Feb 11, 2024): How to make it producing log file and where to find it?
Author
Owner

@devgianlu commented on GitHub (Feb 11, 2024):

With SSH access you can do journalctl -u go-librespot-daemon --since today -f, not sure how to do it from the dev page. @volumio

<!-- gh-comment-id:1937798576 --> @devgianlu commented on GitHub (Feb 11, 2024): With SSH access you can do `journalctl -u go-librespot-daemon --since today -f`, not sure how to do it from the dev page. @volumio
Author
Owner

@phts commented on GitHub (Feb 11, 2024):

No worries, I have access to ssh 😸

<!-- gh-comment-id:1937799624 --> @phts commented on GitHub (Feb 11, 2024): No worries, I have access to ssh 😸
Author
Owner

@phts commented on GitHub (Feb 11, 2024):

Logs and my comments inside

Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=info msg="loaded track \"Nasze Słońce\" (uri: spotify:track:5iprUHzH3rdcCDs6IT2D97, paused: false, position: 0ms, duration: 225484ms)"
Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="fetched chunk 1/19, size: 524288"
Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=trace msg="emitting websocket event: metadata"
Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="fetched chunk 3/19, size: 524288"
Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=trace msg="emitting websocket event: playing"
Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="fetched chunk 2/19, size: 524288"
Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=debug msg="pause track at 6916ms"
Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=trace msg="emitting websocket event: paused"

// here I paused and just didnt do anything....

Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=debug msg="put connect state inactive"
Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=trace msg="emitting websocket event: inactive"
Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=error msg="failed receiving dealer message" error="failed to get reader: received close frame: status = StatusGoingAway and reason = \"\""
Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=error msg="failed receiving packet" error="failed reading packet header: read tcp 192.168.0.102:58150->104.199.65.124:4070: use of closed network connection"


// at 18:48 I tried to play - and it didnt play anymore, and seems to not produce any logs anymore regarding those events.
// So there are logs above which where shown during innactivity. 
// You can see that it is reproducable even after 25 min of innactivity

// After I tried Connect, and it works:


Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="obtained new client token: AACAH/xxx="
Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="completed keyexchange"
Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="completed challenge"
Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="authenticated as xxx"
Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="authenticated as xxx"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="dealer connection opened"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=info msg="accepted zeroconf user xxx from Pixel 6a"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeSecretBlock, len: 336"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeLicenseVersion, len: 2"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeUnknown1f, len: 17"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeLegacyWelcome, len: 0"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeMercuryEvent, len: 513"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="received connection id: xxx="
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because NEW_DEVICE"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="handling transfer player command from 5fefda75fbc1e24848cceb417a660b861bc2da09"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="fetched new page 0 with 5 items (list: 5)"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="fetched new page 1 with 19 items (list: 24)"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="loading track spotify:track:2r3Od6LuCNMJM0wlILTLXW (paused: false, position: 2813ms)"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: will_play"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="selected format OGG_VORBIS_320 for spotify:track:2r3Od6LuCNMJM0wlILTLXW"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="requested aes key for file eb49513d840b98560894c6f49c6f1035ae6ef3eb, gid: 2r3Od6LuCNMJM0wlILTLXW"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched first chunk of 21, total size is 10765920 bytes"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="seek to 2813ms (diff: 124ms, samples: 124053, bytes: 85694)"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=info msg="loaded track \"Karłowate\" (uri: spotify:track:2r3Od6LuCNMJM0wlILTLXW, paused: false, position: 2813ms, duration: 260785ms)"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched chunk 2/20, size: 524288"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched chunk 1/20, size: 524288"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: metadata"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: active"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="sending successful reply for delaer request"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping dealer message" uri=social-connect/v2/session_update
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched chunk 3/20, size: 524288"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: playing"
Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="handling pause player command from 5fefda75fbc1e24848cceb417a660b861bc2da09"
Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="pause track at 8659ms"
Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="sending successful reply for delaer request"
Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=trace msg="emitting websocket event: paused"


// paused by connect

// After, played in signed-in mode again - works:

Feb 11 18:53:36 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:36+01:00" level=debug msg="pause track at 10566ms"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="pause track at 10566ms"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="fetched new page 0 with 1 items (list: 1)"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="loading track spotify:track:1ysyXgakIuQWmmeLYArPEG (paused: false, position: 0ms)"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: will_play"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="selected format OGG_VORBIS_320 for spotify:track:1ysyXgakIuQWmmeLYArPEG"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="requested aes key for file 734f105d0c02e49660057e4e9e73d798e1bf3f07, gid: 1ysyXgakIuQWmmeLYArPEG"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched first chunk of 16, total size is 8172236 bytes"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="seek to 0ms (diff: 0ms, samples: 0, bytes: 0)"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=info msg="loaded track \"Elektryczny prąd\" (uri: spotify:track:1ysyXgakIuQWmmeLYArPEG, paused: false, position: 0ms, duration: 175714ms)"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched chunk 1/15, size: 524288"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched chunk 3/15, size: 524288"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: metadata"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched chunk 2/15, size: 524288"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: paused"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: paused"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED"
Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: playing"
Feb 11 18:53:48 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:48+01:00" level=debug msg="fetched chunk 4/15, size: 524288"
<!-- gh-comment-id:1937822503 --> @phts commented on GitHub (Feb 11, 2024): Logs and my comments inside ``` Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=info msg="loaded track \"Nasze Słońce\" (uri: spotify:track:5iprUHzH3rdcCDs6IT2D97, paused: false, position: 0ms, duration: 225484ms)" Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="fetched chunk 1/19, size: 524288" Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=trace msg="emitting websocket event: metadata" Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="fetched chunk 3/19, size: 524288" Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=trace msg="emitting websocket event: playing" Feb 11 18:21:26 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:26+01:00" level=debug msg="fetched chunk 2/19, size: 524288" Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=debug msg="pause track at 6916ms" Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:21:30 phts-np-01 go-librespot[26608]: time="2024-02-11T18:21:30+01:00" level=trace msg="emitting websocket event: paused" // here I paused and just didnt do anything.... Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=debug msg="put connect state inactive" Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=trace msg="emitting websocket event: inactive" Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=error msg="failed receiving dealer message" error="failed to get reader: received close frame: status = StatusGoingAway and reason = \"\"" Feb 11 18:44:16 phts-np-01 go-librespot[26608]: time="2024-02-11T18:44:16+01:00" level=error msg="failed receiving packet" error="failed reading packet header: read tcp 192.168.0.102:58150->104.199.65.124:4070: use of closed network connection" // at 18:48 I tried to play - and it didnt play anymore, and seems to not produce any logs anymore regarding those events. // So there are logs above which where shown during innactivity. // You can see that it is reproducable even after 25 min of innactivity // After I tried Connect, and it works: Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="obtained new client token: AACAH/xxx=" Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="completed keyexchange" Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="completed challenge" Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="authenticated as xxx" Feb 11 18:49:33 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:33+01:00" level=debug msg="authenticated as xxx" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="dealer connection opened" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=info msg="accepted zeroconf user xxx from Pixel 6a" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeSecretBlock, len: 336" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeLicenseVersion, len: 2" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeUnknown1f, len: 17" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeLegacyWelcome, len: 0" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping packet PacketTypeMercuryEvent, len: 513" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="received connection id: xxx=" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because NEW_DEVICE" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="handling transfer player command from 5fefda75fbc1e24848cceb417a660b861bc2da09" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="fetched new page 0 with 5 items (list: 5)" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="fetched new page 1 with 19 items (list: 24)" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="loading track spotify:track:2r3Od6LuCNMJM0wlILTLXW (paused: false, position: 2813ms)" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: will_play" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="selected format OGG_VORBIS_320 for spotify:track:2r3Od6LuCNMJM0wlILTLXW" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="requested aes key for file eb49513d840b98560894c6f49c6f1035ae6ef3eb, gid: 2r3Od6LuCNMJM0wlILTLXW" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched first chunk of 21, total size is 10765920 bytes" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="seek to 2813ms (diff: 124ms, samples: 124053, bytes: 85694)" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=info msg="loaded track \"Karłowate\" (uri: spotify:track:2r3Od6LuCNMJM0wlILTLXW, paused: false, position: 2813ms, duration: 260785ms)" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched chunk 2/20, size: 524288" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched chunk 1/20, size: 524288" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: metadata" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: active" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="sending successful reply for delaer request" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="skipping dealer message" uri=social-connect/v2/session_update Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="fetched chunk 3/20, size: 524288" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:49:34 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:34+01:00" level=trace msg="emitting websocket event: playing" Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="handling pause player command from 5fefda75fbc1e24848cceb417a660b861bc2da09" Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="pause track at 8659ms" Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="sending successful reply for delaer request" Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:49:39 phts-np-01 go-librespot[26608]: time="2024-02-11T18:49:39+01:00" level=trace msg="emitting websocket event: paused" // paused by connect // After, played in signed-in mode again - works: Feb 11 18:53:36 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:36+01:00" level=debug msg="pause track at 10566ms" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="pause track at 10566ms" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="fetched new page 0 with 1 items (list: 1)" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="loading track spotify:track:1ysyXgakIuQWmmeLYArPEG (paused: false, position: 0ms)" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: will_play" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="selected format OGG_VORBIS_320 for spotify:track:1ysyXgakIuQWmmeLYArPEG" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="requested aes key for file 734f105d0c02e49660057e4e9e73d798e1bf3f07, gid: 1ysyXgakIuQWmmeLYArPEG" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched first chunk of 16, total size is 8172236 bytes" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="seek to 0ms (diff: 0ms, samples: 0, bytes: 0)" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=info msg="loaded track \"Elektryczny prąd\" (uri: spotify:track:1ysyXgakIuQWmmeLYArPEG, paused: false, position: 0ms, duration: 175714ms)" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched chunk 1/15, size: 524288" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched chunk 3/15, size: 524288" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: metadata" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="fetched chunk 2/15, size: 524288" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: paused" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: paused" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=debug msg="put connect state because PLAYER_STATE_CHANGED" Feb 11 18:53:37 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:37+01:00" level=trace msg="emitting websocket event: playing" Feb 11 18:53:48 phts-np-01 go-librespot[26608]: time="2024-02-11T18:53:48+01:00" level=debug msg="fetched chunk 4/15, size: 524288" ```
Author
Owner

@devgianlu commented on GitHub (Feb 12, 2024):

I think what's happening is that when the device goes inactive and zerconf_enabled is true the account will be logged out which is fine when playing from Connect because it'll re-authenticate, but for volumio it'll break since it expects a session to be there.

This could be fixed by not ever logging out the account that has been logged in with "signed-in" mode from the configuration file. This would also require to re-login that account after another Zeroconf account leaves.

I'll think about whether there could be other side effects and possibly implement it tomorrow.

<!-- gh-comment-id:1939318965 --> @devgianlu commented on GitHub (Feb 12, 2024): I think what's happening is that when the device goes inactive and `zerconf_enabled` is true the account will be logged out which is fine when playing from Connect because it'll re-authenticate, but for volumio it'll break since it expects a session to be there. This could be fixed by not ever logging out the account that has been logged in with "signed-in" mode from the configuration file. This would also require to re-login that account after another Zeroconf account leaves. I'll think about whether there could be other side effects and possibly implement it tomorrow.
Author
Owner

@devgianlu commented on GitHub (Feb 16, 2024):

@phts I have released v0.0.14 with a fix for this and some other improvements.

<!-- gh-comment-id:1948855083 --> @devgianlu commented on GitHub (Feb 16, 2024): @phts I have released [v0.0.14](https://github.com/devgianlu/go-librespot/releases/tag/v0.0.14) with a fix for this and some other improvements.
Author
Owner

@devgianlu commented on GitHub (Feb 23, 2024):

Closing this, if any problem comes around please open another issue.

<!-- gh-comment-id:1961797631 --> @devgianlu commented on GitHub (Feb 23, 2024): Closing this, if any problem comes around please open another issue.
Author
Owner

@phts commented on GitHub (Feb 23, 2024):

Working so far, thanks

<!-- gh-comment-id:1961799324 --> @phts commented on GitHub (Feb 23, 2024): Working so far, thanks
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-librespot#7
No description provided.