[idd] audio: poll LGMP streams at low latency

Move audio ingress and playback-credit recovery off the display timer.
Poll through a dedicated MMCSS worker at sub-millisecond intervals.

Wake capture retries immediately and drain queued client records during
release so backpressure cannot stall recording or shutdown.
This commit is contained in:
Geoffrey McRae
2026-09-02 03:38:27 +10:00
parent 3cd005ac74
commit 405233bfb9
3 changed files with 289 additions and 3 deletions

View File

@@ -26,6 +26,7 @@
#include <Windows.h>
#include <avrt.h>
#include <algorithm>
#include <memory>
#include <new>
@@ -1078,6 +1079,14 @@ private:
void Thread()
{
DWORD avTask = 0;
HANDLE avTaskHandle =
AvSetMmThreadCharacteristicsW(L"Pro Audio", &avTask);
if (avTaskHandle &&
!AvSetMmThreadPriority(avTaskHandle, AVRT_PRIORITY_HIGH))
DEBUG_WARN("Failed to raise audio broker MMCSS priority: %lu",
GetLastError());
while (!Stopping())
{
if (m_handle == INVALID_HANDLE_VALUE)
@@ -1131,6 +1140,8 @@ private:
CloseBroker(false);
}
FinishAbsentDeactivation();
if (avTaskHandle)
AvRevertMmThreadCharacteristics(avTaskHandle);
}
void CloseEvents()