-
Notifications
You must be signed in to change notification settings - Fork 19
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
Windows ASIO output and frameSize conflicts #18
Comments
Looking at the source RtAudio docs for
I wonder if for ASIO this gets interpreted as the control panel forced value. I tried passing 0 for |
I think the problem starts here, the Line 230 in 856fdba
So there needs to be a way to poll the stream instance for "The actual value used by the device". |
Fixed in v1.7.1. Please re-open if you're still encountering issues. |
ASIO is a strange bird and I've been running into an issue where many devices have control panels in which the user can specify buffer size settings. These settings seem to override any attempt to specify
frameSize
in RtAudio'sopenStream()
. The problem is if aframeSize
is specified inopenStream()
that is not exactly equal to whatever the user selected in their control panel, then calls towrite()
fail silently. TheframeOutputCallback
is never called following thewrite()
, no error is fired, andisStreamOpen
andisStreamRunning
both returntrue
. So the RtAudio instance is in this weird state where buffers keep piling up in the queue with every call towrite()
but are never played. There's no way that I can see to detect the user-set buffer size and pick the right magic number forframeSize
when instantiating an RtAudio stream. Is there a way to havegetDevices()
return the device's current preset buffer size? Or perhaps some flag that forces overriding the control panel setting?Here are 2 examples of the sort of ASIO device control panels I'm referring to:
You can see that in the MOTU device panel both sample rate and buffer size are configurable, but interestingly the
sampleRate
specified inopenStream()
does override the panel setting (I can see the change reflected in the panel as soon as I open the RtAudio stream).I guess an ugly workaround would be to brute force it by continuously opening streams and checking if the
frameOutputCallback
was called, and if not, open a new stream and try again with a different power of 2 value until arriving at the magic number that works, but it would be nice to have a more elegant solution.The text was updated successfully, but these errors were encountered: