Repository navigation
Fix ASIO callback and audio buffer contract bugs - #638
Conversation
|
These look very nice to me! Did you check if this is still working fine ingame? If so, I'll just merge it :) |
|
Game works but I only ran synthetic tests since my device is Int32LSB only. It also part of my fork so this code wont cause trouble for regular users on standard rates. I made a test for forced Int32 - float64 - Int24 - Int32 path and theres zero errors/xruns. Up my other pr sleeve is: I need real hardware to see formats support work on real hw cleanly. |
|
Yeah, every interface I have also only works with Int32LSB, so we just have to rely on user reports if other formats are an issue :( Anyway, merged! Thank you 👍 |
Below is autogenerated summary I distilled from my upstream, theres part of my next pr about calibration.
Summary
Fix five small correctness issues in the existing ASIO/WASAPI adapter code:
asioMessageresult that was already computed and logged;ASIOSTInt24LSBsamples in little-endian byte order during software volume processing;ASIOSTFloat32LSBvolume;AUDCLNT_E_INVALID_SIZEwhile preserving the documented zero-frame discard case.Failure modes
AsioCalback_asioMessagepreviously loggedretbut returned0, so selectors such askAsioEngineVersionnever received the advertised result.The Int24 volume path treated the third (most-significant) byte as the low byte. Negative values were not sign-extended from bit 23, and the result was written back in a different byte order.
The Int32-to-Float64 matrix selected
AudioCopyConvertI2F<5, double>even though each input sample is four bytes. That advances through the source with the wrong sample width and can read beyond the final sample.The Float32 volume path completed its work but fell through and returned
false.IAudioCaptureClient::ReleaseBufferaccepted arbitrary partial frame counts. For this fixed-size packet implementation, only zero or the complete acquired packet size is valid.