-
Notifications
You must be signed in to change notification settings - Fork 351
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
Use alsa-rs for alsa support rather than alsa-sys #308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but the formatting changes have made it overwhelmingly hard to reason about the diff. I appreciate if you avoid them for this PR: we have a plan to run rustfmt after the large refactoring PRs.
At this point I wouldn't review the code of the diff, I've opened the PR more to get feedback on the idea. I think having another layer of abstraction (that is zero-cost) makes implementing the |
Yes, I think using Rust bindings is a good idea, and it seems it's better than using raw FFI bindings that haven't been updated for 2 years anyway. I haven't looked at the code but at the moment we have some low-level dealing with the poll descriptors - wonder if that would be correctly abstracted in alsa-rs. |
I agree and think we should be careful when evaluating projects like Both these projects are very handy when working with unix c libraries though, as you no longer have to hold the ffi cognitive load in your head while working on using the libraries. |
Do you still plan to work on this? So far it doesn't seem You're welcomed to add RAII wrappers or other unsafe-to-safe facilities inside cpal as well. |
Hi! I'm the maintainer of the alsa crate. I just wanted to say that if there's anything in the alsa crate that keeps you from moving over CPAL from alsa-sys to alsa, I'm all ears and likely willing to improve the alsa crate to fit your needs. Please open an issue if that's the case.
There is indeed a poll descriptor abstraction in the alsa crate. I hope you will find it to be correct 🙂 |
Hi folks, just wanted to notify you that this is currently being discussed at #386 :) |
Closed via #386. |
I'm opening this as a draft, both because it's quite large, and because it depends on some additions I've made to
alsa-rs
. I really like it though in principal. It removes almost all unsafe code (certainly the bits that are hard to reason about), and IMO makes the alsa backend much easier to reason about.EDIT oh, and there are bugs in it at the moment that prevent it from making any noise. Specifically I get