Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Groovy - SDL2 patch  (Read 4486 times)

0 Members and 1 Guest are viewing this topic.

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Groovy - SDL2 patch
« on: November 17, 2014, 05:34:22 am »

Hello,

Starting from version 155, the SDL library version to use is now version 2. Nevertheless, the library needs still to be patched for low resolution with some other fixes. Under linux, the SDL1 version is patched with the following:

    1sdl_changeres.diff
    1xrand.diff
    fix_joystick_misc_axes.diff
    libsdl-1.2.15-resizing.patch
    sdl-1.2.14-disable-mmx.patch
    sdl-1.2.14-fix-mouse-clicking.patch
    sdl_x11sym.patch
    X11_KeyToUnicode.patch

What about SDL2? I looked around but the sdl-2 patch set is not released yet. @cools, do you plan to update the AUR to reflect this change?

Cheers



Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 19, 2025, 04:03:33 am
  • Quote me with care
Re: Groovy - SDL2 patch
« Reply #1 on: November 17, 2014, 05:54:46 am »
All my tests have been done using the latest iso (beta) from October the 24th, here.

I'm almost sure there's no patch applied to SDL2 in this one. Ves will confirm that this week (hopefully).

I'm eager to get rid of at least the SDL patch. That combined with using a custom EDID which also makes the kernel patch unnecessary (at least for ATI), would simplify things to only mantaining the ATI driver patch.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: Groovy - SDL2 patch
« Reply #2 on: November 17, 2014, 07:59:59 am »

Quote
I'm almost sure there's no patch applied to SDL2 in this one. Ves will confirm that this week (hopefully).

OK, I will enable SDL2 on the 32bit iso (GroovyArcade-Arch2013.02.24-i686.iso) to see if the switch over can be performed.

Quote
I'm eager to get rid of at least the SDL patch. That combined with using a custom EDID which also makes the kernel patch unnecessary (at least for ATI), would simplify things to only mantaining the ATI driver patch.

I have made EDID injection tests with several P4 motherboard but the limitation is coming from the BIOS default vesa mode(s).
ASUS bios does not allow mode override to 15kHz during boot. It disables the output even with a 15kHz patched video BIOS.
ASROCK bios is more tolerant and allow the card to select default modeline defined in the video BIOS region (still not following EDID modeline).
I have understood that UEFI bios gives mitigated results so far due to the extra XGA/SXGA resolutions. Unfortunately, I do not own an atom-15 bios video card to play with. I might look into this in the future.

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 19, 2025, 04:03:33 am
  • Quote me with care
Re: Groovy - SDL2 patch
« Reply #3 on: November 17, 2014, 08:10:04 am »
I have made EDID injection tests with several P4 motherboard but the limitation is coming from the BIOS default vesa mode(s).

Never heared of that before. We've been testing custom EDIDs created by the standalone SwitchRes with success regardless the motherboard. As far as I understand the BIOS modes have nothing to do here. Once you setup the kms drivers for early load, they take over the process and BIOS is out of the equation. It's only the BIOS post and boot loader what's out of sync and that is never affected by the EDID either way (unless with moder UEFI boards).
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: Groovy - SDL2 patch
« Reply #4 on: November 17, 2014, 08:24:50 am »

Indeed, I am making reference to the bios post screen. I was trying to force the bios to select a 15kHz modeline at boot. I am using diskless system booting through the ISCSI network stack and post text mode is visible longer. As soon as the kernel video driver kicks-in picture is perfect.

At the moment the solution for me is to use a dedicated 31kHz screen for post debugging and a 15kHz limiter to avoid damaging the CRT chassis. Hopefully, I own also a 15/25/31kHz CRT screen which facilitate all this without the pains inherent to plugging/unplugging the cables...

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 19, 2025, 04:03:33 am
  • Quote me with care
Re: Groovy - SDL2 patch
« Reply #5 on: November 17, 2014, 08:29:54 am »
Ok, I see what you mean now :)
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

cools

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 645
  • Last login:May 17, 2025, 02:24:48 pm
  • Arcade Otaku Sysadmin
    • Arcade Otaku
Re: Groovy - SDL2 patch
« Reply #6 on: November 17, 2014, 04:47:57 pm »
Your BIOS probably doesn't use the EDID data, instead selecting an available VESA mode. Pretty normal behaviour (I've not yet seen anything that actually uses EDID in BIOS)

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: Groovy - SDL2 patch
« Reply #7 on: November 19, 2014, 02:52:32 am »

