kcat / dsoal

A DirectSound DLL replacer that enables surround sound, HRTF, and EAX support via OpenAL Soft
GNU Lesser General Public License v2.1
385 stars 51 forks source link

Medal of Honor crash (breakthrough & spearhead) #57

Open UserGit-2021 opened 2 years ago

UserGit-2021 commented 2 years ago

dsoal Force an EAX2 call to "initialize" EAX with 2.0 paramaeters and dsoal 1.31a doesn't work openal - openal-soft-1.22.1 log does not create.

mirh commented 2 years ago

https://github.com/kcat/dsoal/actions/runs/2509145907#artifacts http://vaporeon.io/hosted/dsoal-builds/dsoal-r430.7z http://vaporeon.io/hosted/dsoal-builds/old/ Does it also happen with older builds?

UserGit-2021 commented 2 years ago

https://github.com/kcat/dsoal/actions/runs/2509145907#artifacts http://vaporeon.io/hosted/dsoal-builds/dsoal-r430.7z http://vaporeon.io/hosted/dsoal-builds/old/ Does it also happen with older builds?

yes, crash

mirh commented 2 years ago

You have to set the DSOAL_LOGLEVEL environment variable for the log file to exist.

ThreeDeeJay commented 2 years ago

I tried the demo with the latest DSOAL build and didn't crash, although it was just virtual stereo even with the surround/headphones mode. But you could try your luck with the DSOAL-XP build, which usually doesn't crash when the regular build does for some reason.

EDIT: Apparently, the DSOAL v1.1 build (which seems to be based on 5147af08da947a56762b12785ecb5e2690c9e26e from June 16th 2018, or older idk) doesn't crash, according to this. For future reference, you might wanna check out this database to search for best known configurations for games.

mirh commented 2 years ago

