ncspot icon indicating copy to clipboard operation
ncspot copied to clipboard

Feature - Command-line option to list available audio devices to ease backend_device configuration

Open instinctualjealousy opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. I have VoiceMeeter set-up. I want my music to go through to a different audio device than my system default for routing purposes. Even using Windows 10's built-in per-program output settings, it doesn't work. It always uses system default. I imagine it's a bug with Rodio or something.

Describe the solution you'd like I would like the ability to figure out my audio device's name within ncspot for use with backend_device. It's possible that ncspot could be called to list available audio output devices (like it can with available backends), so people know they're using the right name/naming convention for the setting. Given that different backends may use different naming conventions, it could possibly try to list for all compiled-in backends, or list for the currently active default only.

Describe alternatives you've considered I have a hilarious personal workaround currently... where I script my default audio device to change to the one I want ncspot to use, run ncspot, and then revert to my initial default audio device- it stays hooked to the device it initially determined as default (#846, #158). This does solve the problem, but it's a bodge.

General praise I thank all the contributors for ncspot. Having a librespot client on Windows that just works as it should, is great. I'm not huge on TUIs, but I'm willing to adjust given the general quality and performance of this client.

instinctualjealousy avatar Aug 29 '22 20:08 instinctualjealousy

Hi there, there is a backend_device config option that should do what you want. The only challenge is to find the device string corresponding to your output device, as they are backend specific and I don't think there's an API in librespot listing them.

hrkfdn avatar Aug 29 '22 21:08 hrkfdn

Looks like librespot itself can do a --device ? on some backends to list available devices. I'd rather not compile librespot on Windows just to find out what ~~esoteric, arcane naming scheme~~ (it's simple, actually!) the Rodio backend uses.

Still, you're right. This is technically supported. I should've RTFM. I just glossed over it, even though I successfully used other options in my config.toml.

It feels like this should be abstracted to the end user somehow, but it's probably not in your hands. Thank you for your help, anyway! Given this is still an "issue" in a sense (different roadblock, same problem), I have adjusted its title and description accordingly.

instinctualjealousy avatar Aug 30 '22 03:08 instinctualjealousy

It looks like Rodio will list the devices if you pass "?" as the device name: https://github.com/librespot-org/librespot/blob/16dbade51665667ecf768f21099afc648e0b0176/playback/src/audio_backend/rodio.rs#L139

You could set backend_device to ? and see if it logs something. Would be cool if librespot had an explicit interface for that, sounds like something that could be submitted as a PR upstream :)

hrkfdn avatar Aug 30 '22 15:08 hrkfdn

Simple naming scheme

Ha, look at that. I didn't even think to do that. Thanks for the tip- it looks like the naming scheme isn't weird. It's just "Customizable Name (Driver Assigned Name)", which is very easy, actually. This is at least the format it uses on Windows.

I can confirm ncspot obeys these device names and is working as it should! Sound is now coming out of the desired device without a weird workaround.

instinctualjealousy avatar Aug 30 '22 16:08 instinctualjealousy

Hooray! I think it's still kind of weird UX-wise but at least it helped you finding your device 😄

hrkfdn avatar Aug 30 '22 16:08 hrkfdn