Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX SDK sample crashes with dsoal #40

Closed
mirh opened this issue Jan 26, 2022 · 18 comments
Closed

DX SDK sample crashes with dsoal #40

mirh opened this issue Jan 26, 2022 · 18 comments

Comments

@mirh
Copy link

mirh commented Jan 26, 2022

Quick download

@Kappa971
Copy link

This program doesn't seem official from Microsoft, what does it do? Maybe the problem is this program and not DSOAL or it takes advantage of some DirectSound function that is absent in DSOAL and crashes (like GTA San Andreas).

@mirh
Copy link
Author

mirh commented Jan 31, 2022

It's an official sample
https://github.com/walbourn/directx-sdk-legacy-samples/tree/main/DirectSound/play3dsound
If any it may be that they dropped all the directsound ones with the 2008 sdks, but still.

@ThreeDeeJay
Copy link

ThreeDeeJay commented Feb 4, 2022

Can confirm. I don't know if there's anything useful but here's my log:

3984:trace:dsound:load_libopenal Found ALC_EXT_thread_local_context
3984:trace:dsound:DSOAL_DirectSoundCreate8 ((null), 00ED2B30, 00000000)
3984:trace:dsound:DSDevice_Create Creating device instance 006D7BE8
3984:trace:dsound:DS8_AddRef (006D7BE8) ref 1
3984:trace:dsound:DS8_Initialize (006D7BE8)->((null))
3984:trace:dsound:DSOAL_GetDeviceID (DSDEVID_DefaultPlayback, 000DF914)
3984:trace:dsound:DS8_Initialize Searching shared devices for {4ab7a8e2-da2b-4e63-a1f3-25c40571e13e}
3984:trace:dsound:DSShare_Create Creating shared device 006E4710

That's a nice find tho. Was there ever a 64-bit version of this or any other DirectSound3D benchmark app to test DSOAL x64?

@ThreeDeeJay
Copy link

ThreeDeeJay commented Feb 4, 2022

Good news, turns out the DSOAL XP fork doesn't crash and even HRTF works (running Windows 10).
https://i.imgur.com/05BRFXJ.mp4
https://github.com/pachuco/dsoal-XP/tree/master/release

Also tested it in XP (no DSOAL) for comparison
https://i.imgur.com/D24YAOj.mp4

btw in both XP and 10, all 3D algorithms sound identical.
But anyway, wonder how many broken games the XP fork fixes, and most importantly: if the relevant changes should be implemented in the master branch 🤔

@Kappa971
Copy link

Kappa971 commented Feb 4, 2022

With the recent changes in OpenAL Soft (EAX extensions) I don't think they are the only changes needed to DSOAL.

I think we need someone else who can help @kcat with the development (DSOAL seems pretty stuck at the moment).
Let's be clear, it's not a complaint, just my observation. I appreciate and admire all this work 🙂

@mirh
Copy link
Author

mirh commented Feb 4, 2022

@pachuco

That's a nice find tho. Was there ever a 64-bit version of this or any other DirectSound3D benchmark app to test DSOAL x64?

Yes? Updated source code is provided above, and x64 binaries were also provided in the original sdk.

@kcat
Copy link
Owner

kcat commented Feb 4, 2022

I think we need someone else who can help @kcat with the development (DSOAL seems pretty stuck at the moment).

I would like to get back to DSOAL after the next release of OpenAL Soft. That's taking a bit longer than expected because of PipeWire moving a bit slow along with a couple other things I'd like to have in for it.

@ThreeDeeJay
Copy link

Quick update: Still crashes on DSOAL (a16c19f)

@kcat
Copy link
Owner

kcat commented Jul 5, 2022

The executable doesn't seem to be available anymore, and I don't think I can build the sample from source (cross-compiling using MinGW-w64).

@ThreeDeeJay
Copy link

@kcat I made a backup here. Direct download.

@kcat
Copy link
Owner

kcat commented Jul 5, 2022

Hmm, it's not crashing here, using the latest DSOAL and OpenAL Soft (on Wine/Proton). Both the 32-bit and 64-bit versions work fine.

@ThreeDeeJay
Copy link

Interesting, perhaps it's related to the OS somehow.
I just tested again using the latest Github actions builds and on Windows 10 it still crashes, tho on my (mostly vanilla) Windows 11 virtual machine, it doesn't even run (no errors), even tho it works when DSOAL files aren't present.
Logs look very similar to #40 (comment)
dsoal_error-Win10.txt
dsoal_error-Win11.txt

@kcat
Copy link
Owner

kcat commented Jul 5, 2022

Might be related to the way it's handling COM during DSound device initialization. It initializes COM with CoInitialize to use IMMDeviceEnumerator and get an IMMDevice for the desired device. It then releases the enumerator and uninitalizes COM, but continues to query the IMMDevice for information. If the app already had COM initialized on the thread it's creating the DSound device with, it would be fine since COM initialization is reference counted (every init needs a deinit before it's fully deinitialized), but if it doesn't, the app could be crashing when trying to access the device after COM was uninitialized. Wine/Proton could be less sensitive to this than native Windows.

@mirh
Copy link
Author

mirh commented Jul 6, 2022

https://github.com/LiveMirror/DX9SDK/blob/master/Samples/C%2B%2B/DirectSound/Bin/Play3DSound.exe
And they don't use (well, at least directly) CoInitialize.
They call InitCommonControls in the WinMain entry point.

@kcat
Copy link
Owner

kcat commented Jul 6, 2022

Try now with commit 910cf95.

@ThreeDeeJay
Copy link

So far, so good 👌 https://i.imgur.com/nekEpEo.mp4

@ThreeDeeJay
Copy link

ThreeDeeJay commented Jul 6, 2022

And to top it off, it also seems to fix #41 so I hope this means we won't have to resort to (ol' reliable, but still ol') https://github.com/pachuco/dsoal-XP to fix startup crashes anymore.
Tho I noticed there were some mentions of MMDevice and COM in master...pachuco:dsoal-XP:master so I wonder if there are other changes that might be worth merging 👀

@ThreeDeeJay
Copy link

Yet another success story: QSound 3D demo (installer might not run, but you can get the extracted files from the mirror)
Configuration (contains instructions to get it to run on modern Windows) - Demo
910cf95 is lowkey looking like a huge step forward in terms of stability 👌

@mirh mirh closed this as completed Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants