-
Notifications
You must be signed in to change notification settings - Fork 560
Allow WASAPI exclusive mode to work in more devices #1084
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
Conversation
alc/backends/wasapi.cpp
Outdated
mDevice->handleDisconnect("Failed to retrieve buffer padding: {:#x}", | ||
as_unsigned(hr)); | ||
break; | ||
hr = audio.mClient->GetBufferSize(&written); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless this value can change, it was already stored in mOutBufferSize
, which is copied into the local variable buffer_len
. It doesn't need to be queried each time. Also, since written
is used to update mPadding
, which is used for latency calculations, I'm not sure leaving it as the buffer size is a good idea (unless that is the actual amount of padding WASAPI holds for exclusive streams, i.e. the amount of audio still left to play before the new samples to be mixed).
Confirmed this fixed audio on my onboard Realtek device, though other devices are still having issues. |
I ended up reworking stuff in the WASAPI backend, which created conflicts. But I may have also fixed some issues with exclusive mode. Are there still issues that need fixing? |
@kcat I'm still getting no audio on my Realtek card (which is probably what most PC users have) https://www.diffchecker.com/gR1s8cfX/ |
This should have been fixed in the rework. |
Can confirm 👌 |
Possibly the Realtek device can't go lower than 160 (~3.333ms), while the Creative card can go a bit lower. If initializing fails with |
Replied in the main thread #682 (comment) |
In all my devices exclusive mode wasn't working, and that is because
GetCurrentPadding
was always returning zero. This PR fixes in all my devices in my case, and there are no skipping or glitches.sample-type=int16
is still required for my devices, but I am going to resolve it later.