Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
#123347 03/20/24 11:22 AM
Joined: May 2007
Posts: 582
Likes: 9
M
mizapf Offline OP
Senior Member
OP Offline
Senior Member
M
Joined: May 2007
Posts: 582
Likes: 9
I just noticed something strange on startup, before I saw that the recent update of my openSUSE Linux silently switched me to Wayland.

-video opengl is working

With -video bgfx -videodriver x11, the gameinfo screen stays displayed; the emulated screen is not rendered, although the emulation is running (reacts to keypresses).

With -video bgfx -videodriver wayland, I'm getting a segfault:

BGFX: Unsupported SDL window manager type 6
Setting BGFX platform data failed
BGFX library initialization failed
Segmentation fault (core dumped)

Found on three different installations, for MAME 0.261 and 0.263.

mizapf #123349 03/20/24 01:35 PM
Joined: Aug 2009
Posts: 1,229
Likes: 114
Very Senior Member
Offline
Very Senior Member
Joined: Aug 2009
Posts: 1,229
Likes: 114
1. Run MAME with -bgfx_debug, pickup a snapshot of that.
2. Run MAME with -verbose flag and paste the output here.

mizapf #123350 03/20/24 02:24 PM
Joined: Mar 2001
Posts: 17,137
Likes: 163
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,137
Likes: 163
Wayland in general is extremely experimental both from the SDL2 and bgfx ends. If you can force an X11 session, I highly recommend it.

mizapf #123351 03/20/24 04:36 PM
Joined: May 2007
Posts: 582
Likes: 9
M
mizapf Offline OP
Senior Member
OP Offline
Senior Member
M
Joined: May 2007
Posts: 582
Likes: 9
Actually, I don't really feel like going to Wayland; there are still lots of open issues. The desktop login still allows you to select "Plasma (X11)".

I just want to make sure I don't blame it for something on our side.

There are lots of Wayland advocates out there who give you downvotes in every forum should you dare to express anything less than enthusiasm for Wayland. wink

[Linked Image from mizapf.eu]



-verbose:
$ ./mame ti99_4ae -window -verbose
Attempting load of mame.ini
Parsing mame.ini
Loading translation file language/English/strings.mo
Reading translation file: 1 strings, original table at word offset 7, translated table at word offset 9
Loaded 0 translated string from file
Starting plugin data...
Available videodrivers: x11 wayland KMSDRM offscreen dummy evdev
Current Videodriver: x11
Display #0
Desktop Mode: 2560x1440-24@60
Current Display Mode: 2560x1440-24@60
Renderdrivers:
opengl (0x0)
opengles2 (0x0)
opengles (0x0)
software (0x0)
Display #1
Desktop Mode: 2560x1440-24@60
Current Display Mode: 2560x1440-24@60
Renderdrivers:
opengl (0x0)
opengles2 (0x0)
opengles (0x0)
software (0x0)
Available audio drivers:
pulseaudio
alsa
pipewire
dsp
disk
dummy
Build version: 0.263 (mame0263-283-gcbace25352c)
Build architecure:
Build defines 1: SDLMAME_UNIX=1 SDLMAME_X11=1 SDLMAME_LINUX=1
Build defines 1: LSB_FIRST=1 PTR64=1
SDL/OpenGL defines: SDL_COMPILEDVERSION=5001 USE_OPENGL=1
Compiler defines A: __GNUC__=13 __GNUC_MINOR__=2 __GNUC_PATCHLEVEL__=1 __VERSION__="13.2.1 20240206 [revision 67ac78caf31f7cb3202177e6428a46d829b70f23]"
Compiler defines B: __amd64__=1 __x86_64__=1 __unix__=1
Compiler defines C: __USE_FORTIFY_LEVEL=0
Enter init_monitors
Adding monitor screen0 (2560 x 1440)
Adding monitor screen1 (2560 x 1440)
Leave init_monitors
Enter sdlwindow_init

Hints:
SDL_FRAMEBUFFER_ACCELERATION (NULL)
SDL_RENDER_DRIVER (NULL)
SDL_RENDER_OPENGL_SHADERS (NULL)
SDL_RENDER_SCALE_QUALITY (NULL)
SDL_RENDER_VSYNC (NULL)
SDL_VIDEO_X11_XVIDMODE (NULL)
SDL_VIDEO_X11_XINERAMA (NULL)
SDL_VIDEO_X11_XRANDR (NULL)
SDL_GRAB_KEYBOARD (NULL)
SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS (NULL)
SDL_IOS_IDLE_TIMER_DISABLED (NULL)
SDL_IOS_ORIENTATIONS (NULL)
SDL_XINPUT_ENABLED (NULL)
SDL_GAMECONTROLLERCONFIG (NULL)
SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS (NULL)
SDL_ALLOW_TOPMOST (NULL)
SDL_TIMER_RESOLUTION (NULL)
SDL_RENDER_DIRECT3D_THREADSAFE (NULL)
SDL_VIDEO_ALLOW_SCREENSAVER (NULL)
SDL_ACCELEROMETER_AS_JOYSTICK (NULL)
SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK (NULL)
SDL_VIDEO_WIN_D3DCOMPILER (NULL)
SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT (NULL)
SDL_VIDEO_MAC_FULLSCREEN_SPACES (NULL)
SDL_MOUSE_RELATIVE_MODE_WARP (NULL)
SDL_RENDER_DIRECT3D11_DEBUG (NULL)
SDL_VIDEO_HIGHDPI_DISABLED (NULL)
SDL_WINRT_PRIVACY_POLICY_URL (NULL)
SDL_WINRT_PRIVACY_POLICY_LABEL (NULL)
SDL_WINRT_HANDLE_BACK_BUTTON (NULL)
Leave sdlwindow_init
Enter sdl_info::create
Initializing BGFX library
Audio: Start initialization
Audio: Driver is pulseaudio
Audio: frequency: 48000, channels: 2, samples: 512
sdl_create_buffers: creating stream buffer of 25600 bytes
Audio: End initialization
Keyboard: Start initialization
Input: Adding keyboard #1: System keyboard (device id: System keyboard)
Keyboard: Registered System keyboard
Keyboard: End initialization
Mouse: Start initialization
Input: Adding mouse #1: System mouse (device id: System mouse)
Mouse: Registered System mouse
Mouse: End initialization
Lightgun: Begin initialization
Events types to register: motion:-1, press:-1, release:-1
Lightgun: End initialization
Game Controller: Start initialization
Game Controller: End initialization
Searching font Liberation Sans in -. path/s
Matching font: 0x61ce650
unzip: opened archive file roms/ti99_4a.zip
unzip: found roms/ti99_4a.zip ECD at 1002
unzip: roms/ti99_4a.zip has no ZIP64 ECD locator
unzip: read roms/ti99_4a.zip central directory
unzip: closing archive file roms/ti99_4a.zip and sending to cache
unzip: found roms/ti99_4a.zip in cache
unzip: opened archive file roms/ti99_4a.zip
unzip: closing archive file roms/ti99_4a.zip and sending to cache
unzip: found roms/ti99_4a.zip in cache
unzip: opened archive file roms/ti99_4a.zip
unzip: closing archive file roms/ti99_4a.zip and sending to cache
unzip: found roms/ti99_4a.zip in cache
unzip: opened archive file roms/ti99_4a.zip
unzip: closing archive file roms/ti99_4a.zip and sending to cache
unzip: found roms/ti99_4a.zip in cache
unzip: opened archive file roms/ti99_4a.zip
unzip: closing archive file roms/ti99_4a.zip and sending to cache
Optional memory region ':screen' not found
Starting TI-99/4A Home Computer (Europe) ':'
(missing dependencies; rescheduling)
Starting Texas Instruments TMS9900 ':maincpu'
Starting TMS9901 Programmable System Interface ':tms9901'
Starting TI-99 Databus multiplexer ':datamux_16_8'
Starting TI-99 Cartridge port ':gromport'
Starting TI-99 Standard cartridge connector ':gromport:single'
Starting TI-99 cartridge ':gromport:single:cartridge'
Starting TMC0430 GROM ':gromport:single:cartridge:grom3'
Starting TMC0430 GROM ':gromport:single:cartridge:grom4'
Starting TMC0430 GROM ':gromport:single:cartridge:grom5'
Starting TMC0430 GROM ':gromport:single:cartridge:grom6'
Starting TMC0430 GROM ':gromport:single:cartridge:grom7'
Starting RAM ':scratchpad'
Starting RAM ':internal_32k_mod'
Starting Software List ':cart_list_ti99'
Starting Speaker ':cass_out'
(missing dependencies; rescheduling)
Starting Cassette ':cassette1'
Starting Cassette ':cassette2'
Starting TMC0430 GROM ':console_grom_0'
Starting TMC0430 GROM ':console_grom_1'
Starting TMC0430 GROM ':console_grom_2'
Starting TI-99 I/O Port ':ioport'
Starting Speaker ':sound_out'
(missing dependencies; rescheduling)
Starting SN94624 ':soundchip'
Starting TI-99 Joystick port ':joyport'
Starting TI-99/4(A) Twin Joysticks ':joyport:twinjoy'
Starting TMS9929A VDP ':vdp'
Starting Video Screen ':screen'
Starting TI-99/4A Home Computer (Europe) ':'
(missing dependencies; rescheduling)
Starting Speaker ':cass_out'
Starting Speaker ':sound_out'
Starting TI-99/4A Home Computer (Europe) ':'
Attempting to parse: default.cfg
Attempting to parse: ti99_4ae.cfg
BGFX: Found configuration for window 0
BGFX: Applying configuration for window 0


