Skip to content

Using cubeb as a dependency with the cubeb-coreaudio-rs backend? #229

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

Closed
mutexlox-signal opened this issue Jul 19, 2024 · 5 comments
Closed

Comments

@mutexlox-signal
Copy link
Contributor

I'm trying to use cubeb-rs with cubeb-coreaudio-rs as a backend. Currently, I'm doing so by adding cubeb to my Cargo.toml, but it appears that:

  1. This doesn't pull in cubeb-coreaudio-rs (attempting to manually select the audiounit-rust backend fails; I just get the audiounit backend instead)
  2. There is not anything in crates.io for cubeb-coreaudio-rs
  3. The suggested steps for using cubeb-coreaudio-rs do not seem to integrate well into Cargo.toml files

Is there any recommended / supported way to use cubeb-coreaudio-rs as a backend without manually cloning the git repo?

If not, do you have any plans to make it available in crates.io?

@mutexlox-signal
Copy link
Contributor Author

Just wanted to ping this issue. I've managed to get this building locally, by:

  1. Checking out cubeb-rs and initializing submodules
  2. cd'ing to cubeb and manually cloning cubeb-coreaudio-rs
  3. Adding .define("BUILD_RUST_LIBS", "ON") to cubeb-sys/build.rs, AND adding cubeb-rs/cubeb-sys/libcubeb/src/cubeb-coreaudio-rs/target/release to the library search path AND adding static=cubeb_coreaudio to the link-libs.

I can, perhaps, make this work for production purposes, but it seems like a lot of changes; is there any simpler way to depend on cubeb-rs with all of the tier-1 backends?

@padenot
Copy link
Collaborator

padenot commented Jul 31, 2024

That seem about right. cubeb-rs hasn't received much work, in part because it isn't used in Firefox and other large programs using cubeb, most users are using the C API, sometimes with Rust backends underneath.

I have a plan to merge all repos to make this a lot easier, but I haven't done it just now.

@mutexlox-signal
Copy link
Contributor Author

mutexlox-signal commented Jul 31, 2024

Thanks for the input! Created mozilla/cubeb-rs#91 as a way to add this support to cubeb-rs. This is an early draft still, so let me know what you think. (especially if this is the right general idea)

@mutexlox-signal
Copy link
Contributor Author

The submodule merge is very helpful, but now I'm running into rust-lang/cargo#6745 (Fix tracked in rust-lang/cargo#11405), which I think can only be worked around by adding empty [workspace] declarations to cubeb-coreaudio-rs and cubeb-pulse-rs's Cargo.toml files and then updating the submodules in cubeb.

@mutexlox-signal
Copy link
Contributor Author

Posted mozilla/cubeb-pulse-rs#94 and #236 to work around that issue.

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

No branches or pull requests

2 participants