mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-11-13 07:17:28 +00:00
[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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user