momentum-mod / game

Momentum Mod - Standalone Source Movement Speedrunning (READ README)
https://momentum-mod.org
Other
531 stars 210 forks source link

Speaker configuration options not showing at first #1721

Open Shegetz opened 2 years ago

Shegetz commented 2 years ago

Describe the bug

Speaker configuration dropdown is blank until you change settings and discard them unknown

How To Reproduce

  1. open settings
  2. look under Audio Device Configuration look at the speaker configuration dropdown

Expected Behavior

Dropdown options should appear without any fiddling

Operating System

Windows 10

Renderer

DX11 (default)

SlidyBat commented 1 week ago

This seems to happen because the convar has a default value of -1, which causes it to use headphones configuration but also enable HRTF. This is based off of CS:GO code, and I'm not sure how that even worked there. There seems to be some confusion due to the cvar also having been used in a legacy audio system, where -1 meant that engine should update it to reflect current value system is using.

Easiest option would be to just add new dropdown value for -1 of "unset"/"default"/"auto". Other option is to make some changes to audio code so that cvar is automatically updated from -1 to the actual value being used like it was in legacy audio system, but that could cause unintended changes elsewhere, e.g. disabling HRTF or archiving a value for cvar that shouldn't be saved.