Skip to content

Commit

Permalink
ao_pipewire: use realtime scheduling for data thread
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
t-8ch authored and philipl committed Mar 5, 2023
1 parent 291e05e commit c0ca5f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion audio/out/ao_pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ static int pipewire_init_boilerplate(struct ao *ao)
if (pw_thread_loop_start(p->loop) < 0)
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)
goto error;

Expand Down

0 comments on commit c0ca5f1

Please sign in to comment.