#14132 closed defect (fixed)

scummvm opengl: gui_scale bug

Reported by: legluondunet Owned by: criezy
Priority: normal Component: Graphics
Version: Keywords:
Cc: Game:

Description

Hello, in global options, when I change graphic mode from sdl_surface to opengl, I obtain a maximized scummvm window with too little content, so little I can not see buttons, polices...it's unusable.
I can reproduce this issue all the time.

I joined you screenshots.

Attachments (10)

Capture d’écran_2023-02-05_22-45-12.png (1004.4 KB ) - added by legluondunet 15 months ago.
Capture d’écran_2023-02-05_22-44-21.png (73.6 KB ) - added by legluondunet 15 months ago.
Capture d’écran_2023-02-05_22-44-05.png (767.6 KB ) - added by legluondunet 15 months ago.
Capture d’écran_2023-02-05_22-35-10.png (56.6 KB ) - added by legluondunet 15 months ago.
Capture d’écran_2023-02-05_22-22-08.png (45.6 KB ) - added by legluondunet 15 months ago.
scummvm_opengl_dpi.log (7.3 KB ) - added by legluondunet 15 months ago.
Capture d’écran_2023-02-05_23-44-58.png (730.6 KB ) - added by legluondunet 15 months ago.
scummvm2.6.1 bug is present.png (1.0 MB ) - added by legluondunet 14 months ago.
scummvm 20 february 2023 can not reproduce bug.png (899.5 KB ) - added by legluondunet 14 months ago.
scummvm20february.log (12.1 KB ) - added by legluondunet 14 months ago.

Change History (21)

comment:1 by legluondunet, 15 months ago

scummvm git version form today 05/03/2023

My config:
OS: Manjaro 22.0.2 Sikaris
Kernel: x86_64 Linux 6.1.9-1-MANJARO
CPU: AMD Ryzen 9 5900HX with Radeon Graphics @ 16x 3.3GHz
GPU: AMD Radeon RX 6600M (navi23, LLVM 15.0.7, DRM 3.49, 6.1.9-1-MANJARO)
Video drivers: Mesa 22.3.4

comment:2 by legluondunet, 15 months ago

I joined log where you can read:

Setting 1900 x 1019 -> 6563 x 3520 -- 0.289459

My computer is connected directly to my TV with a HDMI cable.
My TV has 4K resolution and my computer can display 4K resolution.
But I prefer to use a HD resolution for gaming 1920x1080 to obtain a better framerate and speed for gaming.

To display scummvm with normal ratio, I have to set gui_scale to 600 !!!
But this setting does not stay, it is reset each time I change an option in global settings.

by legluondunet, 15 months ago

Attachment: scummvm_opengl_dpi.log added

comment:3 by legluondunet, 15 months ago

Capture d’écran_2023-02-05_23-44-58.png look normal, gui_scale set to 600!

comment:4 by antoniou79, 15 months ago

