joncampbell123 / dosbox-x

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

Wayland issue with machine=ega, ega200, hercules #3543

Closed rderooy closed 2 years ago

rderooy commented 2 years ago

Describe the bug

Unfortunately it seems there is an issue when starting DOSBox-X with Wayland, which the SDL2 on Fedora 36 defaults to.

When I start DOSBox-X SDL2 with -set machine=ega (or ega200, or hercules), it gets stuck at the "bios" screen and flickers between the bios screen and a black screen with grey block in the upper-left quadrant of the screen.

The menu bar also flickers and trying to select an option from the menu just turns the menu black.

ega

dosbox-x-sdl2 . -set machine=ega
LOG: Early LOG Init complete
LOG: DOSBox-X's working directory: /home/rderooy/x/FantasyLand
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.84.1 (Linux SDL2)
LOG: Host keyboard layout is now us (US English)
LOG: Mapper keyboard layout is now us (US English)
LOG: SDL2 reports desktop display mode 2560 x 1440
LOG: The default output for the video system: opengl
LOG: Configured windowposition: 
LOG: SDL: Current window pixel format: SDL_PIXELFORMAT_RGB888
LOG: SDL: You are running in 24 bpp mode, this will slow down things!
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: WARNING: DOS/V is only supported for VGA video cards.
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: 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/soundfonts/default.sf2
LOG: MIDI:Opened device:fluidsynth
LOG: Pentium CMPXCHG8B emulation is enabled
LOG: VOODOO LFB now at d0000000
LOG: Serial1: BASE 3f8h
LOG: Serial2: BASE 2f8h
LOG: Parallel1: BASE 378h
LOG: MPU-401 Registering I/O ports as if IBM PC MPU-401 at base 330h
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: Allocated APM BIOS pm entry point at f000:ce40
LOG: Writing code to fce40
LOG: Writing code to fce60
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: ISA Plug & Play BIOS enabled
LOG: VGA ROM BIOS init callback
LOG: pixratio 1.288, dw false, dh false
LOG: Aspect ratio: 640 x 451  xToY=1.419 yToX=0.705
LOG: menuScale=1
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: WARNING: No translation support (to host) for code page 0
LOG:    3037890 ERROR BIOS:Keyboard layout file auto not found
LOG:    3037890 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: SHELL:Redirect output to nul

ega200

dosbox-x-sdl2 . -set machine=ega200
LOG: Early LOG Init complete
LOG: DOSBox-X's working directory: /home/rderooy/dos/FantasyLand
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.84.1 (Linux SDL2)
LOG: Host keyboard layout is now us (US English)
LOG: Mapper keyboard layout is now us (US English)
LOG: SDL2 reports desktop display mode 2560 x 1440
LOG: The default output for the video system: opengl
LOG: Configured windowposition: 
LOG: SDL: Current window pixel format: SDL_PIXELFORMAT_RGB888
LOG: SDL: You are running in 24 bpp mode, this will slow down things!
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: WARNING: DOS/V is only supported for VGA video cards.
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: 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/soundfonts/default.sf2
LOG: MIDI:Opened device:fluidsynth
LOG: Pentium CMPXCHG8B emulation is enabled
LOG: VOODOO LFB now at d0000000
LOG: Serial1: BASE 3f8h
LOG: Serial2: BASE 2f8h
LOG: Parallel1: BASE 378h
LOG: MPU-401 Registering I/O ports as if IBM PC MPU-401 at base 330h
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: Allocated APM BIOS pm entry point at f000:ce40
LOG: Writing code to fce40
LOG: Writing code to fce60
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: ISA Plug & Play BIOS enabled
LOG: VGA ROM BIOS init callback
LOG:         17 ERROR INT10:EGA:Trying to set illegal mode 10
LOG: pixratio 1.200, dw false, dh true
LOG: Aspect ratio: 640 x 480  xToY=1.333 yToX=0.750
LOG: menuScale=1
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: WARNING: No translation support (to host) for code page 0
LOG:    3047020 ERROR BIOS:Keyboard layout file auto not found
LOG:    3047020 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: SHELL:Redirect output to nul

Hercules

