joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.82k stars 383 forks source link

Segmentation Fault in Tombraider game switching to glide #3465

Open bell07 opened 2 years ago

bell07 commented 2 years ago

Code of Conduct & Contributing Guidelines

Have you checked that no other similar bug report(s) already exists?

What operating system(s) this bug have occurred on?

Gentoo Linux 5.17 x86_64

What version(s) of DOSBox-X have this bug?

games-emulation/dosbox-x-0.83.25::tatsh-overlay

Describe the bug

Something is changed with 0.83.25 version. Last working version is 0.93.24 If I try to run TombRaider1, I get segmentation fault in libsdl-1, if the game try to switch to OpenGlide Voodoo.

System log get the next lines

[22375.663055] dosbox-x[18938]: segfault at 250 ip 00007f71fe6afc7c sp 00007ffcc502d168 error 4 in libSDL-1.2.so.0.11.5[7f71fe688000+45000]
[22375.663085] Code: 05 e1 83 03 00 48 8d 50 50 48 85 c0 48 0f 45 c2 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 f8 48 8b 3d be 83 03 00 89 f2 <48> 8b 87 50 02 00 00 48 85 c0 74 28 4d 85 c0 74 13 48 8b 47 10 4c

Found already existing issues with libSDL-2, but this time it seems to be related to libSDL-1

Tried on 2 different computers Tried with OpenGlide commit c300160d0a8292bc04e79dd59e6cc178aa648dec (Gentoo package) and with the latest git version

Expected behavior

No response

Steps to reproduce the behaviour

Run dosbox-x in TombRaider 1 folder with given dosbox.x conf The game starts, you see the intro videos At the point the menu should appear, dosbox crash with segmentation fault

Used configuration

[sdl]
mapperfile = dosbox-x-mapper.map
fullresolution    = desktop
output            = opengl

[voodoo]
glide = true

[joystick]
timed = false

[autoexec]
mount C .
imgmount d GAME.DAT -t iso -fs iso
c:
cd TOMBRAID
cls
tomb.exe
exit

Emulator log

