Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to PortAudio backend on non-Linux #1257

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klemensn
Copy link
Contributor

@klemensn klemensn commented Jan 5, 2024

  • macOS homebrew[0], NetBSD pkgsrc[1], FreeBSD[2] and OpenBSD[3] ports diable default features and do not reenable "alsa_backend" by default
  • macOS CI builds do not use it
  • Windows has no ALSA

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

- macOS homebrew[0], NetBSD pkgsrc[1], FreeBSD[2] and OpenBSD[3] ports
  diable default features and do not reenable "alsa_backend" by default
- macOS CI builds do not use it
- Windows has no ALSA

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
Copy link
Member

eladyn commented Jan 6, 2024

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.

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
Copy link
Contributor Author

klemensn commented Jan 6, 2024

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 klemensn marked this pull request as draft January 6, 2024 22:52
@klemensn
Copy link
Contributor Author

For reference: rodio uses cpal, so it all boils down to RustAudio/cpal#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants