perf: low-latency streaming pipeline, swapchain mailbox presentation, and macOS QoS #817
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
stale
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-streetpea/chiaki-ng!817
Loading…
Reference in a new issue
No description provided.
Delete branch "whitestorm007/perf/low-latency-optimizations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary of Changes
This PR introduces latency, throughput, and thread scheduling optimizations across the networking, decoding, and rendering pipeline:
Networking (
lib/src/takion.c):a_rwnd. This absorbs microbursts and prevents UDP packet drops during high-bitrate frame bursts (e.g., 30–50 Mbps local PS5 HDR streams).SO_NET_SERVICE_TYPEwithNET_SERVICE_TYPE_RVon Darwin platforms. This informs the macOS kernel to map Remote Play UDP packets to Layer 2 802.11e WMM Video Access Category (AC_VI) and DSCP priority (CS4/AF41), minimizing latency and queueing over Wi-Fi.Video Decoding (
lib/src/ffmpegdecoder.c):AV_CODEC_FLAG_LOW_DELAYandAV_CODEC_FLAG2_FASTtoAVCodecContextprior toavcodec_open2().Vulkan Swapchain Presentation (
gui/src/qmlmainwindow.cpp):VK_PRESENT_MODE_MAILBOX_KHRfor VSync presentation, with an automatic fallback toVK_PRESENT_MODE_FIFO_KHRif mailbox mode is unsupported by the surface.// Prefer MAILBOX for vsync (lower) latency when supported). This eliminates VSync blocking stalls on high-refresh displays (such as 120Hz ProMotion / VRR panels).Thread Scheduling Priorities (
gui/src/qmlbackend.cpp,gui/src/qmlmainwindow.cpp,gui/src/streamsession.cpp):frame_threadandrender_threadtoQThread::TimeCriticalPriorityandaudio_out_drain_threadtoQThread::HighPriority.Verification & Testing
chiaki-unit(117 of 117 tests passing, 0 failures, 0 skipped).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.