dosbox-staging / dosbox-staging

DOSBox Staging is a modern continuation of DOSBox with advanced features and current development practices.
https://www.dosbox-staging.org/
Other
1.31k stars 155 forks source link

Fullscreen doesn't work in SDL Wayland mode #2671

Closed shmerl closed 1 year ago

shmerl commented 1 year ago

Are you using the latest Dosbox-Staging Version?

Different version than latest?

0.80.1

What Operating System are you using?

Linux x86_64

If Other OS, please describe

Debian testing

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

A clear and concise description of what the bug is.

When trying to run some games (Dune, Dune 2) using -fullscreen with SDL video driver set to Wayland, the window isn't scaling to screen size, unlike when using X11 SDL mode.

Steps to reproduce the behaviour.

The variable I'm setting:

SDL_VIDEODRIVER='wayland'

Download URL of affected game or software

No response

Your configuration

[sdl]
fullscreen          = false
display             = 0
fullresolution      = desktop
windowresolution    = default
viewport_resolution = fit
window_position     = auto
window_decorations  = true
transparency        = 0
host_rate           = auto
vsync               = false
vsync_skip          = 7000
presentation_mode   = auto
output              = opengl
texture_renderer    = auto
waitonerror         = true
priority            = auto auto
mute_when_inactive  = false
pause_when_inactive = false
mapperfile          = mapper-sdl2-0.80.1.map
screensaver         = auto

[dosbox]
language           = 
machine            = svga_s3
captures           = capture
memsize            = 16
mcb_fault_strategy = deny
vmemsize           = auto
dos_rate           = default
vesa_modes         = compatible
speed_mods         = true
autoexec_section   = join
automount          = true
startup_verbosity  = auto

[render]
aspect             = true
monochrome_palette = white
cga_colors         = default
glshader           = default

[composite]
composite   = auto
era         = auto
hue         = 0
saturation  = 100
contrast    = 100
brightness  = 0
convergence = 0

[cpu]
core      = auto
cputype   = auto
cycles    = auto
cycleup   = 10
cycledown = 20

[mouse]
mouse_capture        = onclick
mouse_middle_release = true
mouse_sensitivity    = 100
mouse_raw_input      = true
dos_mouse_driver     = true
dos_mouse_immediate  = false
ps2_mouse_model      = intellimouse
com_mouse_model      = wheel+msm

[mixer]
nosound    = false
rate       = 48000
blocksize  = 512
prebuffer  = 20
negotiate  = true
compressor = true
crossfeed  = off
reverb     = off
chorus     = off

[midi]
mididevice = auto
midiconfig = 
mpu401     = intelligent

[fluidsynth]
soundfont     = default.sf2
fsynth_chorus = auto
fsynth_reverb = auto
fsynth_filter = off

[mt32]
model       = auto
romdir      = 
mt32_filter = off

[sblaster]
sbtype              = sb16
sbbase              = 220
irq                 = 7
dma                 = 1
hdma                = 5
sbmixer             = true
sbwarmup            = 100
oplmode             = auto
sb_filter           = modern
sb_filter_always_on = false
opl_filter          = auto
cms_filter          = on

[gus]
gus        = false
gusbase    = 240
gusirq     = 5
gusdma     = 3
ultradir   = C:\ULTRASND
gus_filter = off

[innovation]
sidmodel          = none
sidclock          = default
sidport           = 280
6581filter        = 50
8580filter        = 50
innovation_filter = off

[speaker]
pcspeaker           = discrete
pcspeaker_filter    = on
tandy               = auto
tandy_filter        = on
tandy_dac_filter    = on
lpt_dac             = none
lpt_dac_filter      = on
ps1audio            = false
ps1audio_filter     = on
ps1audio_dac_filter = on

[reelmagic]
reelmagic       = off
reelmagic_key   = auto
reelmagic_fcode = 0

[joystick]
joysticktype                = auto
timed                       = true
autofire                    = false
swap34                      = false
buttonwrap                  = false
circularinput               = false
deadzone                    = 10
use_joy_calibration_hotkeys = false
joy_x_calibration           = auto
joy_y_calibration           = auto

[serial]
serial1       = dummy
serial2       = dummy
serial3       = disabled
serial4       = disabled
phonebookfile = phonebook.txt

[dos]
xms                   = true
ems                   = true
umb                   = true
ver                   = 5.0
country               = 0
expand_shell_variable = false
keyboardlayout        = auto

[ipx]
ipx = false

[ethernet]

ne2000            = true
nicbase           = 300
nicirq            = 3
macaddr           = AC:DE:48:88:99:AA
tcp_port_forwards = 
udp_port_forwards = 

[autoexec]

Provide a Log

2023-07-10 00:39:39.520 | arguments: dosbox -fullscreen dune2.exe
2023-07-10 00:39:39.520 | Current dir: /home/user/mnt/games/dune_2/game
2023-07-10 00:39:39.520 | stderr verbosity: 0
2023-07-10 00:39:39.520 | -----------------------------------
2023-07-10 00:39:39.520 | dosbox-staging version 0.80.1
2023-07-10 00:39:39.520 | ---
2023-07-10 00:39:39.520 | LOG: Loguru version 2.1.0 initialized
2023-07-10 00:39:39.526 | SDL: version 2.0.8 initialized (wayland video and pipewire audio)
2023-07-10 00:39:39.527 | CONFIG: Loaded primary conf file /home/user/.config/dosbox/dosbox-staging.conf
2023-07-10 00:39:39.527 | LANG: Using internal English language messages
2023-07-10 00:39:39.527 | RENDER: Using GLSL shader 'interpolation/sharp'
2023-07-10 00:39:39.527 | DISPLAY: Initialized 1422x1066 window-mode using Bilinear scaling on 1440p display-0
2023-07-10 00:39:39.546 | OPENGL: Vendor: AMD
2023-07-10 00:39:39.546 | OPENGL: Version: 4.6 (Compatibility Profile) Mesa 23.2.0-devel (git-d3662ba461)
2023-07-10 00:39:39.546 | OPENGL: GLSL version: 4.60
2023-07-10 00:39:39.546 | OPENGL: Pixel buffer object: available
2023-07-10 00:39:39.546 | OPENGL: NPOT textures: supported
2023-07-10 00:39:39.546 | VIDEO: Using the DOS video mode's frame rate
2023-07-10 00:39:39.549 | MEMORY: Using 4096 DOS memory pages (16 MiB) at address: 0x7fdfe95fc010
2023-07-10 00:39:39.550 | VIDEO: Initialized S3 Trio64 VESA 2.0 compatible with 4-MiB of FP DRAM supporting 86 modes
2023-07-10 00:39:39.578 | MIXER: Negotiated 2-channel 48000-Hz audio in 512-frame blocks
2023-07-10 00:39:39.578 | MIXER: Reverb disabled
2023-07-10 00:39:39.578 | MIXER: Chorus disabled
2023-07-10 00:39:39.578 | MIXER: Master compressor enabled
2023-07-10 00:39:39.578 | ALSA: No available MIDI devices found
2023-07-10 00:39:39.578 | MIDI: No working MIDI device found/selected.
2023-07-10 00:39:39.578 | MIDI: Opened device: none
2023-07-10 00:39:39.578 | OPL: Operating at 48000 Hz without resampling
2023-07-10 00:39:39.578 | OPL: Running OPL3 on ports 220h and 388h
2023-07-10 00:39:39.578 | SB16: Sound Blaster 16 OPL output filter enabled
2023-07-10 00:39:39.578 | SB: Operating at 22050 Hz and upsampling to the output rate
2023-07-10 00:39:39.579 | SB16: Modern DAC output filter enabled
2023-07-10 00:39:39.579 | SB16: BLASTER=A220 I7 D1 H5 T6
2023-07-10 00:39:39.579 | SB16: Running on port 220h, IRQ 7, DMA 1, and high DMA 5
2023-07-10 00:39:39.579 | PCSPEAKER: Operating at 48000 Hz without resampling
2023-07-10 00:39:39.579 | PCSPEAKER: Initialized discrete model
2023-07-10 00:39:39.579 | PCSPEAKER: Highpass filter enabled (18 dB/oct at 120 Hz)
2023-07-10 00:39:39.579 | PCSPEAKER: Lowpass filter enabled (12 dB/oct at 4800 Hz)
2023-07-10 00:39:39.579 | MOUSE: Will be captured after the first left or right button click
2023-07-10 00:39:39.579 | MOUSE: Middle button will capture/release the mouse (clicks not sent to the game/program)
2023-07-10 00:39:39.579 | MOUSE (PS/2): Standard, 3 buttons
2023-07-10 00:39:39.579 | SLIRP: Slirp version: 4.7.0
2023-07-10 00:39:39.579 | SLIRP: Successfully initialized
2023-07-10 00:39:39.579 | NE2000: Base=0x300 irq=3
2023-07-10 00:39:39.579 | CONFIG: Loaded drive conf file /home/user/.config/dosbox/drives/y.conf
2023-07-10 00:39:39.580 | SDL: Using VRR-adjusted (auto) display refresh rate of 177 Hz
2023-07-10 00:39:39.580 | DISPLAY: Text 640x480 16 color (mode 03h) at 70 Hz VFR, scaled to 1421x1066 with 1 pixel aspect ratio
2023-07-10 00:39:39.593 | MAPPER: no joysticks found
2023-07-10 00:39:39.594 | MAPPER: Loaded default key bindings
2023-07-10 00:39:39.594 | SHELL: Redirect output to NUL
2023-07-10 00:39:39.594 | MOUNT: Path '../../../../.config/dosbox/drives/y' found
2023-07-10 00:39:39.595 | MOUNT: Path '/home/user/mnt/games/dune_2/game' found
2023-07-10 00:39:39.606 | DISPLAY: Text 640x400 16 color (mode 03h) at 70.087 Hz VFR, scaled to 1920x1440 with 1.2 pixel aspect ratio
2023-07-10 00:39:40.992 | SB16: DSP was reset
2023-07-10 00:39:41.077 | SB16: DSP was reset
2023-07-10 00:39:41.092 | SB16: Speaker-output has been toggled on
2023-07-10 00:39:41.154 | DISPLAY: VGA 320x200 8-bit (mode 13h) at 70.086 Hz VFR, scaled to 1421x1066 with 1.2 pixel aspect ratio
2023-07-10 00:39:49.223 | PCSPEAKER: Shutting down discrete model
2023-07-10 00:39:49.223 | OPL: Shutting down OPL3
2023-07-10 00:39:49.223 | SB16: Shutting down
2023-07-10 00:39:49.234 | SDL: Using standard SDI (auto) display refresh rate of 180 Hz
2023-07-10 00:39:49.234 | DISPLAY: VGA 320x200 8-bit (mode 13h) at 70.086 Hz VFR, scaled to 1421x1066 with 1.2 pixel aspect ratio
2023-07-10 00:39:49.241 | atexit