$ dosbox-x 
LOG: Early LOG Init complete
LOG: DOSBox-X's working directory: /home/belka/Games/DOS/Tomb Raider 1
LOG: Logging init: beginning logging proper. This is the end of the early init logging
LOG: Logging: No logfile was given. All further logging will be discarded.
LOG: DOSBox-X version 0.83.25 (Linux SDL1)
Warning: XMODIFIERS is unspecified
LOG: Current X11 keyboard layout (full name) is: 'German'
LOG: Current X11 keyboard layout (token) is: 'de'
LOG: Host keyboard layout is now ger (German)
LOG: Mapper keyboard layout is now ger (German)
LOG: SDL1 auto-detected desktop as 4480 x 1440
LOG: Configured windowposition: 
LOG: X11 main window is 640 x 400 maximized=0
LOG: X11 extension XRANDR is available
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: XRandR CRTC 1: pos=(0,0) size=(1920,1080) outputs=1
LOG: Our window lies on this CRTC display (window pos=(634,324) size=(640,400) match=(954,524)).
LOG:   Goes to output 0: name='eDP-1' size_mm=(344 x 194)
LOG: Screen report: Method 'XRandR' (1920.000 x 1080.000 pixels) at (0.000 x 0.000) (344.000 x 194.000 mm) (13.543 x 7.638 in) (141.767 x 141.402 DPI)
LOG: ISA BCLK: 8333333.333Hz (25000000/3)
LOG: monopal: green, 
LOG: Active save slot: 1 [Empty]
LOG: USING AVI+ZMBV
LOG: Max 3670016 sz 16384
LOG: Final 16384
LOG: Glide:LFB access: read-write (no aux)
LOG: SDLNet_TCP_Open: Couldn't connect to remote host
LOG: TiMidity: can't open control connection (host=127.0.0.1, port=7777)
fluidsynth: error: Unknown numeric setting 'audio.periods'
fluidsynth: error: Unknown numeric setting 'audio.period-size'
fluidsynth: error: Unknown string setting 'synth.reverb.active'
fluidsynth: error: Unknown string setting 'synth.chorus.active'
fluidsynth: Using PulseAudio driver
fluidsynth: warning: Failed to set thread to high priority
LOG: MIDI:fluidsynth: Loaded SoundFont: /usr/share/sounds/sf2/FluidR3_GM.sf2
LOG: MIDI:Opened device:fluidsynth
LOG: Pentium CMPXCHG8B emulation is enabled
LOG: One joystick reported, initializing with 4axis
LOG: Using joystick Logitech Gamepad F710 with 6 axes, 11 buttons and 1 hat(s)
LOG: VOODOO LFB now at d0000000
LOG: Serial1: BASE 3f8h
LOG: Serial2: BASE 2f8h
LOG: MPU-401 Registering I/O ports as if IBM PC MPU-401 at base 330h
LOG: GetDesktopResolution reading X11 desktop resolution
LOG: Root window (ID 505) is 4480 x 1440
LOG: X11 main window is 640 x 400 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: XRandR CRTC 1: pos=(0,0) size=(1920,1080) outputs=1
LOG: Our window lies on this CRTC display (window pos=(634,324) size=(640,400) match=(954,524)).
LOG:   Goes to output 0: name='eDP-1' size_mm=(344 x 194)
LOG: Screen report: Method 'XRandR' (1920.000 x 1080.000 pixels) at (0.000 x 0.000) (344.000 x 194.000 mm) (13.543 x 7.638 in) (141.767 x 141.402 DPI)
LOG: Allocated APM BIOS pm entry point at f000:ce20
LOG: Writing code to fce20
LOG: Writing code to fce40
LOG: X11 main window is 640 x 400 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: XRandR CRTC 1: pos=(0,0) size=(1920,1080) outputs=1
LOG: Our window lies on this CRTC display (window pos=(634,324) size=(640,400) match=(954,524)).
LOG:   Goes to output 0: name='eDP-1' size_mm=(344 x 194)
LOG: Screen report: Method 'XRandR' (1920.000 x 1080.000 pixels) at (0.000 x 0.000) (344.000 x 194.000 mm) (13.543 x 7.638 in) (141.767 x 141.402 DPI)
LOG: ISA Plug & Play BIOS enabled
LOG: VGA ROM BIOS init callback
LOG: pixratio 1.000, dw false, dh false
LOG: Aspect ratio: 640 x 480  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG: WARNING: No translation support (to host) for code page 0
LOG:    1381850 ERROR BIOS:Keyboard layout file auto not found
LOG:    1381850 ERROR BIOS:Keyboard layout file auto not found
LOG: XMS: 50 handles allocated for use by the DOS environment
LOG: EMS page frame at 0xe000-0xefff
LOG: COMMAND.COM env size:             720 bytes
LOG: COMMAND.COM environment block:    0x0701 sz=0x002d
LOG: COMMAND.COM main body (PSP):      0x072f sz=0x009a
LOG: COMMAND.COM stack:                0x0749
LOG: pixratio 1.350, dw false, dh false
LOG: Aspect ratio: 720 x 540  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: X11 main window is 720 x 417 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1880,511) size=(720,417) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: X11 main window is 720 x 417 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1880,511) size=(720,417) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG: IDE: index 0 slave=0
LOG: CDROM: Loaded 02.mp3 [44100 Hz 2-channel length 3.4 min.]
LOG: CDROM: Loaded 03.mp3 [44100 Hz 2-channel length 2.1 min.]
LOG: CDROM: Loaded 04.mp3 [44100 Hz 2-channel length 3.2 min.]
LOG: CDROM: Loaded 05.mp3 [44100 Hz 2-channel length 3.3 min.]
LOG: CDROM: Loaded 06.mp3 [44100 Hz 2-channel length 3.2 min.]
LOG: CDROM: Loaded 07.mp3 [44100 Hz 2-channel length 1.2 min.]
LOG: CDROM: Loaded 08.mp3 [44100 Hz 2-channel length 1.1 min.]
LOG: CDROM: Loaded 09.mp3 [44100 Hz 2-channel length 0.4 min.]
LOG: CDROM: Loaded 10.mp3 [44100 Hz 2-channel length 0.6 min.]
LOG:   14564250 ERROR BIOS:INT15:Unknown call ax=BFDE
LOG:   14564328 ERROR BIOS:INT15:Unknown call ax=BFDE
LOG: DOSBox-X has switched to max cycles, because of the setting: cycles=auto.
If the game runs too fast, try a fixed cycles amount in DOSBox-X's options.
LOG:   14575397 ERROR BIOS:INT15:Unknown call ax=BF01
LOG: CDROM: GetAudioTracks, stTrack=1, end=10, leadOut.min=45, leadOut.sec=2, leadOut.fr=27
LOG:   14842705 ERROR MOUSE:Unhandled videomode 69 on reset
LOG: pixratio 1.000, dw false, dh false
LOG: Aspect ratio: 640 x 480  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG:   14842749 ERROR MOUSE:Unhandled videomode 69 on reset
LOG: Glide:Activated
LOG:   14845495 ERROR MOUSE:Unhandled videomode 69 on reset
LOG:   14852922 ERROR MOUSE:Unhandled videomode 78 on reset
LOG: pixratio 1.000, dw false, dh false
LOG: Aspect ratio: 640 x 480  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG:   15050121 ERROR MOUSE:Unhandled videomode 78 on reset
LOG:   15623928 ERROR MOUSE:Unhandled videomode 69 on reset
LOG: pixratio 1.000, dw false, dh false
LOG: Aspect ratio: 640 x 480  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: X11 main window is 640 x 497 maximized=0
LOG: XRandR CRTC 0: pos=(1920,0) size=(2560,1440) outputs=1
LOG: Our window lies on this CRTC display (window pos=(1920,471) size=(640,497) match=(2240,719)).
LOG:   Goes to output 0: name='DP-1' size_mm=(698 x 393)
LOG: Screen report: Method 'XRandR' (2560.000 x 1440.000 pixels) at (1920.000 x 0.000) (698.000 x 393.000 mm) (27.480 x 15.472 in) (93.158 x 93.069 DPI)
Speicherzugriffsfehler

