PulseAudio: fix using 100% CPU

soundio_wait_events wasn't blocking but now it is.
This commit is contained in:
Andrew Kelley 2015-07-29 13:12:04 -07:00
parent 0dee34a84e
commit d3cf8f02db
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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) {