Jump to content
The Dark Mod Forums

[Obsolete as of TDM 2.07] Improve your TDM experience by playing with OpenAL Soft HRTF (better 3d audio)


Hiradur

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
Link to comment
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.

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

 

http://www.indiedb.com/mods/the-dark-mod

 

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

Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
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

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.

Link to comment
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
Link to comment
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
Link to comment
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.

Link to comment
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

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.

Link to comment
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.

Link to comment
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

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

 

http://www.indiedb.com/mods/the-dark-mod

 

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

Link to comment
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.

Link to comment
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
Link to comment
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

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.

Link to comment
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.


  • Recent Status Updates

    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
×
×
  • Create New...