Arsunt / TR2Main

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

linux wine issue: no background sound #4

Closed legluondunet closed 5 years ago

legluondunet commented 5 years ago

Hello,

I just tested TR2main on Linux with Wine, replaced tomb2.exe and copy TR2main.dll to the TR2 main folder. First issue: like many other tomb2.exe executable, it doesn't interact with winmm.dll, so it doesn't play soundtracks. I had the same issue with TR2 Gog edition, they changed the way TR2 play soundtracks, they doesn't seem to use winmm with music folder containing OGG/MP3 tracks. They now use an audio folder with two files: "cdaudio.dat" and "cdaudio.mp3". This new solution does not work with Wine.

I verified TR2main was active: I imported the animated background regedit file, it worked ok, very nice effect. The widescreen and FOV looked nice and compatible with DGVoodoo2.

Thank you for your help.

legluondunet commented 5 years ago

Finally found a winmm.dll wrapper TR2MAIN's compatible on this discussion: https://www.tombraiderforums.com/showpost.php?p=7845289&postcount=360 option b, put winmm.dll and fmodex.dll in the aim TR2 folder, extract cd audio files to mp3 format, call them xx.mp3 where xx is the track number and put them in a "audio" folder in the aim TR2 folder. I joined the dll to this issue, it could help someone. TR2_mp3_dll.zip

Arsunt commented 5 years ago

Thanks for the information. Has your problem been solved?

legluondunet commented 5 years ago

yes, thank you, TR2main is definitely the patch to use for playing TR2 today.

legluondunet commented 5 years ago

Could you tell me what sound wrapper you recommend for tr2main?

Arsunt commented 5 years ago

Could you tell me what sound wrapper you recommend for tr2main?

At the moment I recommend using a winmm.dll+fmodex.dll wrapper for the separate mp3 tracks. Otherwise use a cdaudio.dat+cdaudio.mp3 package from the Steam version, but pay attention that there must be no winmm.dll in the game folder.

Implementing in-game customizable sound engine is in my ToDo list.

legluondunet commented 5 years ago

"but pay attention that there must be no winmm.dll in the game folder" Could you tell me the reason? In this case what is the name of the sound wrapper?

Arsunt commented 5 years ago

"but pay attention that there must be no winmm.dll in the game folder" Could you tell me the reason? In this case what is the name of the sound wrapper?

It's a long story, but I will try to explain. WINMM.DLL is a part of Windows System32 libraries and in the past it was actively used to work with multimedia. Not only playing Audio CD, but also playing audio formats such as wav, mp3, and even mpeg4 video files.

The original library is designed in such a way that it executes commands from the application. For example, "play track 14" or "stop playing" or "set the volume level to 74%" or "play this mp3 file starting from second 38".

The idea of any Audio CD wrapper is to put fake winmm.dll (and some additional files) in the game folder, so that the game uses a fake library, not the original one in the system folder. This fake library converts any game command like "play track 14" into the command like "play file 14.mp3". That's why they call such thing as "wrapper", it just wraps, not patches. Wrapper change nothing in the game code, but it redirects, modifies or drops some game commands sent to system.

However, multipatch (used by Steam) is a completely different, the game code itself is rewritten to use the winmm.dll library to play mp3 files, not AudioCD tracks. This method is invented by hacker PaulD, and known as "PaulD CD audio solution". This way requires that winmm.dll is original, not fake. This is possible if there is no winmm.dll file in the game folder, so the game uses the one that in System32 folder.

TR2Main is full-fledged solution with redesigned and properly rewritten game code. So it supports original CD Audio if you want to use CD disk or CD image or CD Audio wrapper. It supports PaulD solution too if you want to use claudio.mp3+cdaudio.dat with no wrapper at all. Also in the future it will support separate audio files with no wrapper required at all.