# Enable 7.1 Virtual Sound in Linux using Pipewire

### This article explains how to enable 7.1 virtual surround sound in Linux using Pipewire Photo by Sascha Bosshard on Unsplash

1. Copy pipewire.conf file from /usr/share/pipewire/ folder to ~/.config/pipewire/ folder. Create the folder if necessary.

2. Copy the following text in the configuration file inside context.modules = [] section

``````{ name = libpipewire-module-filter-chain
args = {
node.description = "Virtual Surround Sink"
media.name       = "Virtual Surround Sink"
filter.graph = {
nodes = [
# duplicate inputs
{ type = builtin label = copy name = copyFL  }
{ type = builtin label = copy name = copyFR  }
{ type = builtin label = copy name = copyFC  }
{ type = builtin label = copy name = copyRL  }
{ type = builtin label = copy name = copyRR  }
{ type = builtin label = copy name = copySL  }
{ type = builtin label = copy name = copySR  }
{ type = builtin label = copy name = copyLFE }

# apply hrir - HeSuVi 14-channel WAV (not the *-.wav variants) (note: */44/* in HeSuVi are the same, but resampled to 44100)
{ type = builtin label = convolver name = convFL_L config = { filename = "hrir_hesuvi/hrir.wav" channel =  0 } }
{ type = builtin label = convolver name = convFL_R config = { filename = "hrir_hesuvi/hrir.wav" channel =  1 } }
{ type = builtin label = convolver name = convSL_L config = { filename = "hrir_hesuvi/hrir.wav" channel =  2 } }
{ type = builtin label = convolver name = convSL_R config = { filename = "hrir_hesuvi/hrir.wav" channel =  3 } }
{ type = builtin label = convolver name = convRL_L config = { filename = "hrir_hesuvi/hrir.wav" channel =  4 } }
{ type = builtin label = convolver name = convRL_R config = { filename = "hrir_hesuvi/hrir.wav" channel =  5 } }
{ type = builtin label = convolver name = convFC_L config = { filename = "hrir_hesuvi/hrir.wav" channel =  6 } }
{ type = builtin label = convolver name = convFR_R config = { filename = "hrir_hesuvi/hrir.wav" channel =  7 } }
{ type = builtin label = convolver name = convFR_L config = { filename = "hrir_hesuvi/hrir.wav" channel =  8 } }
{ type = builtin label = convolver name = convSR_R config = { filename = "hrir_hesuvi/hrir.wav" channel =  9 } }
{ type = builtin label = convolver name = convSR_L config = { filename = "hrir_hesuvi/hrir.wav" channel = 10 } }
{ type = builtin label = convolver name = convRR_R config = { filename = "hrir_hesuvi/hrir.wav" channel = 11 } }
{ type = builtin label = convolver name = convRR_L config = { filename = "hrir_hesuvi/hrir.wav" channel = 12 } }
{ type = builtin label = convolver name = convFC_R config = { filename = "hrir_hesuvi/hrir.wav" channel = 13 } }

# treat LFE as FC
{ type = builtin label = convolver name = convLFE_L config = { filename = "hrir_hesuvi/hrir.wav" channel =  6 } }
{ type = builtin label = convolver name = convLFE_R config = { filename = "hrir_hesuvi/hrir.wav" channel = 13 } }

# stereo output
{ type = builtin label = mixer name = mixL }
{ type = builtin label = mixer name = mixR }
]
# input
{ output = "copyFL:Out"  input="convFL_L:In"  }
{ output = "copyFL:Out"  input="convFL_R:In"  }
{ output = "copySL:Out"  input="convSL_L:In"  }
{ output = "copySL:Out"  input="convSL_R:In"  }
{ output = "copyRL:Out"  input="convRL_L:In"  }
{ output = "copyRL:Out"  input="convRL_R:In"  }
{ output = "copyFC:Out"  input="convFC_L:In"  }
{ output = "copyFR:Out"  input="convFR_R:In"  }
{ output = "copyFR:Out"  input="convFR_L:In"  }
{ output = "copySR:Out"  input="convSR_R:In"  }
{ output = "copySR:Out"  input="convSR_L:In"  }
{ output = "copyRR:Out"  input="convRR_R:In"  }
{ output = "copyRR:Out"  input="convRR_L:In"  }
{ output = "copyFC:Out"  input="convFC_R:In"  }
{ output = "copyLFE:Out" input="convLFE_L:In" }
{ output = "copyLFE:Out" input="convLFE_R:In" }

# output
{ output = "convFL_L:Out"  input="mixL:In 1" }
{ output = "convFL_R:Out"  input="mixR:In 1" }
{ output = "convSL_L:Out"  input="mixL:In 2" }
{ output = "convSL_R:Out"  input="mixR:In 2" }
{ output = "convRL_L:Out"  input="mixL:In 3" }
{ output = "convRL_R:Out"  input="mixR:In 3" }
{ output = "convFC_L:Out"  input="mixL:In 4" }
{ output = "convFC_R:Out"  input="mixR:In 4" }
{ output = "convFR_R:Out"  input="mixR:In 5" }
{ output = "convFR_L:Out"  input="mixL:In 5" }
{ output = "convSR_R:Out"  input="mixR:In 6" }
{ output = "convSR_L:Out"  input="mixL:In 6" }
{ output = "convRR_R:Out"  input="mixR:In 7" }
{ output = "convRR_L:Out"  input="mixL:In 7" }
{ output = "convLFE_R:Out" input="mixR:In 8" }
{ output = "convLFE_L:Out" input="mixL:In 8" }
]
inputs  = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In", "copySL:In", "copySR:In" ]
outputs = [ "mixL:Out" "mixR:Out" ]
}
capture.props = {
node.name      = "effect_input.virtual-surround-7.1-hesuvi"
media.class    = Audio/Sink
audio.channels = 8
audio.position = [ FL FR FC LFE RL RR SL SR ]
}
playback.props = {
node.name      = "effect_output.virtual-surround-7.1-hesuvi"
node.passive   = true
audio.channels = 2
audio.position = [ FL FR ]
}
}
}
``````

3. Note there is file named hrir_hesuvi/hrir.wav in the text above. You will need the file.
{"ft_lang_label":"__label__en","ft_lang_prob":0.57020587,"math_prob":0.98177034,"size":5392,"snap":"2023-14-2023-23","text_gpt3_token_len":1779,"char_repetition_ratio":0.2423905,"word_repetition_ratio":0.3071823,"special_character_ratio":0.33494064,"punctuation_ratio":0.15729047,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9946236,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-08T22:29:05Z\",\"WARC-Record-ID\":\"<urn:uuid:a4c6cc70-c6da-402e-8db4-f53108180a1e>\",\"Content-Length\":\"30739\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:cc67ab7d-c5ff-477f-bfdf-9d798f2f8a73>\",\"WARC-Concurrent-To\":\"<urn:uuid:dbd4b8a3-6565-4fb6-9eb1-3f4ede279bc8>\",\"WARC-IP-Address\":\"172.104.238.165\",\"WARC-Target-URI\":\"https://prabin-dahal.com.np/articles/view/enable-71-virtual-sound-in-linux-using-pipewire\",\"WARC-Payload-Digest\":\"sha1:KUAUAYKVUMEFMRGZTQ7DRLH6YGBXXGGV\",\"WARC-Block-Digest\":\"sha1:XJSX7ZDL37XUYTWCABKRWZNMWXAKYPLM\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224655143.72_warc_CC-MAIN-20230608204017-20230608234017-00585.warc.gz\"}"}