Then, if we take the dates for good (which isn't exactly ideal tbh) the deal is in https://github.com/kcat/dsoal/compare/5147af08da947a56762b12785ecb5e2690c9e26e...fd6c69e8b98e47a69c9141d01375505d19adf511. Maybe disabling eax in alsoftrc could be already enough to change something.

UserGit-2021 commented 2 years ago

I tried the demo with the latest DSOAL build and didn't crash, although it was just virtual stereo even with the surround/headphones mode. But you could try your luck with the DSOAL-XP build, which usually doesn't crash when the regular build does for some reason.

EDIT: Apparently, the DSOAL v1.1 build (which seems to be based on 5147af0 from June 16th 2018, or older idk) doesn't crash, according to this. For future reference, you might wanna check out this database to search for best known configurations for games.

Doesn't work. 1.1 and xp build.

ThreeDeeJay commented 2 years ago

@UserGit-2021 The latest update (https://github.com/kcat/dsoal/commit/910cf95edc7c36113e949fa073cae637d3b44557) fixed a bunch of games like #59 (including some that needed the same workaround as the one used for Breakthrough/Spearhead) so there's a good chance it might also fix those 2. You can download the new dll from here or the whole package from here (might need to manually set hrtf = true in alsoft.ini). 🤞

UserGit-2021 commented 2 years ago

@UserGit-2021 The latest update (910cf95) fixed a bunch of games like #59 (including some that needed the same workaround as the one used for Breakthrough/Spearhead) so there's a good chance it might also fix those 2. You can download the new dll from here or the whole package from here (might need to manually set hrtf = true in alsoft.ini). 🤞

Tested. The latest new version is completely broken, including MOHAA, which used to work. OLD version OLD version

NEW version New version

Result before update MOHAA War Chest (GOG) Medal of Honor - Allied Assault - WORKS! OK! Spearhead - doesn't work breakthrough - doesn't work

Result after update MOHAA War Chest (GOG) Medal of Honor - Allied Assault - doesn't work Spearhead - doesn't work breakthrough - doesn't work

ThreeDeeJay commented 2 years ago

@UserGit-2021 So by "doesn't work", do you mean it just uses Miles Fast 2D Positional Audio? AFAIK the new update is supposed to fix crashes, but I just noticed that apparently you also need to force EAX/DS3D with a command.

Base game:

seta s_milesdriver "Creative Labs EAX 2 (TM)" using enhanced mss32.dll

Breakthrough / Spearhead:

seta s_milesdriver "DirectSound3D Hardware support" using enhanced mss32.dll

You can also force EAX/DS3D by deleting/moving all the .m3d files from the game folder (except for msseax.m3d and mssds3d.m3d) or just edit "main\configs\unnamedsoldier.cfg" with one of these values for seta s_milesdriver seta s_milesdriver "DirectSound3D Hardware Support" seta s_milesdriver "Creative Labs EAX (TM)" seta s_milesdriver "Creative Labs EAX 2 (TM)"

There's also this one but apparently the game doesn't support EAX 3.0, though you might be able to copy msseax3.m3d from another game and give it a shot if you wanna experiment. seta s_milesdriver "Creative Labs EAX 3 (TM)"

EAX 3 with Msseax3.m3d library from GTA Vice City works (also with its Mss32.dll), but spatialization quality is decreased in comparison to EAX 2. It can be obtained here. (EAX 3 wasn't released in 2001 yet[11]) https://www.pcgamingwiki.com/wiki/Medal_of_Honor:_Allied_Assault#3D_audio_providers_restoration

UserGit-2021 commented 2 years ago

@UserGit-2021 So by "doesn't work", do you mean it just uses Miles Fast 2D Positional Audio? AFAIK the new update is supposed to fix crashes, but I just noticed that apparently you also need to force EAX/DS3D with a command.

Base game:

seta s_milesdriver "Creative Labs EAX 2 (TM)" using enhanced mss32.dll

Breakthrough / Spearhead:

seta s_milesdriver "DirectSound3D Hardware support" using enhanced mss32.dll

You can also force EAX/DS3D by deleting/moving all the .m3d files from the game folder (except for msseax.m3d and mssds3d.m3d) or just edit "main\configs\unnamedsoldier.cfg" with one of these values for seta s_milesdriver seta s_milesdriver "DirectSound3D Hardware Support" seta s_milesdriver "Creative Labs EAX (TM)" seta s_milesdriver "Creative Labs EAX 2 (TM)"

There's also this one but apparently the game doesn't support EAX 3.0, though you might be able to copy msseax3.m3d from another game and give it a shot if you wanna experiment. seta s_milesdriver "Creative Labs EAX 3 (TM)"

EAX 3 with Msseax3.m3d library from GTA Vice City works (also with its Mss32.dll), but spatialization quality is decreased in comparison to EAX 2. It can be obtained here. (EAX 3 wasn't released in 2001 yet[11]) https://www.pcgamingwiki.com/wiki/Medal_of_Honor:_Allied_Assault#3D_audio_providers_restoration

Again a problem. Changed to creative eax 2-3, when the game starts, it translates back Miles Fast 2D Positional Audio. Running as administrator does not solve the problem. I give up.

ThreeDeeJay commented 2 years ago

Perhaps that means the game just doesn't support EAX 1/2/3 so it falls back to the default (Miles Fast 2D Positional Audio), or the .m3d files for those providers aren't present in the snddrivers folder. So if you wanna try one last thing, you could extract this into the game folder, then run/edit into main\configs\unnamedsoldier.cfg seta s_milesdriver "DirectSound3D Hardware support" or you can just go into the snddrivers folder and delete all the .m3d files except for Mssds3dh.m3d, and if it still fails, try DSOAL v1.1 again True 3D Sound for Headphones (HRTF mod)-65094-1-1.zip

UserGit-2021 commented 2 years ago

Perhaps that means the game just doesn't support EAX 1/2/3 so it falls back to the default (Miles Fast 2D Positional Audio), or the .m3d files for those providers aren't present in the snddrivers folder. So if you wanna try one last thing, you could extract this into the game folder, then run/edit into main\configs\unnamedsoldier.cfg seta s_milesdriver "DirectSound3D Hardware support" or you can just go into the snddrivers folder and delete all the .m3d files except for Mssds3dh.m3d, and if it still fails, try DSOAL v1.1 again True 3D Sound for Headphones (HRTF mod)-65094-1-1.zip

I often visit the pcgamingwiki site. I have tried all options. Does not work. Only 1.31a for the base game works. I don't want to experiment anymore. Thanks for trying to help me.

ThreeDeeJay commented 2 years ago

Well, for what is worth I can confirm the expansions do work with the latest DSOAL Spearhead https://youtu.be/JOJXHtPcDkY Breakthrough https://youtu.be/W3w9MgJemSQ I included simplified instructions to get 3D audio and EAX 3 in case you ever wanna give it another shot.

UserGit-2021 commented 2 years ago

Well, for what is worth I can confirm the expansions do work with the latest DSOAL Spearhead https://youtu.be/JOJXHtPcDkY Breakthrough https://youtu.be/W3w9MgJemSQ I included simplified instructions to get 3D audio and EAX 3 in case you ever wanna give it another shot.

It's a good news! Great job!

ThreeDeeJay commented 2 years ago

@UserGit-2021 Good luck! and remember to close the issue if it works on your end, too. 👍

UserGit-2021 commented 2 years ago

@UserGit-2021 Good luck! and remember to close the issue if it works on your end, too. 👍

I will later compare between Alchemy and dsoal. I will find errors in sounds. I will send reports later.

UserGit-2021 commented 2 years ago

@UserGit-2021 Good luck! and remember to close the issue if it works on your end, too. 👍

It's on Creative Alchemy. Hope this helps. I don't hear the difference. https://drive.google.com/file/d/1Ms5E3OmU55EFFTPo1ODJSH3rn8mxLI5O/view?usp=sharing

I'll attach the log. dsoal_error.txt

UserGit-2021 commented 2 years ago

Creative ALchemy EAX2.0

https://user-images.githubusercontent.com/91757058/180872740-adcc2c9d-0003-4848-8eb9-739a4d6834e3.mp4

DSOAL EAX2.0

https://user-images.githubusercontent.com/91757058/180872749-a7982b19-2da1-4e45-b185-c7c9739ad745.mp4

Spearhead LOG

dsoal_error.txt

kcat commented 2 years ago

Are you using headphones or speakers? The log shows the device is configured for 7.1 surround sound, which means OpenAL Soft will make a 7.1 mix. If you're using headphones, that will then be either downmixed to stereo or virtualized with some kind of HRTF (the latter better than the former, but neither as good as OpenAL Soft's native HRTF rendering).

I'm not sure why the panning is behaving like that in the video. I can hear a very slight left/right panning as the camera turns around, but it's nowhere near as much as it should be. The log indicates it's using DS3D though, and I'm not seeing anything obviously wrong, so OpenAL Soft's 3D panning should be used. I've checked to make sure OpenAL Soft's 7.1 mixing is fine, it has strong channel separation as expected, even when played back with HRTF virtualization.

UserGit-2021 commented 2 years ago

Are you using headphones or speakers? The log shows the device is configured for 7.1 surround sound, which means OpenAL Soft will make a 7.1 mix. If you're using headphones, that will then be either downmixed to stereo or virtualized with some kind of HRTF (the latter better than the former, but neither as good as OpenAL Soft's native HRTF rendering).

I'm not sure why the panning is behaving like that in the video. I can hear a very slight left/right panning as the camera turns around, but it's nowhere near as much as it should be. The log indicates it's using DS3D though, and I'm not seeing anything obviously wrong, so OpenAL Soft's 3D panning should be used. I've checked to make sure OpenAL Soft's 7.1 mixing is fine, it has strong channel separation as expected, even when played back with HRTF virtualization.

Thanks for the answer. May I know your configuration file for Spearhead alsoft.ini? What do you think is the best result? Alchemy or DSOAL?

kcat commented 2 years ago

I don't have the game, so I can't tell you. If you're having issues with it when using DSOAL, I can try to help fix it, but since it seems to be working now for other people, I need to know what the issue is that you're actually having.

UserGit-2021 commented 2 years ago

I don't have the game, so I can't tell you. If you're having issues with it when using DSOAL, I can try to help fix it, but since it seems to be working now for other people, I need to know what the issue is that you're actually having.

I don't know if this is a problem. I made a video to show the difference between DSOAL and ALchemy.

The real problem is ❌ Some sounds are virtual stereo even though most sounds are spatialized in 3D ❌ Sound orientation seems to be all over the place sometimes, like footsteps when looking down

UserGit-2021 commented 1 year ago

I don't have the game, so I can't tell you. If you're having issues with it when using DSOAL, I can try to help fix it, but since it seems to be working now for other people, I need to know what the issue is that you're actually having.

New video https://youtu.be/zu98JG0yCsM

UserGit-2021 commented 1 year ago

I don't have the game, so I can't tell you. If you're having issues with it when using DSOAL, I can try to help fix it, but since it seems to be working now for other people, I need to know what the issue is that you're actually having.

it would be nice to add the ability to change position / rotation https://github.com/kcat/openal-soft/issues/674

kcat commented 1 year ago

New video https://youtu.be/zu98JG0yCsM

The lack of strong panning is likely because you're trying to force HRTF when the device is configured for (virtual?) surround sound. From the log you've shown in other issues, there's this:

[ALSOFT] (II) Found sample-type = "float32"
[ALSOFT] (II) Found channels = "stereo"
[ALSOFT] (II) Key ambi-format not found
[ALSOFT] (II) Found hrtf = "true"
[ALSOFT] (WW) general/hrtf is deprecated, please use stereo-encoding instead
[ALSOFT] (II) Key stereo-encoding not found
[ALSOFT] (II) ALC_MONO_SOURCES = 1024
[ALSOFT] (II) ALC_STEREO_SOURCES = 0
[ALSOFT] (II) Pre-reset: *Stereo, *Float32, *48000hz, 128 / 256 buffer
[ALSOFT] (II) Got message "Reset Device" (0x0001, this=0A0670B8, param=00000000)
[ALSOFT] (II) Device mix format:
    FormatTag      = 0xfffe
    Channels       = 8
    SamplesPerSec  = 48000
    AvgBytesPerSec = 1536000
    BlockAlign     = 32
    BitsPerSample  = 32
    Size           = 22
    Samples        = 32
    ChannelMask    = 0x63f
    SubFormat      = {00000003-0000-0010-8000-00aa00389b71}
[ALSOFT] (II) Requesting playback format:
    FormatTag      = 0xfffe
    Channels       = 2
    SamplesPerSec  = 48000
    AvgBytesPerSec = 384000
    BlockAlign     = 8
    BitsPerSample  = 32
    Size           = 22
    Samples        = 32
    ChannelMask    = 0x3
    SubFormat      = {00000003-0000-0010-8000-00aa00389b71}
[ALSOFT] (II) Got playback format:
    FormatTag      = 0xfffe
    Channels       = 8
    SamplesPerSec  = 48000
    AvgBytesPerSec = 1536000
    BlockAlign     = 32
    BitsPerSample  = 32
    Size           = 22
    Samples        = 32
    ChannelMask    = 0x63f
    SubFormat      = {00000003-0000-0010-8000-00aa00389b71}
[ALSOFT] (II) Key wasapi/allow-resampler not found
[ALSOFT] (II) Post-reset: Stereo, Float32, 48000hz, 480 / 1056 buffer
[ALSOFT] (II) Found stereo-mode = "headphones"

The device says it's 7.1, OpenAL Soft asks for stereo (as requested), then the device reports back it's giving 7.1. OpenAL Soft will then take the 7.1 stream, and use just the front-left and front-right channels to get the requested stereo output, which it then treats as direct-to-ear headphones. So as a result, you have a 7.1 speaker setup and the front two speakers are filtered as if they're headphones, which isn't how HRTF is supposed to be played. Remove these lines from your alsoft config file:

channels=stereo # incorrectly forces a stereo mix when the device isn't stereo
sources=512 # unnecessary, DSOAL asks for how many it needs and this is restricting it
stereo-mode=headphones # unnecessary, WASAPI will report this from the system configuration
sample-type=float32 # unnecessary, it's the default already
hrtf=true # incorrectly forces stereo/HRTF when it doesn't fit the device configuration

If you have headphones and are using 7.1 virtualization, you need to disable the virtualization to make them act as headphones for proper HRTF mixing. OpenAL Soft will automatically use HRTF when the system says the device is stereo headphones or headset. If you don't want to disable the virtualization, then you should let OpenAL Soft match how the device is configured (a 7.1 surround mix, as the device is expecting).

As for the weird panning when looking up and down, does that happen with real hardware? That behavior makes me think the game's using a naive method to convert a facing direction (a single 'at' vector) to an orientation (separate 'at' and 'up' vectors), which fails when the facing direction is parallel to the vertical axis. There's not much DSOAL or OpenAL Soft can do because the game isn't giving it a correct listener orientation, and there's no way to know what is correct.

UserGit-2021 commented 1 year ago

I don't have the game, so I can't tell you. If you're having issues with it when using DSOAL, I can try to help fix it, but since it seems to be working now for other people, I need to know what the issue is that you're actually having.

alsoft_error.txt dsoal_error.txt изображение https://youtu.be/YIhpfERq_24

Alsoft.ini [reverb] boost=12

[eax] enable = true

UserGit-2021 commented 1 year ago

I don't have the game, so I can't tell you. If you're having issues with it when using DSOAL, I can try to help fix it, but since it seems to be working now for other people, I need to know what the issue is that you're actually having.

изображение I want to leave these settings in the sound card panel. How to specify in alsoft.ini?

kcat commented 1 year ago

That's interesting that it's not detecting the device as headphones when set to "Headphone (Stereo)". You can put this back in alsoft.ini:

stereo-mode=headphones

to have OpenAL Soft assume headphones when the device reports stereo, but won't force stereo/HRTF when the device is set to virtual surround sound.

I want to leave these settings in the sound card panel. How to specify in alsoft.ini?

Make sure these values are removed:

channels=stereo
sources=512
sample-type=float32
hrtf=true

OpenAL Soft will then detect and do 7.1 mixing, which will sound better over virtual surround than trying to do stereo/HRTF over virtual surround.

If you really want full HRTF mixing while having Virtual 7.1 Surround enabled, you'll have to find a way to set up a virtual device with Windows, and have that virtual device do Virtual Surround while the real device is stereo. You can then set that virtual device as default so apps will use virtual surround normally, but then set individual apps (e.g. OpenAL Soft and DSOAL apps) to use the real device when they can do full HRTF itself.

UserGit-2021 commented 10 months ago

I think we can close this topic. Since the implementation is present OpenAL soft in openMOHAA.