I have applied the 0.015c patch along with the stock 32bit SDL2 library. I confirm that SDL2 does not need to be patched.

I made a quick test swapping between SDL and SDL2 library. I have observed a 40% performance drop with SDL2 on a 3GHz P4. This result sounds surprising to me. Is it expected?

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 19, 2025, 04:03:33 am
  • Quote me with care
Re: Groovy - SDL2 patch
« Reply #8 on: November 19, 2014, 03:39:09 am »
I have applied the 0.015c patch along with the stock 32bit SDL2 library. I confirm that SDL2 does not need to be patched.

Good news then. Thanks!

Quote
I made a quick test swapping between SDL and SDL2 library. I have observed a 40% performance drop with SDL2 on a 3GHz P4. This result sounds surprising to me. Is it expected?

How are you testing this? What do you mean by a 40% performance drop? I do my tests in a P4 3GHz too and have no problems, although I use a 64bit build.
(just in case, when you press F11 I've noticed the speed decreases due to having to print the percentage text --yes-- so it's better to check the speed log on exit)
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: Groovy - SDL2 patch
« Reply #9 on: November 19, 2014, 04:30:03 am »
Quote
How are you testing this? What do you mean by a 40% performance drop? I do my tests in a P4 3GHz too and have no problems, although I use a 64bit build.
(just in case, when you press F11 I've noticed the speed decreases due to having to print the percentage text --yes-- so it's better to check the speed log on exit)

My P4 does not have the 64bit instruction set, this is the reason why I am sticking to the 32bit distro.

I use F11 to display the percentage in both tests. Since v155, the core drivers require little more CPU cycle to achieve the same emulation compared to previous build. I have selected a game running below 100% in attract mode to see the impact. Under SDL the reported speed is 84% of nominal speed. With SDL2 the same test shows 50% nominal speed. The two tests have been conducted with the same ume.ini configuration file.

There is still a gap I need to rectify to confirm the behaviour. At the the moment the SDL version is based on 015b and the SDL2 version is based on 015c. I will build a SDL in 015c with commented SDL_LIBVER line and report back here.

I will redo the tests with -seconds_to_run and check the reported speed at exit. Do you have a recommended/preferred ROM for the check?


Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 19, 2025, 04:03:33 am
  • Quote me with care
Re: Groovy - SDL2 patch
« Reply #10 on: November 19, 2014, 04:42:38 am »
When vsync is used, you need some care to interpret your results. Due to how vsync works, even a tiny 1% real performance drop can force the emulation speed to drop to 50% (and exactly 50%, not 36% or 64%).
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

Doozer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:June 12, 2023, 09:19:49 am
  • Z80 ERROR
Re: Groovy - SDL2 patch
« Reply #11 on: November 21, 2014, 11:33:06 pm »
I performed the speed test comparison between patch 015b/015c and SDL/SDL2. With the same ume.ini configuration, a speed drop is visible between 015b_SDL and 015c_SDL. It could be related to the configuration file I used. I assume SDL2 is also affected by the same effect. But definitely, speed is not reduced with a magnitude of 1/2.

Command used:

Code: [Select]
# Linux 32 bit, single CPU
ume <rom> -seconds_to_run 60

Configuration:

Code: [Select]
#
# CORE CONFIGURATION OPTIONS
#
readconfig                1
writeconfig               0

#
# CORE SEARCH PATH OPTIONS
#
rompath                   /home/roms/MAME/roms;/home/roms/BIOS_roms
hashpath                  $HOME/hash
samplepath                /home/roms/MAME/samples
artpath                   /home/roms/MAME/artwork
ctrlrpath                 /home/roms/MAME/ctrlr
inipath                   $HOME/.ume;$HOME;.;$HOME/ini
fontpath                  /home/roms/MAME/fonts
cheatpath                 /home/roms/MAME/cheat
crosshairpath             /home/roms/MAME/crosshair

#
# CORE OUTPUT DIRECTORY OPTIONS
#
cfg_directory             $HOME/cfg
nvram_directory           $HOME/nvram
memcard_directory         $HOME/memcard
input_directory           $HOME/inp
state_directory           $HOME/sta
snapshot_directory        $HOME/snap
diff_directory            $HOME/diff
comment_directory         $HOME/comments

