[GH-ISSUE #183] On macOS automatically switch to new default sound output #92

Closed
opened 2026-03-02 23:44:27 +03:00 by kerem · 9 comments
Owner

Originally created by @yerke on GitHub (Apr 24, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/183

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!

Originally created by @yerke on GitHub (Apr 24, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/183 **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!
kerem 2026-03-02 23:44:27 +03:00
Author
Owner

@aome510 commented on GitHub (Apr 24, 2023):

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.

<!-- gh-comment-id:1520775775 --> @aome510 commented on GitHub (Apr 24, 2023): `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.
Author
Owner

@Foxtrod89 commented on GitHub (May 14, 2023):

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

<!-- gh-comment-id:1546953415 --> @Foxtrod89 commented on GitHub (May 14, 2023): I didn't even expect this project to support wireless devices lol. Seems like `device_type = "wireless"` doesn't do anything.
Author
Owner

@aome510 commented on GitHub (May 15, 2023):

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
<!-- gh-comment-id:1547118804 --> @aome510 commented on GitHub (May 15, 2023): > 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 <img width="314" alt="Screenshot 2023-05-14 at 10 55 02 PM" src="https://github.com/aome510/spotify-player/assets/40011582/f97c97f8-b15b-41d7-bffa-dc769bdb5a48">
Author
Owner

@Foxtrod89 commented on GitHub (May 15, 2023):

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?

<!-- gh-comment-id:1548259395 --> @Foxtrod89 commented on GitHub (May 15, 2023): > > 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 > > <img alt="Screenshot 2023-05-14 at 10 55 02 PM" width="314" src="https://user-images.githubusercontent.com/40011582/238232029-f97c97f8-b15b-41d7-bffa-dc769bdb5a48.png"> How to setup wireless connection?
Author
Owner

@aome510 commented on GitHub (May 15, 2023):

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.

<!-- gh-comment-id:1548266170 --> @aome510 commented on GitHub (May 15, 2023): 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.
Author
Owner

@Spuxy commented on GitHub (Aug 8, 2023):

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

<!-- gh-comment-id:1669006713 --> @Spuxy commented on GitHub (Aug 8, 2023): 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
Author
Owner

@nazriel commented on GitHub (Aug 28, 2023):

@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.

<!-- gh-comment-id:1695640573 --> @nazriel commented on GitHub (Aug 28, 2023): @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.
Author
Owner

@aome510 commented on GitHub (Aug 28, 2023):

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.

<!-- gh-comment-id:1695774032 --> @aome510 commented on GitHub (Aug 28, 2023): > 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.
Author
Owner

@aome510 commented on GitHub (Oct 31, 2024):

This seems to be handled automatically now with new librespot v0.5.0 release

<!-- gh-comment-id:2450163212 --> @aome510 commented on GitHub (Oct 31, 2024): This seems to be handled automatically now with new `librespot v0.5.0` release
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-player#92
No description provided.