mizapf #123352 03/20/24 07:12 PM
Joined: Feb 2014
Posts: 1,024
Likes: 112
G
Very Senior Member
Online Content
Very Senior Member
G
Joined: Feb 2014
Posts: 1,024
Likes: 112
don't know if it makes any difference, but I've noticed that -bgfx defaults to vulkan (at least for me on ubuntu) you could try experimenting with -bgfx_backend opengl

mizapf #123354 03/21/24 10:38 AM
Joined: Nov 2004
Posts: 15
Likes: 3
S
Member
Offline
Member
S
Joined: Nov 2004
Posts: 15
Likes: 3
support will probably depend on how complete the wayland compositor is openSUSE chose to go with. I am not running into unexpected issues with wayland (kwin) on debian12.

Originally Posted by mizapf
With -video bgfx -videodriver x11, the gameinfo screen stays displayed; the emulated screen is not rendered, although the emulation is running (reacts to keypresses).
the xwayland xserver will need to be configured and running for the x11 driver to be supported on wayland

Originally Posted by mizapf
With -video bgfx -videodriver wayland, I'm getting a segfault:

BGFX: Unsupported SDL window manager type 6
Setting BGFX platform data failed
BGFX library initialization failed
Segmentation fault (core dumped)

This will happen when the MAME build is not compiled with USE_WAYLAND=1, wayland support is not the default.

Last edited by sairuk; 03/21/24 10:40 AM.
mizapf #123355 03/21/24 01:15 PM
Joined: Mar 2004
Posts: 698
Likes: 2
Senior Member
Online Content
Senior Member
Joined: Mar 2004
Posts: 698
Likes: 2
FWIW, on fedora both of these work:
Code
$ mame -intscaley 3 -autostretchxy -videodriver x11 -video bgfx -bgfx_backend vulkan mvsc
$ mame -intscaley 3 -autostretchxy -videodriver wayland -video bgfx -bgfx_backend vulkan mvsc
I am on a different GPU (RADV RENOIR) though.

mizapf #123356 03/21/24 01:51 PM
Joined: May 2007
Posts: 582
Likes: 9
M
mizapf Offline OP
Senior Member
OP Offline
Senior Member
M
Joined: May 2007
Posts: 582
Likes: 9
OK, I added USE_WAYLAND=1, but I'm having some problems when compiling. Seems as if the /usr/include/wayland directory is not in the include search path, as the files that were reported as missing are actually in that directory. I'll check a bit further.

mizapf #123357 03/21/24 02:28 PM
Joined: Mar 2001
Posts: 17,137
Likes: 163
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,137
Likes: 163
Sounds like maybe it needs to use pkgconfig or whatever to locate the Wayland includes?

mizapf #123358 03/23/24 03:17 PM
Joined: Mar 2004
Posts: 698
Likes: 2
Senior Member
Online Content
Senior Member
Joined: Mar 2004
Posts: 698
Likes: 2
The only additional header needed by wayland is wayland-egl.h AFAIR:
https://github.com/mamedev/mame/pull/11451/files
Where is it located on your distro? On Fedora it is directly in /usr/include. If this is not a standard location, we need pkg-config indeed.

mizapf #123361 03/23/24 09:52 PM
Joined: May 2007
Posts: 582
Likes: 9
M
mizapf Offline OP
Senior Member
OP Offline
Senior Member
M
Joined: May 2007
Posts: 582
Likes: 9
For openSUSE it is /usr/include/wayland/.

mizapf #123374 03/26/24 09:45 AM
Joined: Mar 2004
Posts: 698
Likes: 2
Senior Member
Online Content
Senior Member
Joined: Mar 2004
Posts: 698
Likes: 2
Does the following patch help building with USE_WAYLAND=1?
Code
diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua
index 17132ad814a..75f294a78b6 100644
--- a/scripts/src/osd/sdl_cfg.lua
+++ b/scripts/src/osd/sdl_cfg.lua
@@ -54,6 +54,11 @@ if _OPTIONS["USE_WAYLAND"]=="1" then
        defines {
                "SDLMAME_USE_WAYLAND",
        }
