Jump to content


Photo

Improve your TDM experience by playing with OpenAL Soft HRTF (better 3d audio)

hrtf positional audio vr 3d audio

  • Please log in to reply
67 replies to this topic

#51 Hiradur

Hiradur

    Member

  • Member
  • PipPip
  • 65 posts

Posted 31 January 2016 - 10:10 AM

Got this working with TDM, left to right sounds great, but I still have a hard time telling up from down.

 

In this case the default HRTF dataset is probably not matching your head shape well. With luck you will find one which suits your head shape better if you follow this guide: https://www.reddit.c...necraft/cagd3lb

 

How does the KHz setting affect the success of this system? I've read that I should set it manually in the config file to 44.1 at least for Thief 2. Normally my sound card is set to 96.000 btw. So do I need to change both the config file and the sound card settings to 44.1000 to make it work properly?

 

It comes down to for which sample rate you have HRTF datasets available. The problem with the Thief games is that they run at 22,050 Hz and the smallest sample rate you can generate HRTF datasets for is 32,000 Hz with makehrtf.exe. So you have to enforce a higher frequency in the OpenAL Soft config. The sample rate set in Windows doesn't have an effect because the chain goes like this: game sample rate -> OpenAL Soft sample rate (resample if necessary) -> Windows sample rate (resample if necessary).

The default HRTF datasets coming with OpenAL Soft are for 44,100Hz and 48,000Hz but you could generate some for 96,000Hz with makehrtf.exe if you desire.

 

For Thief games I recommend to enforce a multiple of 22,050Hz (44.1kHz, 88.2kHz etc.) to reduce resampling artifacts. For modern games I suggest to enforce nothing or enforce a multiple of 48kHz because that's what most modern games run at.


Edited by Hiradur, 31 January 2016 - 10:14 AM.


#52 SeriousToni

SeriousToni

    Beginner Contest 2012 Winner

  • Member
  • PipPipPipPip
  • 2204 posts

Posted 31 January 2016 - 10:13 AM

Thanks for clarification and sorry for all the dumb questions btw :blush:

I really want to get this working :)


"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

#53 Hiradur

Hiradur

    Member

  • Member
  • PipPip
  • 65 posts

Posted 31 January 2016 - 10:41 AM

Thanks for clarification and sorry for all the dumb questions btw :blush:

I really want to get this working :)

 

There are no dumb questions, especially for game audio. There is a lot of wrong information on the internet (e.g. people claiming that EAX equals 5.1 surround sound) so just ask if something is unclear.


  • Deadlove likes this

#54 SeriousToni

SeriousToni

    Beginner Contest 2012 Winner

  • Member
  • PipPipPipPip
  • 2204 posts

Posted 31 January 2016 - 11:07 AM

So I set it up for my Thief 2 NewDark installation (installed with Taffer Patcher) and it also creates a log file now. Ingame in audio I have chosen "OpenAL" and I've set the frequency to 441000 Hz and activated hrtf both in the config file. I get an EAX like echo which changes from room to room (depending on the size) and also there seems to be at least stereo. But looking in my openal.log hrtf seems not to work properly. Asus GX mode is set to OFF and I've set its mode to 2 speakers.

 

Here is my log file for Thief 2

Spoiler

 

Dark Mod said something similiar:

 

Spoiler

 

EDIT: Is it because I have OpenAL installed too? I didn't know how to uninstall it / uninstaller wasnt working, so I just let it there and installed OpenAL Soft just again like you stated in post #001.


Edited by SeriousToni, 31 January 2016 - 11:24 AM.

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

#55 Hiradur

Hiradur

    Member

  • Member
  • PipPip
  • 65 posts

Posted 31 January 2016 - 12:02 PM

So I set it up for my Thief 2 NewDark installation (installed with Taffer Patcher) and it also creates a log file now. Ingame in audio I have chosen "OpenAL" and I've set the frequency to 441000 Hz and activated hrtf both in the config file. I get an EAX like echo which changes from room to room (depending on the size) and also there seems to be at least stereo. But looking in my openal.log hrtf seems not to work properly. Asus GX mode is set to OFF and I've set its mode to 2 speakers.

 


EDIT: Is it because I have OpenAL installed too? I didn't know how to uninstall it / uninstaller wasnt working, so I just let it there and installed OpenAL Soft just again like you stated in post #001.

 

Looks like you didn't change "#hrtf = auto" to "hrtf = true". hrtf = auto only turns on HRTF if OpenAL Soft detects headphones which I believe it only does when Windows detects headphones, which, from my experience, it rarely does.

 

It's safe to have Creative's OpenAL installed as well. It works like this: The game will first look for OpenAL32.dll in the same folder where the .exe file is. If it doesn't find it there it'll instead look at C:\Windows\system32 (32bit Windows or 64bit game on 64bit Windows) or C:\Windows\SysWOW64 (32bit games on 64bit Windows). So if you have e.g. Creative's OpenAL32.dll in C:\Windows\system32 and OpenAL Soft's OpenAL32.dll in the game folder only OpenAL Soft will be used.



#56 SeriousToni

SeriousToni

    Beginner Contest 2012 Winner

  • Member
  • PipPipPipPip
  • 2204 posts

Posted 31 January 2016 - 12:04 PM

You mean this?

