devgianlu / go-librespot

Yet another open source Spotify client, written in Go.
GNU General Public License v3.0
137 stars 19 forks source link

autoplay doesn't work #133

Closed szygmunt closed 1 week ago

szygmunt commented 1 week ago

Doesn't matter "autoplay" slider position in android app i have always "DEBU[0001] autoplay enabled: false". Or maybe is some configuration option in config.yml file to enable this feature? edited: when i toggle "autoplay" slider in android app while i'm connected to go-librespot i get this in logs: DEBU[0543] skipping dealer message uri="spotify:user:attributes:mutated" DEBU[0543] skipping packet PacketTypeMercuryEvent, len: 121

devgianlu commented 1 week ago

It is currently not possibile to update the autoplay value when go-librespot is running (this is the same for the desktop clients). If you restart go-librespot after changing the autoplay settings, the logs should report the correct value.

szygmunt commented 1 week ago

It is currently not possibile to update the autoplay value when go-librespot is running (this is the same for the desktop clients).

Yes i know. I saw #57. But i mean that slider position in my android app doesnt affect to go-librespot (autoplay in logs is always autoplay enabled: false)

If you restart go-librespot after changing the autoplay settings, the logs should report the correct value.

It should't for me. Tested only with app on my android mobile.

devgianlu commented 1 week ago

Just tested from Android and it seems to work for me. Can you try using the desktop app to toggle? Are you connecting via zeroconf or interactive?

szygmunt commented 1 week ago

I did some tests and i think it work in different way i thought before. I had two "machine" in the same network with native android apps on it: on my android mobile and linux desktop. Autoplay works only when slider on target machine is ON (slider position on source machine when connect to target using "spotify connect" isn't important). So i think go-librespot have to get "slider" in config.yml.

devgianlu commented 1 week ago

So it appers that autoplay is not an account setting, but a device setting? In that case it would make sense to have it in the configuration of go-librespot.

szygmunt commented 1 week ago

So it appers that autoplay is not an account setting, but a device setting?

Yes, i think so. Maybe someone can confirm that for sure.

In that case it would make sense to have it in the configuration of go-librespot.

Before i used raspotify and rememer that was option in config for enable/disable autoplay. I'll be very happy to test it when it will be ready.

devgianlu commented 1 week ago

Done!

szygmunt commented 1 week ago

It almost work but have got some problems: Playing only single track finding using "search" in spotify:

  1. Android app - music is playing like always but on the end of track nothing is loading to queue and logs say: WARN[0217] failed resolving station for spotify:search error="invalid status code from context resolve autoplay: 204" When track is starting go-librespot doesn't resolv context of track in proper way: DEBU[0039] resolved context of track uri="spotify:search" ` - missing uri?
  2. Desktop app (linux) - on the end of track queue is loading with bunch of new tracks, first track from newly created queue is loading but not playing cause some problem with alsa. In logs it seems like this:

Start playing first track: DEBU[0417] resolved context of track uri="spotify:track:7B6Hw8SyK6JnFoL1GaCeGf"

Problem with playing first track from newly created playlist:

DEBU[0508] resolved autoplay station: spotify:station:track:7B6Hw8SyK6JnFoL1GaCeGf 
DEBU[0508] resolved context of track                     uri="spotify:station:track:7B6Hw8SyK6JnFoL1GaCeGf"
DEBU[0508] loading track (paused: false, position: 0ms)  uri="spotify:track:6jGFzqqW8VBBf4oLhnP4A6"
DEBU[0508] put connect state because PLAYER_STATE_CHANGED 
DEBU[0508] selected format OGG_VORBIS_320 (67f1c0188d3f4db34584322c60ea0163bb9b6b66)  uri="spotify:track:6jGFzqqW8VBBf4oLhnP4A6"
DEBU[0508] requested aes key for file 67f1c0188d3f4db34584322c60ea0163bb9b6b66, gid: 6jGFzqqW8VBBf4oLhnP4A6 
DEBU[0508] fetched first chunk of 19, total size is 9619512 bytes  uri="spotify:track:6jGFzqqW8VBBf4oLhnP4A6"
INFO[0508] loaded track "Tamagotchi" (paused: false, position: 0ms, duration: 201829ms, prefetched: false)  uri="spotify:track:6jGFzqqW8VBBf4oLhnP4A6"
DEBU[0509] put connect state because PLAYER_STATE_CHANGED 
WARN[0509] failed getting output device delay            error="ALSA error at snd_pcm_delay: Broken pipe"
devgianlu commented 1 week ago
  1. Android app - music is playing like always but on the end of track nothing is loading to queue

Can you open a separate issue for this? This may be inteded if Spotify does not support autoplay from search results.

  1. Desktop app (linux) - on the end of track queue is loading with bunch of new tracks, first track from newly created queue is loading but not playing cause some problem with alsa.

Should be fixed with https://github.com/devgianlu/go-librespot/commit/08e546e4953b29afdc5b2753f37e79748db4aa17, nasty little bug :)

szygmunt commented 1 week ago

Sorry for comment in closed thread but...

  1. Android app - music is playing like always but on the end of track nothing is loading to queue

Can you open a separate issue for this? This may be inteded if Spotify does not support autoplay from search results.

I'll do some more test with android and will open.

  1. Desktop app (linux) - on the end of track queue is loading with bunch of new tracks, first track from newly created queue is loading but not playing cause some problem with alsa.

Should be fixed with 08e546e, nasty little bug :)

