feat: replace mutex with lock-free ring buffer for real-time audio recording
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
@@ -109,6 +109,12 @@ typedef struct {
|
||||
int current_batch_size; // NEW: current batch being recorded
|
||||
} undo;
|
||||
|
||||
// Ring buffers for real-time recording (written by JACK callback, read by dispatcher)
|
||||
// Lock-free: single producer (JACK callback), single consumer (dispatcher thread)
|
||||
float record_buffer[MAX_CHANNELS][MAX_BUFFER_SIZE];
|
||||
atomic_size_t record_write_pos[MAX_CHANNELS]; // Only written by JACK callback
|
||||
atomic_size_t record_read_pos[MAX_CHANNELS]; // Only written by dispatcher thread
|
||||
|
||||
// Carla host
|
||||
CarlaHost carla_host;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user