## hrtf:
#  Controls HRTF processing. These filters provide better spatialization of
#  sounds while using headphones, but do require a bit more CPU power. The
#  default filters will only work with 44100hz or 48000hz stereo output. While
#  HRTF is used, the cf_level option is ignored. Setting this to auto (default)
#  will allow HRTF to be used when headphones are detected or the app requests
#  it, while setting true or false will forcefully enable or disable HRTF
#  respectively.
hrtf = true

I have set it up in the config file in my User folder, yes


"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

#57 Hiradur

Hiradur

    Member

  • Member
  • PipPip
  • 65 posts

Posted 31 January 2016 - 12:08 PM



You mean this?

## hrtf:
#  Controls HRTF processing. These filters provide better spatialization of
#  sounds while using headphones, but do require a bit more CPU power. The
#  default filters will only work with 44100hz or 48000hz stereo output. While
#  HRTF is used, the cf_level option is ignored. Setting this to auto (default)
#  will allow HRTF to be used when headphones are detected or the app requests
#  it, while setting true or false will forcefully enable or disable HRTF
#  respectively.
hrtf = true

I have set it up in the config file in my User folder, yes

 

Yes, this. Is it in the right folder (%appdata%)? Because the log file indicates the value is not set:

AL lib: (II) GetConfigValue: Key hrtf not found


#58 SeriousToni

SeriousToni

    Beginner Contest 2012 Winner

  • Member
  • PipPipPipPip
  • 2204 posts

Posted 31 January 2016 - 12:16 PM

If I insert %APPDATA% into my explorer, I get directed to my user folder in AppData/roaming which exactly is here C:\Users\Toni\AppData\Roaming\openal\hrtf

There I have three files. the default-44100.mhr, the default-48000.mhr and the alsoft.ini in which I made the hrtf = true. This is correct, right?

 

This is what is in the file:

 

Spoiler

Edited by SeriousToni, 31 January 2016 - 12:17 PM.

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

#59 Hiradur

Hiradur

    Member

  • Member
  • PipPip
  • 65 posts

Posted 31 January 2016 - 12:23 PM

If I insert %APPDATA% into my explorer, I get directed to my user folder in AppData/roaming which exactly is here C:\Users\Toni\AppData\Roaming\openal\hrtf

There I have three files. the default-44100.mhr, the default-48000.mhr and the alsoft.ini in which I made the hrtf = true. This is correct, right?

 

alsoft.ini should go into C:\Users\Toni\AppData\Roaming\ not the the openal subfolder.



#60 SeriousToni

SeriousToni

    Beginner Contest 2012 Winner

  • Member
  • PipPipPipPip
  • 2204 posts

Posted 31 January 2016 - 12:39 PM

Omg you're so smart, thank you! :laugh:

 

Now it says hrtf key true and frequency 44100 found. Also ingame it seems to work properly. Especially in Thief 2 I can better find out where the sound is coming from. What an experience together with the room echoes, wow! Thank you so much, again for posting this guide! :)

 

EDIT:

The echoes are very strong in Thief 2 though (I don't hear any in TDM). I reduced them in the config file by -12dB.


Edited by SeriousToni, 31 January 2016 - 05:12 PM.

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

#61 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 466 posts

Posted 16 May 2016 - 03:07 PM

I tried it - and it is great.

But in some missions i hear an annoying continuous beep sound around some electric lighting. Anyone else experienced that? How did you fix it?



#62 Spooks

Spooks

    Member

  • Member
  • PipPip
  • 485 posts

Posted 16 May 2016 - 03:33 PM

I'm pretty sure that's just a default electric light buzzing sound that some mappers have decided to put on their lights. I don't personally like it either, how I fix it is I try to get out of the room containing the light  :rolleyes:


My FMs: The King of Diamonds (2016)

 

Visit my Mapbook thread sometimes!


#63 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8984 posts

Posted 16 May 2016 - 03:38 PM

Beep might be the bug where negative values are being sent to the audio driver. (Fixed in 2.04)


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#64 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 466 posts

Posted 16 May 2016 - 04:27 PM

It definitely is not the default electric buzzing sound. It is more "pure" - like a synthetic low frequency (somewhere around 500 Hz i guess) sine.

 

When is 2.04 expected to arrive in the updater?



#65 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8984 posts

Posted 16 May 2016 - 04:39 PM

We are targeting a July 1st release.

Beta is starting very soon:

 

http://forums.thedar...ic-beta-period/


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#66 lowenz

lowenz

    Advanced Member

  • Member
  • PipPipPip
  • 1876 posts

Posted 17 May 2016 - 04:14 AM

eager to test the new audio stack!


Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#67 The Black Arrow

The Black Arrow

    Member

  • Member
  • PipPip
  • 49 posts

Posted 17 August 2016 - 03:53 AM

Are the really no more samples other than 44k and 48k? I play at 192k.


Posted Image

#68 Hiradur

Hiradur

    Member

  • Member
  • PipPip
  • 65 posts

Posted 25 August 2016 - 07:37 AM

Are the really no more samples other than 44k and 48k? I play at 192k.

There aren't, but you can create some yourself with the makehrtf tool.

 

Anyway, I'd like to point out here that sample rates higher than 44.1/48 kHz actually decrease audio quality even though marketing wants to make you believe otherwise. I don't want to go into details myself but if you are interested in why I recommend this excellent post and the videos it links to: https://xiph.org/~xi...neil-young.html

This post was created by the Xiph foundation, they guys behind the free and open source audio codecs FLAC, Vorbis, Opus and a few others.







Also tagged with one or more of these keywords: hrtf, positional audio, vr, 3d audio

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users