Code of Conduct & Contributing Guidelines

shmerl commented 1 year ago

By the way, using Alt+Enter works to make it fullscreen even if -fullscreen doesn't.

weirddan455 commented 1 year ago

What compositioner are you using? I can't reproduce this on Weston.

shmerl commented 1 year ago

KWin (KDE Plasma 5.27.5).

weirddan455 commented 1 year ago

I can confirm it's also bugged on Arch Linux with KDE. Resizing the window also seems noticeably more jerky than in X11 (not sure if you've noticed that as well).

shmerl commented 1 year ago

Just for the reference, some other SDL use cases work fullscreen fine. So it must be something about how it's being used?

rderooy commented 1 year ago

Are you using a current SDL2 release? The latest is 2.28.1, while you seem to be using version 2.0.8.

shmerl commented 1 year ago

That's interesting. My system SDL is 2.28.1. I'm using dosbox-staging build from Github here. May be it statically links SDL? Let me try explicit SDL override.

shmerl commented 1 year ago

I tried adding:

export SDL_DYNAMIC_API=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0

But it still shows me:

SDL: version 2.0.8 initialized (wayland video and pipewire audio)

I have this installed:

dpkg --list | rg sdl2
ii  libsdl2-2.0-0:amd64                            2.28.1+dfsg-1                          amd64        Simple DirectMedia Layer
ii  libsdl2-2.0-0:i386                             2.28.1+dfsg-1                          i386         Simple DirectMedia Layer
ii  libsdl2-image-2.0-0:amd64                      2.6.3+dfsg-1                           amd64        Image loading library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-image-2.0-0:i386                       2.6.3+dfsg-1                           i386         Image loading library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-mixer-2.0-0:amd64                      2.6.2+dfsg-2                           amd64        Mixer library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-net-2.0-0:amd64                        2.2.0+dfsg-2                           amd64        Network library for Simple DirectMedia Layer 2, libraries
shmerl commented 1 year ago
ldd dosbox | rg SDL
        libSDL2-2.0.so.0 => /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (0x00007f37d4d4c000)
        libSDL2_image-2.0.so.0 => /lib/x86_64-linux-gnu/libSDL2_image-2.0.so.0 (0x00007f37d4d2d000)
        libSDL2_net-2.0.so.0 => /lib/x86_64-linux-gnu/libSDL2_net-2.0.so.0 (0x00007f37d4c98000)

Seems to be dynamic?

ls -la /lib/x86_64-linux-gnu/libSDL2-2.0.so.0
lrwxrwxrwx 1 root root 23 Jul 10 10:22 /lib/x86_64-linux-gnu/libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2800.1

So I have no idea where 2.0.8 is coming from.

weirddan455 commented 1 year ago

@shmerl It's a compile time constant:

https://github.com/dosbox-staging/dosbox-staging/blob/56a52cfceb1de0f5621228675789dd4b29653648/src/gui/sdlmain.cpp#L4889-L4891

Those macros are defined in SDL's headers so it depends on the header you compiled DOSBox with. It's not the most accurate way to get the version. There's also a runtime SDL_GetVersion() function that we should probably be using instead.

Anyway, I'm on 2.28.1 and I'm seeing the same bug. I think I've got a fix as well. About to put a PR in.

shmerl commented 1 year ago

Thanks for the fix! Do you plan to make a new tag / build that includes it sometime soon?

weirddan455 commented 1 year ago

@shmerl I think 0.81 will be coming out soon...ish. You can always grab the latest dev build though if you don't want to wait. I believe those get automatically built with every commit: https://dosbox-staging.github.io/downloads/development-builds/

johnnovak commented 1 year ago

I believe those get automatically built with every commit: https://dosbox-staging.github.io/downloads/development-builds/

That's right.

The new version will be released... when it's ready 😎