Spotifyd / spotifyd

A spotify daemon
https://spotifyd.rs
GNU General Public License v3.0
9.68k stars 444 forks source link

Default to PortAudio backend on non-Linux #1257

Open klemensn opened 6 months ago

klemensn commented 6 months ago

They all do, however, enable "portaudio_backend" to use PortAudio by default.

Reflect that such that the aforementioned four platforms/operating systems do not have to override features whilst making ALSA Linux-only by default.

I am not sure what backend is used on Windows by default, but PortAudio aught to work there; certainly better than ALSA.

0: https://github.com/Homebrew/homebrew-core/blob/master/Formula/s/spotifyd.rb 1: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/audio/spotifyd/Makefile?rev=1.2&content-type=text/x-cvsweb-markup 2: https://cgit.freebsd.org/ports/tree/audio/spotifyd/Makefile 3: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/audio/spotifyd/Makefile?rev=1.6&content-type=text/x-cvsweb-markup

eladyn commented 6 months ago

Thank you for that contribution! Unfortunately, the target specific features don't seem to be working. That's probably a missing cargo feature, however: https://github.com/rust-lang/cargo/issues/1197.

Maybe a different solution would be to use rodio by default which is apparently designed to be a cross platform audio playback library? Not sure, how it works on things different than linux though.

klemensn commented 6 months ago

Thank you for that contribution! Unfortunately, the target specific features don't seem to be working. That's probably a missing cargo feature, however: rust-lang/cargo#1197.

I see, that doesn't fly. /me is a rust/cargo rookie

Maybe a different solution would be to use rodio by default which is apparently designed to be a cross platform audio playback library? Not sure, how it works on things different than linux though.

First and last time I tried, rodio wouldn't build as-is on OpenBSD; I can look into that, but only on my platform and either way, I have no experience with rodio (haven't even heard about it), whereas I know that PortAudio pretty much just works on all supported platforms.

klemensn commented 6 months ago

For reference: rodio uses cpal, so it all boils down to https://github.com/RustAudio/cpal/pull/493 from a few years ago. psst (Rust GUI Spotify client) also uses cpal -- building was one issue, working playback was another, it is all very much WIP on OpenBSD, still.