diff --git a/README.md b/README.md index 582477b..a652c6c 100644 --- a/README.md +++ b/README.md @@ -245,8 +245,7 @@ view `coverage/index.html` in a browser. 0. implement CoreAudio (OSX) backend, get examples working 0. implement WASAPI (Windows) backend, get examples working 0. implement ASIO (Windows) backend, get examples working - 0. JACK: implement prebuffering - 0. why does pulseaudio microphone use up all the CPU? + 0. JACK: implement prebuffering ...or delete prebuffering as a concept 0. Avoid calling `soundio_panic` in PulseAudio. 0. Figure out a way to test prebuf. I suspect prebuf not working for ALSA which is why we have to pre-fill the ring buffer with silence for diff --git a/src/pulseaudio.cpp b/src/pulseaudio.cpp index 1503232..7dca8fb 100644 --- a/src/pulseaudio.cpp +++ b/src/pulseaudio.cpp @@ -460,7 +460,9 @@ static void flush_events(SoundIoPrivate *si) { static void wait_events(SoundIoPrivate *si) { SoundIoPulseAudio *sipa = &si->backend_data.pulseaudio; flush_events(si); + pa_threaded_mainloop_lock(sipa->main_loop); pa_threaded_mainloop_wait(sipa->main_loop); + pa_threaded_mainloop_unlock(sipa->main_loop); } static void wakeup(SoundIoPrivate *si) {