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 Exclusive Mode shows worse performance #105

Closed
XBagon opened this issue Jan 3, 2021 · 8 comments
Closed

WASAPI Exclusive Mode shows worse performance #105

XBagon opened this issue Jan 3, 2021 · 8 comments

Comments

@XBagon
Copy link

XBagon commented Jan 3, 2021

I tried this ASIO driver for the first time today in combination with Ableton. I'm using version 1.7.

WASAPI with default settings worked and I noticed that buffer sizes between 32 and 256 had little differences, all produces tiny crackles here and there and it's still happening with bigger sizes, but then the latency is noticeable.

Output Latency is now at ~25ms and I wanted to reduce it further and I guess that's what exclusive mode is for. So I tried wasapiExclusiveMode = true which resulted in FlexASIO not initialising, the log said something about sample rate and I came up with

wasapiExclusiveMode = true
wasapiExplicitSampleFormat = false
sampleType = "Int24"

to fix that, both devices are set to 44,100 24bit in Windows sound settings, so that should be fine.

But now the noise got a lot worse and the overall latency even increased by 2ms. I'm not quite sure what I'm doing wrong here.

I also tried to make the Windows WDM-KS backend work, but couldn't bring it to initialize at all, due to further format errors, which I (obviously) couldn't fix with the WASAPI specific settings above.

So I guess in the end the format which Windows is showing me for the devices has to be wrong?

Thank you for this project and possible help!

@dechamps
Copy link
Owner

dechamps commented Jan 3, 2021

WASAPI with default settings worked and I noticed that buffer sizes between 32 and 256 had little differences, all produces tiny crackles here and there and it's still happening with bigger sizes, but then the latency is noticeable.

Did you try to follow the latency FAQ? In particular, did you try experimenting with suggestedLatencySeconds?

Sadly, it is always difficult to troubleshoot glitching problems with small buffer sizes, because the list of possible causes is endless and can vary a lot depending on host application, system, drivers, etc. I can only provide limited help I'm afraid.

Another thing you might want to try is to go back to the previous FlexASIO release (1.6). FlexASIO 1.7 contains very new WASAPI buffer management code that has not yet seen much testing. It's supposed to be an improvement, but you never know, maybe it also introduces unknown regressions in some cases.

Output Latency is now at ~25ms and I wanted to reduce it further and I guess that's what exclusive mode is for. So I tried wasapiExclusiveMode = true which resulted in FlexASIO not initialising

That's not normal. Can you provide a log where FlexASIO fails to initialize with just wasapiExclusiveMode = true?

the log said something about sample rate and I came up with

wasapiExclusiveMode = true
wasapiExplicitSampleFormat = false
sampleType = "Int24"

to fix that, both devices are set to 44,100 24bit in Windows sound settings, so that should be fine.

Again this is not normal - you shouldn't have to set wasapiExplicitSampleFormat = false if your hardware is natively capable of 24-bit operation. Nor should you have to set sampleType explicitly.

I also tried to make the Windows WDM-KS backend work, but couldn't bring it to initialize at all, due to further format errors, which I (obviously) couldn't fix with the WASAPI specific settings above.

Can you provide a log of those errors?

Also, I note that you're using Ableton. Ableton is known to initialize ASIO drivers in parallel which can lead to weird, hard-to-reproduce initialization failures because of multiple ASIO drivers racing against each other. See #86. If you're facing such issues I would recommend uninstalling or disabling other ASIO drivers when using Ableton.

@dechamps
Copy link
Owner

dechamps commented Jan 3, 2021

Oh and one more thing:

But now the noise got a lot worse and the overall latency even increased by 2ms. I'm not quite sure what I'm doing wrong here.

You might want to read the glitches FAQ as well. In particular, do make sure that you disable logging when testing for glitches, as logging itself slows down FlexASIO and can cause it to fall behind with small buffer sizes.

@XBagon
Copy link
Author

XBagon commented Jan 4, 2021

Thanks for the thoroughly answer.

did you try experimenting with suggestedLatencySeconds?

Yes I did, and I don't think it changes anything besides the displayed latency.

go back to the previous FlexASIO release (1.6)

Just did that, other than not having to specify wasapiExplicitSampleFormat=false, etc., it gave me the same result, very noisy in exclusive mode and Windows WDM-KS couldn't start.

Can you provide a log where FlexASIO fails to initialize with just wasapiExclusiveMode = true?

FlexASIO.log with wasapiExclusiveMode = true.

Can you provide a log of those errors?

Windows WDM-KS with devices probably already in use: FlexASIO.log
I managed to initialise with other devices, but couldn't switch over afterwards, then it just crashed again.

I would recommend uninstalling or disabling other ASIO drivers when using Ableton.

Great tip, thank you, I uninstalled all other ASIO things and tried again, sadly I couldn't find any differences.

@XBagon
Copy link
Author

XBagon commented Jan 4, 2021

You might want to read the glitches FAQ as well. In particular, do make sure that you disable logging

Went through that, and logging was disabled when testing, couldn't improve it sadly..
I'm kinda afraid, it could be a problem with WASAPI and how it handles my interface. I tried a few things and it seems, that playing music on the interface over DirectSound works perfectly fine, while the same song over WASAPI is very noisy. The weirdest thing is, I had no problem a few months ago, maybe Windows updates broke something, well.
I guess even if that's the case, it shouldn't explain the other weird behaviour I'm witnessing, so I hope this is still relevant.

@dechamps
Copy link
Owner

dechamps commented Jan 4, 2021

Can you provide a log where FlexASIO fails to initialize with just wasapiExclusiveMode = true?

FlexASIO.log with wasapiExclusiveMode = true.

Okay, that clearly looks like a bug in FlexASIO. Filed #106 to track this specific problem. Just use sampleType to work around it in the mean time, no need to set wasapiExplicitSampleFormat = false.

Can you provide a log of those errors?

Windows WDM-KS with devices probably already in use: FlexASIO.log

This is a known issue with WDM-KS. In general, WDM-KS will fail to initialize if you point it to your Windows default audio devices, because that makes it likely they are already in use by another application (even implicitly). To work around this problem, change your default Windows audio devices to something else.

As for the glitches you're experiencing with WASAPI Exclusive and small buffer sizes, there's not much else I can do I'm afraid. This kind of issue is notoriously difficult to troubleshoot.

@XBagon
Copy link
Author

XBagon commented Jan 4, 2021

Okay, that clearly looks like a bug in FlexASIO.

Glad I could find something of use. 😄

To work around this problem, change your default Windows audio devices to something else.

I'm pretty sure I tried just that. But I will try again.

This kind of issue is notoriously difficult to troubleshoot.

I totally understand, thank you for your time! I shall continue trying things until hopefully it works some day.

@dechamps
Copy link
Owner

@XBagon: going back to your original issue, it seems like one of the problems you encountered is glitching with WASAPI Exclusive using 24-bit samples specifically. FlexASIO 1.8 includes PortAudio/portaudio#508 which seems related so you might want to give it a try.

@dechamps
Copy link
Owner

dechamps commented May 3, 2022

Closing due to inactivity. Feel free to comment if you have more to share.

@dechamps dechamps closed this as completed May 3, 2022
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