[GH-ISSUE #366] Cannot change device. #154

Closed
opened 2026-02-28 14:47:25 +03:00 by kerem · 8 comments
Owner

Originally created by @ppublicgit on GitHub (Mar 30, 2020).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/366

After running spotifyd and then spt, I am unable to see my computer as an option for devices. This seems to be a spotifyd issue, but I figured I would check here first. I can see my tv, and phone as options (but I cannot switch the playback device as Enter will not change the device for playback) but my computer will not show up. If I launch the spotify client from the AUR then my computer shows as an option but I again I am unable to switch the playback device. If I change the playback device via my phone though, spotify-tui correctly recognizes a new playback device has been chosen.

Originally created by @ppublicgit on GitHub (Mar 30, 2020). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/366 After running spotifyd and then spt, I am unable to see my computer as an option for devices. This seems to be a spotifyd issue, but I figured I would check here first. I can see my tv, and phone as options (but I cannot switch the playback device as Enter will not change the device for playback) but my computer will not show up. If I launch the spotify client from the AUR then my computer shows as an option but I again I am unable to switch the playback device. If I change the playback device via my phone though, spotify-tui correctly recognizes a new playback device has been chosen.
kerem closed this issue 2026-02-28 14:47:25 +03:00
Author
Owner

@Rigellute commented on GitHub (Mar 30, 2020):

When you have the official client open on your computer, can you see it in the list? I've just been testing it out and it's working, using my phone, official client on computer, and spotifyd running.

<!-- gh-comment-id:605889491 --> @Rigellute commented on GitHub (Mar 30, 2020): When you have the official client open on your computer, can you see it in the list? I've just been testing it out and it's working, using my phone, official client on computer, and spotifyd running.
Author
Owner

@ppublicgit commented on GitHub (Mar 30, 2020):

If I have the official client open on my computer, I can see the client in my list of devices but I still cannot change the output to my computer. I am able to pause, skip songs etc via the spotify-tui application but cannot change playback device.

<!-- gh-comment-id:606304270 --> @ppublicgit commented on GitHub (Mar 30, 2020): If I have the official client open on my computer, I can see the client in my list of devices but I still cannot change the output to my computer. I am able to pause, skip songs etc via the spotify-tui application but cannot change playback device.
Author
Owner

@Rigellute commented on GitHub (Mar 31, 2020):

Hmm... if you disable the spotifyd daemon can you change devices?

<!-- gh-comment-id:606549685 --> @Rigellute commented on GitHub (Mar 31, 2020): Hmm... if you disable the spotifyd daemon can you change devices?
Author
Owner

@ppublicgit commented on GitHub (Apr 4, 2020):

Sorry for the late response. Been busy the past few days. I realized my spotifyd install was not adequate (I use pulseaudio as a backend and my spotifyd install only had support for alsa). I have been trying to get the proper install but have run into several issues. I have disabled spotifyd but still cannot change devices. I am able to pause, skip, save change songs etc without an issue and the correct devices are always shown in the playback choices but I just cannot switch it seems (though it did work twice out of the 100 or so attempts I have made, I have no idea why it worked those two times and none of the others though). For now I am going to try and get spotifyd to work first, whenever I can find a little spare time, and see if that solves the issue for me. Thanks for the speedy replies.

<!-- gh-comment-id:608951961 --> @ppublicgit commented on GitHub (Apr 4, 2020): Sorry for the late response. Been busy the past few days. I realized my spotifyd install was not adequate (I use pulseaudio as a backend and my spotifyd install only had support for alsa). I have been trying to get the proper install but have run into several issues. I have disabled spotifyd but still cannot change devices. I am able to pause, skip, save change songs etc without an issue and the correct devices are always shown in the playback choices but I just cannot switch it seems (though it did work twice out of the 100 or so attempts I have made, I have no idea why it worked those two times and none of the others though). For now I am going to try and get spotifyd to work first, whenever I can find a little spare time, and see if that solves the issue for me. Thanks for the speedy replies.
Author
Owner

@ppublicgit commented on GitHub (Apr 4, 2020):

One question though, if I do get spotifyd working, should that be a new choice for a playback device separate from my regular laptop choice via the official client?

<!-- gh-comment-id:608952064 --> @ppublicgit commented on GitHub (Apr 4, 2020): One question though, if I do get spotifyd working, should that be a new choice for a playback device separate from my regular laptop choice via the official client?
Author
Owner

@Rigellute commented on GitHub (Apr 6, 2020):

You're right yes, spotifyd should appear as another device in the list 👍

<!-- gh-comment-id:609704362 --> @Rigellute commented on GitHub (Apr 6, 2020): You're right yes, spotifyd should appear as another device in the list 👍
Author
Owner

@TimotheeGerber commented on GitHub (Apr 17, 2020):

I think there may be two different problems here. I'll try to explain both and propose a workaround for each one. I am quite new to sptotify-tui and spotifyd so don't hesitate to correct me if I am wrong.

TL;DR: Add username/password in your spotifyd configuration and always play a new song after switching device (by selecting it + Enter key, no next/previous shortcut).


spotify-tui uses rspotify which in turn is based on the official Spotify Web API. As a consequence, the list of devices proposed by spotify-tui correspond to the devices already registered on Spotify servers.

spotifyd can be used with two different authentication scenario. You can provide a username/password and it will automatically register on Spotify servers. Thus, it will be available in spotify-tui device list. The second authentication possibility is to use the discovery mode: spotifyd wait for a Spotify client to send the credentials. This method is based on Zeroconf (also called mDNS for Multicast Domain Name Service) and needs that the Spotify client and the receiver (here spotifyd) are on the same network.

In the second case, spotify-tui is not able to find the device because it is not registered on Spotify servers. And spotify-tui does not implement the discovery mode. But, once you select spotifyd as a device in the official Spotify client, it get the credentials and register to the Spotify servers. Therefore, it becomes available in the spotify-tui device list.

I am currently working on a small code to authenticate a device via discovery mode to ditch completely the official Spotify client and be able to use my Onkyo amplifier with spotify-tui . If I manage to do it properly, I will release it as a crate, so maybe spotify-tui could use it in the future.


The second problem is that spotify-tui does not transfer playback from one device to the other when selecting a device. That means that the currently playing song will not stop on the previous device and resume on the new one. Instead, the internal representation change and next time you will play a song, it will start on the new device (this automatically stop the playback on the old device as Spotify only allow one playback at a time).

This lead to strange situations. If you change device, play/stop/next/volume/etc command will be send to the new device playing nothing, not to the old one still playing a sonf. So spotify-tui looks like doing nothing at all.

I'll try to make a PR to change this behavior. The idea is to call the transfert_playback from rspotify when changing the device.

<!-- gh-comment-id:615230196 --> @TimotheeGerber commented on GitHub (Apr 17, 2020): I think there may be two different problems here. I'll try to explain both and propose a workaround for each one. I am quite new to `sptotify-tui` and `spotifyd` so don't hesitate to correct me if I am wrong. > TL;DR: Add username/password in your `spotifyd` configuration and always play a new song after switching device (by selecting it + Enter key, no next/previous shortcut). --- `spotify-tui` uses `rspotify` which in turn is based on the official Spotify Web API. As a consequence, the list of devices proposed by `spotify-tui` correspond to the devices already registered on Spotify servers. `spotifyd` can be used with two different authentication scenario. You can provide a username/password and it will automatically register on Spotify servers. Thus, it will be available in `spotify-tui` device list. The second authentication possibility is to use the discovery mode: `spotifyd` wait for a Spotify client to send the credentials. This method is based on Zeroconf (also called mDNS for Multicast Domain Name Service) and needs that the Spotify client and the receiver (here `spotifyd`) are on the same network. In the second case, `spotify-tui` is not able to find the device because it is not registered on Spotify servers. And `spotify-tui` does not implement the discovery mode. But, once you select `spotifyd` as a device in the official Spotify client, it get the credentials and register to the Spotify servers. Therefore, it becomes available in the `spotify-tui` device list. I am currently working on a small code to authenticate a device via discovery mode to ditch completely the official Spotify client and be able to use my Onkyo amplifier with `spotify-tui` . If I manage to do it properly, I will release it as a crate, so maybe `spotify-tui` could use it in the future. --- The second problem is that `spotify-tui` does not transfer playback from one device to the other when selecting a device. That means that the currently playing song will not stop on the previous device and resume on the new one. Instead, the internal representation change and next time you will play a song, it will start on the new device (this automatically stop the playback on the old device as Spotify only allow one playback at a time). This lead to strange situations. If you change device, play/stop/next/volume/etc command will be send to the new device playing nothing, not to the old one still playing a sonf. So `spotify-tui` looks like doing nothing at all. I'll try to make a PR to change this behavior. The idea is to call the `transfert_playback` from `rspotify` when changing the device.
Author
Owner

@ppublicgit commented on GitHub (May 2, 2020):

Sorry for the late response. I decided to do a complete reinstall of Arch (for an unrelated reason) and have been busy getting everything up and running. Anyways, what you said is true. I would not be able to transfer the player after repeated attempts, but then it would randomly work (because the song had finished). I am going to close the issue since the problem has been solved.

<!-- gh-comment-id:623007621 --> @ppublicgit commented on GitHub (May 2, 2020): Sorry for the late response. I decided to do a complete reinstall of Arch (for an unrelated reason) and have been busy getting everything up and running. Anyways, what you said is true. I would not be able to transfer the player after repeated attempts, but then it would randomly work (because the song had finished). I am going to close the issue since the problem has been solved.
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/spotify-tui#154
No description provided.