From e0ab5e6b815ab7a063321ce333540bac57dd5823 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 11 Jul 2019 19:08:49 +0300 Subject: radio: gstreamer: use pwaudiosink instead of alsasink This native pipewire sink has better performance and allows 1) properly selecting the role of the app 2) proper handling of the situation where another app with higher priority has taken over the audio stream Bug-AGL: SPEC-2634 Signed-off-by: George Kiagiadakis Change-Id: I9d0ea9ff475817c0944dd7c2b6d153f149abc957 --- binding/radio_output_gstreamer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binding/radio_output_gstreamer.c b/binding/radio_output_gstreamer.c index f492bb5..6b938fd 100644 --- a/binding/radio_output_gstreamer.c +++ b/binding/radio_output_gstreamer.c @@ -61,7 +61,7 @@ int radio_output_open() queue = gst_element_factory_make("queue", "queue"); convert = gst_element_factory_make("audioconvert", "convert"); resample = gst_element_factory_make("audioresample", "resample"); - sink = gst_element_factory_make("alsasink", "sink"); + sink = gst_element_factory_make("pwaudiosink", "sink"); if(!(pipeline && appsrc && queue && convert && resample && sink)) { fprintf(stderr, "pipeline element construction failed!\n"); } @@ -73,6 +73,7 @@ int radio_output_open() "layout", G_TYPE_STRING, "interleaved", "channel-mask", G_TYPE_UINT64, 3, NULL), NULL); + gst_util_set_object_arg(sink, "stream-properties", "p,media.role=Multimedia"); if((p = getenv("RADIO_OUTPUT"))) { fprintf(stderr, "Using output device %s\n", p); -- cgit 1.2.3-korg