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

WASAPI-specific PortAudio API extension header discussion #11

Open
DJKero opened this issue Apr 15, 2021 · 4 comments
Open

WASAPI-specific PortAudio API extension header discussion #11

DJKero opened this issue Apr 15, 2021 · 4 comments

Comments

@DJKero
Copy link
Collaborator Author

DJKero commented Apr 15, 2021

I'm not sure, but it seems that the flag paWinWasapiThreadPriority allows you to set a custom threadPriority to the scheduler?

If so, here's the reference:
https://docs.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities

@DJKero
Copy link
Collaborator Author

DJKero commented Apr 15, 2021

Seems to me that the lowest latency config would be:

flags:
paWinWasapiExclusive
paWinWasapiRedirectHostProcessor
paWinWasapiThreadPriority

threadPriority:
something high that works, if it's the same as windows scheduler 24~26 or 31

streamOption:
eStreamOptionRaw / eStreamOptionMatchFormat

@sebastian-heinz
Copy link
Owner

sebastian-heinz commented Apr 21, 2021

Added a flag to request for exclusive mode to a device:

virtual void set_exclusive_mode(bool p_exclusive_mode, Error &error) = 0;

Added code for setting exclusive mode flags for WASAPI:

if (pa_api_info->type == paWASAPI) {

still need to implement for other drivers that are available in PA, that support some sort of performance setting for pro audio.

also need to validate if this code works, and perhaps adjust the parameter if required

note: it need to be set before starting the device

@sebastian-heinz
Copy link
Owner

wasapi is now implemented as a driver : #23
It will provide you a list of supported configurations for each device, by calling getProperties on a device.
https://github.com/sebastian-heinz/lowl_audio/blob/master/demo/main.cpp#L149

The same functionality is also intended for PortAudio, so instead of trying to find a working configuration, different sample rates will be probed and then exposed to the user, so it should be as easy as selecting a configuration that has exclusive mode available.

I will still keep it open for now as testing with port audio is not yet completed for this feature

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

No branches or pull requests

2 participants