Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 433  / 1 Year ago, tue, february 7, 2023, 4:32:52

I have three monitors hooked up to my PC with an RTX 2060.
aplay -l & pactl list sinks results as below.


How do I get following configured with PulseAudio :



  • The left monitor to be left-only channels.

  • The middle monitor to be centre channels.

  • The right monitor to be the right channels.


I'm currently running Ubuntu 18.04.05.


Sink #10
State: SUSPENDED
Name: alsa_output.pci-0000_01_00.1.hdmi-stereo
Description: HDA NVidia Digital Stereo (HDMI)
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 7
Mute: no
Volume: front-left: 30148 / 46% / -20.23 dB, front-right: 30148 / 46% / -20.23 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor Source: alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor
Latency: 0 usec, configured 0 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY SET_FORMATS

card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
Subdevices: 1/1
Subdevice #0: subdevice #0

Many thanks for your help.


More From » sound

 Answers
3

Okay, generally answering my own questions after days of researching, testing and so on, I have finally got this working. It's amazing. My 3 monitors feel like million-dollar speakers. Thanks for the hint @nusch for pointing me the right direction.


Here are the general steps.



  1. Replace PulseAudio to pipewire.3.x by following the guide at https://pipewire-debian.github.io/pipewire-debian/



  2. Switch HDMI to Pro Audio profile, so all sub HDMI ports on gpu shows up on qpwgraph




enter image description here



  1. Create a remap sink by executing:


    #Don't forget to replace the device name by alsa_output.pci-alsa_output.pci-0000_01_00.1.hdmi-stereo





pactl load-module module-remap-sink master_device=alsa_output.pci-alsa_output.pci-0000_01_00.1.hdmi-stereo master_channel_map=front-left,front-right,front-center channel_map=front-right,front-left,front-center remix=false



  1. Switch the default audio output from the ubuntu gnome sound control to remapped-sink by selecting it as output from GUI.



  2. Build & install qpgraph at https://gitlab.freedesktop.org/rncbc/qpwgraph.





git clone [email protected]:rncbc/qpwgraph.git


#>=Ubuntu 21.x
sudo apt install libasound2-dev libpipewire-0.3-dev libalsaplayer-dev libqt6svg6-dev libgl1-mesa-dev libqt6widgets6 libqt6gui6 qt6-base-dev qt6-base-dev g++ cmake libglx-dev pavucontrol

#<=Ubuntu 20.04
sudo apt install libasound2-dev libpipewire-0.3-dev libalsaplayer-dev libqt5svg5-dev libgl1-mesa-dev libqt5widgets5 libqt5gui5 g++-8 cmake libglx-mesa0 mesa-common-dev qt5-default pavucontrol

#before build
export CC=/usr/bin/gcc-8
export CXX=/usr/bin/g++-8
cmake -B build
cmake --build build



  1. Using qpwgraph to map the remap sink to playback on each playback on HDMI as followings (No need to restart the service for channel mapping.):


enter image description here


6.1 You can use the gnome sound control to test front, center and right. This makes mapping so much easier.


enter image description here



  1. Useful commands & links



    cat /proc/asound/pcm
    pactl info
    #restart pipewire service
    systemctl --user restart pipewire-pulse.service




https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/
https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Virtual-Devices#remap-sink



  1. You can literally map any audio aux to a source depending on your need with pipe wire. It's super awesome. The author of qpwgraph recommended to "ditch PulseAudio altogether".



  2. Enjoy, and don't forget to upvote and improve my answer so more people can enjoy these awesome Linux features.




Bonus points,


1.Awesome music to test out front, center, right channel - https://www.youtube.com/watch?v=3xt8Mp8oWzc



  1. Test your speakers with this video https://www.youtube.com/watch?v=ijSYp6N5Yrs&ab_channel=4KClipsAndTrailers



  2. You can pass your virtual sink to KVM/Qemu as an audio device, so you can game on windows / macOS and use remap sink as your audio device.




To make the changes permanent, it would be great to have someone improve my answer based on the qpwgraph export file.


All the best.


[#122] Tuesday, February 7, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mugustered

Total Points: 193
Total Questions: 123
Total Answers: 108

Location: Bermuda
Member since Wed, Mar 22, 2023
1 Year ago
mugustered questions
Sat, Nov 19, 22, 07:03, 1 Year ago
Sun, May 29, 22, 11:53, 2 Years ago
Fri, Dec 23, 22, 15:02, 1 Year ago
Sun, Mar 5, 23, 02:51, 1 Year ago
;