+       if _OPTIONS["targetos"]=="linux" then
+               buildoptions {
+                       backtick(pkgconfigcmd() .. " --cflags wayland-egl"),
+               }
+       end
 end
 
 if _OPTIONS["NO_USE_XINPUT"]=="1" then

mizapf #123387 03/30/24 05:36 AM
Joined: Mar 2004
Posts: 698
Likes: 2
Senior Member
Online Content
Senior Member
Joined: Mar 2004
Posts: 698
Likes: 2

mizapf #123388 03/30/24 09:44 PM
Joined: May 2007
Posts: 582
Likes: 9
M
mizapf Offline OP
Senior Member
OP Offline
Senior Member
M
Joined: May 2007
Posts: 582
Likes: 9
Thanks, I'll test it during the next few days and report.

mizapf #123395 04/01/24 02:47 PM
Joined: May 2007
Posts: 582
Likes: 9
M
mizapf Offline OP
Senior Member
OP Offline
Senior Member
M
Joined: May 2007
Posts: 582
Likes: 9
Sorry, does not work yet:

../../../../../3rdparty/bgfx/src/renderer_vk.cpp:21:17: fatal error: wayland-egl-backend.h: No such file or directory
21 | # include <wayland-egl-backend.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [bgfx.make:573: ../../../../linux_gcc/obj/x64/Release/3rdparty/bgfx/src/renderer_vk.o] Error 1
make[2]: *** Waiting for unfinished jobs....


I see the -I/usr/include/wayland entries in these files:

build/projects/sdl/mame/gmake-linux/mame.make
build/projects/sdl/mame/gmake-linux/ocore_sdl.make
build/projects/sdl/mame/gmake-linux/osd_sdl.make
build/projects/sdl/mame/gmake-linux/qtdbg_sdl.make

but not in

build/projects/sdl/mame/gmake-linux/bgfx.make

I guess that's where it's missing.

mizapf #123396 04/01/24 03:31 PM
Joined: Feb 2004
Posts: 2,552
Likes: 246
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,552
Likes: 246
Raise it upstream, we can cherry-pick a fix.

mizapf #123397 04/01/24 08:25 PM
Joined: Mar 2004
Posts: 698
Likes: 2
Senior Member
Online Content
Senior Member
Joined: Mar 2004
Posts: 698
Likes: 2
@mizapf, please give this a shot:
Code
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 64a8e3b7ab6..fc3ef8a6daa 100755
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -1558,6 +1558,9 @@ end
                        defines {
                                "WL_EGL_PLATFORM=1",
                        }
+                       buildoptions {
+                               backtick(pkgconfigcmd() .. " --cflags wayland-egl-backend"),
+                       }
                end
        end
 
@Vas, bgfx upstream seems not to use pkg-config at all.

mizapf #123401 04/04/24 03:46 PM
Joined: May 2007
Posts: 582
Likes: 9
M
mizapf Offline OP
Senior Member
OP Offline
Senior Member
M
Joined: May 2007
Posts: 582
Likes: 9
Looks good, the build was successful. Thanks!

For video=bgfx I have to explicitly set videodriver=wayland. Auto does not work here.

As I said, I'm not really a fan of Wayland (yet). Too many applications that don't work as expected, most notably, keepassxc which loses its hotkey feature. (Not MAME-related, but if anyone knows how to fix that, any hint would be great.)

mizapf #123402 04/04/24 05:09 PM
Joined: Mar 2004
Posts: 698
Likes: 2
Senior Member
Online Content
Senior Member
Joined: Mar 2004
Posts: 698
Likes: 2
Happy to hear compilation is fixed.

Regarding "auto", you get your distro's default, mame does not change anything here. You can use -verbose to see what the default you get is. Upstream SDL defaults to X11 afaik, Fedora has overridden this to wayland. I do not know whether openSUSE follows upstream SDL or have changed the default too.

Regarding hotkey - if you are referring to auto-type, vanilla keepass has the kpuinput plugin: https://keepass.info/help/kb/autotype_wayland.html

Last edited by belegdol; 04/04/24 05:10 PM.
1 member likes this: sairuk
Page 1 of 2 1 2

Link Copied to Clipboard
Who's Online Now
0 members (), 37 guests, and 6 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,273
Posts121,387
Members5,064
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com