G3: 1 clock - PDC latency that + playhead engine-derived
This commit is contained in:
@@ -236,6 +236,15 @@ int run_juce_fx_loop(const std::string& jobPath, const std::string& shmName,
|
||||
MemoryBarrier();
|
||||
ipc->h.outWrite++;
|
||||
++processed;
|
||||
// G3: báo processed samples (playhead engine-derived — app tính
|
||||
// position = (processed - anchor - latency)/sr) qua lat ring slot
|
||||
// đặc biệt 0xFFFFFFFE. Python _lat_drain tách riêng (không vào
|
||||
// latencies dict). Ring 8 slot, Python drain mỗi ~2ms — an toàn.
|
||||
const uint32_t pls = ipc->h.latWrite & (FXRT_LAT_SLOTS - 1);
|
||||
ipc->lat[pls].slot = 0xFFFFFFFEu;
|
||||
ipc->lat[pls].samples = (uint32_t)(processed * n);
|
||||
MemoryBarrier();
|
||||
ipc->h.latWrite++;
|
||||
}
|
||||
const auto perfIterT1 = std::chrono::steady_clock::now();
|
||||
const double perfLoopMs = std::chrono::duration<double, std::milli>(perfIterT1 - perfT0).count();
|
||||
|
||||
Reference in New Issue
Block a user