Yes, now is perfect. I have only one question/problem. Is it normal when i get error like this:

ERRO[4255] failed fetching next tracks error="failed moving to next index 50 (page 1): failed fetching next page: invalid status code from page at radio-apollo/v3/tracks/spotify:station:track:70X7swUO33mrChUj4JSnbW?salt=345682&autoplay=true&count=50&isVideo=false&prev_tracks=5WWK07aVRFrnOhcYw3jOHl,5DLmRrqLyjVHhOkXa05Vtz,7wg60oyA8mWpKvJ1RsNQeV,0FGBCrLj15yxjJ1WPRnVMQ,2AbDY2agHP7e5slykeHPxJ,2yta07TETX5RGOpp12Kal8,5kruxMsxFfAadntmuoDVTj,4aA0qqyR2w9hpxYcHASxlT,3lOmInQxDnecxjn9mkCDRd,65Islxiuhti81Mep299R0I,7wYVm3OFsQvR8o8UwPoxQ0,702sdcjH1JbU2hwK8xEJD6,3xda00PJhL4k22ZF128QiL,7kXg41pCrpFulNrU7tK69Y,6qBBQTa27IJAsz3nGxTm7p,4oLgclTNif24XEFC7O7we4,405oT48J84IgtbWVDsCODc,1PGfufH63EaaMVxu8ik0qZ,12OV9e97TVkKb33cPqVSOj,318KZH2O4R003o3hL1aDqS,0m0MNn28t3VYGpzQd3PHuw,3W2UqSFjZt3bodeSTwFT8o,5E3fl4qohyr9LfS8xPimgV,4asWH98MYw0pdaCMc8sXI6,4xdzAOB3baQ8VmPJ8cf3ij,1rD0BmlixRov9u1zPGFpZu,0ECGOpzz0JKno4wjTWCui8,4srUcUkIP3NejBuRvQz3Gv,5nDtyyEmU26FJl77XLzNkV,7fYmDKSydjDrY4LWRSvAzf,633WGcoYmJrMCozV8Hssdh,5dk1wOmZVukUhwl5kKr7aS,18sM7A95jQugA982HWRJoe,4eG1ODcdjySLxlB9dtmbiv,3YQjwJ6JFqE588ZOXRmKLl,1WYcxUfqJmmmduS7F6qImy,1ZqHxSsl7BAWsw6G0lvZJJ,5SeCzfPjdei1yqoSVtppFF,0yLYTwDxdJGbyfgNwxd3ec,5RJc7zSyxLC6rbPGkQKoCl,5p7umW7hZRTMEoUZgSmz7a,143zd3DGXoJI7sHlrJlSVn,5W5l9ysNngpGz2J4xK8Rsa,1kAb8sDgCY43mRRw8lskmp,3Wmi9Qmtgp8nuS14qneAqi,4L2RcmaSgKr0Z1MVcVuA24,3YsjJZc6HgHAU2tAKl2uKL,6SGkgm9OEhK898PeaxLViI,675FZ1NEbcwiCO9vHoiQpu,04kSSveBKXiNeRaOXu2iog,70X7swUO33mrChUj4JSnbW&minimal=true: 502"?

It apears in logs after few tracks from newly created playlist was allready played and after that is duplicate each time new song from playlist is loading.

devgianlu commented 1 week ago

It apears in logs after few tracks from newly created playlist was allready played and after that is duplicate each time new song from playlist is loading.

Does it happen everytime or just sometimes? 502 should be a temporary error from Spotify side, but worth investigating if it always does this.

szygmunt commented 6 days ago

It happens everytime (but as i say, after few songs, don't know how many exactly). Additionally is some problem with play/pause songs playing from autogenerated playlist, exactly i can't resume track and have to skip to next or prev to unblock sound at all. About android app: after https://github.com/devgianlu/go-librespot/commit/08e546e4953b29afdc5b2753f37e79748db4aa17 autoplay is working but playlist icon is inactive and you can't check track's list and skip to any specified track (only skip to prev/next).

devgianlu commented 6 days ago

Additionally is some problem with play/pause songs playing from autogenerated playlist, exactly i can't resume track and have to skip to next or prev to unblock sound at all.

This is being tracked as https://github.com/devgianlu/go-librespot/issues/135, I broke something...

after https://github.com/devgianlu/go-librespot/commit/08e546e4953b29afdc5b2753f37e79748db4aa17 autoplay is working but playlist icon is inactive and you can't check track's list and skip to any specified track (only skip to prev/next).

Can you open a separate issue for this too?

szygmunt commented 5 days ago

Can you open a separate issue for this too?

137