From 9fa2e07588eb91b72ee4e6abdb30458673c88498 Mon Sep 17 00:00:00 2001 From: zwostein Date: Mon, 1 Jul 2019 22:03:02 +0200 Subject: [PATCH] Explicitly set a channel map when initialising the Pulseaudio stream. --- drivers/pulseaudio/audio_driver_pulseaudio.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index aec3d27d692..a61fa449f11 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -191,6 +191,14 @@ Error AudioDriverPulseAudio::init_device() { spec.format = PA_SAMPLE_S16LE; spec.channels = pa_map.channels; spec.rate = mix_rate; + pa_map.map[0] = PA_CHANNEL_POSITION_FRONT_LEFT; + pa_map.map[1] = PA_CHANNEL_POSITION_FRONT_RIGHT; + pa_map.map[2] = PA_CHANNEL_POSITION_FRONT_CENTER; + pa_map.map[3] = PA_CHANNEL_POSITION_LFE; + pa_map.map[4] = PA_CHANNEL_POSITION_REAR_LEFT; + pa_map.map[5] = PA_CHANNEL_POSITION_REAR_RIGHT; + pa_map.map[6] = PA_CHANNEL_POSITION_SIDE_LEFT; + pa_map.map[7] = PA_CHANNEL_POSITION_SIDE_RIGHT; pa_str = pa_stream_new(pa_ctx, "Sound", &spec, &pa_map); if (pa_str == NULL) {