spotify-player icon indicating copy to clipboard operation
spotify-player copied to clipboard

On macOS automatically switch to new default sound output

Open yerke opened this issue 1 year ago • 8 comments

Is your feature request related to a problem? Please describe. When I connect my Bluetooth headphones I expect spotify-player to switch to them automatically.

Describe the solution you'd like When I connect my Bluetooth headphones I expect spotify-player to switch to them automatically.

Describe alternatives you've considered Keep existing behavior. Right now I have to close spotify-player and open it again after connecting to BT headphones (old way). Another way would be to use RestartIntegratedClient, which I just discovered.

Additional context Once again, thanks for the spotify-player!

yerke avatar Apr 24 '23 19:04 yerke

RestartIntegratedClient is the one way that I usually use when connecting to a new bluetooth device. The command doesn't work sometimes in the first try (maybe because it takes time to retrieve the newly connected bluetooth) and I need to re-run the command.

I don't know if it's possible to listen to new bluetooth device event and implement the automatic switching logic. Will take a look.

aome510 avatar Apr 24 '23 20:04 aome510

I didn't even expect this project to support wireless devices lol. Seems like device_type = "wireless" doesn't do anything.

Foxtrod89 avatar May 14 '23 17:05 Foxtrod89

I didn't even expect this project to support wireless devices lol.

Not sure what you mean by supporting wireless devices. device_type only changes how the client is displayed in the official application. A list of options for device_type can be found in https://github.com/librespot-org/librespot/wiki/Options

Screenshot 2023-05-14 at 10 55 02 PM

aome510 avatar May 15 '23 02:05 aome510

I didn't even expect this project to support wireless devices lol.

Not sure what you mean by supporting wireless devices. device_type only changes how the client is displayed in the official application. A list of options for device_type can be found in https://github.com/librespot-org/librespot/wiki/Options

Screenshot 2023-05-14 at 10 55 02 PM

How to setup wireless connection?

Foxtrod89 avatar May 15 '23 17:05 Foxtrod89

I'll assume you mean hearing sound from a wireless device (bluetooth headphone). If you install the app with streaming feature, it should use the default output device on startup (in this case the bluetooth headphone), so no need to setup anything.

aome510 avatar May 15 '23 17:05 aome510

Yep the problem what u got is, that u don't have probably connected properly wireless hw to your Mac or u don't have Spotify daemon or u don't have opened Spotify (the official one) + Spotify_player.

I got m1 with the newest OS and everything works correctly.

brew info spotifyd brew services list | grep spotifyd

this should indicates if there is even chance to connect into spotify

Spuxy avatar Aug 08 '23 06:08 Spuxy

@aome510 from what I've gathered this is the issue with audio backends.

Spotifyd folks mention librespot as being the issue. Librespot folks mention RustAudio/rodio as source of the problem: https://github.com/librespot-org/librespot/issues/547 https://github.com/RustAudio/rodio/issues/327

I will try to play around with librespot-playback versions etc to see if it is fixed with upstream master - since last tagged release is more than a year old https://crates.io/crates/librespot-playback

For now I wonder if we could implement some workaround - detecting if default output device changes and automatically restarting streaming service (RestartIntegratedClient) - not sure if it is worth in the first place though.

nazriel avatar Aug 28 '23 12:08 nazriel

For now I wonder if we could implement some workaround - detecting if default output device changes and automatically restarting streaming service (RestartIntegratedClient) - not sure if it is worth in the first place though.

Would be nice improvement but for me personally, I can live w/o that feature. I also use RestartIntegratedClient to manually change the audio device when I connect to a new one. It may not work in the first try though. My guess is that it takes time for librespot or other libraries to be notified of the new device connection.

aome510 avatar Aug 28 '23 14:08 aome510