diff options
| author | dec05eba <dec05eba@protonmail.com> | 2025-12-07 13:44:11 +0100 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2025-12-07 13:44:11 +0100 |
| commit | 2064d109ee0f3f89923b7bd8d3b17fa78cf0962c (patch) | |
| tree | ee14541dbf7ef5e8aa0ce7289916172a4913d2ce | |
| parent | cedf3ae7d7d864321f060b505c0f4ba0b23e1e96 (diff) | |
Pipewire audio: set media role to production (hoping for lower latency)
| -rw-r--r-- | src/sound.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sound.cpp b/src/sound.cpp index d954609..8ff8def 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -206,10 +206,13 @@ static pa_handle* pa_sound_device_new(const char *server, p->output_length = buffer_size; p->output_index = 0; + pa_proplist *proplist = pa_proplist_new(); + pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "production"); + if (!(p->mainloop = pa_mainloop_new())) goto fail; - if (!(p->context = pa_context_new(pa_mainloop_get_api(p->mainloop), name))) + if (!(p->context = pa_context_new_with_proplist(pa_mainloop_get_api(p->mainloop), name, proplist))) goto fail; if (pa_context_connect(p->context, server, PA_CONTEXT_NOFLAGS, NULL) < 0) { @@ -239,12 +242,14 @@ static pa_handle* pa_sound_device_new(const char *server, if(pa) pa_operation_unref(pa); + pa_proplist_free(proplist); return p; fail: if (rerror) *rerror = error; pa_sound_device_free(p); + pa_proplist_free(proplist); return NULL; } |
