mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 01:33:23 -10:00
Both drivers front the device with a single-producer ring their own callback drains - PipeWire's process callback, CoreAudio's render callback - so both now lend the span at that ring's head, to its wrap in whole frames, through write_begin/write_end, and the threaded pipeline produces its output there instead of copying it in. The PipeWire lend takes no thread-loop lock, which write() holds only for its wait. A stream that is not streaming, a paused unit, and a frame that would straddle the wrap keep write(). pipewire_write checks the lend against the ring across its wrap, lock-free, and its refusals. coreaudio_write lends whole streams through the shipping writer and render callback and plays them back in order across the wrap; the samples/audio workflow now runs it.