Jump to content


Photo

Minimum volume cap for directional sounds

sound audio feature suggestion

  • Please log in to reply
18 replies to this topic

#1 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 736 posts

Posted 05 November 2018 - 05:49 PM

I'm coming across a little annoyance periodically, which I'm sure nearly every player can confirm and at least partly agree on. When playing TDM on headphones, directional audio does not set a minimum volume for the ear opposite of the source. This means that when a sound source is to your left, you hear it entirely in the left ear... and if it's to the right only in the right ear.

 

The first problem with this is that it's very irking for the player... to the point where I often have to look in a certain direction just to avoid noise in one ear and complete silence in the other. It's the same as trying to listen to music on one headphone only: It has an uncomfortable and unnatural effect on the brain and you feel tempted to press the stop button immediately. An additional issue is realism: If someone is standing to your left and talking toward you, you will of course hear them a bit more clearly with your left ear, but you'll also hear them with the right ear somewhat.

 

My suggestion is a new menu setting in the Audio panel, which allows us to configure a minimum volume that a sound can be reduced to by its direction alone. This would allow everyone to set it based on what feels most comfortable to each person, as well as what type of headphones they are using. It should only need to be a small value for comfort... something like 0.05 or 0.1 volume when the sound is coming directly away from that ear.

 

I know that directional sound is very important from a gameplay perspective; Players often use it to listen to a guard's footsteps or idle ramblings and know where they're coming from. This is why I'm suggesting a small minimum cap enough so it doesn't irk the ear, or at least having an option players can enable themselves even if it's off by default. Till then, is there already a cvar for this in the settings by chance?



#2 New Horizon

New Horizon

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 13853 posts

Posted 05 November 2018 - 07:11 PM

I don't think it should be a menu option. If this is really a matter of the sound being all in one ear and nothing in the other, then it should be fixed in code.

#3 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 736 posts

Posted 05 November 2018 - 08:18 PM

I don't think it should be a menu option. If this is really a matter of the sound being all in one ear and nothing in the other, then it should be fixed in code.

 

I do believe there should be a setting for it at least so everyone can customize it. 0 disables the min volume cap (current behavior), 1 disables directional sound entirely (volume only drops with distance not orientation, not sure who'd want that) but between them you can set the option to whatever best suits you. This should most likely be done as an engine change, it can probably be implemented with a tweak to the audio system.



#4 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12727 posts

Posted 05 November 2018 - 09:02 PM

Atm, there appear to be two minimums in use. One is for a 2-speaker system (aka "Stereo") and the other is for a 5.1 setup (aka "5.1").

 

The Stereo minimum is 0.25.

 

The 5.1 minimum is 0.

 

So, w/o digging into how the sound volume is split among the channels, I'm guessing that the Stereo code is already set up to provide a minimum amount of sound.

 

I don't know if this will work, but you could try setting "s_minVolume2" to something higher than its default setting of "0.25" (for a Stereo setup), or setting "s_minVolume6" to something higher than its default setting of "0.0". These cvars are not archived, so they get wiped when you close TDM. Maybe putting them into autoexec.cfg would make them persistent.

 

If this does work, then the remainder of the discussion should be about how to respond to the request.

 

 


  • Anderson likes this

#5 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 736 posts

Posted 05 November 2018 - 09:34 PM

Atm, there appear to be two minimums in use. One is for a 2-speaker system (aka "Stereo") and the other is for a 5.1 setup (aka "5.1").

 

The Stereo minimum is 0.25.

 

The 5.1 minimum is 0.

 

So, w/o digging into how the sound volume is split among the channels, I'm guessing that the Stereo code is already set up to provide a minimum amount of sound.

 

I don't know if this will work, but you could try setting "s_minVolume2" to something higher than its default setting of "0.25" (for a Stereo setup), or setting "s_minVolume6" to something higher than its default setting of "0.0". These cvars are not archived, so they get wiped when you close TDM. Maybe putting them into autoexec.cfg would make them persistent.

 

If this does work, then the remainder of the discussion should be about how to respond to the request.

 

 

 

So a minimum is implemented and enabled by default... something else must be wrong then. I'm using a pair of wireless stereo headphones with which I'm clearly experiencing this issue. I do have a 5.1 audio system integrated into my motherboard with speakers plugged into them, however they're a secondary device and always turned off (if they were used I wouldn't get sound in my headphones). Could TDM be detecting my headphones as a 5.1 system instead of merely stereo? If so that might be a bug or something in ALSA / PulseAudio which the engine doesn't like. I shall investigate more tomorrow, thanks.



#6 Anderson

Anderson

    Advanced Member

  • Member
  • PipPipPip
  • 1119 posts

Posted 06 November 2018 - 05:35 AM

You own a dedicated sound card?


 "I really perceive that vanity about which most men merely prate — the vanity of the human or temporal life. I live continually in a reverie of the future. I have no faith in human perfectibility. I think that human exertion will have no appreciable effect upon humanity. Man is now only more active — not more happy — nor more wise, than he was 6000 years ago. The result will never vary — and to suppose that it will, is to suppose that the foregone man has lived in vain — that the foregone time is but the rudiment of the future — that the myriads who have perished have not been upon equal footing with ourselves — nor are we with our posterity. I cannot agree to lose sight of man the individual, in man the mass."...

 

 

- 2 July 1844 letter to James Russell Lowell from Edgar Allan Poe.

 


#7 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12727 posts

Posted 06 November 2018 - 07:10 AM

What is Settings->Audio->Surround Sound set to?



#8 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 736 posts

Posted 06 November 2018 - 07:44 AM

What is Settings->Audio->Surround Sound set to?

 

The "Surround Sound" option is set to "Stereo".



#9 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 736 posts

Posted 06 November 2018 - 07:46 PM

