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

X-Wing Alliance missing sounds with DSOAL #70

Open
morallo opened this issue Sep 26, 2022 · 5 comments
Open

X-Wing Alliance missing sounds with DSOAL #70

morallo opened this issue Sep 26, 2022 · 5 comments

Comments

@morallo
Copy link

morallo commented Sep 26, 2022

Hello,
I am trying to make X-Wing Alliance work with DSOAL, but when the 3D sound is active, there are sounds missing (mainly your own spacecraft engine).

These are the debug messages that the game provides:

[11232] { 16,4865 (16,4865)} 3D sound supported in hardware with 64 sounds.
[11232] { 16,4866 ( 0,0001)} Speaker config set to: Unknown
[11232] { 16,4866 ( 0,0000)} Primary sound buffer originally at 22050 hz, 16 bits, 2 channels.
[11232] { 16,4866 ( 0,0000)} Primary sound buffer set to 22050 hz, 16 bits, 2 channels.
[...]
[11232] { 33,3844 (13,9088)} Failed to queue sound; out of range.
[11232] { 33,3845 ( 0,0001)} Failed to queue sound; out of range.
[...]

And from dsoal_error.txt:

[...]
414c:err:dsound:DSBuffer_SetLoc Out of software sources
414c:err:dsound:DSBuffer_SetLoc Out of software sources
414c:warn:dsound:DSBuffer_Unlock Invalid parameters (0x1c2f7fb0,29184) (1C2F7FB0,29184,0019F2D8,0)
[...]

The last warning appears when actually playing sounds that work fine.
The Out of software sources happens as soon as in the loading screen for the mission.

Any idea of a typical root cause for this, or how to troubleshoot? I can have a look at the game code in IDA but I need some tips on what to look for.
Thanks in advance!

@kcat
Copy link
Owner

kcat commented Sep 26, 2022

Can you provide a full trace log from DSOAL? The "Out of software sources" error could indicate an older build that had fewer "software" sources, or it may be an app that uses many more sources/buffers than anticipated.

The DSBuffer_Unlock Invalid parameters warning/failure may indicate DSound should ignore the second pointer if the size is 0. Or maybe it's supposed to fail to make the app behave like it does with normal DSound. It looks like Wine would return the same error with those parameters.

@morallo
Copy link
Author

morallo commented Sep 27, 2022

Thanks for the help!

dsoal_log.zip

The game is supposed to use 32 channels/sources.
I configured 256 in a local alsoft.ini. I have tried also with lower values, even 32.

@kcat
Copy link
Owner

kcat commented Sep 28, 2022

That's using an older DSOAL. I'd try using a newer version. Also, I wouldn't modify the sources in alsoft.conf. DSOAL requests how many it wants to use, so modifying it with alsoft.conf will just limit it and make it behave less well.

@morallo
Copy link
Author

morallo commented Oct 1, 2022

dsoal_log.zip
This is with the latest version from 18 Aug 2022.

There are still "out of software sources" errors, and missing sounds.
The main missing sound is the user spacecraft engine, which I expect to be one of the first ones to be requested to DSOAL before the software sources can be exhausted...

This is the alsoft.ini:

 [General]
default-hrtf=Built-In HRTF
hrtf=true

[decoder]
hq-mode=true

Any ideas or next steps for troubleshooting?
Thank you!

@kcat
Copy link
Owner

kcat commented Mar 14, 2023

The latest commits for DSOAL increase the max source count, which allows for more software sources and should avoid that error (unless there's a deeper issue that just will use up all sources regardless of how many there are).

The DSBuffer_Unlock Invalid parameters error I'm less sure about. Wine's dsound should return a similar error, so either it's something the app normally does and the error is normal, or something else is causing it to provide a bad pointer.

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

2 participants