HRTF Audio for Arma Reforger

Virtual Surround Sound for Virtual Warzones

This is going to be a shareable thing soon but I just thought I’d write about it.

I noticed Arma Reforger can output it’s audio in multi channel audio, not just stereo. I was getting Front Left (FL), Front Right (FR), Front Center (FC) and LFE (???) channels. So I did some digging with Codex.

I discovered that depending on how many channels you have available on your audio device on Linux, Arma will negotiate on launch how many to transmit on. It turns out we can abuse this by tricking Arma into thinking I have 5.1 compatible audio channels, then take each one and do fun things.

To abuse this, we create a virtual sink on pipewire with 5.1 channels, and set up some rules that Reforger will auto negotiate with this sink, exposing the channels.

The ‘.1’ channel in 5.1 is the Low Frequency channel or subwoofer, and this outputs nothing. So we’re left with 5.0 Channels effectively. These are

  • Front Left FL
  • Front Right FR
  • Front Center FC
  • Rear Left RL
  • Rear Right RR

You can see this in action in the wire graph below. Notice that LFE is not wired up

Head-Related Transfer Function

Turns out our ears are pretty perceptive to minute audio differences. If we have a virtual 3D environment, we can ‘color’ audio coming from different directions to enhance our perception of that audio in 3D space. ‘Coloring’ audio means to apply some sort of filters, in this case Equalization (EQ) to change the frequency spectrums.

I sent Codex off to find out the details about this. Turns out theres a ton of fancy schmancy investigations and papers written about this, but there was concensus that, when audio is coming from behind, our ears detect slightly less detail in certain ‘middle’ frequencies (between 1000hz and 6000hz) and a slight increase in the 400hz range. By emulating this ‘color’ in the RL and RR channels using a Parametric EQ plugin, we can trick our brains into more naturally feeling the difference in direction.

Codex also made the EQ plugin configs which I could just import directly into my plugins module. Im using the LSP Parametric Equalizer x16 which is available on the pro-audio tag in pacman.