output/alsa: use a new I/O thread with real-time scheduling

The normal I/O event thread can have a large latency, e.g. when
libgnutls loads all TLS CA certificates for a https connect.  This
makes it unreliable for the ALSA I/O notifications, and causes ring
buffer xruns.  To avoid interfering with high latency events such as
CURL's, we move the ALSA I/O events to a separate I/O thread which
also obtains real-time scheduling (if possible).

Closes #221
This commit is contained in:
Max Kellermann
2018-02-16 22:38:55 +01:00
parent 61f2ce67dd
commit d29d186d62
5 changed files with 33 additions and 5 deletions

View File

@@ -40,7 +40,8 @@
#include <exception>
Instance::Instance()
:idle_monitor(event_loop, BIND_THIS_METHOD(OnIdle))
:rtio_thread(true),
idle_monitor(event_loop, BIND_THIS_METHOD(OnIdle))
{
}