mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-11-05 00:27:30 +00:00
[GH-ISSUE #2859] RVC VST: persistent latency after GPU overload; recovery patch available #2059
Labels
No labels
AMD/Intel
bug
bug
bug
colab
dependencies
documentation
duplicate
enhancement
following up
good first issue
help wanted
invalid
question
stale
stale
stale
todo list
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#2059
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @AutoGavy on GitHub (Sep 21, 2026).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/2859
Problem
When GPU contention temporarily makes the RVC worker slower than real time, the VST bridge can retain old audio in both its input and output queues. After the GPU recovers, the worker catches up and fills the output queue, but the host can only drain that queue in real time. In practice this can leave the plugin replaying speech with roughly nine seconds of persistent delay until Cantabile/the plugin is restarted, even though GPU utilization has already returned to normal.
The current inference-time display does not expose this queueing age, so inference can appear healthy while old audio is still being replayed.
Root cause
The delay is not only the duration of one slow inference call. Old samples remain in the C++ input/output queues. Processing the backlog does not eliminate its age: it moves stale audio into the output queue, where it is consumed at real-time speed. Without an expiry policy and a discontinuity reset, the plugin can remain permanently behind live input.
Proposed patch
A complete patch is available here:
AutoGavy:codex/vst-overload-recovery9e18532a9c0b286da154276cf1db6dfde3113f40The repository currently has Pull Requests disabled, so I am opening this issue with the full implementation details.
1. Bounded cumulative audio age and overload recovery
MAX ACCEPTABLE LATENCY, default 300 ms, range 100-2000 ms.age, and discarded block-equivalents (drop) separately.ageis sampled at the output callback and excludes sound-card, host, OBS/broadcast, and other external buffering.Under sustained overload this policy can produce gaps/silence, but it prevents expired speech from accumulating and being replayed indefinitely.
2. Reset inference history after a discontinuity
worker/rvc_worker.pymust be distributed together.3. Dedicated worker GPU scheduling priority
GPU PRIORITY, enabled by default.HIGHusingD3DKMTSetProcessSchedulingPriorityClassfor the exact dedicated RVC worker process handle, then verify it usingD3DKMTGetProcessSchedulingPriorityClass.python.exeprocesses, requestREALTIME, elevate privileges, reserve GPU/VRAM, or guarantee preemption over games.4. UI controls and clearer toggle state
GPU PRIORITYswitch,MAX ACCEPTABLE LATENCYslider, overload guidance, and status text; enlarge the editor to accommodate them.ENGINEandGPU PRIORITYto red (RGB 190, 42, 48) with light text.5. Persist realtime tuning parameters
Before 0.1.4,
%LOCALAPPDATA%\RVCRealtime\settings.inipersisted paths only. The patch stores UI edits for all 13 tuning controls in[Parameters]:Persistence behavior:
ENGINEhost-controlled rather than making it a global default; fresh instances remain off.Compatibility
GPU PRIORITYandMAX ACCEPTABLE LATENCYare appended as IDs 12 and 13.[Paths]settings remain supported.Tests and validation
ring-recovery: passed.python-reset: passed.bridge-recovery: passed.git diff --check: passed.Automated coverage includes timestamp/ring wrap behavior, partial discards, cumulative age across stages, live budget changes, retaining more than three blocks inside budget, a simulated nine-second backlog, concurrent SPSC producer/consumer activity, stale IPC responses, restart recovery, and in-place Python reset ordering/buffer identity.
Live validation with an actual model, audio device/host, and sustained game GPU contention is still required.
@dagimmenberu-hub commented on GitHub (Oct 22, 2026):
ሚሚ