Hi Calamity and Substring, and first just wanted to say, AWESOME work on groovy+drmkms! Really cool having an X-less setup, and reminds me of AdvanceMAME!
The last few days I've been messing around with putting together a highly optimized setup with some new audio synchronization code I've been working on, which should allow for under/overrun free playback when no frames are dropped and a decent estimate is found. This usually takes a couple of seconds. It uses a finer granularity than the soundsync currently in groovy, and is quite restrictive with the estimate, so there should be no audible pitch shifts. I've attached a plot of the number of samples in the audio buffer during a 6-ish minute run of Sonic Wings 2, the buffered number of samples seem to consistently be less than 1 millisecond!
I've patched the 6.5 linux-rt arch package with the 15khz patches, and done everything here
https://wiki.archlinux.org/title/Professional_audio . It's currently running on an i5-4690K@4.6 GHz, with idle=poll as an added kernel boot option. I'm using a R7 260 and have blacklisted the amdgpu driver, so the radeon driver is used. I'm not sure the -rt package improve things substantially, but it doesn't seem to hurt.
The complete kernel boot is BOOT_IMAGE=/vmlinuz-linux-rt root=/dev/disk/by-uuid/305991b6-4ba1-4094-8b80-5d3ebc1966aa rw quiet rd.udev.log-priority=3 mitigations=off audit=0 consoleblank=0 monitor=generic_15 video=DVI-I-1:640x240S idle=poll drm.edid_firmware=DVI-I-1:edid/generic_15.bin initrd=/initramfs-linux-rt.img
I'm using
groovyarcade/sdl2 2.28.5-2 [installed]
extra/mesa 1:23.3.5-1 [installed: 23.0.3-1]
linux-rt-6.5.2.8.realtime1-1 with 15 khz patches applied
6.5 seems to work fine. With 6.6 or later I get issues (black screen when starting GM).
I found that the latest mesa package (23.3.5) seems to break (or at least impair) next frame response? When installing 23.0.3 as suggested earlier in the thread it seems to work fine.
I have one issue though I really hope can be sorted - and that is that you have to launch the games directly (not from the MAME UI) in order to get a working display.
When looking through the logs I can see this:
First run (mame aes -cart sonicwi2):
Available videodrivers: x11 wayland KMSDRM offscreen dummy evdev
Current Videodriver: KMSDRM
Display #0
Desktop Mode: 640x240-32@60
Current Display Mode: 640x240-32@60
Renderdrivers:
opengl (0x0)
opengles2 (0x0)
software (0x0)
...
Switchres: Monitor range 15625.00-15750.00,49.50-65.00,2.000,4.700,8.000,0.064,0.192,1.024,0,0,192,288,448,576
parsing /etc/switchres.ini
Switchres/SDL2: Detected SDL version 2.30.0 on KMSDRM
Switchres: get_mode(0) 320 224 59.185606 1.333333
Switchres: Calculating best video mode for 320x224@59.185608 orientation: normal
Switchres: Modeline "320x224_59 15.625000KHz 59.185608Hz" 6.734375 320 339 370 431 224 235 238 264 -hsync -vsync
SwitchRes: Setting option -nokeepaspect
SwitchRes: Setting option -nounevenstretch
SwitchRes: Setting option -nounevenstretchx
SwitchRes: Setting option -waitvsync
SwitchRes: Setting option -syncrefresh
SwitchRes: Setting option -nofilter
drm_open: /dev/dri/card0 successfully opened
OpenGL: AMD
OpenGL: BONAIRE (, LLVM 15.0.7, DRM 2.50, 6.5.2.8.realtime1-1-rt)
OpenGL: 4.5 (Compatibility Profile) Mesa 23.0.3
OpenGL: texture rectangle supported
OpenGL: non-power-of-2 textures supported (new method)
OpenGL: vertex buffer supported
OpenGL: pixel buffers supported
OpenGL: framebuffer object supported
OpenGL: GLSL supported, but disabled
OpenGL: max texture size 16384 x 16384
Leave renderer_ogl::create
...
When launching a new cart from within the UI:
...
Available videodrivers: x11 wayland KMSDRM offscreen dummy evdev
Current Videodriver: offscreen
Display #0
Desktop Mode: 1024x768-24@0
Current Display Mode: 1024x768-24@0
Renderdrivers:
opengl (0x0)
opengles2 (0x0)
software (0x0)
...
Leave sdlwindow_init
Enter sdl_info::create
Switchres: Monitor range 15625.00-15750.00,49.50-65.00,2.000,4.700,8.000,0.064,0.192,1.024,0,0,192,288,448,576
parsing /etc/switchres.ini
Switchres/SDL2: (sdl2_display): SDL2 is only available for KMSDRM for now.
DRM/KMS: <1> (get_master_fd) No way to get master rights!
DRM/KMS: <1> (init) [ERROR] limited DRM rights on this screen
DRM/KMS: <1> (init) [ERROR] no screen detected
drm_open: /dev/dri/card0 successfully opened
Leave renderer_ogl::create
...
I've attached the full log. At this point I'm not sure where to start looking, since launching games from the UI seemed to work better with mesa 23.3.5? Any pointers are appreciated. I tried closing the drm file descriptor in video_opengl::exit but this doesn't seem to help.
Edit: mesa 23.1.4 seems fine both in regards to next-frame response and launching/switching games from the UI.