• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

[guide] how to make and use custom HRTF's with OpenAL on Linux systems

birb

Member
Joined
Jun 26, 2025
Messages
16
Likes
9
HEADPHONES!!!

to start, i recommend grabbing the "Subject D2 HRIR" (ignore the BRIR) for best results of the final HRTF from here: https://www.york.ac.uk/sadie-project/database.html
i recommend D2 for the reason of openal's 'makemhr' doesnt use all the measurements in the HRIR files for the SADIE HRIRs and there's far less on the other subjets available. i also recommend you keep openal-soft up to date from the git https://github.com/kcat/openal-soft (not required)
to compile the hrtf you can either run 'makemhr -j 2 -r 48000 -i D2_48K_24bit_256tap_FIR_SOFA.sofa -o SADIE.mhr' .. once compiled you will have an output file of "SADIE.mhr" that you can then move to "/usr/share/openal/hrtf/" or to "/home/user/.local/share/openal/hrtf/" or to a custom directory for example "/home/user/openal/hrtf/" you can then run in the terminal 'alsoft-config' (if this fails you can use the file i will list at the end), on the "playback" tab i highly recommend setting the resampler to the highest setting "47th order sinc" go to the HRTF tab, if you used the "/usr/share/openal/hrtf/" folder or "/home/user/.local/share/openal/hrtf/", then you can just select the SADIE HRTF under the "preferred HRTF" if you used a custom location you will want to add under the advanced settings that folder location "/home/user/openal/hrtf" and hit "apply" .. close the window and reopen it, under the "playback" tab, set "Stereo Encoding" to "Binaural" and check under the HRTF tab to confirm that "SADIE" is selected, apply and close the window. go into the terminal ant type 'openal-info' and confirm that SADIE is the first HRTF listed under "Available HRTF profiles:", Device output mode reads "Stereo (HRTF)" and that under "Device HRTF profile:" reads "SADIE" if this is correct then you're ready to go, this can give you an edge in some games as you will be able to hear things behind you, above you, etc. (some might need you to enable the use of 3D sound within the settings but it will use your custom HRTF)

if 'alsoft-config' fails then you can always use the file within "/home/user/.config/alsoft.conf" with the following options:

[General]
default-hrtf=SADIE
hrtf-paths="/home/user/openal/hrtf,"
resampler=bsinc48
stereo-encoding=hrtf

and check 'openal-info' to confirm it is working

if you want the max quality settings for your HRTF you can run 'makemhr -r 48000 -j 2 -f 131072 -w 128 -i D2_48K_24bit_256tap_FIR_SOFA.sofa -o SADIE.mhr'

if you want to turn off the HRTF, go into 'alsoft-config' and set "Stereo Encoding" to "Default". or within the file set "stereo-encoding=default" (if you're using the file and enabling HRTF, set it as "hrtf" and not "binaural")

for media players you can let them just output surround or you can use custom layouts to add height channels (nice to use for Dolby Atmos or DTS-X) and the HRTF will do the mixing...
 
Last edited:
Thank you!

move to "/usr/share/openal/hrtf/" (im not sure what the default home user path is)

That would be ~/.local/share/openal/hrtf/

The alsoft-config tool listed SADIE once I created this directory and placed the mhr file in it.
 
Is this system-wide? Can I use it with Spotify?

Right now, I use ffmpeg's sofalizer filter while watching movies or listening to music, but I haven't been able to do it system-wide.
 
Is this system-wide? Can I use it with Spotify?

Right now, I use ffmpeg's sofalizer filter while watching movies or listening to music, but I haven't been able to do it system-wide.
yes, openal does this system wide.
 
There's also PipeWire's filter chain which has both SOFA and convolver options. https://lemmy.world/post/1865680 has details as it's not entirely obvious from the PipeWire docs. EasyEffects has an outstanding feature request for an easy way to set something like this up, but it only has a stereo chain so wouldn't do multichannel spatialization.
Wow! That page contains this link https://airtable.com/shruimhjdSakUPg2m/tbloLjoZKWJDnLtTc which is a treasure trove of HRTF collection.

I found that the 7.1 convolution files have only 7x2 channels. Do we know the channel order? I guess they miss the convolution for LFE channel?
 
Back
Top Bottom