Repository navigation
perf(amf): minimize native output latency - #461
Conversation
Preserve explicit quality choices while aligning backend, settings UI, documentation and translated defaults. Copy fresh cursor frames directly to the shared encoder image before saving the cursor-free desktop cache. Release WGC capture ownership before diagnostics, move encoder border setup outside the capture mutex, and reject abandoned or failed GPU handoffs. Add behavioral ordering and default-consistency regression tests.
|
ported this to 1.19.0-beta.3 codebase, (testbuild, more infos) |
|
@000MDK runs stable for me. Under 4 - 5 ms. Couldnt find any further optimization potential or regression so from here on I would consider this running stable. I also build it against the latest 20 beta release and it runs fine. |
|
Planning to accept this later this week when my weekly usage limit reset and or double checking with GPT-6-Sol (rumored this week) which apparently will be more intelligent than Astra.... which is just insanity at this point. Note it is in the plans to rewrite everything from scratch, the future streaming host will be named Amaterasu; however Vibeshine and Vibepollo will be maintained and developed until that project reaches 1:1 feature parity, which then both Vibeshine and Vibepollo will upgrade to Amaterasu |
|
@RamazanKara Tested this beta build on an RX 6600. It feels noticeably smoother with lower latency, and the FPS looks as smooth as on the real display. No issues so far. Thanks! |
|
here is a 2.0.0-beta.3 testbuild with this PR integrated (also comes with the pre-RDNA fallback for Polaris-cards) Can confirm, works great! |
I tried this version and it's not smooth as the 1.19.0-beta.3 version, I tried lots of settings and without success, I reverted back to 1.19.0-beta.3, it's perfect here. |
Windows 11 can give windowless processes EcoQoS scheduling and ignore their timer-resolution requests. Both apply to the host while streaming and to the WGC helper. Request full QoS and honored timer resolution for the host during a stream, restoring system control when streaming stops, and for the helper for its lifetime. Windows 10 falls back to the execution-speed policy alone.
When the realtime GPU scheduling class is granted, request the same absolute GPU thread priority the encoder device already uses, so the capture copy that conversion waits on does not queue behind game work. The NVIDIA+HAGS high-class downgrade keeps relative priority 7.
|
Update, 28 Sep: two small follow-ups on this branch, plus a separate PR for the 2.0 line. New commits here
Separate PR for 2.0 ( The once-per-second WGC display re-validation added in 2.0 runs on the capture thread right before the pacing sleep. #528 moves it to a background thread. It is not AMF-specific, and master doesn't have that check, so I kept it out of this PR. It is the most likely 2.0-specific cause of the smoothness difference compared with 1.19 that was reported here, but that is not confirmed yet. Test build 2.0.0-beta.3, this PR, both follow-ups and #528: https://github.com/RamazanKara/Vibepollo/releases/tag/native-amf-beta3-amf2-20260928 (unsigned prerelease; to keep an existing controller driver, use @WiiMoritz, if you can, please compare this build against 1.19.0-beta.3 for smoothness. It would help to know your capture method (WGC or DDX) and whether any hitch recurs about once per second. No new latency number is claimed for these changes yet; a stream measurement is still pending. |
|
Follow-up, 29 Sep: I traced and fixed the remaining host latency spikes. Both fixes are in the WGC capture path, not native AMF, so they're in a separate PR against
Test build with this PR, #528 and #530: https://github.com/RamazanKara/Vibepollo/releases/tag/native-amf-beta3-amf4-20260929 |
I tested this and it's perfect! Played for about 7 hours, not a single issue! |
|
I have concerns about the capture GPU priority change to absolute priority 30. This is hard realtime and does not yield to lower-priority GPU work, so it could cause FPS drops or worse frame times in games when the GPU is heavily loaded, without offering much benefit to capture if capture is already keeping up. I don't currently observe capture starvation, and there isn't a measured benefit for this change yet. Please revert the capture GPU priority change and retain the existing relative +7 behavior. The other changes look fine to me. |
Absolute GPU thread priority 30 is hard realtime and does not yield to lower-priority work, so with the GPU fully loaded it could cost the game frame rate or frame-time consistency, and no capture starvation has been measured that it would fix. The capture device goes back to relative priority 7 in every scheduling class. This reverts commit 0d3cb24. Signed-off-by: Ramazan Kara <github@r-kara.de>
…ency-fast-path Conflicts were additive: master's HEVC GDR GOP setup now runs before the split-frame hint, the WGC snapshot computes master's composition timestamp after the early keyed-mutex release, and both sides' includes and parity tests are kept. Signed-off-by: Ramazan Kara <github@r-kara.de>
|
Reverted the capture GPU priority change: the capture device is back to relative priority 7 in every scheduling class (636a321). I also merged current master to clear the conflicts. They were additive; master's HEVC GDR GOP setup now runs before the split-frame hint. Builds with The Arch Linux job failed in "Initialize containers" before any build step ran, so that one looks like a runner issue and may just need a re-run. |
…tialization rollback
…loss from rollback
…ailing policy cases

Native AMF can delay an already-ready packet behind another capture/conversion iteration and allow application backlog to grow. This PR reduces those delays and makes native AMD the preferred automatic implementation on Windows, with one compatible FFmpeg AMF rollback after an encoder-attributable initialization failure.
Accepted AMD changes
speedacross backend, both settings UIs, documentation, and translated defaults. Preserve explicit quality settings. This can trade compression efficiency for latency at a fixed bitrate.amd_av1_tiles = 1/2/4; default0preserves negotiated/preset behavior.Default and initialization rollback
Automatic selection prefers
amdvce_experimental(the historical native adapter name);amdvce_ffmpegremains the explicit legacy implementation. Existingamdvce/amdvce_legacyaliases and explicit implementation choices remain strict.For an automatic native stream, only a confirmed AMF library/component creation or encoder initialization failure can trigger rollback, after the native worker has destroyed its resources and released the runtime fence. The legacy adapter uses the same negotiated codec, depth, chroma, HDR colorspace, and resolved metadata; its capabilities are probed separately. Explicit native-only options, intra refresh, and unverified decoder reference limits block incompatible rollback. Unsupported requested formats/settings, D3D/capture/conversion errors, cancellation, fence contention, network failures, and unsafe watchdog timeouts do not trigger rollback. A failed rollback ends that stream. The stream keeps its successful legacy choice through reinitialization; later streams retry native. Existing safety quarantine for an abandoned vendor call remains intact.
Excluded from the final diff
WGC bookkeeping/mutex changes, DXGI cursor-copy/handoff changes, capture GPU priority/policy changes, host/helper power-throttling changes, and the driver-version packaging change. Current master installer/signing policy is preserved. The author had already reverted absolute capture GPU priority; the remaining excluded behavior is removed before merge.
Validation and measurement limit
All 39 local native AMF lifecycle/output/configuration/rollback cases pass with
-Wall -Wextra -Werror, AddressSanitizer, and UndefinedBehaviorSanitizer. All 23 settings parity tests pass. New regression cases cover native success, encoder create/init failure, explicit native/legacy selection, incompatible and unsupported requirements, unrelated failures, terminal rollback failure, cleanup, and next-stream native retry. Additional regression checks protect producer-side cleanup after late/cancelled ready handoffs, and retain the latest converted image for static/IDR repeats when ready output skips its submission. Both regression checks fail with the earlier behavior and pass with the fixes.Exact head
3f44775209efb3f5918d74401ee8296c1cdbb67cpassed PR CI, hosted Windows build/full tests, and hosted Linux validation (168 CTest checks). No live host install, driver change, or manual release publication is part of this PR. AMD hardware stream measurements cannot be run on the review Mac; no measured latency improvement or multi-engine execution is claimed for this revision. Original AMD work and commit attribution by Ramazan Kara are retained.