kcat / dsoal

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

Relics: The 2nd Birth works only with ancient DSOUND.DLL #96

Open BEENNath58 opened 1 year ago

BEENNath58 commented 1 year ago

The game doesn't use EAX or any proprietary sound effects. The problem is in the normal DSOUND.DLL part.

The problem was mentioned in DxWnd forums https://sourceforge.net/p/dxwnd/discussion/general/thread/11e0a66a3c/

and despite my assumptions to be a problematic MME (the game was loading MMDevApi.dll too much, something that didn't happen with an old dsound.dll on Win11), the final issue was found in DSOUND.DLL. I could live with an old dsound.dll but it often stutters in the intro video parts (not to mention an old file is potentially unsafe).

Could DSOAL do anything for it?

The game is present in old-games ru.

I don't think logs can tell where the problem is since the game just hangs, but still I got LVL3 logs from OpenALSoft as well as DSOAL:

logs.zip

mirh commented 1 year ago

MMDevApi is WASAPI, which in turn just about everything in Vista uses. Nothing strange at all there.

The fix for my issue is: Take volume sliders to the highest with Hook DirectSound + Initialise Volume + Lock/Emulate Volume.

It's not exactly clear if this is actually something "qualitatively wrong" with dsound, or just the game having been written with the most fragile code ever and breaking even for (say) the slightest change in default values or something. You also mention ddrawcompat (which if any is something for dxwrapper to check), and XP compatibility mode. If the last is trully essential it would be nice if you could break down which of its 27 compatibility shims is actually the lucky one.

BEENNath58 commented 1 year ago

MMDevApi is WASAPI, which in turn just about everything in Vista uses. Nothing strange at all there.

I was suspecting the fact it was loading as a loop so that was suspicious...

The fix for my issue is: Take volume sliders to the highest with Hook DirectSound + Initialise Volume + Lock/Emulate Volume.

It's not exactly clear if this is actually something "qualitatively wrong" with dsound, or just the game having been written with the most fragile code ever and breaking even for (say) the slightest change in default values or something.

DON'T worry about this! This is a DxWnd feature which was breaking sound volume, and it happened because the feature is used rarely.

(A small view as to what it does: As I wrote "Initialise volume", the setting would multiply any volume in the Windows mixer by the volume put in DxWnd, by default, 0. So even without using DxWnd, it was running at 0 volume regardless of what volume is put in Windows mixer. I don't know how it does affect a condition outside DxWnd, but it happens on multiple computers so it should be something DxWnd exclusive)

This Volume is NOT the issue at all. As in my original post and the SF post: the issue is the game hangs with modern dsound.dll. Old dsound.dll fixes it, DSOAL doesn't. IndirectSound somehow manages to get into a DPlay error instead (not that I know how to contact jonpol to fix this).

You also mention ddrawcompat (which if any is something for dxwrapper to check), and XP compatibility mode. If the last is trully essential it would be nice if you could break down which of its 27 compatibility shims is actually the lucky one.

Username oleg on SF mentioned this, not me. Compatibility mode does nothing useful as he said. Ddrawcompat gives the 16bit color mode the game wants, which I instead get with the 16bit color compatibility mode in Properties panel.

mirh commented 1 year ago

Can you check if catchsegv gives some workable stack trace?

BEENNath58 commented 1 year ago

Can you check if catchsegv gives some workable stack trace?

Sorry but can you tell how to specifically use the catchsegv.exe I used drmingw.exe -i to install the JIT, but I don't know how to use catchsegv.exe, or how to hook it to the game

mirh commented 1 year ago
catchsegv -- Relics2.exe
BEENNath58 commented 1 year ago

Got this from CMD debugoutput

CREATE_PROCESS PID=22800 TID=25864 lpBaseOfImage=0000000000400000 \\?\D:\Program Files (x86)\BOTHTEC\RELICS The 2nd Birth\Relics2.exe
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00007FFA5C430000 \\?\C:\Windows\System32\ntdll.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000077B60000 \\?\C:\Windows\SysWOW64\ntdll.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00007FFA5AC70000 \\?\C:\Windows\System32\wow64.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00007FFA5B740000 \\?\C:\Windows\System32\wow64base.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00007FFA5AF30000 \\?\C:\Windows\System32\wow64win.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00007FFA5C3D0000 \\?\C:\Windows\System32\wow64con.dll
EXCEPTION PID=22800 TID=25864 ExceptionCode=0x80000003 dwFirstChance=1
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000077B50000 \\?\C:\Windows\System32\wow64cpu.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000768B0000 \\?\C:\Windows\SysWOW64\kernel32.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000076E40000 \\?\C:\Windows\SysWOW64\KernelBase.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=000000007A6F0000 \\?\C:\Windows\SysWOW64\apphelp.dll
CREATE_THREAD PID=22800 TID=9584
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000076600000 \\?\C:\Windows\SysWOW64\user32.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000076870000 \\?\C:\Windows\SysWOW64\win32u.dll
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=00000000748F0000 \\?\C:\Windows\SysWOW64\winmm.dll
CREATE_THREAD PID=22800 TID=5380
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000075C30000 \\?\C:\Windows\SysWOW64\gdi32.dll
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=0000000076B80000 \\?\C:\Windows\SysWOW64\ucrtbase.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000077A60000 \\?\C:\Windows\SysWOW64\gdi32full.dll
CREATE_THREAD PID=22800 TID=6352
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000075B10000 \\?\C:\Windows\SysWOW64\msvcp_win.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000076B00000 \\?\C:\Windows\SysWOW64\advapi32.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000077960000 \\?\C:\Windows\SysWOW64\msvcrt.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000767E0000 \\?\C:\Windows\SysWOW64\sechost.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000757F0000 \\?\C:\Windows\SysWOW64\rpcrt4.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000075F00000 \\?\C:\Windows\SysWOW64\shell32.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000759C0000 \\?\C:\Windows\SysWOW64\ole32.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000077200000 \\?\C:\Windows\SysWOW64\combase.dll
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=0000000079660000 \\?\C:\Windows\SysWOW64\ddraw.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000079220000 \\?\C:\Windows\SysWOW64\dsound.dll
LOAD_DLL PID=22800 TID=6352 lpBaseOfDll=0000000079050000 \\?\C:\Windows\SysWOW64\avifil32.dll
LOAD_DLL PID=22800 TID=5380 lpBaseOfDll=0000000079020000 \\?\C:\Windows\SysWOW64\msvfw32.dll
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=0000000079070000 \\?\C:\Windows\SysWOW64\dplayx.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000073590000 \\?\C:\Windows\SysWOW64\wsock32.dll
LOAD_DLL PID=22800 TID=6352 lpBaseOfDll=0000000079C10000 \\?\C:\Windows\SysWOW64\RESAMPLEDMO.DLL
LOAD_DLL PID=22800 TID=5380 lpBaseOfDll=000000005F300000 \\?\C:\Windows\SysWOW64\dxgi.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000765A0000 \\?\C:\Windows\SysWOW64\ws2_32.dll
LOAD_DLL PID=22800 TID=6352 lpBaseOfDll=0000000077480000 \\?\C:\Windows\SysWOW64\oleaut32.dll
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=0000000079FC0000 \\?\C:\Windows\SysWOW64\dciman32.dll
LOAD_DLL PID=22800 TID=5380 lpBaseOfDll=000000006C9C0000 \\?\C:\Windows\SysWOW64\powrprof.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000019D0000 \\?\C:\Windows\SysWOW64\powrprof.dll
UNLOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000019D0000
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=000000007AA10000 \\?\C:\Windows\SysWOW64\winmmbase.dll
LOAD_DLL PID=22800 TID=6352 lpBaseOfDll=000000007AAC0000 \\?\C:\Windows\SysWOW64\msacm32.dll
LOAD_DLL PID=22800 TID=5380 lpBaseOfDll=000000006C370000 \\?\C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.22621.608_none_42d541138da2ebd2\comctl32.dll
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=000000007AA30000 \\?\C:\Windows\SysWOW64\msdmo.dll
LOAD_DLL PID=22800 TID=5380 lpBaseOfDll=000000005EC50000 \\?\C:\Windows\SysWOW64\DXCore.dll
EXCEPTION PID=22800 TID=25864 ExceptionCode=0x4000001f dwFirstChance=1
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000767B0000 \\?\C:\Windows\SysWOW64\imm32.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=000000006C930000 \\?\C:\Windows\SysWOW64\umpdc.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000073430000 \\?\C:\Windows\SysWOW64\sspicli.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=000000006C940000 \\?\C:\Windows\SysWOW64\uxtheme.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000076A00000 \\?\C:\Windows\SysWOW64\msctf.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000073E20000 \\?\C:\Windows\SysWOW64\kernel.appcore.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000770C0000 \\?\C:\Windows\SysWOW64\bcryptprimitives.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000065E20000 \\?\C:\Windows\SysWOW64\TextInputFramework.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=000000007AF80000 \\?\C:\Windows\SysWOW64\CoreMessaging.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000042D0000 \\?\C:\Windows\SysWOW64\CoreUIComponents.dll
UNLOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000042D0000
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=00000000042D0000 \\?\C:\Windows\SysWOW64\CoreUIComponents.dll
LOAD_DLL PID=22800 TID=6352 lpBaseOfDll=0000000072AC0000 \\?\C:\Windows\SysWOW64\WinTypes.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000070B10000 \\?\C:\Windows\SysWOW64\cryptbase.dll
CREATE_THREAD PID=22800 TID=24108
CREATE_THREAD PID=22800 TID=25248
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000076DB0000 \\?\C:\Windows\SysWOW64\clbcatq.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000054270000 \\?\C:\Windows\SysWOW64\MMDevAPI.dll
LOAD_DLL PID=22800 TID=25864 lpBaseOfDll=0000000072B90000 \\?\C:\Windows\SysWOW64\devobj.dll
LOAD_DLL PID=22800 TID=9584 lpBaseOfDll=0000000003510000 \\?\C:\Windows\SysWOW64\cfgmgr32.dll
LOAD_DLL PID=22800 TID=5380 lpBaseOfDll=0000000072C30000 \\?\C:\Windows\SysWOW64\cfgmgr32.dll
LOAD_DLL PID=22800 TID=6352 lpBaseOfDll=0000000003550000 \\?\C:\Windows\SysWOW64\cfgmgr32.dll
UNLOAD_DLL PID=22800 TID=9584 lpBaseOfDll=0000000003510000
UNLOAD_DLL PID=22800 TID=6352 lpBaseOfDll=0000000003550000
CREATE_THREAD PID=22800 TID=11412
LOAD_DLL PID=22800 TID=11412 lpBaseOfDll=000000007BC80000 \\?\C:\Windows\SysWOW64\AudioSes.dll
LOAD_DLL PID=22800 TID=11412 lpBaseOfDll=0000000077130000 \\?\C:\Windows\SysWOW64\SHCore.dll
LOAD_DLL PID=22800 TID=11412 lpBaseOfDll=000000007A890000 \\?\C:\Windows\SysWOW64\ResourcePolicyClient.dll
CREATE_THREAD PID=22800 TID=20036
CREATE_THREAD PID=22800 TID=21612
CREATE_THREAD PID=22800 TID=20508
LOAD_DLL PID=22800 TID=21612 lpBaseOfDll=00000000540C0000 \\?\C:\Windows\SysWOW64\Windows.UI.dll
CREATE_THREAD PID=22800 TID=25196
LOAD_DLL PID=22800 TID=25196 lpBaseOfDll=000000007AAB0000 \\?\C:\Windows\SysWOW64\avrt.dll
EXIT_THREAD PID=22800 TID=24108 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=11412 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=20036 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=20508 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=25248 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=6352 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=9584 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=21612 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=25864 dwExitCode=0x1
EXIT_THREAD PID=22800 TID=5380 dwExitCode=0x1
EXIT_PROCESS PID=22800 TID=25196 dwExitCode=0x1

I also defined a minidump using -Z "C:\dumps\" but it is not generated.

I also know it is not the DxWnd forums, but that probably had a better logging of operations: I did a comparision of what happens on XP and 11, scroll to the middle to start seeing the sound part:

dxwndlogs.zip

BEENNath58 commented 1 year ago

Anything since?