From a49e2ebbc56e8694a03a150e4210f4070203e43d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 16 May 2017 16:50:43 -0700 Subject: [PATCH] Add an env var to specify a default pulse device Some apps don't allow selecting an audio device, and due to problems with KDE, PulseAudio isn't allowed to move the stream after being created by default. --- Alc/backends/pulseaudio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 9e2d4f73..43761e23 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -764,6 +764,13 @@ static pa_stream *ALCpulsePlayback_connectStream(const char *device_name, pa_stream_state_t state; pa_stream *stream; + if(!device_name) + { + device_name = getenv("ALSOFT_PULSE_DEFAULT"); + if(device_name && !device_name[0]) + device_name = NULL; + } + stream = pa_stream_new_with_proplist(context, "Playback Stream", spec, chanmap, prop_filter); if(!stream) { -- 2.11.4.GIT