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

update portaudio #190

Merged
merged 2 commits into from May 5, 2024
Merged

update portaudio #190

merged 2 commits into from May 5, 2024

Conversation

dansgithubuser
Copy link
Contributor

Hey, hope it's not too forward to lead with a PR. Figured it's a tiny change so might as well clarify that part up front.

I was hitting PortAudio/portaudio#268 and noticed the portaudio people solved it somewhere in 2020, and made a release in 2021. I tried installing that version of portaudio, but need a static build. pgk_config has its own unsolved problem with static system libraries rust-lang/pkg-config-rs#102.

Not sure of a couple things:

  • how married is this wrapper to 2014 portaudio?
  • am I missing some other way to get what I need?

I can confirm this changed solved my issue. Not sure about anything but dead obvious regressions, though.

All the best,
Dan

dansgithubuser and others added 2 commits April 25, 2024 03:32
can't use a modern static portaudio via pkg_config because of rust-lang/pkg-config-rs#102
@wmedrano
Copy link
Member

wmedrano commented May 5, 2024

  • how married is this wrapper to 2014 portaudio?
    • Not sure... haven't followed portaudio development but if it works for you its probably fine.
  • am I missing some other way to get what I need?
    • No, this is probably the way but... the Rust community has largely converged onto https://github.com/RustAudio/cpal for the same space that portaudio covers. Is there any reason you prefer portaudio over cpal?

@wmedrano wmedrano merged commit b494038 into RustAudio:master May 5, 2024
@dansgithubuser
Copy link
Contributor Author

Hey, thanks for the merge!

Yeah I've been keeping my eye on CPAL. I rely on small fixed frame size and find that CPAL does not guarantee a frame size, at least on ALSA.

Code: https://github.com/dansgithubuser/playground/blob/master/languages/rust/cpal/src/main.rs

Example run:

playground/languages/rust/cpal$ cargo run --release
   Compiling cpal v0.1.0 (/home/dan/Desktop/repos/playground/languages/rust/cpal)
warning: unused variable: `data`
  --> src/main.rs:13:15
   |
13 |         move |data: &[f32], _: &cpal::InputCallbackInfo| {
   |               ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: `cpal` (bin "cpal") generated 1 warning (run `cargo fix --bin "cpal"` to apply 1 suggestion)
    Finished release [optimized] target(s) in 0.89s
     Running `target/release/cpal`
128
128
127
127
127
127
127
127
127
127
127
127
127
127
127
127
127
127
45
127

Happy to write up an issue if it'd be useful. I just assumed it's one of many things CPAL is working through as it matures. Or just not considered an 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

Successfully merging this pull request may close these issues.

None yet

2 participants