MrAlert / sdlcl

SDL Compatibility Library
GNU Lesser General Public License v2.1
51 stars 5 forks source link

OSS interface crashes some games #17

Open rea987 opened 6 years ago

rea987 commented 6 years ago

As I have just found some games do crash due to unmet OSS library dependency when used with SDLCL. Unreal Tournement 2004's inexplicable crash https://github.com/MrAlert/sdlcl/issues/15 and Quake 4's SMP-accelerated client (quake4smp.x86, libSDL-1.2.id.so.0) crash are directly related with that.

It is usually expected to have no sound or a sound related crash information in case of lack of sound library; that's actually what happens when stock SDL library is use. But it that particular OSS related instance, games crash without information or with unrelated warnings when SDLCL used. Tried games:

Quake 4 and Quake 4 Multiplayer Demo:

Just like Enemy Territory: Quake Wars, it has 2 clients, first one is default client and the other is SMP-accelerated client which uses similar but older SDL patch of ETQW. https://github.com/MrAlert/sdlcl/issues/14#issuecomment-356764980 Default client (quake4.x86) uses OSS and ALSA without an issue; if OSS or OSS wrapper don't exist in the system when OSS is already selected in config file, there's no sound but also no crash. But accelerated client (quake4smp.x86, libSDL-1.2.id.so.0) crashes even if ALSA is selected in config file. I suspect that somehow accelerated client checks OSS bindings; when it cannot find any, it crashes. But the crash can be prevented by using 32 bit ALSA OSS compatibility library (alsa-oss, aoss).

SMP-accelerated client crash without OSS wrapper: https://pastebin.com/qkDd5bYT

SMP-accelerated client with OSS wrapper (alsa-oss; aoss): https://pastebin.com/J9FbwaHn

Quake 4 Multiplayer demo: https://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake4/demo/quake4-multiplayer-demo.x86.run

Quake 4 sdl.patch.1.2.10: https://github.com/liflg/quake.4_1.4.2-multilingual_x86/blob/master/data/data.tar.xz https://github.com/liflg/quake.4_1.4.2-multilingual_x86/tree/master/data

Unreal Tournement 2004:

This is an OpenAL that uses OSS. Normally, the game either requires either OSS or OSS wrapper to have proper sound; if OSS or OpenAL isn't present, there won't be sound. If the game is launched without OSS wrapper argument while using SDLCL, it will crash.

Unreal Tournament 2004 demo: https://community.pcgamingwiki.com/files/file/160-unreal-tournament-2004-linux-demo/

Unreal Tournament 2004 without OSS wrapper: https://pastebin.com/iQmAuC0y https://pastebin.com/JbxFZQrG

Unreal Tournament 2004 with OSS wrapper (padsp): https://pastebin.com/bJzLhLKn https://pastebin.com/geNErRq8

Enemy Territory: Quake Wars:

The game supports both OSS and ALSA. If OSS selected while there is no OSS wrapper present, there won't be a sound but also no crash.

OSS Wrappers:

OSS Proxy Daemon (osspd): Probably the best OSS emulator currently. It emulates OSS calls on-the-fly without requiring any additional argument. It works fine with Enemy Territory: Quake Wars and Unreal Tournament (1999). https://sourceforge.net/projects/osspd/ https://github.com/libfuse/osspd http://manpages.ubuntu.com/manpages/xenial/man8/osspd.8.html

PulseAudio OSS Wrapper (padsp): As it is a part of PulseAudio, it requires no install. But padsp needs to be used as a pre-argument to function. It works fine with 64 bit binary of Unreal Tournament 2004. https://linux.die.net/man/1/padsp

ALSA wrapper for OSS applications (alsa-oss; aoss): A simple wrapper that translates OSS calls into ALSA. 32 bit version works fine with Quake 4. https://www.unix.com/man-page/all/1/AOSS/

MrAlert commented 6 years ago

I normally use osspd, but when stopping it, I haven't had much luck reproducing the crashes in Unreal Tournament 2004 or Quake 4. None of these games use any of the audio-related functions in SDL either, so I don't understand why these would crash with SDLCL, but only when OSS is unavailable.

ghost commented 4 years ago

Hi @MrAlert , great project here!! I have tested it succesfully on RPI4 under box86 emulator, the problem is.. sound, it doesnt do the resampling (terrible sound, obviusly). I use osspd for this porpoise and under alsa (with osspd) it worked great out of the box, not with the wrapper