mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 17:35:50 +03:00
[GH-ISSUE #79] Integrated device not shown up "fast enough" on startup #27
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#27
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 @alosarjos on GitHub (Sep 11, 2022).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/79
Lately I've noticed that spotify-player is starting without picking the default device (Which is itself). In the config file is like this:
So whenever I open the player, I have to choose a device manually (There it's listed) and then I can play music. Is there some kind of race condition or something for picking the default device maybe?
@aome510 commented on GitHub (Sep 11, 2022):
@alosarjos can you share one example log of such case?
Does the app display something like "No playback found. Please make sure there is a running Spotify client and try to connect to it using the
SwitchDevicecommand."?@alosarjos commented on GitHub (Sep 11, 2022):
Sure, I remove some keys/ids I saw since I wasn't sure those should be "public" just in case
And yes, that is exactly the message it says.
spotify-player-22-09-11-19:59.log
@alosarjos commented on GitHub (Sep 11, 2022):
I'm assuming the issue comes from this info lines:
Where, for some reason the device is not showing up fast enough?
@alosarjos commented on GitHub (Sep 11, 2022):
The device is correctly initialized, it shows up if I open de device selector and it's also available on the phone app.
@aome510 commented on GitHub (Sep 11, 2022):
Thanks for the log and further investigation. Look like a known issue to me.
Yes, the reason is the new device is not shown up fast enough when calling
get_deviceAPI for available devices, at least based on my understanding. I've encountered this issue a few times before. I also made some changes to make it happen less frequently, but I guess they're not enough.Related discussion: https://github.com/aome510/spotify-player/issues/69#issuecomment-1211556708.
I'll change the title to better reflect the issue. In the meantime, I'll think more about ways to improve this startup process.
@elkrien commented on GitHub (Sep 16, 2022):
Have the same problem with new version. I had this problem in the past where there was no option for default device. Then after implementing this option it was ok, now after update player acts like it is not reading my config for this option.
When I open player it starts playing on first device on the list (in my situation is Sony TV). It's very frustrating because it turns on tv every time I start player, then I need to change device manually and go downstairs to turn off tv ;)
@aome510 commented on GitHub (Sep 16, 2022):
That's unfortunate it happens again. I'm currently implementing a proper fix (hope so) for this issue. Will ping you guys once it's ready
@alosarjos commented on GitHub (Sep 16, 2022):
@aome510 Sure thing. If you ping me with a branch or a commit I can give it a try before tagging the release if you need it. ;)
@aome510 commented on GitHub (Sep 16, 2022):
@alosarjos @elkrien implemented the fix in https://github.com/aome510/spotify-player/pull/81. Can you check it out and try if the new changes fix this issue?
Basically, what I did is to add retries when connecting to the integrated device. That means it ensures that the integrated device is picked on startup but with delay (~ the time it took for the integrated device to be fully initialized).
Regarding the issue after update, I don't particularly know why the integrated device registration is slower now (maybe because of third-party library changes). Let's leave that to a separated issue and do further investigation if the new fix is not enough.
@alosarjos commented on GitHub (Sep 17, 2022):
@aome510 For my is having a strange behaviour, I keep opening and closing the app and I've seen 3 things happening in all those tries:
@elkrien commented on GitHub (Sep 17, 2022):
@aome510 It starts a lot slower now but works fine - no more turning on my TV :)
@aome510 commented on GitHub (Sep 17, 2022):
Interesting. Will take a look 👀
@aome510 commented on GitHub (Sep 18, 2022):
I also experience the same thing occasionally. Looking into the log in that case, it seems that the app displays the playback from the previous run, whose device is shut down but not updated in the Spotify server. Because there is already a running playback at startup, it doesn't try to connect to one. Then, when the shutdown event is known, the playback becomes empty.
I think this is also because of the same thing as above. The app knows there is one running on startup, so it doesn't look for one.
@aome510 commented on GitHub (Sep 21, 2022):
Should be fixed by #81. I'll close this for now. Feel free to re-open it if encounter any related issues.