I’ll write something more precise when I will have time to try with my 2 TVs, but at least, it worked with one.
First, you need to find the number of the card and the number of device of each hdmi output with aplay -l | grep card (for me it aplay -l | grep carte because my system is set to french).
I get this:
$ aplay -l | grep carte
carte 0 : NVidia [HDA NVidia], périphérique 3 : HDMI 0 [VE248]
carte 0 : NVidia [HDA NVidia], périphérique 7 : HDMI 1 [VE248]
carte 0 : NVidia [HDA NVidia], périphérique 8 : HDMI 2 [SAMSUNG]
carte 0 : NVidia [HDA NVidia], périphérique 9 : HDMI 3 [HDMI 3]
carte 1 : Wireless [Arctis Nova Pro Wireless], périphérique 0 : USB Audio [USB Audio]
carte 2 : Generic [HD-Audio Generic], périphérique 0 : ALC892 Analog [ALC892 Analog]
The two first are my monitors, the third one is one of my TV and the last one is not plugged.
I created a new output for each hdmi output. It’s useless for the monitors since they don’t have speakers, but it’s just to try.
pactl load-module module-alsa-sink device="hw:0,3" sink_name=vsink_0_3 sink_properties="device.description='HDMI 0 VSINK' device.icon_name='audio-card'"
pactl load-module module-alsa-sink device="hw:0,7" sink_name=vsink_0_7 sink_properties="device.description='HDMI 1 VSINK' device.icon_name='audio-card'"
pactl load-module module-alsa-sink device="hw:0,8" sink_name=vsink_0_8 sink_properties="device.description='HDMI 2 VSINK' device.icon_name='audio-card'"
What is important is to use hw:[CARD_NUMBER],[DEVICE_ID]. For the 4th hdmi output, I will have to use hw:0,9.
It creates outputs that I can see with qpwgraph:
I tried connecting an audio source to HDMI-2, which is my TV and it worked.
I need to try with both TVs connected, but it seems to work. I think I’ll do a script that creates the outputs when I launch the game and then that destroys them when I quit.
When you create a new ouput, you get a number that is displayed. To destroy the output, you just have to do pactl unload-module [THE_NUMBER_OF_THE_SINK].