diff --git a/native_bridge/src/main.cpp b/native_bridge/src/main.cpp index 8ca87c6..85f0235 100644 --- a/native_bridge/src/main.cpp +++ b/native_bridge/src/main.cpp @@ -717,6 +717,10 @@ int main(int argc, char* argv[]) { } auto* shmIPC = (SharedAudioBufferIPC*)MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(SharedAudioBufferIPC)); if (!shmIPC) { CloseHandle(hMapFile); return 1; } + // VSTi crackle fix: 8-slot audio ring (see SharedMemoryIPC.h). Must be set + // on Windows too — ringMask stays 0 otherwise and the ring collapses to + // 1 slot (slot = writeIndex & 0), dropping whole blocks on any jank. + shmIPC->ringMask = 7; #else (void)shmName; // POSIX shm mapping (shm_open) added when porting off Windows auto* shmIPC = (SharedAudioBufferIPC*)std::calloc(1, sizeof(SharedAudioBufferIPC));