Based on the solution I found for my setup (Linux within Windows using WSL2 and VcXsrv, where I had to override Windows auto hidpi scaling for the VcXsrv, see: ticket #14105), and a quick search on Google, it looks like your distribution's GUI, or the NVidia drivers not playing well with it, may be the culprit here (and supposedly this is a known issue to the Manjaro team).

Here they proposed forcing a value for DPI through System Settings -> Fonts:
https://forum.manjaro.org/t/fresh-install-has-problematic-scaling/113234/8

They recommend "96" but also read the followup answer since another value might work better for your case -- the user with the issue was happy with "144":

System Settings → Display Configuration → Global scale: 150% (originally 100%)
System Settings → Fonts → Force font DPI: 144 (originally greyed out 96)

Other topics reporting similar issue over at Manjaro's forums (the solutions are similar too):
https://forum.manjaro.org/t/windows-and-icons-too-small/120709/4
https://forum.manjaro.org/t/how-can-i-change-the-scaling-kde-plasma-everything-looks-too-big-after-changing-my-laptops-display/122893/8
https://forum.manjaro.org/t/need-help-changing-dpi-or-scaling-since-text-is-out-of-bounds/120186/6

Related bug reports to KDE and NVidia:
https://bugs.kde.org/show_bug.cgi?id=458321
https://forums.developer.nvidia.com/t/dpi-scaling-is-way-off-on-kde-plasma/227317

Last edited 15 months ago by antoniou79 (previous) (diff)

comment:5 by legluondunet, 14 months ago

Hello Antoniou, thank you for this infos, it's interesting but:

  • I'm using latest version of Manjaro but not KDE nor Nvidia GPU.
  • I never had DPI problem with others softwares, only with scummvm interface in opengl mode.
  • $ xdpyinfo | grep resolution resolution: 96x96 dots per inch

all is normal.

  • in scummvm log we can see scummvm does not see correctly my display parameters:

dpi: 26.0513 default: 90
Setting 1900 x 1019 -> 4375 x 2346 -- 0.434188
My resolution is 1920x1080

  • I don't think it is a normal behavior when scummvm reset gui_scale each time I click on "global settings", even whithout change anything.

comment:6 by legluondunet, 14 months ago

in case this could help, this is xrandr command result:
$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1872mm x 1053mm

3840x2160 30.00 + 25.00 24.00 29.97 23.98
4096x2160 30.00 24.00 29.97 23.98
2560x1440 59.95
1920x1200 30.00
1920x1080 120.00 100.00* 119.88 60.00 50.00 59.94 30.00 25.00 24.00 29.97 23.98
1600x1200 30.00
1680x1050 59.88
1600x900 60.00
1280x1024 75.02 60.02
1440x900 59.90
1280x800 59.91
1152x864 75.00
1280x720 60.00 50.00 59.94
1024x768 75.03 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32
720x576 50.00
720x480 60.00 59.94
640x480 75.00 72.81 66.67 60.00 59.94
720x400 70.08

HDMI-A-1 disconnected (normal left inverted right x axis y axis)
HDMI-A-1-2 disconnected (normal left inverted right x axis y axis)

comment:7 by antoniou79, 14 months ago

Just in case someone tries to reproduce this on Manjaro, what is your desktop environment?

comment:8 by legluondunet, 14 months ago

I use XFCE 4.18.
To reproduce this issue, you have to:

  • like me use a resolution inferior of your maximum resolution. My GPU card is capable to display 4K but I use HD resolution 1920x1080.
  • then change scummvm display renderer from sdl_surface to opengl

I think there is here two issues to verify:
1) scummvm when using opengl renderer set gui size to maximum resolution available and not to current used resolution
2) scummvm reset gui_scale each time you open global settings

reminder: to obtain an normal scummvm gui size in opengl, I have to set gui_scale to 600.

comment:9 by legluondunet, 14 months ago

I don't know what you modified in code between 12 february 2023 and today but this bug is no more.
I compile today's git and I can no more reproduce this bug.
I can now use ScummVM interface to opengl at normal size, without change gui_scale.
If I launch ScummVM from terminal I can read:

req: 1920 x 1019  cur: 1920 x 1019, scale: 1.000000
dpi: 26.0513 default: 90
Setting 1920 x 1019 -> 1920 x 1019 -- 1

My resolution seems now correctly recognized by ScummVM.

I tried to change scaling interface option from standard to large and it works as expected, it seems stable.

To be sure I launch ScummVM version from my Distribution (ScummVM 2.6.1 official Manjaro package) and the bug is still here.

I joined you a log when I did my tests of changing gui scaling in global options, you could verify if all works as expected.

Once again, thank you for your help.

Last edited 14 months ago by legluondunet (previous) (diff)

by legluondunet, 14 months ago

by legluondunet, 14 months ago

Attachment: scummvm20february.log added

comment:10 by antoniou79, 14 months ago

I believe that ScummVM developer @criezy fixed this with this commit (which is also backported to 2.7.0 as far as I can tell):
https://github.com/scummvm/scummvm/commit/8de1c2a4b87505e30b3b427e87a07d9cba2c3870

comment:11 by antoniou79, 14 months ago

Component: --Unset--Graphics
Owner: set to criezy
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.