Good news regarding tearing and low EmulationStation performance on Pi 4
-
@akamming said in Good news regarding tearing and low EmulationStation performance on Pi 4:
These are my /boot/config.txt settings which sped up my pi 4:
over_voltage=6 arm_freq=2100 v3d_freq=815 gpu_freq=750 hdmi_enable_4kp60=1 dtoverlay=vc4-kms-v3d-pi4,noaudio dtparam=audio=on
I had some instability, which was fixed by bringing down v3d_freq from 825 to 815 since the last post i made here...
In the individual emulators i set all settings to the fastest settings. Also bringing down the screen resolution helps a lot to get better fps. (e.g. N64 games i can only run at intern resolution of the emulator of 640x480, so i use runcommand to set screen resolution to 848x480. This gives much better framerate than 720p or 1080p)
I tried to switch for kms driver but I only have a black screen on the boot screen.
Could share your config.txt
My settings
Does this part of the config go under [pi4] or [all]?
hdmi_enable_4kp60=1 dtoverlay=vc4-kms-v3d-pi4,noaudio dtparam=audio=on
My config must be wrong in that part.
# Enable audio (loads snd_bcm2835) dtparam=audio=on [pi4] # Enable DRM VC4 V3D driver on top of the dispmanx display stack dtoverlay=vc4-kms-v3d-pi4,noaudio max_framebuffers=2 [all] #dtoverlay=vc4-fkms-v3d gpu_mem=256 hdmi_enable_4kp60=1
-
@JUM you should really the link which was provided by @dankcushions. Instead of updating the previous post you now made another one, making the thread even more unreadable….
anyway. Another suggestion is that if you make changes in files like config.txt you should know what you are doing and not just copy / past what you got from the last forum post, but check the entire thread and/or study the official documentation before making the changes. Making the wrong changes can brick your pi (e.g. too aggessive overclock settings) !
The original forum posts contains links which quite clearly describe how to modify the config.txt. Also a lot of info on overclock settings can be found here.
anyway if it helps: Here's my current config.txt:
# For more options and information see # http://rpf.io/configtxt # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan #disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1920 #framebuffer_height=1080 # uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=2 hdmi_mode=82 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. over_voltage=6 arm_freq=2100 v3d_freq=800 gpu_freq=750 hdmi_enable_4kp60=1 # Uncomment some or all of these to enable the optional hardware interfaces #dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # Uncomment this to enable infrared communication. #dtoverlay=gpio-ir,gpio_pin=17 #dtoverlay=gpio-ir-tx,gpio_pin=18 # Additional overlays and parameters are documented /boot/overlays/README # Enable audio (loads snd_bcm2835) dtparam=audio=on [pi4] # Enable DRM VC4 V3D driver on top of the dispmanx display stack #dtoverlay=vc4-fkms-v3d dtoverlay=vc4-kms-v3d-pi4,noaudio max_framebuffers=2 [all] #dtoverlay=vc4-fkms-v3d # NOOBS Auto-generated Settings: gpu_mem=256
-
@akamming said in Good news regarding tearing and low EmulationStation performance on Pi 4:
@JUM you should really the link which was provided by @dankcushions. Instead of updating the previous post you now made another one, making the thread even more unreadable….
anyway. Another suggestion is that if you make changes in files like config.txt you should know what you are doing and not just copy / past what you got from the last forum post, but check the entire thread and/or study the official documentation before making the changes. Making the wrong changes can brick your pi (e.g. too aggessive overclock settings) !
The original forum posts contains links which quite clearly describe how to modify the config.txt. Also a lot of info on overclock settings can be found here.
anyway if it helps: Here's my current config.txt:
# For more options and information see # http://rpf.io/configtxt # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan #disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1920 #framebuffer_height=1080 # uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=2 hdmi_mode=82 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. over_voltage=6 arm_freq=2100 v3d_freq=800 gpu_freq=750 hdmi_enable_4kp60=1 # Uncomment some or all of these to enable the optional hardware interfaces #dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # Uncomment this to enable infrared communication. #dtoverlay=gpio-ir,gpio_pin=17 #dtoverlay=gpio-ir-tx,gpio_pin=18 # Additional overlays and parameters are documented /boot/overlays/README # Enable audio (loads snd_bcm2835) dtparam=audio=on [pi4] # Enable DRM VC4 V3D driver on top of the dispmanx display stack #dtoverlay=vc4-fkms-v3d dtoverlay=vc4-kms-v3d-pi4,noaudio max_framebuffers=2 [all] #dtoverlay=vc4-fkms-v3d # NOOBS Auto-generated Settings: gpu_mem=256
Thanks
You have Raspbian Buster installed or Raspberry Pi OS?
-
@akamming with your new clock settings are you able to play Cave shooters with lr-mame2016 without slowdown/audio stutter? For example espgal2 or futaribl both of those make the pi4 cry
-
@JUM said in Good news regarding tearing and low EmulationStation performance on Pi 4:
You have Raspbian Buster installed or Raspberry Pi OS?
raspbian buster, but i think that's now called raspberry pi os ;-)
-
@beerninja said in Good news regarding tearing and low EmulationStation performance on Pi 4:
@akamming with your new clock settings are you able to play Cave shooters with lr-mame2016 without slowdown/audio stutter? For example espgal2 or futaribl both of those make the pi4 cry
don't know, haven't tried that. i use lr-mame2003 for most games. lr-mame2016 is much slower...
-
@akamming I would use that too (or FBN) except those games were released after 2003 :-( Maybe one day we'll get an optimized cv1000 Cave game emulator that works on pi
-
@beerninja Last I heard, the FBNeo team definitely want to add cv1k support, they just need someone who can write the required sh4 dynarec for the CPU emulation.
-
So is the latest update suppose to fix this? I updated everything and still get tearing on NES games such as Metroid and even punch out.
-
@xanstin Not really, and I'm pretty sure we are not getting a fix anytime soon. Most "retro enthusiasts" on youtube are happy with PI4 performance, so fixing stuff like this seems to be pretty low priority.
-
@RetroWhirl said in Good news regarding tearing and low EmulationStation performance on Pi 4:
@xanstin Not really, and I'm pretty sure we are not getting a fix anytime soon. Most "retro enthusiasts" on youtube are happy with PI4 performance, so fixing stuff like this seems to be pretty low priority.
what will expedite a fix is someone logging the issue with the raspberry pi firmware team, but to do that someone needs to recreate the issue in a small test program, not something with so many other factors like emulationstation/emulation.
right now i don't think this issue is on their radar.
-
I’m currently trying to put together a RetroPie installation consisting of:
- Linux kernel 5.9 64-bit
- Mesa 20.3
I started from the latest Raspberry Pi OS 64-bit desktop beta. Upgraded to kernel 5.9, which is simple now since it’s available in the ”next” branch of rpi-update since a few days. Upgrading from the almost year-old Mesa 19.3 to 20.3 was a bit more involved, but was successful. Currently installing RetroPie from source and hoping it will work as expected.
Testing this will be interesting, since it contains major updates to both the full-KMS driver as well as Mesa. Also, using 64-bit for RetroPie will be a first for me, so that is interesting as well.
-
@Brunnis Are they still not providing kernel headers even if it's in the "next" branch? My snes pad driver needs it. It's why I've never bothered using bleeding edge kernels.
-
@Darksavior I’m not sure about that. I haven’t seen that they do, though, so maybe not then.
EmulationStation started up fine on my build, but there’s no sound. Need to get that working before I do any testing.
-
@Brunnis If you are using the KMS audio driver then you need to replace the code in
vc4-hdmi.conf
inusr/share/alsa/cards
with the following:# Configuration for the VC4-HDMI sound card using software IEC958 # subframe conversion <confdir:pcm/hdmi.conf> vc4-hdmi.pcm.hdmi.0 { @args [ CARD AES0 AES1 AES2 AES3 ] @args.CARD { type string } @args.AES0 { type integer } @args.AES1 { type integer } @args.AES2 { type integer } @args.AES3 { type integer } type iec958 slave { format IEC958_SUBFRAME_LE pcm { type hooks slave.pcm { type hw card $CARD device 0 } hooks.0 { type ctl_elems hook_args [ { name "IEC958 Playback Default" optional true lock true preserve true value [ $AES0 $AES1 $AES2 $AES3 ] } ] } } } status [ $AES0 $AES1 $AES2 $AES3 ] } # default with plug vc4-hdmi.pcm.default { @args [ CARD ] @args.CARD { type string } type plug slave.pcm { type softvol slave.pcm { @func concat strings [ "hdmi:" $CARD ] } control { name "PCM Playback Volume" card $CARD } } }
If you are trying to use the firmware Broadcom audio driver with the KMS audio disabled (
vc4-kms-v3d,noaudio
) then at present the 5.9 kernel is broken. A fix has been committed, but rpi-update has not been updated with the latest change. -
@bluestang Ahh, thanks, that worked nicely! So, compared to current RetroPie images, I now have an installation that runs:
- 64-bit kernel and userland
- Linux kernel 5.9
- Bleeding edge Mesa ("20.3")
- The full KMS video driver
- The new ARM-side HDMI audio driver
That's quite a lot of under the hood changes. Despite this, I actually once again ran into the dreaded 30 FPS issue in EmulationStation. To the best of my knowledge, this only plagues the Pi 4, right? No other Pi and no other platform has this issue?
-
@Brunnis Last time I checked, ES runs at 60fps on my pi3b+ using the default low-res scraped box art. I switched to the pegasus-frontend with higher res box art, and it really lags on my pi3b+ (because of the box art) but on my pi4 it's butter smooth.
Also, Is there a real reason to go bleeding edge? I thought that in time, the pi4 would have drivers to handle the crt-pi shader at 4k, or at least the pc crt shaders at 1080p. I expected too much, I suppose.
-
@Brunnis the "30 FPS issue" in EmulationStation on a Pi4 is something that requires a more in-depth investigation.
The only way I can overcome this issue is by setting
v3d_freq_min=500
in /boot/config.txt
, however, this is not a solution that works for everyone.What I found out is that once
v3d_freq
is downclocked (~200-250MHz) when at idle the FPS will drop to 30 FPS in EmulationStation. Oncev3d
is taken off of idle (i.e. video playback, 3D game, etc) EmulationStation's FPS will jump up back to 60 FPS.I've spent more time than I care to admit trying see what is the cause but have come up empty.
The one thing I have not tried is Batocera's implementation of EmulationStation. I'd be curious to know if it also has the same FPS issue. The reasoning behind my curiousity is that Batocera's OpenGLES implementation of EmulationStation was completely re-done.
If Batocera's EmulationStation doesn't have the same issue than that would narrow down what is causing the FPS problem.
-
@bluestang I'd test out batocera but I get a black screen. Might be the usb boot, I don't know (I'm not opening up my snes case to use the microsd).
-
@bluestang Interesting. It would make sense and could also explain the intermittent/unpredictable behavior. For example, at one point (when I started this thread) I could no longer reproduce the issue. Then it came back, perhaps after firmware changes to the clock frequency scaling were made. I know this part of the firmware has received several changes over the course of the 16 months since the Pi 4 was released.
I wonder why the Pi 4 can't determine that it needs to clock the V3D up in these situations... Have you had any discussions with the Raspberry Pi folks (i.e. 6by9) regarding this issue?
@Darksavior Real reason to go bleeding edge? Only for testing out what might become the future of RetroPie and report issues found to the involved parties. I wouldn't attempt it on a system I intend to actually use for gaming.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.