From 6794a569873b19084e1173fb62c8075b5c6fcb4a Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Wed, 1 Jul 2026 22:59:19 -0300 Subject: [PATCH] RK3326: gameplay priority and RetroArch tuning from the dArkOS analysis - Launch emulators at nice -19 like dArkOS does; with the full-preempt kernel this keeps frame pacing stable when background work wakes up mid-frame. - audio_latency 64 to 128, matching dArkOS on the same alsathread driver and hardware: the 64ms buffer underruns audibly on heavy cores, which users read as instability. - fastforward_frameskip on: skip rendering during fast-forward and give the GPU time back to the core. Co-Authored-By: Claude Fable 5 --- projects/ArchR/packages/archr/sources/scripts/runemu.sh | 6 +++++- .../libretro/retroarch/sources/RK3326/retroarch.cfg | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/ArchR/packages/archr/sources/scripts/runemu.sh b/projects/ArchR/packages/archr/sources/scripts/runemu.sh index 95a5b140b0..4e9d1082eb 100755 --- a/projects/ArchR/packages/archr/sources/scripts/runemu.sh +++ b/projects/ArchR/packages/archr/sources/scripts/runemu.sh @@ -485,7 +485,11 @@ if [[ "${ROMNAME}" == *".sh" ]] && [ ! "${PLATFORM}" = "ports" ] && [ ! "${PLATF ret_error=$? else ${VERBOSE} && log $0 "Executing $(eval echo ${RUNTHIS})" - eval ${RUNTHIS} &>>${OUTPUT_LOG} + # Launch the emulator at high priority: with the full-preempt + # kernel this keeps frame pacing stable when background work + # (udev, journald, wifi) wakes up mid-frame. Same value dArkOS + # uses for its emulators. + eval nice -n -19 ${RUNTHIS} &>>${OUTPUT_LOG} ret_error=$? fi diff --git a/projects/ArchR/packages/emulators/libretro/retroarch/sources/RK3326/retroarch.cfg b/projects/ArchR/packages/emulators/libretro/retroarch/sources/RK3326/retroarch.cfg index e2e893128c..fda5dd5adc 100755 --- a/projects/ArchR/packages/emulators/libretro/retroarch/sources/RK3326/retroarch.cfg +++ b/projects/ArchR/packages/emulators/libretro/retroarch/sources/RK3326/retroarch.cfg @@ -23,7 +23,9 @@ audio_enable_menu_ok = "false" audio_enable = "true" audio_fastforward_mute = "false" audio_filter_dir = "~/.config/retroarch/filters/audio" -audio_latency = "64" +# 128 matches dArkOS on the same hardware/driver (alsathread): the 64ms +# buffer underruns audibly on heavy cores, which users read as instability. +audio_latency = "128" audio_max_timing_skew = "0.049999" audio_mixer_mute_enable = "false" audio_mixer_volume = "0.000000" @@ -820,3 +822,6 @@ xmb_shadows_enable = "true" xmb_theme = "0" xmb_vertical_thumbnails = "false" youtube_stream_key = "" + +# skip render during fast-forward (GPU time back to the core) +fastforward_frameskip = "true"