dosbox-x-sdl2 . -set machine=hercules
LOG: Early LOG Init complete
LOG: DOSBox-X's working directory: /home/rderooy/x/FantasyLand
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.84.1 (Linux SDL2)
LOG: Host keyboard layout is now us (US English)
LOG: Mapper keyboard layout is now us (US English)
LOG: SDL2 reports desktop display mode 2560 x 1440
LOG: The default output for the video system: opengl
LOG: Configured windowposition: 
LOG: SDL: Current window pixel format: SDL_PIXELFORMAT_RGB888
LOG: SDL: You are running in 24 bpp mode, this will slow down things!
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: WARNING: DOS/V is only supported for VGA video cards.
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: 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/soundfonts/default.sf2
LOG: MIDI:Opened device:fluidsynth
LOG: Pentium CMPXCHG8B emulation is enabled
LOG: VOODOO LFB now at d0000000
LOG: Serial1: BASE 3f8h
LOG: Serial2: BASE 2f8h
LOG: Parallel1: BASE 378h
LOG: MPU-401 Registering I/O ports as if IBM PC MPU-401 at base 330h
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: Allocated APM BIOS pm entry point at f000:ce40
LOG: Writing code to fce40
LOG: Writing code to fce60
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: ISA Plug & Play BIOS enabled
LOG: pixratio 1.222, dw false, dh false
LOG: Aspect ratio: 640 x 428  xToY=1.495 yToX=0.669
LOG: menuScale=1
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: font texture id=2 will make 128 x 256
LOG: Screen report: Method 'None' (-1.000 x -1.000 pixels) at (0.000 x 0.000) (-1.000 x -1.000 mm) (-0.039 x -0.039 in) (-1.000 x -1.000 DPI)
LOG: WARNING: No translation support (to host) for code page 0
LOG:    3041557 ERROR BIOS:Keyboard layout file auto not found
LOG:    3041557 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: SHELL:Redirect output to nul

Using other video modes, or when using the SDL1 build, or forcing the SDL2 version to use X11 with:

SDL_VIDEODRIVER=x11 dosbox-x -set machine=ega20

And it starts just fine.

Steps to reproduce the behaviour

DOSBox-X SDL2 using native wayland, using either the default Fedora SDL2, or forcing wayland with:

SDL_VIDEODRIVER=wayland dosbox-x

Expected behavior

DOSBox-X to work normally on Wayland like it does on X11.

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

Fedora 36

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

0.84.0 + git

Used configuration

No response

Output log

No response

Additional information

No response

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

grapeli commented 2 years ago

I do not note anything of the sort under the Sway.

https://user-images.githubusercontent.com/452325/171691428-97acf3c0-53bb-4997-89d9-62478e508c0d.mp4

Although I have to admit that dosbox-x has some shortcomings under Wayland. I do not recommend. I suggest using x11 in this case, which is Xwayland.

grapeli commented 2 years ago

I checked with the system sdl2-2.0.22 and it doesn't work properly with it.

https://user-images.githubusercontent.com/452325/171700238-27b4367c-1f95-4bda-ba5b-39b170fdaf51.mp4

That's why I always use the latest (git) version of SDL2. Waiting for new bugs to be fixed is much shorter.

rderooy commented 2 years ago

@grapeli thanks for confirming. Yes I was using 2.0.22.

Closing this as it is apparently an SDL2 issue that was already fixed upstream.

grapeli commented 2 years ago

@rderooy This is definitely an SDL2 bug that has now been fixed. You can see exactly which commit fixed this. I do not want to.

I am applying additional patches to each version of dosbox-x. It's not just about dosbox-x behavior under wayland. 0002-voodoo-disable-some-LOGS.patch.txt 0004-opengl-flicker-glitch-workaround.patch.txt Fixes buggy dosbox-x behavior. 0006-partial-revert-Make-HMENU-the-default-menu-17918c.patch.txt Bug in dosbox-x. If you want to avoid Segmentation fault when you close mapper editor and then resize the window.

Additionally, I undo the following commits: 1624f04 61801c9.

grapeli commented 2 years ago

I have misled you. SDL2 upstream doesn't fix that either. To fix this, you need to undo this commit. I have been doing this since the release of 2.0.22. I do it automatically and I missed it. And today I checked it out exactly. Unfortunately, this commit breaks a lot.

It is very likely causing the problems with dosbox-x on bug #3491. Although the reporting person provided too little details.

viki-t-s commented 2 years ago

I reported bug #3491. Sorry was not following up on this topic. Issue persists even after updating to latest version 0.84