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

FlexASIO should not open the input or output stream direction if it's not used #24

Closed
dechamps opened this issue Nov 10, 2018 · 2 comments
Assignees

Comments

@dechamps
Copy link
Owner

Currently, if both input and output devices are available, but the ASIO Host Application only opens channels for one direction (i.e. input or output), FlexASIO will still open a full-duplex PortAudio stream. In other words, FlexASIO calls Pa_OpenStream() with both input and output devices even if the ASIO Host Application calls createBuffers() with a set of ASIOBufferInfos that are all input channels, or all output channels.

Ideally, FlexASIO should not open a device that it's not going to use, because that increases the likelihood of clock mismatch issues.

As part of #22 I will introduce a way to disable one side of the stream. This helps, but ideally FlexASIO should just figure this out on its own.

@dechamps
Copy link
Owner Author

Note that this enhancement, on its own, will not help with audio format negotiation, because FlexASIO will still attempt to open a stream in canSampleRate(), but at this point FlexASIO doesn't know which direction will be used yet. This probably means FlexASIO should stop trying to open a stream in canSampleRate() and instead should act as if any sample rate is supported; this would probably result in a net improvement to user experience, especially when using WASAPI Shared (see #23).

@dechamps
Copy link
Owner Author

Actually, I just thought of an even better way to solve the above problem: in canSampleRate(), try to open two streams: an input-only stream and an output-only stream. Return false only if both streams fail to open. This will still allow canSampleRate() to return mostly accurate information, in the sense that it will still accept a sample rate if there is any way to make it work.

@dechamps dechamps self-assigned this Nov 16, 2018
dechamps added a commit that referenced this issue Nov 18, 2018
This avoids unnecessarily restricting what the application can do
if it only ends up using input channels, or only output channels.

See #24.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant