ao_pipewire: use realtime scheduling for data thread

By making the data thread realtime it is able to serve requests faster
and more reliable reducing crackling in certain situations.

As the mpv callbacks that are running on the data thread are all
non-blocking and very short this should be safe.

The same mechanism is also used by pw-cat and the alsa plugin shipped by
pipewire.
This commit is contained in:
Thomas Weißschuh 2023-02-19 01:09:43 +00:00 committed by Philip Langdale
parent 291e05ec1a
commit c0ca5f1a37
1 changed files with 4 additions and 1 deletions

View File

@ -487,7 +487,10 @@ static int pipewire_init_boilerplate(struct ao *ao)
if (pw_thread_loop_start(p->loop) < 0) if (pw_thread_loop_start(p->loop) < 0)
goto error; goto error;
context = pw_context_new(pw_thread_loop_get_loop(p->loop), NULL, 0); context = pw_context_new(
pw_thread_loop_get_loop(p->loop),
pw_properties_new(PW_KEY_CONFIG_NAME, "client-rt.conf", NULL),
0);
if (!context) if (!context)
goto error; goto error;