-
Notifications
You must be signed in to change notification settings - Fork 365
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
32 bit Sample Format support #420
base: master
Are you sure you want to change the base?
Conversation
@mitchmindtree would love some review on this when you have a moment. refactored the 32 bit implementation per @kawogi 's great notes. I also added a first pass at the 24 bit implementation. I know the conversions are working correctly because I was able to play back 24 bit and 32 bit audio on macos (after converting to f32). PR checks are breaking because I have to resolve 24 bit for hosts that I know support 24 bit audio but I'm unable to verify how I should implement it (yet) - ALSA, ASIO, WASAPI. I wanted to get your input on the API and what I've done so far before proceeding further. in the original issue I opened #414, we discussed how to structure the API for 24 bit audio. one idea was to store 24 bit as packed data, but I ended up going the opposite route with this and storing the 24 bit unpacked in an If you want, I can change this to use the packed 3 bytes, but it still would require converting to I also couldn't find any examples of how ALSA, ASIO, or WASAPI handle 24 bit audio - do you know if they just look for 3 byte buffers or unpacked 32 bit numbers in their native endianness? I need to test myself I guess, but I still need to set up my local dev env for those targets so insight would be helpful if you happen to have any. thanks! |
built a new PC recently so going to be testing my branch of in the meantime, still would love any feedback if you have any, anything you're looking for, or if I should stop asking about this MR, etc. thanks! |
Sorry about the wait @julientregoat, and thanks for your work on this! I think the direction you're going in makes sense. The Also I'm not sure if we've already discussed this together, but there has been some discussion in the past about potentially using the |
No worries, appreciate you taking the time to look over this! OK cool re: packed vs unpacked. I definitely agree that both will be needed eventually, I think for now it makes sense to hold off on deciding a packed interface until we cross that bridge so we can keep all options open. The Hadn't seen those I believe we'll need our own trait either way so we can map types to trait Sample: dasp_sample::Sample {
const FORMAT: SampleFormat;
} I'm hesitant to say we should do that with this PR but don't have any good reasons. Something about not having direct control of the structs or traits? Like you mentioned, we'll probably need a few different I'm going to get this PR working with linux targets next and hopefully get a chance to play with the 24 + 32 bit ALSA targets if I have some devices that register with one of the following formats
|
I'm looking forward to having this merged! |
@HEnquist yeah that’s a fair point, I’ll split it out tonight and open a separate PR |
alright @mitchmindtree I've extracted the 24 bit stuff into a separate PR and finished off any lingering issues in this one. I've tested that it converts to the other sample formats successfully, and tested it with a native 32 bit ALSA output. I haven't been able to test it with a native 32 bit ASIO output yet |
What's missing to this? |
It needs a rebase at the least. Then a review. Refactoring to use |
like the title says, added 32 bit support and tests. when converting
i32
toi16
andu16
, the values are scaled down to reflect their relative magnitude. I'm not sure yet of the performance implications of these conversions or if there is a more efficient way to implement themedit: will fix the checks errs later