Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: sample playback — remove double-lock that silenced all samples

The audio callback locked the mutex at the top of the buffer loop,
then tried trylock again for sample mixing. Non-recursive mutex
trylock always fails when already held → samples never mixed.

Removed the redundant trylock since the outer lock already protects
sample_buf access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+2 -4
+2 -4
fedac/native/src/audio.c
··· 292 292 mix_r /= mix_divisor; 293 293 294 294 // Mix sample voices (pitch-shifted playback) 295 - // trylock: skip sample mixing if load_data holds the lock (prevents SIGSEGV) 296 - int sample_locked = (pthread_mutex_trylock(&audio->lock) == 0); 297 - if (sample_locked) 295 + // Lock already held from line 246 — safe to read sample_buf 298 296 for (int v = 0; v < AUDIO_MAX_SAMPLE_VOICES; v++) { 299 297 SampleVoice *sv = &audio->sample_voices[v]; 300 298 if (!sv->active) continue; ··· 368 366 } 369 367 } 370 368 } 371 - if (sample_locked) pthread_mutex_unlock(&audio->lock); 369 + // (lock released at end of buffer loop) 372 370 373 371 // Smooth room_mix toward target (~10ms at 192kHz) 374 372 if (audio->room_mix != audio->target_room_mix) {