Software Support > GroovyMAME

GroovyArcade live-CD 2022 (collaborative effort)

<< < (115/117) > >>

intealls:

--- Quote from: Substring on October 26, 2024, 04:10:32 am ---In terms of input latency, Calamity said the RT patch brought nothing when he tested. But I shouldn't speak on his behalf ;)

--- End quote ---

No this would seem reasonable, I don't think the -rt patch would improve that all that much. Also, it would be brutally hard to measure this without some custom equipment. The runs I did were 15 minutes long I think and you can see there are a handful of framedrops. Checking next-frame response with a high frame rate camera (this is what I do anyway) for such a long time would probably drive anyone insane.


--- Quote from: edomatic on October 24, 2024, 04:01:22 pm ---Interesting stuff intealls!
Have you by any chance checked in with Calamity on his view on this?, i believe i read a comment from substring saying calamity experimented with this about 2 years ago ? but a lot can change in that timeframe off course,(patches,updates,improvements..).it looks like you are on to something.
I would love to test this rt kernel out to see what the impact is on the games in terms of framedelay/audio latency performance.
I myself am on a i7 4790k with substring’s latest GA build running in pretty much vanilla.i have not experimented with rt kernels, is it hard is to set that up or modify /add that functionality to the existing build i have?

--- End quote ---

Hi endomatic, unfortunately it's kind of a painful process.

I've attached PKGBUILDs for linux-rt and GM with the rate filter patch. Building the packages is probably best done on something faster than the 46x0k, linux-rt package needs makepkg --skipinteg, or you'll need to add the sha512sums to the PKGBUILD.

Also, if you try this make sure to disable automatic installation of linux-rt on GA, otherwise you might lose 15 kHz on pacman -Syu.

Then:

Install linux-rt kernel and GM package.

Modify kernel command line (idle=poll is probably the most important one here, clocksource can probably vary between systems):

mitigations=off idle=poll tsc=reliable clocksource=tsc

Stuff run on startup (most from arch wiki, the performance governor is critical if not set through kernel, unclear advantage from all the other stuff):

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo 2048 > /sys/class/rtc/rtc0/max_user_freq
echo 2048 > /proc/sys/dev/hpet/max-user-freq
echo 0 > /proc/sys/vm/compaction_proactiveness
echo 1 > /proc/sys/vm/watermark_boost_factor
echo 1048576 > /proc/sys/vm/min_free_kbytes
echo 500 > /proc/sys/vm/watermark_scale_factor
echo 10 > /proc/sys/vm/swappiness
echo 5 > /sys/kernel/mm/lru_gen/enabled
echo 0 > /proc/sys/vm/zone_reclaim_mode
echo 1 > /proc/sys/vm/page_lock_unfairness
echo 0 > /proc/sys/kernel/sched_child_runs_first
echo 1 > /proc/sys/kernel/sched_autogroup_enabled
echo 3000 > /proc/sys/kernel/sched_cfs_bandwidth_slice_us
echo 500000 > /sys/kernel/debug/sched/migration_cost_ns

/etc/sysctl.d/90-max_user_watches.conf:
fs.inotify.max_user_watches = 600000

Allow arcade user to run mame with nice -n -20 (important):

https://wiki.archlinux.org/title/Limits.conf

nano /etc/security/limits.conf

...
#@student        -       maxlogins       4
*                -       nice            -20

# End of file
...

Reboot and then run mame:

nice -n -20 mame [options]

To measure use PortAudio with a low latency (-pa_latency 0.004 or 0.008 or similar) and do nice -n -20 mame game -pa_log -v | grep 123456.123456 > game.log and use buf.py (in rate_filter.patch) to visualize it (requires python and some supporting packages, can't be done easily on GA machine).

Substring:
I'd be really open to anything that would bring extra perfs to GM, with or without the kernel patch.

Regarding port audio : too many people complained about it, so it's not default anymore. I find it way to complicated to set up, and it's pretty hardware dependant.

For nice and such : is it worh with a default kernel ?

intealls:

--- Quote from: Substring on October 29, 2024, 11:40:48 am ---I'd be really open to anything that would bring extra perfs to GM, with or without the kernel patch.

--- End quote ---

Nice, Calamity has OK'd the idea of the rate patch - it should get rid of most audio pitch shifts but only works for PortAudio. But I've got some boring stuff left on it so it'll take some more time, it needs testing on Windows, and might need some additional cleanup etc. I'm currently running GA on an SBC so a vastly different machine than the i5, and it seems to perform the same on this platform, and seems to be needed here as well. But since most people use Windows it needs some testing there. Maybe it should be added as an "experimental improved soundsync" option or something.


--- Quote from: Substring on October 29, 2024, 11:40:48 am ---Regarding port audio : too many people complained about it, so it's not default anymore. I find it way to complicated to set up, and it's pretty hardware dependant.

--- End quote ---

For most cases I think it should be adequate to do -sound portaudio -pa_latency 0.0xx  -audio_latency 1 to get improved audio latency. It should then use the default audio device, but I'm not sure how that works in GA with ALSA etc, it's up to PortAudio itself. When manually selecting the sound device they can sometimes switch order (so if you have two, sometimes one shows up as hw:1,0 and other times as hw:0,0 which can be really irritating). But this could probably be fixed with udev, but also needs some tweaking.

But in the general case, PA will require more tweaking than SDL, it's the nature of the beast unfortunately.


--- Quote from: Substring on October 29, 2024, 11:40:48 am ---For nice and such : is it worh with a default kernel ?

--- End quote ---

I think some of the tweaks are probably beneficial, most of them deal with pushing framedelay. If you're looking to add something to GA I'd say probably the most helpful one would be to set the performance governor and run GM with -nosleep. Of all the tweaks this is probably the one that helps the most. Keep in mind though that power will go up (and heat as well). So it's probably not a good idea to use it on a laptop. Also nice is good if there are many background processes, -20 is probably overkill though.

But generally, most of the improvements will come when trimming the latencies. Most of them are from https://wiki.archlinux.org/title/Professional_audio and https://wiki.archlinux.org/title/Gaming#Improving_performance .

pixeltao:
I hope I'm not breaking any forum rules already (this is my first post here). I registered just to say that I've built a GroovyArcade using an old ATI graphics card from the 2010s during the holdidays and it's freaking awesome! Playing all of these arcade games on my D-series CRT is just perfect! I already got 2 MiSTers but having the option to play the huge MAME library (including CPS3 and Midway games) is really cool. I was hoping to support this via a patreon or something, but I've read on github that it's not a thing for GroovyArcade, so I wanted to at least share how happy I am this exists. Fantastic work!

Cheers

Substring:
GroovyArcade is Free. I'm not asking any kind of retribution for it. I'd feel really ashamed of getting money from assembling stuff mostly done by others. So no, it's just free, eriod.

And I'm glad it worked like a charm for you :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version