Battlefield Vietnam Doesn't change Speaker Config
UserGit-2021 opened this issue · 22 comments
DSOAL Doesn't works.
dsoal_error.txt
Creative ALchemy works.
Does it make any difference if you try windows 98 compatibility?
Uhm.. that shouldn't happen either. Does it change anything if you use this script?
EAX works. But I can't choose headphones.
I have windows 10.
I entered the dsound registry a long time ago.

That doesn't work if you run the game as administrator, use the one I linked.
Run it as an admin then??
I see, right. The first line reports success indeed.
Does it make any difference if you run this first?
I see, right. The first line reports success indeed.
Does it make any difference if you run this first?
no difference.
Do you have {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} , {47D4D946-62E8-11CF-93BC-444553540000}, {B0210780-89CD-11d0-AF08-00A0C925CD16}, {B2F586D4-5558-49D1-A07B-3249DBBB33C2}, {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} and
{FEA4300C-7959-4147-B26A-2377B9E7A91D} in your registry?
Do you have
{3901CC3F-84B5-4FA4-BA35-AA8172B8A09B},{47D4D946-62E8-11CF-93BC-444553540000},{B0210780-89CD-11d0-AF08-00A0C925CD16},{B2F586D4-5558-49D1-A07B-3249DBBB33C2},{E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1}and{FEA4300C-7959-4147-B26A-2377B9E7A91D}in your registry?
Yes. All In registry. HKEY_CLASSES_ROOT\CLSID
DirectSound 8.0 Object
DirectSound Object
DirectSoundCapture Object
DirectSoundBufferConfig Object
DirectSoundCapture 8.0 Object
DirectSoundFullDuplex Object

Please check in HKLM\Software\Classes directly, HCR isn't reliable.
Please check in HKLM\Software\Classes directly, HCR isn't reliable.
The reason why these items do not work was identified.

https://i.imgur.com/VbjDcdN.mp4
The Windows GUI may be different since Vista, but I really don't think that matters.
My realtek audio console totally lets you select between line-in, headphones and speakers when you connect a jack to the green/frontal one (ok the screenshot is from an older version of the control panel, but still).
And you might argue: sure, because now the device type has a new/separate/alternate meaning.
https://web.archive.org/web/20030826041631/http://msdn.microsoft.com/archive/en-us/dx81_c/directx_cpp/htm/_dx_idirectsound8_getspeakerconfig_dxaudio.asp
But even after digging the hell out of old docs, I could barely find a "system" difference between DSSPEAKER_STEREO and DSSPEAKER_HEADPHONE. And it's about spatialization.. to the extent that it may even have practical consequences at all.
(there's also a note about that choice toggling sound card amps, and that may be the reason for its shift to the audio driver)
EDIT: this says nothing about the game's considerations it may do on its own. Source games for instance, should use this distinction to "upgrade mono room buffer to surround status" and to set different angles (↔ rather than ⦡) to calculate the volume scaling distance.
https://web.archive.org/web/20150110222639/http://msdn.microsoft.com/en-us/library/windows/hardware/ff536187(v=vs.85).aspx
https://web.archive.org/web/20040316072922/http://msdn.microsoft.com/archive/en-us/dx81_c/directx_cpp/htm/_dx_speaker_configuration_dxaudio.asp
https://web.archive.org/web/20040912053927/http://msdn.microsoft.com/library/en-us/directx9_c/directx/htm/idirectsound8setspeakerconfig.asp
https://web.archive.org/web/20130726013353/http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectsound8.idirectsound8.setspeakerconfig(v=vs.85).aspx
In Windows Vista and later versions of Windows, SetSpeakerConfig is a NOP. For Windows Vista and later versions, the speaker configuration is a system setting that should not be modified by an application. End users can set the speaker configuration through control panels.
I feel really dumb for having gone on such tangents in the previous comments, when the issue was so obvious.
I don't believe the function ever offered any guarantee of immediacy (if not even working at all between reboots) but the game might have added some extra checking (or maybe it's dsoal's fault, is default dsound.dll fine?) and it complains if nothing changes.
As they note here, I think the obvious solution would be passing the call to the DeviceTopology API's IAudioChannelConfig::SetChannelConfig (hoping that dsoal and oal-soft don't trip over the change on-the-fly).
I was told by one of the Daikatana 1.3 community patch developers that Miles Sound System is one of the very few APIs that are supported in Windows 98, so maybe that's why the game just hides all the others. or maybe Win98 compatibility just breaks something else idk

Also I wonder why my registry script is failing there. I should probably add more verbose logging 🤔
But anyhow, is changing speaker configuration in game even necessary?
From what I've seen so far, DSOAL doesn't seem to care if games/apps are set to headphones or speakers (just like how it also seems to ignore hardware vs software DirectSound3D and full vs light HRTF modes). Unless there are exceptions I'm not aware of, it overrides those settings with whatever alsoft.ini is set to do, so for example, if you already configured DSOAL to output HRTF for headphones, it will stick to that despite the game/app settings: https://i.imgur.com/lT2xGzh.mp4
In Windows XP using X-Fi hardware, however, those settings do behave differently: https://youtu.be/YtZ7WmtVs-o
Usually changing speaker configuration while DSOAL is active tends to break it so even if DSOAL could switch speaker config like games did in XP, which only a few rare apps can do in modern Windows, you might need to restart the game/app, unless you can restart DSOAL/the audio engine internally or something like that.




