How to create a bluetooth stereo virtual output device with two bluetooth speakers separately connected via bluetooth to the PC ?
My PC gets two Amazon Echo Pop connected separately via bluetooth
Each Echo Pop is seen by bluetooth as a stereo ouput device with a left and right channel.
- Procedure
create a virtual stereo device named “bluetooth_stereo”
pactl load-module module-null-sink media.class=Audio/Sink sink_name=bluetooth_stereo channel_map=stereo
link the left channel of the PC to the left channel of the left Echo Pop (named “Gauche” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FL bluez_output.<mac_address_1>:playback_FL
link the left channel of the PC to the right channel of the left Echo Pop (named “Gauche” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FL bluez_output.<mac_address_1>:playback_FR
link the right channel of the PC to the right channel of the right Echo Pop (named “Droite” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FR bluez_output.<mac_address_2>:playback_FR
link the right channel of the PC to the left channel of the right Echo Pop (named “Droite” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FR bluez_output.<mac_address_2>:playback_FL
see the helvum graphic
- Creating the device when logging
the device disappears when you log out or you restart the PC.
you must create it for each kde logging.
For this :
- you must create a script with this contents :
#!/bin/bash
sleep 30s
#create a virtual stereo device named “bluetooth_stereo”
pactl load-module module-null-sink media.class=Audio/Sink sink_name=bluetooth_stereo channel_map=stereo
#link the left channel of the PC to the left channel of the left Echo Pop (named “Gauche” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FL bluez_output.7C_ED_C6_AF_FE_1B.1:playback_FL
#link the left channel of the PC to the right channel of the left Echo Pop (named “Gauche” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FL bluez_output.7C_ED_C6_AF_FE_1B.1:playback_FR
#link the right channel of the PC to the right channel of the right Echo Pop (named “Droite” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FR bluez_output.7C_ED_C6_B8_7C_78.1:playback_FR
#link the right channel of the PC to the left channel of the right Echo Pop (named “Droite” as a bluetooth device)
pw-link bluetooth_stereo:monitor_FR bluez_output.7C_ED_C6_B8_7C_78.1:playback_FL
There is a delay for, at logging, connecting the bluetooth speakers and then appearing as sound output devices.
Creating the virtual device needs that the bluetooth speakers are already created as sound output devices.
Then you need to execute the script after. Then you need a delay. Adjust it to your need.
- you must add the script as a logging script in kde “automatical start”
At logging, according to connect automatically the bluetooth speakers to the PC, you must record the bluetooth context. For this, restart the PC.