@@ -403,3 +403,119 @@ setup-virtual-channels:
403403remove-virtual-channels :
404404 rm ~/.config/pipewire/pipewire.conf.d/virtual-channels.conf
405405 echo "Virtual audio channels config removed, the channels will be removed next time you login."
406+
407+ # Setup a simple Virtual Surround 7.1 sink using the ASH Control Room 1 convolver file (you can change this yourself after setup)
408+ setup-virtual-surround-71 :
409+ # !/bin/bash
410+ mkdir -p ~/.config/pipewire/pipewire.conf.d
411+ mkdir -p ~/.config/pipewire/hrir_hesuvi
412+ wget -O ~/.config/pipewire/hrir_hesuvi/Control_Room_1.wav https ://github.com/ShanonPearce/ASH-Listening-Set/raw/main/HeSuVi/hrir/_Control_Room_1.wav
413+ cat << HESUVI > ~/.config/pipewire/pipewire.conf.d/virtual-surround-71.conf
414+ context.modules = [
415+ { name = libpipewire-module-filter-chain
416+ flags = [ nofail ]
417+ args = {
418+ node.description = "Virtual Surround 7.1"
419+ media.name = "Virtual Surround 7.1"
420+ filter.graph = {
421+ nodes = [
422+ # Duplicate inputs
423+ { type = builtin label = copy name = copyFL }
424+ { type = builtin label = copy name = copyFR }
425+ { type = builtin label = copy name = copyFC }
426+ { type = builtin label = copy name = copyRL }
427+ { type = builtin label = copy name = copyRR }
428+ { type = builtin label = copy name = copySL }
429+ { type = builtin label = copy name = copySR }
430+ { type = builtin label = copy name = copyLFE }
431+
432+ # Apply hrir - HeSuVi 14-channel WAV (not the *-.wav variants) (note: */44/* in HeSuVi are the same, but resampled to 44100)
433+ # The file paths HAS to be absolute paths
434+ { type = builtin label = convolver name = convFL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 0 } }
435+ { type = builtin label = convolver name = convFL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 1 } }
436+ { type = builtin label = convolver name = convSL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 2 } }
437+ { type = builtin label = convolver name = convSL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 3 } }
438+ { type = builtin label = convolver name = convRL_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 4 } }
439+ { type = builtin label = convolver name = convRL_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 5 } }
440+ { type = builtin label = convolver name = convFC_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 6 } }
441+ { type = builtin label = convolver name = convFR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 7 } }
442+ { type = builtin label = convolver name = convFR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 8 } }
443+ { type = builtin label = convolver name = convSR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 9 } }
444+ { type = builtin label = convolver name = convSR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 10 } }
445+ { type = builtin label = convolver name = convRR_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 11 } }
446+ { type = builtin label = convolver name = convRR_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 12 } }
447+ { type = builtin label = convolver name = convFC_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 13 } }
448+
449+ # Treat LFE as FC
450+ { type = builtin label = convolver name = convLFE_L config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 6 } }
451+ { type = builtin label = convolver name = convLFE_R config = { filename = "$HOME/.config/pipewire/hrir_hesuvi/Control_Room_1.wav" channel = 13 } }
452+
453+ # Stereo output
454+ { type = builtin label = mixer name = mixL }
455+ { type = builtin label = mixer name = mixR }
456+ ]
457+ links = [
458+ # Input
459+ { output = "copyFL :Out" input="convFL_L:In" }
460+ { output = "copyFL :Out" input="convFL_R:In" }
461+ { output = "copySL :Out" input="convSL_L:In" }
462+ { output = "copySL :Out" input="convSL_R:In" }
463+ { output = "copyRL :Out" input="convRL_L:In" }
464+ { output = "copyRL :Out" input="convRL_R:In" }
465+ { output = "copyFC :Out" input="convFC_L:In" }
466+ { output = "copyFR :Out" input="convFR_R:In" }
467+ { output = "copyFR :Out" input="convFR_L:In" }
468+ { output = "copySR :Out" input="convSR_R:In" }
469+ { output = "copySR :Out" input="convSR_L:In" }
470+ { output = "copyRR :Out" input="convRR_R:In" }
471+ { output = "copyRR :Out" input="convRR_L:In" }
472+ { output = "copyFC :Out" input="convFC_R:In" }
473+ { output = "copyLFE :Out" input="convLFE_L:In" }
474+ { output = "copyLFE :Out" input="convLFE_R:In" }
475+
476+ # Output
477+ { output = "convFL_L :Out" input="mixL:In 1" }
478+ { output = "convFL_R :Out" input="mixR:In 1" }
479+ { output = "convSL_L :Out" input="mixL:In 2" }
480+ { output = "convSL_R :Out" input="mixR:In 2" }
481+ { output = "convRL_L :Out" input="mixL:In 3" }
482+ { output = "convRL_R :Out" input="mixR:In 3" }
483+ { output = "convFC_L :Out" input="mixL:In 4" }
484+ { output = "convFC_R :Out" input="mixR:In 4" }
485+ { output = "convFR_R :Out" input="mixR:In 5" }
486+ { output = "convFR_L :Out" input="mixL:In 5" }
487+ { output = "convSR_R :Out" input="mixR:In 6" }
488+ { output = "convSR_L :Out" input="mixL:In 6" }
489+ { output = "convRR_R :Out" input="mixR:In 7" }
490+ { output = "convRR_L :Out" input="mixL:In 7" }
491+ { output = "convLFE_R :Out" input="mixR:In 8" }
492+ { output = "convLFE_L :Out" input="mixL:In 8" }
493+ ]
494+ inputs = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In", "copySL:In", "copySR:In" ]
495+ outputs = [ "mixL:Out" "mixR:Out" ]
496+ }
497+ capture.props = {
498+ node.name = "effect_input.virtual-surround-7.1-hesuvi"
499+ media.class = Audio/Sink
500+ audio.channels = 8
501+ audio.position = [ FL FR FC LFE RL RR SL SR ]
502+ }
503+ playback.props = {
504+ node.name = "effect_output.virtual-surround-7.1-hesuvi"
505+ node.passive = true
506+ audio.channels = 2
507+ audio.position = [ FL FR ]
508+ }
509+ }
510+ }
511+ ]
512+ HESUVI
513+ echo "Virtual Surround 7.1 has now been set up with a basic convolver file, either restart pipewire or reboot for it to take effect."
514+ echo "Then select the Virtual Surround 7.1 audio output as your default audio output."
515+ echo "If you want something like DTS, Atmos or OpenAL, you will have to aquire those convolver wav files yourself and edit ~/.config/pipewire/pipewire.conf.d/virtual-surround.conf to point to the one you want to use."
516+
517+ # Remove Virtual Surround 7.1 sink
518+ remove-virtual-surround-71 :
519+ rm ~/.conf/pipewire/pipewire.conf.d/virtual-surround-71.conf
520+ rm ~/.conf/pipewire/hrir_hesuvi/Control_Room_1.wav
521+ echo "Virtual Surround 7.1 removed, please reboot or restart pipewire for it to take effect."
0 commit comments