Additional context

No response

maron2000 commented 2 years ago

Tombraider1 works. on Windows SDL1 x86 0.83.25 with nGlide.

grapeli commented 2 years ago

I don't use glide (openglide). Redundant complication.

Out of curiosity, I checked if it works. I have not noted any problems. dosbox-x 0.83.25 SDL2

https://user-images.githubusercontent.com/452325/167117439-b0a42caa-eabc-442b-b981-e213cf91d46c.mp4

dosbox-ece withdrew glide support.

grapeli commented 2 years ago

Openglide does not have any particular advantage when used in conjunction with dosbox-x. Just use the configuration:

voodoo_card=opengl
glide=false

In the case of sdl2, undo this commit 1624f049 and window scaling will work properly again.

https://user-images.githubusercontent.com/452325/167137928-b49a213e-93be-40fc-afa2-abbaf5295af6.mp4

bell07 commented 2 years ago

Without glide I get the error "unable to load DLL". I am able only to run the SVGA version :-( How is the right way to get voodoo working without glide?

grapeli commented 2 years ago

It's quite complicated. Although only seemingly.

The 3DFx patch for Tomb Raider comes in two versions with a statically linked library and a dynamically GLIDE2X.

Openglide only works with dynamic libraries. If you use glide=true dosbox-x loads a specially version of this library automatically from "z:\system\". It does not have to be in the game directory. The GOG version Tomb Raider is distributed with the GLIDE2X.OVL version bundled.

When using glide=false you must have the appropriate version of this library or use the tomb.exe binary that has it statically linked.

bell07 commented 2 years ago

Tried using "original" glide2x.ovl from 3dfx Voodoo2 drivers V3.02.02 (from http://falconfly.3dfx.pl/voodoo2.htm) and glide=false. The game starts, but the acceleration does not appears. I do not see the "mipmapping" setting in menu. With OpenGlide the TR1 runs smoothly, with full emulation the game cut down to 4 FPS. I play the game on my GPD Win 2 device with Core M3-7Y30 CPU and HD 615 GPU.

MY GOG version seems to be provide OpenGlide version. I see the gint in the glide.ini, that is "Configuration File for OpenGlide".

Back to initial issue, is it possible to get the OpenGlide working again with 0.83.25 on my Gentoo linux?

grapeli commented 2 years ago

Back to initial issue, is it possible to get the OpenGlide working again with 0.83.25 on my Gentoo linux?

I checked version 0.83.25 SDL2 with openglide under archlinux and the tomb raider works under it.

You have to roll up your sleeves and check a few things for yourself.

First, check that openglide works properly with dosbox-x with something other than the tomb raider. Check what is the cause of segmentation fault. Build a debug version and use gdb (including debug sdl).

If Tomb Raider was running correctly in the earlier version of dosbox-x with openglide, determine which commit caused this regression. In this case, git bisect must be used. Lots of compilations, but 200x less than building gentoo.

You can finally check what it is like with dosbox-x in SDL2 (why use SDL1 in 2022). As I mentioned before, you can opt out of openglide and have fast 3DFx under dosbox-x. I assure you it works.

bell07 commented 2 years ago

Recompiled dosbox-x with SDL-2. Same issue The segfault is still in [ 9071.156737] dosbox-x[15297]: segfault at 250 ip 00007f1462f34c4c sp 00007ffd3a12e3b8 error 4 in libSDL-1.2.so.0.11.5[7f1462f0d000+45000]

Recompiled openglide with --disable-sdl, the game starts, but no keyboard input is available :-(

bell07 commented 2 years ago

The gdb trace is

Thread 1 "dosbox-x" received signal SIGSEGV, Segmentation fault.
0x00007fffe9fa7c4c in SDL_ListModes () from /usr/lib64/libSDL-1.2.so.0
(gdb) bt
#0  0x00007fffe9fa7c4c in SDL_ListModes () at /usr/lib64/libSDL-1.2.so.0
#1  0x00007fffe9fa7d2b in SDL_VideoModeOK () at /usr/lib64/libSDL-1.2.so.0
#2  0x00007fffe9fa94cd in SDL_SetVideoMode () at /usr/lib64/libSDL-1.2.so.0
#3  0x00007fffea001098 in InitialiseOpenGLWindow(unsigned long, int, int, int, int) () at /usr/lib64/libglide2x.so
#4  0x00007fffe9ffb46f in InitWindow(unsigned long) () at /usr/lib64/libglide2x.so
#5  0x00007fffe9ff49e2 in grSstWinOpen () at /usr/lib64/libglide2x.so
#6  0x0000555555cc2fef in process_msg(unsigned long) ()
#7  0x0000555555cc070f in write_gl(unsigned long, unsigned long, unsigned long) ()
#8  0x0000555555bb6289 in IO_WriteB(unsigned long, unsigned char) ()
#9  0x0000555555eb8791 in dyn_io_writeB(unsigned long, unsigned char) ()
#10 0x00007fffb4c566c4 in  ()
#11 0x0000000000000019 in  ()
#12 0x0000000000000202 in  ()
#13 0x00007fffb47730b7 in  ()
#14 0x00007fffffff8a98 in  ()
#15 0x0000000000000008 in  ()
#16 0x00007fffffff8fb0 in  ()
#17 0x000055555b0a5a90 in  ()
#18 0x000055555a838320 in  ()
#19 0x0000000000000001 in  ()
#20 0x0000000000000000 in  ()
bell07 commented 2 years ago

Same issue with the same trace, if I try the nature demo from http://falconfly.3dfx.pl/coolstuff.htm

bell07 commented 2 years ago

Did some manual bisect and found out the commit https://github.com/joncampbell123/dosbox-x/commit/a499f1a77717924f5c6b632d9b993d9c44975daf causes the issue. The last working commit is https://github.com/joncampbell123/dosbox-x/commit/be2f7385fa6e8ee3cfc553e61b51d4e0b04309de . To be sure checked out latest master and reverted the commit https://github.com/joncampbell123/dosbox-x/commit/a499f1a77717924f5c6b632d9b993d9c44975daf. The game starts and glide works

Compared the output of working version and the broken version: The working version contains

LOG: Glide:LFB access: read-write (no aux)
LOG: SDLNet_TCP_Open: Couldn't connect to remote host
LOG: TiMidity: can't open control connection (host=127.0.0.1, port=7777)
LOG: MIDI:Opened device:none

The broken version:

LOG: Glide:LFB access: read-write (no aux)
LOG: SDLNet_TCP_Open: Couldn't connect to remote host
LOG: TiMidity: can't open control connection (host=127.0.0.1, port=7777)
fluidsynth: error: Unknown numeric setting 'audio.periods'
fluidsynth: error: Unknown numeric setting 'audio.period-size'
fluidsynth: error: Unknown string setting 'synth.reverb.active'
fluidsynth: error: Unknown string setting 'synth.chorus.active'
fluidsynth: Using PulseAudio driver
fluidsynth: warning: Failed to set thread to high priority
LOG: MIDI:fluidsynth: Loaded SoundFont: /usr/share/sounds/sf2/FluidR3_GM.sf2
LOG: MIDI:Opened device:fluidsynth

And at the end the working version have the line

LOG: Glide:Resolution:640x480, LFB at 0x60000000 (physical) / 0x60000000 (linear)

Instead of segmentation fault.

fluidsynth-2.2.6 is installed on system

bell07 commented 2 years ago

Recompiled with SDL2: same issue. The SDL1 in OpenGlide is affected Recompiled without fluidsynth: The issue still appears

grapeli commented 2 years ago

A moment ago I was running NFS2SE under Win98SE in dosbox-x-git (archlinux) with Openglide. DOSBox-X version without integrated fluidsynth. What does the fluidsynth code have to do with openglide? Absolutely nothing.

You can connect an external fluidsynth daemon to dosbox-x (or timidity). -set mididevice=alsa -set midiconfig=128:0

edit:

https://user-images.githubusercontent.com/452325/168752814-284d45f4-9e2c-4e4d-92f8-508b6e4ddf8d.mp4

Nfs2se doesn't work stably with audio under dosbox-x. during the start I changed the settings (f1, f2, f3, f4).

Under openglide win98 I used this special version of glide2x.dll (instead of the one installed with the driver).

As I wrote, openglide offers nothing more than an integrated version of 3dfx emulation. There is a choice if someone has problems with openglide. I repeat it works fine. I only use it. glide2x_win9x.zip

bell07 commented 2 years ago

@grapeli I do not know why the issue is related to the fluidsynth, but the issue appears since commit https://github.com/joncampbell123/dosbox-x/commit/a499f1a77717924f5c6b632d9b993d9c44975daf

Changing midi to alsa as proposed removes fluidsynth errors, but does not solve the the segfault.

I try to play the TR1 in DOS mode, so I need an glide2x.ovl file, not dll :-( Tried some files found in internet, no one enables the mipmap feauture for example. The game is slow with software emulation on my GPD-Win2

Tatsh (Gentoo ebuild/package maintainer for dosbox-x) found out the reason is presumably the next SDL1 code

        /*
         * rcg11292000
         * If you try to set an SDL_OPENGL surface, and fail to find a
         * matching  visual, then the next call to SDL_SetVideoMode()
         * will segfault, since  we no longer point to a dummy surface,
         * but rather NULL.
         * Sam 11/29/00
         * WARNING, we need to make sure that the previous mode hasn't
         * already been freed by the video driver.  What do we do in
         * that case?  Should we call SDL_VideoInit() again?
         */
        SDL_VideoSurface = (mode != NULL) ? mode : prev_mode;

Can this issue be fixed in dosbox-x or should the fix be done in openglide?

grapeli commented 2 years ago

If you think this a499f1a commit is the cause of your problems with Openglide, why don't you undo it?

As for the Nature demo. It works for me with both the integrated 3DFx emulation as well as with Openglide. With similar performance. In the first case, you need to add the glide2x.ovl library to the demo directory. She is missing. You can use this. glide2x.ovl.zip

After starting the demo and the "Vertigo Pictures" logo disappears, the background lightening sequence (fade in) follows, then you have to intervene for a moment and change the window focus. Every second or half, take the pointer out of the window and come back. Same problem as in demo Dimension. In the case of Openglide, you need to start a similar operation of accelerating the start of the demo earlier after the countdown sequence. Annoying bug.

edit: The Nature demo also works under wine (I tested it on version 7.7) with nGlide. Install nGlide under wine, remove glide2x.dll from the demo directory and run nature95.exe.

It also works in Win98SE under DOSBox-X. Surprisingly, there is no problem with the slow start of the demo (3dfx).

bell07 commented 2 years ago

Currently I keep just the last working (SDL1/0.83.24) version on my device and investigate the issue an my workstation. I am not in a hurry, the main reason for this issue is to contribute as tester, not to get a workaround.

Tried to revert the mentioned commit from current master. Then the dosbox-x was working as before. Since last changes on Gentoo Ebuild https://github.com/Tatsh/tatsh-overlay/commit/f81d3849632c84c35b3c4968e42d9b72385bcc95 the issue does not depend anymore on the fluidsynth-fix-commit. It does not work anymore in any case with OpenGlide.

Thank you providing right GLIDE2X.OVL. Where come this file from? Using this file the game run fast without OpenGlide Passtrough with slightly better lighting. Unfortunately dosbox-x leave the fullscreen and switch into windowed mode, if 3dfx is initialized. :-( So it is not full solution yet.

The nGlide way requires Windows build of dosbox-x? Try to avoid wine if software runs natively on linux.

grapeli commented 2 years ago

Thank you providing right GLIDE2X.OVL. Where come this file from? Using this file the game run fast without OpenGlide Passtrough with slightly better lighting.

I really don't remember.

Unfortunately dosbox-x leave the fullscreen and switch into windowed mode, if 3dfx is initialized. :-( So it is not full solution yet.

Fullscreen does not work with integrated 3dfx emulation and also with openglide. It only works with voodoo_card=software, but as this solution requires a lot of cpu power. If you want a scalable window, read the ability to resize it, maximize it in the case of integrated 3dfx emulation, you need to undo this commit 1624f04 (prevents the window from being scaled).

The nGlide way requires Windows build of dosbox-x? Try to avoid wine if software runs natively on linux.

Of course without dosbox-x. I did not come to such absurdities to run dosbox-x under wine having a native Linux version.

bell07 commented 2 years ago

Got managed the scaling by removing the commit. Fullscreen I can trigger by wmctrl -r DOSBox-X -b add,fullscreen. Need to adjust my game startup script for this. I will continue testing the new setup. Sometimes If I minimize window, I get the textures lost. Looks like: grafik Resizing window fix the textures again grafik

Of course I still support as tester to solve getting dosbox-x working again with OpenGlide on Linux

grapeli commented 2 years ago

Of course I still support as tester to solve getting dosbox-x working again with OpenGlide on Linux

As I wrote, you have to solve it yourself. If this is the case with dosbox-x, use git bisect. It is not really boring.

No one else is likely to install gentoo on purpose and check that openglide under dosbox-x is working properly. It works for me. Different system configuration different hardware, etc.

bell07 commented 2 years ago

Given the integrated 3dfx emulation a chance and played with them last days. Unfortunately it does not perfomant enough for my device. In some game places the FPS drops to 3-5. With OpenGlide I can enter this places with 20-30 FPS. So I am back to my last working build: dosbox-x-0.83.24 with SDL1.

If I build OpenGlide without SDL support, the 3dfx works with the latest dosbox-x, but keyboard and joypad events are not passed to the game anymore :-(

I do not know how I can search for the issue root. The (manual) bisect lead me to the https://github.com/joncampbell123/dosbox-x/commit/a499f1a77717924f5c6b632d9b993d9c44975daf should cause the issue, that does no sense.

Any ideas what I can try at the next?

grapeli commented 2 years ago

If this unfortunate commit a499f1a is causing openglide not to work properly under dosbox-x, undo it.

My hardware is an old cheap slow laptop (westmere) with intel ironlake gpu (gen5). Extremely sensitive to performance gaps. I didn't notice any significant performance difference between openglide and the internal 3dfx emulation. With one exception. It is Screamer Rally. I'm putting an additional trivial patch on dosbox-x that disables redundant logging and restores performance in this 3dfx game. 0002-voodoo-disable-some-LOGS.patch.txt

The second thing is, I don't harden applications that don't require it. DOSBox-X is not systemd, nginx, postgresql or firefox, chrome exposed to attack. I am able to put it in a safe sandbox without sacrificing performance. I do not compile dosbox-x with flags that have a significant performance penalty. I build Dosbox-x with profiling and LTO.

rderooy commented 2 years ago

Not sure which OpenGlide fork you're using. But there is a "new" one here, that may be of interest. https://github.com/kjliew/qemu-xtra/commits/master/openglide

I did not yet have the chance to try it myself.

bell07 commented 2 years ago

Thank you @rderooy , you are my hero! Previously I used the https://github.com/voyageur/openglide fork, as used in gentoo ebuild. Now I tried the qemu fork with success. The fork does not provide any glide2x.ovl, but work well with dosbox-x in latest version! The qemu-xtra fork does work better as expected! All other reported and not reported issues like zoom in fullscreen are solved in this OpenGlide version! Thanks again! Maybe the fork should be menitioned in the documentation. For Gentoo users I adopted the ebuild : https://github.com/bell07/gentoo-bell07_overlay/blob/master/media-libs/openglide-xtra/openglide-xtra-9999.ebuild

Wengier commented 2 years ago

FYI The commit https://github.com/joncampbell123/dosbox-x/commit/a499f1a77717924f5c6b632d9b993d9c44975daf was designed to fix issues where the FluidSynth library may not be found in some Linux systems (even if it is already installed). But in rare cases it might cause problem then one should be able to specify the option --disable-libfluidsynth so that FluidSynth library will always be bypassed (since the said commit will only affect the case when --disable-libfluidsynth is not specified).

bell07 commented 2 years ago

Tested the issue with current release 0.84.0. Still the same.

If I revert the commit https://github.com/joncampbell123/dosbox-x/commit/a499f1a77717924f5c6b632d9b993d9c44975daf and compile with SDL-1, the dosbox-x does work with the https://github.com/voyageur/openglide fork. If I compile with SDL-2 or do not revert the commit, I get segmentation fault.

Using the openglide fork https://github.com/kjliew/qemu-xtra/tree/master/openglide I get no issues but less performance.

rderooy commented 2 years ago

The voyageur openglide fork is known to have issues with SDL2. This is documented.

I don't understand why that commit would break it with SDL1 though.

grapeli commented 2 years ago

The voyageur openglide fork is known to have issues with SDL2. This is documented.

I do not confirm this. Openglide runs under archlinux with dosbox-x SDL2. Another thing is that not everything looks correct under it (Carmageddon).

The openglide code is very old. There, nothing significant has changed for many years. This fork is practically dead. Why use a limited wrapper when there is better functioning 3dfx emulation code integrated with dosbox-x code in one repository. Why complicate it? I do not understand this.

Under windows I understand there is nglide, dgvoodoo.

grapeli commented 2 years ago

Built-in 3dfx emulation has another very important advantage. Works with SDL_VIDEODRIVER=kmsdrm, i.e. without the need to run Xorg, Xwayland, Wayland. Preferred method on embedded devices including Raspberry Pi.

This is not possible with the dingy openglide wrapper.

bell07 commented 2 years ago

For me the issue is solved, since it does work well with qemu-xtra openglide fork. The small performance reduction I catch with GameMode

arromdee commented 2 years ago

I get the same crash as before using the qemu-xtra fork of openglide. It doesn't work for me.