Skip to content

Commit 7586e95

Browse files
authored
feat: add virtual audio channels for special usecases (#449)
1 parent 83b5349 commit 7586e95

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

system_files/desktop/shared/usr/share/ublue-os/just/60-custom.just

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,79 @@ disable-watchdog:
325325
# Add SELinux file context for default looking-glass shm file so that libvirt can create it when needed
326326
selinux-looking-glass:
327327
sudo semanage fcontext -a -t svirt_tmpfs_t /dev/shm/looking-glass
328+
329+
setup-virtual-channels:
330+
#!/bin/bash
331+
mkdir -p ~/.config/pipewire/pipewire.conf.d
332+
cat << 'EOL' > ~/.config/pipewire/pipewire.conf.d/virtual-channels.conf
333+
context.modules = [
334+
{ name = libpipewire-module-loopback
335+
args = {
336+
node.description = "Game"
337+
capture.props = {
338+
node.name = "game_output"
339+
media.class = "Audio/Sink"
340+
audio.position = [ FL FR ]
341+
}
342+
playback.props = {
343+
node.name = "playback.game_output"
344+
audio.position = [ FL FR ]
345+
node.passive = true
346+
}
347+
}
348+
}
349+
{ name = libpipewire-module-loopback
350+
args = {
351+
node.description = "Voice"
352+
capture.props = {
353+
node.name = "voice_output"
354+
media.class = "Audio/Sink"
355+
audio.position = [ FL FR ]
356+
}
357+
playback.props = {
358+
node.name = "playback.voice_output"
359+
audio.position = [ FL FR ]
360+
node.passive = true
361+
}
362+
}
363+
}
364+
{ name = libpipewire-module-loopback
365+
args = {
366+
node.description = "Browser"
367+
capture.props = {
368+
node.name = "browser_output"
369+
media.class = "Audio/Sink"
370+
audio.position = [ FL FR ]
371+
}
372+
playback.props = {
373+
node.name = "playback.browser_output"
374+
audio.position = [ FL FR ]
375+
node.passive = true
376+
}
377+
}
378+
}
379+
{ name = libpipewire-module-loopback
380+
args = {
381+
node.description = "Music"
382+
capture.props = {
383+
node.name = "music_output"
384+
media.class = "Audio/Sink"
385+
audio.position = [ FL FR ]
386+
}
387+
playback.props = {
388+
node.name = "playback.music_output"
389+
audio.position = [ FL FR ]
390+
node.passive = true
391+
}
392+
}
393+
}
394+
]
395+
EOL
396+
echo "Next time you log in, you will have audio channels for Game, Voice, Browser, Music that you can route game audio to"
397+
echo "using programs like qpwgraph, helvum or carla."
398+
echo "You can also add these channels to OBS audio mixer for separate audio control for yourself and your viewers."
399+
echo "NOTE: It is recommended to mute the virtual channels so you do not have to listen to them twice if you are not exclusively routing the audio through said channel instead of splitting audio to them."
400+
401+
remove-virtual-channels:
402+
rm ~/.config/pipewire/pipewire.conf.d/virtual-channels.conf
403+
echo "Virtual audio channels config removed, the channels will be removed next time you login."

0 commit comments

Comments
 (0)