ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
634 stars 74 forks source link

[TF2] - Newest update issue with Windows Volume Mixer #5894

Open gdfsgdfg opened 4 months ago

gdfsgdfg commented 4 months ago

After yesterdays update it appears my volume mixer will never remember its setting of 50 when I restart the game for some reason.

Anyone else have this?

For now I'll just keep the game volume at 50 instead. Untitled

ethanholt1 commented 4 months ago

As far as I know, apps can't set their own level in the Volume Mixer tab in Windows (I use Fedora, so this could be completely incorrect.) If this is true, this is most likely an issue with Windows not remembering the volume level or possibly not distinguishing the HL2 binary from TF2? If this isn't true, possibly just broken Windows calls.

JoriKos commented 4 months ago

It should be possible for a program to remember this, at least I've had programs do this. The only program that consistently doesn't do this is Discord, but that's also one of the worst programs in human history, so it should be possible to save it.

ethanholt1 commented 4 months ago

The only program that consistently doesn't do this is Discord, but that's also one of the worst programs in human history, so it should be possible to save it.

Yeah, Discord's awful. So what I'm hearing is this is a Windows issue and not necessarily a Source engine issue. Does that mean this should be closed, or should it be kept open to find a solution?

JoriKos commented 4 months ago

It's likely an issue that can be fixed on the game's end, though that's for the devs to decide. I would keep it open.

CatOnYourPorch commented 4 months ago

@gdfsgdfg Exact same thing happened with me, and I came here to report it. I use Windows 10.

Before 64-bit update:

After 64-bit update:

CoolJosh3k commented 4 months ago

I’d assume the volume control in TF2 is actually calling that Windows volume function. If you change volume from within TF2, does that also change those Windows settings?

If this is the case, you can set a value in an autoexec.cfg config file so it always sets the volume as desired when you load TF2.

EGH-01 commented 4 months ago

I, too, am having this exact issue.

CatOnYourPorch commented 4 months ago

@CoolJosh3k the Windows volume mixer is entirely different from the in-game sound volume mixer, but, and I didn't think of this before - I should just be able to use the in-game one instead now that 64-bit broke the Windows mixer's ability to save its state between launches! I'll try this. I think it should be a good substitute. Thanks!

elvissteinjr commented 4 months ago

now that 64-bit broke the Windows mixer's ability to save its state

I've tried looking into it a bit, without much practical success. But what I did at least see is that the volume is stored correctly in the registry and is only reset on each TF2 launch (both tf_win64.exe & tf.exe). Funnily enough, blocking write access to the key (for everything on the system) doesn't stop it from going back to 100% (this is relative to master volume ofc). Maybe volume mixer is upset and falls back defaults then anyways.

The key for these values is somewhere in "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore". For me TF2's in "50b962e7_0", but not sure if that ID is stable across systems. There are tools to make this more easily readable.

As far as I know, apps can't set their own level in the Volume Mixer tab in Windows (I use Fedora, so this could be completely incorrect.)

It's definitely possible (ISimpleAudioVolume::SetMasterVolume() on the process' audio session should work for this for example), but I wouldn't know why the game would do that. I more suspect it to be a side-effect of audio backend changes, but I can't do more than guess myself. On the flip side it means an external tool could set the app volume is a shoddy workaround.

As Steam was mentioned above: I did my fiddling without going through Steam to launch the game (obviously still connects to it via API however), so I don't think Steam itself plays a part in this.

JoriKos commented 3 weeks ago

To add to this, for some reason muting the sound entirely isn't reset.