#
# CORE OUTPUT DIRECTORY OPTIONS
#
hiscore_directory         $HOME/hi

#
# CORE STATE/PLAYBACK OPTIONS
#
state                     
autosave                  0
playback                 
record                   
mngwrite                 
aviwrite                 
wavwrite                 
snapname                  %g/%i
snapsize                  auto
snapview                  internal
statename                 %g
burnin                    0

#
# CORE PERFORMANCE OPTIONS
#
autoframeskip             0
frameskip                 0
seconds_to_run            0
throttle                  1
syncrefresh               0
sleep                     1
speed                     1.0
refreshspeed              0

#
# CORE ROTATION OPTIONS
#
rotate                    1
ror                       0
rol                       0
autoror                   0
autorol                   0
flipx                     0
flipy                     0

#
# CORE ARTWORK OPTIONS
#
artwork_crop              1
use_backdrops             0
use_overlays              0
use_bezels                0
use_cpanels               0
use_marquees              0

#
# CORE SCREEN OPTIONS
#
brightness                1.0
contrast                  1.0
gamma                     1.0
pause_brightness          0.65
effect                    none

#
# CORE VECTOR OPTIONS
#
antialias                 1
beam                      1.0
flicker                   0

#
# CORE SOUND OPTIONS
#
sound                     1
samplerate                48000
samples                   1
volume                    0

#
# CORE INPUT OPTIONS
#
coin_lockout              1
ctrlr                     
mouse                     0
joystick                  0
lightgun                  1
multikeyboard             0
multimouse                0
steadykey                 0
ui_active                 0
offscreen_reload          1
joystick_map              auto
joystick_deadzone         0.3
joystick_saturation       0.85
natural                   0
joystick_contradictory    0
coin_impulse              0

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device             keyboard
adstick_device            keyboard
pedal_device              keyboard
dial_device               keyboard
trackball_device          keyboard
lightgun_device           lightgun
positional_device         keyboard
mouse_device              lightgun

#
# CORE DEBUGGING OPTIONS
#
log                       0
verbose                   0
update_in_pause           0
debug                     0
debugscript               
debug_internal            0

#
# CORE MISC OPTIONS
#
drc                       1
drc_use_c                 0
bios                     
cheat                     0
skip_gameinfo             0
uifont                    default
ramsize                   
confirm_quit              0
ui_mouse                  0
autoboot_command         
autoboot_delay            2
autoboot_script           
http                      0
http_port                 8080
http_path                 web

#
# CORE MKChamp OPTIONS
#
disable_hiscore_patch     0
disable_nagscreen_patch   0
disable_loading_patch     1

#
# CORE SWITCHRES OPTIONS
#
modeline_generation       1
monitor                   custom
orientation               horizontal
connector                 auto
interlace                 1
doublescan                1
cleanstretch              0
changeres                 1
powerstrip                0
#AWK test AVGA 0 / Other 1
lock_system_modes         1
lock_unsupported_modes    1
#AWK test AVGA 1 / Other 0
refresh_dont_care         0
dotclock_min              0
sync_refresh_tolerance    2.0
frame_delay               0
black_frame_insertion     0
modeline                  auto
ps_timing                 auto
lcd_range                 auto

#example
#crt_range0  15700-16200, 50-62, 1.098, 3.293, 6.587, 0.064, 0.160, 0.550, 0, 0, 192, 248, 0, 0
#crt_range1  15700-16200, 50-62, 1.098, 3.293, 6.587, 0.064, 0.160, 0.550, 0, 0, 249, 256, 0, 0
#crt_range2  20500-21000, 50-62, 0.782, 4.693, 4.693, 0.986, 0.148, 1.380, 0, 0, 257, 288, 0, 0
#crt_range3  22000-22500, 50-62, 0.782, 4.693, 4.693, 0.986, 0.148, 1.380, 0, 0, 289, 320, 0, 0

# Format:
#crt_range 0-9   HfreqMin-HfreqMax, VfreqMin-VfreqMax, HFrontPorch, HSyncPulse, HBackPorch, VfrontPorch, VSyncPulse, VBackPorch, HSyncPol, VSyncPol, ProgressiveLinesMin, ProgressiveLinesMax, InterlacedLinesMin, InterlacedLinesMax

