0

I am trying to get both of my monitors to play audio out of their speakers. They are connected over HDMI.

enter image description here

I can make them play audio one at a time. But how do I get them both to play audio at the same time?

3 Answers3

2

The other posted solution(s) work however you're going to encounter some issues with stereo sound, as your output speakers are now (L R)(L R). What you're going to want to do is remap the 'left' audio channel to the left channel speaker on your left monitor, then the 'right' audio channel to the right channel speaker on your right monitor. This way you'll have output speakers like this (L x)(x R).

Find the correct device ids:

aplay -l

Add the new configuration to the top of "/etc/pulse/default.pa":

load-module module-alsa-sink device="hw:1,8" sink_name=hdmi_left channel_map=front-left,lfe
load-module module-alsa-sink device="hw:1,10" sink_name=hdmi_right channel_map=lfe,front-right
load-module module-combine-sink sink_name=combined slaves=hdmi_left,hdmi_right
set-default-sink combined

I'm using 'lfe' to disable the middle two speakers. You can remap each audio channel to come out on both speakers on their respective monitors i.e. (L L)(R R), but at least on my setup that sounds terrible.

dabriel
  • 21
  • 2
    Welcome to Ask Ubuntu. Please edit your answer and indicate what you mean my the "above solution". The answers in this site can be sorted differently. I have it set to show the most recently active answer at the top. So there are no solutions above yours. Please use the name of the author of the solution you are referring to. – user68186 Jan 28 '21 at 21:10
0

This is not software problem, and I'm afraid it cannot be solved this way. I suggest you look into audio splitter hardware which is designed specifically for this.

EDIT: found out adding a fake device with paprefs package (which combines other devices) can be an option. Described in detail on Play sound through two or more outputs/devices

Jan Myszkier
  • 1,243
  • Why shouldn't it be a software issue ? Are there any reason that it shouldn't be possible to choose more than one sound output device ? – Soren A Mar 14 '19 at 09:55
  • because this is not normal for any device, however I see someone made a workaround for this by creating fake device: https://askubuntu.com/questions/78174/play-sound-through-two-or-more-outputs-devices – Jan Myszkier Mar 14 '19 at 10:01
  • If your answer is essentially a referral to another question, it would be better to flag this question as a duplicate of the other. Don't forget to vote for the answer(s) there that you found useful! (The other option is to tailor your answer specifically for this question, not posting a link only.) – Melebius Mar 14 '19 at 10:11
  • @Melebius sorry I wasn't aware of other question until the first comment so it was already too late for me to do that, but point taken. – Jan Myszkier Mar 14 '19 at 11:33
0

NOTE: Please refer to Play sound through two or more outputs/devices for some apps mentioned.

I also have 2 HDMI monitors which somehow doesn't bind automatically with paprefs when adding a virtual output for all devices, the steps below worked for me with Built-in Audio card only, hopefully it will work on your setup as i think you have 2 cards based on your screenshot.

Add a custom profile for shared output of analog and digital

sudo gedit /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf

Save this on the last line of the file

[Profile output:analog-stereo+output:hdmi-stereo+output:hdmi-stereo-extra1]
description = Shared Analog/Digital Stereo Output #Laptop Speakers + HDMI Monitor Speakers
output-mappings = analog-stereo hdmi-stereo hdmi-stereo-extra1

Restart pulseaudio to get custom profile

pulseaudio -k

Open PulseAudio Volume Control > Configuration tab and set your custom profile

Open PulseAudio Preferences > Simultaneous Output tab and check the box

Open Ubuntu Sound Settings > Output tab and select Simultaneous output to*

Play any song to test

jjcosare
  • 101