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:
@@ -604,7 +604,7 @@ try {
|
||||
command_init();
|
||||
|
||||
for (auto &partition : instance->partitions) {
|
||||
partition.outputs.Configure(instance->io_thread.GetEventLoop(),
|
||||
partition.outputs.Configure(instance->rtio_thread.GetEventLoop(),
|
||||
config.replay_gain,
|
||||
partition.pc);
|
||||
partition.UpdateEffectiveReplayGainMode();
|
||||
@@ -625,6 +625,7 @@ try {
|
||||
#endif
|
||||
|
||||
instance->io_thread.Start();
|
||||
instance->rtio_thread.Start();
|
||||
|
||||
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
||||
if (instance->neighbors != nullptr)
|
||||
@@ -736,6 +737,7 @@ try {
|
||||
archive_plugin_deinit_all();
|
||||
#endif
|
||||
config_global_finish();
|
||||
instance->rtio_thread.Stop();
|
||||
instance->io_thread.Stop();
|
||||
#ifndef ANDROID
|
||||
SignalHandlersFinish();
|
||||
|
Reference in New Issue
Block a user