This is quite peculiar. I loaded a FM back up then set both s_minVolume2 and s_minVolume6 to higher values. Neither made any difference, even after I used s_restart to reset the sound system. It seems that whatever I set either of them to, directional sounds will never be heard in the ear opposite of their source.



#10 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12727 posts

Posted 07 November 2018 - 12:09 AM

Ok, so either those are red herrings or there's a bug.

 

Issue filed.



#11 MirceaKitsune

MirceaKitsune

    Advanced Member

  • Member
  • PipPipPip
  • 736 posts

Posted 07 November 2018 - 07:36 AM

Ok, so either those are red herrings or there's a bug.

 

Issue filed.

 

Must be some sort of bug yes. Thanks.



#12 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1727 posts

Posted 07 November 2018 - 08:20 AM

It does seem to be a problem. It's not that noticeable on speakers, as they are positioned at certain distance from your ears. But with earphones the effect is much more jarring. Basically, you have to look straight at a speaker to hear the sound in both ears. When you turn the camera left or right, the sound gets cut off from one channel, and plays only in one ear. There seems to be an angle that allows to hear sound in both ears, but it's very narrow. Changing the values above doesn't do a thing.


Edited by Judith, 07 November 2018 - 08:20 AM.


#13 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1727 posts

Posted 25 November 2018 - 05:34 AM

I got back to this again. I was trying to compare TDM sounds with vanilla Doom 3, and the transition is smoother in D3. It also uses s_minVolume2 0.25 as default value. Changing this value actually works in Doom 3, but doesn't work in TDM. I suggest changing severity to high, as it affects player experience a lot.

 

All in all, we don't need a new "volume cap" cvar, it's just that s_minVolume2 doesn't work in TDM.

 

Edit: I just went back to 2.05 to see whether it works there, and it does. So it must have been broken during work on 2.06.


Edited by Judith, 25 November 2018 - 05:54 AM.


#14 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1126 posts

Posted 27 November 2018 - 01:04 AM

I think the old cvars no longer work after switching to OpenAL.

 

OpenAL has its own ways of fixing the problems. They are:

1) HRTF, controlled by hrtf. I can be enabled by following these instructions.

2) crossfeed, controlled by cf_level. It can be enabled in alsoft.ini just as hrtf.

Also all of this depends on whether you use headphones or not (stereo-mode in the ini file).

 

It seems that crossfeed closely corresponds to what s_minVolume did previously.

And HRTF seems to be an even better approach.

 

Moreover, it seems that HRTF should be enabled by default if OpenAL sees that you use headphones.

It least it looks like it from the default openal.ini contents.

I'll try to play with it and see what has to be done to enable HRTF.


  • Judith, nbohr1more and Anderson like this

#15 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9102 posts

Posted 27 November 2018 - 01:07 AM

Interesting that we are now converging on this topic:

http://forums.thedar...etter-3d-audio/
  • Anderson likes this
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...)

#16 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1727 posts

Posted 27 November 2018 - 01:19 AM

There's no such .ini file in TDM folder right now. I suggest making it and finding a value that is close to original s_minVolume2 0.25, because right now, even if OpenAL does something, the hearing angle is very narrow. And IMO it shouldn't rely on whether system detects headphones or not. Onboard chips and laptops do detect headphones, but other cards, like external USB interfaces, don't. It's better to have it switchable / user-controlled.


Edited by Judith, 27 November 2018 - 01:19 AM.

  • Anderson likes this

#17 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1126 posts

Posted 27 November 2018 - 02:19 AM

There's no such .ini file in TDM folder right now. I suggest making it and finding a value that is close to original s_minVolume2 0.25, because right now, even if OpenAL does something, the hearing angle is very narrow. And IMO it shouldn't rely on whether system detects headphones or not. Onboard chips and laptops do detect headphones, but other cards, like external USB interfaces, don't. It's better to have it switchable / user-controlled.

Yes, most likely we should make it easy to tweak alsoft.ini.

 

Right now it is loaded in order:

1) From global settings: %APPDATA%\alsoft.ini or another location on Linux.

2) From alsoft.ini in the path where executable file is located. In case of TDM it is the root directory of TDM installation.

3) From the path specified in ALSOFT_CONF env. var.

I think distributing the default configuration file near TDM executrable is the right way to go.

 

It is OK to set cf_level in the distributed ini file, but it won't affect anything if headphones are not detected.

And I don't think it should, since the tweak only makes sense when you have headphones.

The better approach would be to log somewhere whether headphones are detected or not and explain players how to override it.

Another approach is to add a setting in the main menu "headphones" with values "auto" / "yes" / "no" and propagate this setting into OpenAL.


  • Anderson likes this

#18 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1727 posts

Posted 27 November 2018 - 02:29 AM

It is OK to set cf_level in the distributed ini file, but it won't affect anything if headphones are not detected.
And I don't think it should, since the tweak only makes sense when you have headphones.

 
Not really, it also sounds a bit jarring on speakers. The default  cf_level = 0, and in practical terms it means something like this:
 
This is my WIP map, I placed the sound right in the middle of the door. The sound plays in both channels:
obraz.png
 
Now I turned my head to the right. The there is no sound in right channel.
obraz.png

IMO this default setting is too extreme, even for speakers. I suggest setting default cf_level to 2 (middle crossfeed) or changing it to 1 (low) if that's too much, but not leaving it on 0.

Edited by Judith, 27 November 2018 - 02:30 AM.

  • Anderson likes this

#19 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1126 posts

Posted 28 November 2018 - 12:16 PM

I suggest to continue discussion about distributing alsoft.ini in the thread dedicated to HRTF.


  • Judith and Anderson like this





Also tagged with one or more of these keywords: sound, audio, feature, suggestion

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users