Arsunt / TR2Main

Tomb Raider II Injector Dynamic Library
GNU General Public License v3.0
188 stars 14 forks source link

Still having audio issues under Wine/Proton 8 #44

Open Alyxx88 opened 7 months ago

Alyxx88 commented 7 months ago

Fixed the audio delay by installing quartz_feb2010 and d3dx9_43. Otherwise I am still dealing with the game's audio looping oddly after picking up a secret or otherwise changing the music loop length.

It also crashes after a while on Proton 7 Wine releases.

Originally posted by @Alyxx88 in https://github.com/Arsunt/TR2Main/issues/43#issuecomment-1981306720

noisecode3 commented 7 months ago

Hi, can you run wine and copy the log output in a file? Can you see if its like a FIX ME: DSOUND something right when the sound loops or gets weird? With a clean prefix it should work, the bug might not be related to this project, it could. Try to use latest wine staging if you can. I remember this bug, but I'm really busy also.

Alyxx88 commented 7 months ago

Hi, can you run wine and copy the log output in a file? Can you see if its like a FIX ME: DSOUND something right when the sound loops or gets weird? With a clean prefix it should work, the bug might not be related to this project, it could. Try to use latest wine staging if you can. I remember this bug, but I'm really busy also.

On the latest Wine Staging there is no cd audio at all on my system, at least running it through the default system Wine.

I am running it through Proton-Custom-GE on Garuda Linux Dr460nized KDE (Arch Linux).

I do not find any mention of dsound in the log file. And I am using the AUR version of Proton-Custom-GE although this bug has presented on ALL available Wine/Proton builds I have available, including Proton 9 Beta.

Curiously using a wav file instead of mp3 for cdaudio fixes the loop bug but presents another problem with constant microfreezes when loading a new track, which causes a slight delay in audio for the cutscenes.

I doubt the bug is directly related to TR2Main, as it presents on the base game as well. I think it is more related to Wine/Proton. steam-225300.log

noisecode3 commented 7 months ago

That's some buffer problem, its hitting the else then the first if, and it lands on that error, you see? https://github.com/wine-mirror/wine/blob/0d616f9eb0cf3246630314709c47bec40ee6efb0/dlls/winegstreamer/quartz_parser.c#L1241C2-L1241C59 I'm not gonna go deeper into this right now I have a test, looks interesting.

Alyxx88 commented 7 months ago

err:quartz:send_buffer Failed to get a sample

This line is the one you're talking about, right?

Yeah I'm a bit unsure what to do about that. Suggestions or even better, solutions, would be nice.

noisecode3 commented 7 months ago

You dont need to do anything, right now. I will write again if I need you to test something.

I think it happens when It plays the menu music the buffer gets out of sync when it switches source. when its suppose to repeat what it reads outside at some (Fix point reproducible by a save just before) point and lets the background music hang in a loop. So the end and start of the buffer is not right, so it keeps playing a loop. It could be that files are corrupt (the mp3) or in the game how it handle the buffer. Windows have protections against some buffer problems.

I set this up with windows10+code blocks with virualbox. Used windows sdk 2022 and some old directx sdk from 2010, it was called DXSDK_Jun10.exe... and w64devkit to do the compiling. And It ran with proton.

noisecode3 commented 6 months ago

You can report this to wine, there is multiple problems when it runs on wine. It looks like there is some datarace, buffer problem but just with wine.

Im creating a wine build that wont depend on mono, just for fun, I want it. Maybe I finish that this summer.