crt_range0               "15625-16200, 55.10-65.00, 2.000, 5.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 192, 240, 0, 0"
crt_range1               "15625-16200, 49.50-54.253, 2.000, 5.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 192, 256, 0, 0"
crt_range2               "15625-16200, 49.50-65.00, 2.000, 5.700, 8.000, 0.064, 0.192, 1.024, 0, 0, 0, 0, 448, 576"
crt_range3                auto
crt_range4                auto
crt_range5                auto
crt_range6                auto
crt_range7                auto
crt_range8                auto
crt_range9                auto

#
# DEBUGGING OPTIONS
#
oslog                     0
watchdog                  0

#
# PERFORMANCE OPTIONS
#
multithreading            1
#numprocessors             auto
sdlvideofps               0
bench                     0

#
# VIDEO OPTIONS
#
video                     opengl
numscreens                1
window                    0
maximize                  1
keepaspect                0
unevenstretch             0
centerh                   1
centerv                   1
waitvsync                 1
scalemode                 none

#
# OpenGL-SPECIFIC OPTIONS
#
filter                    0
prescale                  1
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   0
gl_glsl_filter            1
glsl_shader_mame0         /home/arcade/CRT/shader/glsl_plain
glsl_shader_mame1         /home/arcade/CRT/CRT-geom
glsl_shader_mame2         none
glsl_shader_mame3         none
glsl_shader_mame4         none
glsl_shader_mame5         none
glsl_shader_mame6         none
glsl_shader_mame7         none
glsl_shader_mame8         none
glsl_shader_mame9         none
glsl_shader_screen0       none
glsl_shader_screen1       none
glsl_shader_screen2       none
glsl_shader_screen3       none
glsl_shader_screen4       none
glsl_shader_screen5       none
glsl_shader_screen6       none
glsl_shader_screen7       none
glsl_shader_screen8       none
glsl_shader_screen9       none
gl_glsl_vid_attr          1

#
# PER-WINDOW VIDEO OPTIONS
#
screen                    auto
aspect                    auto
resolution                auto
view                      auto
screen0                   auto
aspect0                   auto
resolution0               auto
view0                     auto
screen1                   auto
aspect1                   auto
resolution1               auto
view1                     auto
screen2                   auto
aspect2                   auto
resolution2               auto
view2                     auto
screen3                   auto
aspect3                   auto
resolution3               auto
view3                     auto

#
# FULL SCREEN OPTIONS
#
switchres                 1
useallheads               0

#
# SOUND OPTIONS
#
audio_latency             1.5

#
# SDL KEYBOARD MAPPING
#
keymap                    0
keymap_file               keymap.dat
uimodekey                 SCRLOCK

#
# SDL JOYSTICK MAPPING
#
joy_idx1                  auto
joy_idx2                  auto
joy_idx3                  auto
joy_idx4                  auto
joy_idx5                  auto
joy_idx6                  auto
joy_idx7                  auto
joy_idx8                  auto
sixaxis                   0

#
# SDL LIGHTGUN MAPPING
#
lightgun_index1           WiiMote0
lightgun_index2           WiiMote1
lightgun_index3           auto
lightgun_index4           auto
lightgun_index5           auto
lightgun_index6           auto
lightgun_index7           auto
lightgun_index8           auto

#
# SDL LOWLEVEL DRIVER OPTIONS
#
videodriver               auto
audiodriver               auto
gl_lib                    auto



Rom1: mwalk

SDL 015b Average speed: 99.96% (59 seconds)

SDL 015c Average speed: 97.70% (59 seconds)

SDL2 015c Average speed: 97.84% (59 seconds)


Rom2: boblbobl

SDL 015b Average speed: 100.07% (59 seconds)

SDL 015c Average speed: 100.07% (59 seconds)

SDL2 015c Average speed: 100.07% (59 seconds)

« Last Edit: November 22, 2014, 12:34:16 am by Doozer »

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7463
  • Last login:July 19, 2025, 04:03:33 am
  • Quote me with care
Re: Groovy - SDL2 patch
« Reply #12 on: November 24, 2014, 02:22:25 pm »
mwalk is a game that switches resolutions, not a good choice for performance tests due to the delays introduced by this.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead of pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi