Jump to content
The Dark Mod Forums
Sign in to follow this  
Hiradur

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

Recommended Posts

@The developers: With recent versions of OpenAL Soft software can now request HRTF processing itself. Before it could only be enforced in the OpenAL Soft config file. Any chance this could make it to TDM?

Since OpenAL Soft is LGPLv2 licensed you could bundle it with TDM.

  • Like 1

Share this post


Link to post
Share on other sites

This is an interesting wrinkle.

 

We have an internal EFX branch but it doesn't do full HRTF as I recall. It would be a shame to throw away all that work but (OTOH) if this can just be bundled without

having to dig into the innards of EAX code then it would be a nice stop gap until the 64-bit branch arrives.

Share this post


Link to post
Share on other sites

Any videos of this working in TDM by any chance? I'm at work and am unable to test this until late this evening.

 

Not yet, I'll see if I can make one but I can't promise it will make it in time.

 

This is an interesting wrinkle.

 

We have an internal EFX branch but it doesn't do full HRTF as I recall. It would be a shame to throw away all that work but (OTOH) if this can just be bundled without

having to dig into the innards of EAX code then it would be a nice stop gap until the 64-bit branch arrives.

 

EFX and HRTF are two different things though. EFX (or its predecessor EAX) processes sounds with reverb presets to make them reflect the environment they are in (e.g. sounds in a huge hall have long echo). This doesn't improve positional audio (probably makes it worse due to the reverb but that's realistic at least). HRTF only improves positional audio. Both in combination make for a very realistic experience.

Edited by Hiradur
  • Like 2

Share this post


Link to post
Share on other sites
It would be very nice to have better positional audio in TDM

 

 

Not as useful if it only works on headphones though.

Share this post


Link to post
Share on other sites

Not as useful if it only works on headphones though.

 

I was ready to greentext you. Who doesn't play TDM with headphones?

 

This seems like a good poll question. What sound system do you predominantly use with TDM? Headphones, earphones, laptop speakers, discrete/external speakers, 5.1 surround sound system, etc.

  • Like 1

Share this post


Link to post
Share on other sites

 

Not as useful if it only works on headphones though.

Well, OpenAL Soft has great positional audio even without HRTF on speakers (definitely better than TDM's default). There is also another way to improve positional audio for speakers. Doom 3/TDM uses DirectSound3D by default which was replaced by very poor software audio in Windows Vista. Creative wrote the Alchemy wrapper to bring DirectSound 3D back. It only works with Creative sound cards though. It improves positional audio for older games by a large margin for any Windows newer than XP. However, OpenAL Soft is better than DS3D in every way and should be preferred since it's natively supported by TDM.

 

@New Horizon: I recorded a video. Uploading now. Should take an hour though. Will be here:

https://youtu.be/MVqFbu4gsqs

Edited by Hiradur
  • Like 2

Share this post


Link to post
Share on other sites
Who doesn't play TDM with headphones?

 

 

People with 5.1 surround sound, I imagine.

 

Though I've never been satisfied with the way TDM does 5.1 sound.

Share this post


Link to post
Share on other sites

Though I've never been satisfied with the way TDM does 5.1 sound.

 

Give it a try with OpenAL Soft (you can set 5.1 in its config), surround sound with the DS3D software implementation in Vista and above is very bad.

 

EDIT: Demo video now up

Edited by Hiradur
  • Like 2

Share this post


Link to post
Share on other sites

I believe we can move the runtime/dlls to TDM folder too, without any name change (and so keeping ALL the OpenAL implementations, SoftOpenAL one and Creative one)

 

seta s_useOpenAL "1"
-> seta s_libOpenAL "soft_oal.dll"
Edited by lowenz
  • Like 1

Share this post


Link to post
Share on other sites

 

I believe we can move the runtime/dlls to TDM folder too, without any name change (and so keeping ALL the OpenAL implementations, SoftOpenAL one and Creative one)

 

seta s_useOpenAL "1"
-> seta s_libOpenAL "soft_oal.dll"

 

 

Yes, this should work. Unless you are using a Creative card though OpenAL Soft may be superior to Creative's OpenAL implementation.

  • Like 1

Share this post


Link to post
Share on other sites

I run 5.1 and have in the past played about with eax when tdm still required doom3.

 

So will give this a run through on the headphones and 5.1, with before and after vids.

Share this post


Link to post
Share on other sites

I run 5.1 and have in the past played about with eax when tdm still required doom3.

 

So will give this a run through on the headphones and 5.1, with before and after vids.

 

Please note that EAX and 5.1 surround sound (positional audio in general) are two different things as I mentioned in a post above.

 

I think this video demonstrates what EAX and its successor EFX do quite well:

 

It's adding reverb to his voice depending on the environment he is in. You can clearly tell it has nothing to do with surround sound.

  • Like 1

Share this post


Link to post
Share on other sites

I run 5.1 and have in the past played about with eax when tdm still required doom3.

 

So will give this a run through on the headphones and 5.1, with before and after vids.

Yes, as noted, this is for better positional audio and not environmental effects. EFX would still need to be implemented in the future.

Share this post


Link to post
Share on other sites

As far as I know Soft OpenAL HRTF requires a *stereo* setup (not 5.1) for the speakers, so remember to select stereo in TDM options.

Edited by lowenz
  • Like 1

Share this post


Link to post
Share on other sites
So will give this a run through on the headphones and 5.1, with before and after vids.

 

 

I'll be interested in your results.

  • Like 1

Share this post


Link to post
Share on other sites

As far as I know Soft OpenAL HRTF requires a *stereo* setup (not 5.1) for the speakers, so remember to select stereo in TDM options.

 

That's correct, I forgot to mention this in the guide. Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Hmm I guess someone should open a feature request for a portable implementation. Having to leave the config files in appdata

seems a bit messy. It would be ideal if you could just plop the dll and config files next to your app (and for TDM set the OpenAL driver

console commands).

  • Like 1

Share this post


Link to post
Share on other sites

My problem at this point is:

 

Final steps for both Windows versions:

- move standard HRTF datasets (default*.mhr) from hrtf to %appdata%\openal\hrtf

- remove OpenAL32.dll/wrap_oal.dll from the game folder if existing
- Download alsoftrc.sample, save as alsoft.ini to %appdata% and change "#hrtf = false" to "hrtf=true" (remove "#"!)

- make sure your audio sample rate is 44,1kHz or 48kHz

- turn on OpenAL in Darkmod.cfg (seta s_useOpenAL "1")

- set TDM to stereo sound

---------------------------------------------------

I got that far, but can't seem to locate or know what to do. The download mentioned is just a text of code. I don't get it. I'm sorry for not being as up to par. Just trying to really enjoy TDM with some positional audio.

Thank you.

Share this post


Link to post
Share on other sites

My problem at this point is:

 

Final steps for both Windows versions:

- move standard HRTF datasets (default*.mhr) from hrtf to %appdata%\openal\hrtf

- remove OpenAL32.dll/wrap_oal.dll from the game folder if existing

- Download alsoftrc.sample, save as alsoft.ini to %appdata% and change "#hrtf = false" to "hrtf=true" (remove "#"!)

- make sure your audio sample rate is 44,1kHz or 48kHz

- turn on OpenAL in Darkmod.cfg (seta s_useOpenAL "1")

- set TDM to stereo sound

---------------------------------------------------

I got that far, but can't seem to locate or know what to do. The download mentioned is just a text of code. I don't get it. I'm sorry for not being as up to par. Just trying to really enjoy TDM with some positional audio.

Thank you.

 

Now I'm not sure which step exactly you are lost on but the HRTF datasets are in the hrtf directory in openal-soft-1.17.1-bin.zip

 

For alsoftrc.sample you have to create an alsoft.ini file in %appdata% and then copy the text from https://raw.githubusercontent.com/kcat/openal-soft/master/alsoftrc.sample to this ini file. Inside the ini file you change "#hrtf = false" to "hrtf=true" (remove "#"!).

 

 

Hmm I guess someone should open a feature request for a portable implementation. Having to leave the config files in appdata

seems a bit messy. It would be ideal if you could just plop the dll and config files next to your app (and for TDM set the OpenAL driver

console commands).

 

 

I guess the easiest way to achieve that would be to bundle soft_oal.dll with TDM and add an option to the settings menu for HRTF.

I'm taking this opportunity to propose to make OpenAL Soft the default for audio because there is really no reason not to. DirectSound3D, which is used by TDM by default, only offers good positional audio on Windows XP and older as I said above. Nobody should be using these old Windows versions anymore and even if they do they can just disable OpenAL (OAL Soft ist better than DS3D in every aspect though).

I want to make clear that OpenAL Soft offers great positional audio not only for headphone users but also for speakers, including surround sound systems. I'm one of the Rigs of Rods developers and we've been using OpenAL Soft for years and the audio experience is just great.

 

 

btw: The alsoft.ini file offers some more options other than HRTF. You can set the angles in which speakers point to you for better positioning and you can enforce using a 5.1 setup for example which I would do if you are using one because with Windows you can never be totally sure if it's detecting it correctly. You can also set a resampling algorithm. Sinc4/8 e.g. works wonders for old games using 22,050 sample rate for sounds, such as Thief 1&2 and is basically essential for Quake 2 so that the earthquake sound doesn't get distorted.

The .ini file is well documented and it's worth to look at IMO.

  • Like 1

Share this post


Link to post
Share on other sites

Only one note :D

 

If I use the config tool included in the package it creates the alsoft.ini in appdata\roaming folder.

 

So I assume that is the correct dir, not appdata root.

Edited by lowenz

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...