From f85b6f3596aa8482b22fd9fc8bb93f28b49e4cee Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 17 Jan 2020 21:11:30 -0800 Subject: [PATCH] Use the default monitor rather than the default source --- assets/sunshine.conf | 2 +- sunshine/platform/linux.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/sunshine.conf b/assets/sunshine.conf index 15237110..c4d2134e 100644 --- a/assets/sunshine.conf +++ b/assets/sunshine.conf @@ -58,7 +58,7 @@ fec_percentage = 10 # back_button_timeout = 2000 # The name of the audio sink used for Audio Loopback -# If you do not specify this variable, pulseaudio will select a default device, which could be a microphone instead of a speaker +# If you do not specify this variable, pulseaudio will select the default monitor device. # # You can find the name of the audio sink using the following command: # pacmd list-sources | grep "name:" diff --git a/sunshine/platform/linux.cpp b/sunshine/platform/linux.cpp index 5630d20b..58528f0f 100644 --- a/sunshine/platform/linux.cpp +++ b/sunshine/platform/linux.cpp @@ -336,6 +336,9 @@ std::unique_ptr microphone(std::uint32_t sample_rate) { if(!config::audio.sink.empty()) { audio_sink = config::audio.sink.c_str(); } + else { + audio_sink = "@DEFAULT_MONITOR@"; + } mic->mic.reset( pa_simple_new(nullptr, "sunshine", pa_stream_direction_t::PA_STREAM_RECORD, audio_sink, "sunshine_record", &mic->ss, nullptr, nullptr, &status)