Screen tearing in pi 4
-
Raspberry Pi 4
Retropie v 4.7.1
Mame lr-2003
Primary display: Asus VA27EHE
Secondary display (using PiMarquee2): VSDisplay 14.9Hi all - most of my games work great so far, but I tried 2 horizontal scrollers (wonder boy and super Mario ) and both had what looked like severe screen tearing.
I’ve seen a lot of posts on this, but they are all before Retropie 4.7 came out which removed the beta label, so I don’t know if things have changed or not since.
Any ideas on if those threads are still relevant for how to address this? Or did things change in 4.7?
I have no idea if the second display maybe also impacts things. I can try unplugging it and see.
Thanks in advance.
-
Based on an older thread I tried changing my mame video mode, but it didn’t help.
The preferred mode in the mame menu says:
87-0 1920x1080 @ 60hz n/a (148.5Mhz, phsync, pvsync, preferred, d (.... then it is cut off)
I tried using
87-14 1280x720 @ 60 hz n/a (74.25 MHz, phsync, pvsync, driver)
But still saw tearing (or what I think is tearing, the screen stutters/glitches).
Any tips?
-
Still working on this one....
based on this thread I was wondering if I was somehow using vc4-fkms-v3d, which according to the thread, may be my problems.
Sure enough, I opened my boot.cfg, and it looks like this:
[pi4] # Enable DRM VC4 V3D driver on top of the dispmanx display stack dtoverlay=vc4-fkms-v3d max_framebuffers=2 [all] #dtoverlay=vc4-fkms-v3d overscan_scale=1
I switched the dtoverlay to use vc4-kms-v3d, and I didn't see the normal glitching/tearing that I see (though I only tested 5 minutes). However, two things broke: the second display, and the audio. (I really have no idea what I'm doing here, I just changed the parameter to see what would happen).
I think the only 2 things I've installed are Pi Marquee 2, and the Bevel Project. I don't remember editing that boot config file myself, but it's entirely possible I did when following some instructions somewhere...
If anyone has more advice, I'd love to hear it! Seems like I might be getting close to a solution somewhere...
-
I have the same issue on my new Pi 400 and haven't found anything that works consistently. I certainly couldn't get the fkms change to work at all. The machine just wouldn't boot. I can set the G-sync thing on which works well for 3D games but breaks 2D ones by introducing the tearing again.
But I notice that it isn't just games that tear. Using Kodi I have to set the GUI to 30fps or the screen pretty much tears apart trying to navigate it. Is this a related issue that isn't unique to the Retroarch part of Retropie? Is this a GPU driver issue at the end of the day?
-
@ranma are you using Pi Marquee 2 as well? I’m starting to think this might be where my issue is. After reading a bit more about fake mode and max_framebuffers, it seems like fake mode combines them into one frame buffer. I’m wondering if that’s how Pi Marquee 2 works but I have no idea yet.
-
pure kms will cause problems for anything that relies on the old firmware layer (for example omx videos, iirc). this marquee thing may well rely on that stuff also, so if you want to stop tearing you're probably out of luck unless you stop using it.
-
@dankcushions thanks for the info. Out of curiosity, is there anything official in retropie to support a second display on the pi 4 that I could look at using instead? Pi Marquee 2 was the only way I could find to drive the second display.
-
@jigidyjim not that i'm aware of. i don't know how the 2 displays are driven within kms, but it's presumably possible. one for the pi marquee people to look into, i suppose.
-
@jigidyjim I managed to get this up and running using KMS. The tearing is no longer an issue for me and overall video performance seems better.
I followed this thread and instructions from bluestang: https://retropie.org.uk/forum/topic/27299/low-framerate-on-main-emulationstation-menu-pi-4/115?lang=nl
Initially using option 1 I lost audio in emulationstation and games. I needed to run the audio config of retropie and ensure that in the sound settings of emulationstation the audio card is on default and the audio device is on master.
Took me quite some time to get everything working again but no more tearing. I also included the v3d_freq_min=500 option to ensure emulationstation runs at a stable 60 fps.
The only thing that doesn't run anymore is my startup video and I get error messages about a failed component to create 'vc.ril.hvs'which does not seem to have any impact and is directly related to using KMS (I think). UPDATE: setting the OMX Player to use hardware accelation fixed it, but downside it that it does not display preview video's anymore.. weird.
Hope this helps anyone attempting this.
-
The KMS video driver will never work with OMXplayer since it was designed to work with FKMS only.
Once you switch over you can only use VLC. I would disable all OMX options in ES if you are using KMS.
-
@senseless awesome thanks!!!
Just to clarify since I don’t see it mentioned in that thread - are you also using a marquee display? My rough understanding is that if I do all that my marquee will break?
-
I went over to the raspberry pi forums and it sounds like the official move to kernel 5.10 is almost here, so I might just wait for that instead!
-
Thanks, I didn't know that. Just dived into the whole retropie world and learning on the job :). Having a blast and dusting off my unix knowledge in the process haha. Good to hear the 5.10 release is coming and waiting for this is probably the best option for now ;).
-
@jigidyjim said in Screen tearing in pi 4:
marquee display?
I'm not sure I fully understand your question or that we are talking about the same thing but I use bezels for all my systems and they still work/display during a game.
-
Would you be willing to create and share an IMG of your RetroPie install with KMS? I have followed the instructions from @bluestang as well as instructions elsewhere on the forums and have not been able to get KMS to boot on Pi 4.
If I had a working IMG, I could at least confirm it may be just a conflict between my VGA666 and KMS and not an error on my side.
Thank you, would be quite helpful to myself and others trying to get KMS working.
-
@phos said in Screen tearing in pi 4:
Would you be willing to create and share an IMG of your RetroPie install with KMS? I have followed the instructions from @bluestang as well as instructions elsewhere on the forums and have not been able to get KMS to boot on Pi 4.
If I had a working IMG, I could at least confirm it may be just a conflict between my VGA666 and KMS and not an error on my side.
Thank you, would be quite helpful to myself and others trying to get KMS working.
Are you able to test KMS with a regular monitor or TV?
If the problem exists with the VGA666 than you may need to seek help on the Raspberry Pi forums.
-
I don't have the proper HDMI cable to test, although I could get one.
I made a post detailing my issue. Trying to boot ES after the Pi boot up freezes via SSH only returns an SDL error.
I did also try installing Raspberry Pi OS instead of RetroPie and I also get a freeze on boot up in RPiOS with KMS on. So, it could very well be an issue related to VGA666.
-
@phos said in Screen tearing in pi 4:
I don't have the proper HDMI cable to test, although I could get one.
I made a post detailing my issue. Trying to boot ES after the Pi boot up freezes via SSH only returns an SDL error.
I did also try installing Raspberry Pi OS instead of RetroPie and I also get a freeze on boot up in RPiOS with KMS on. So, it could very well be an issue related to VGA666.
Looks like VGA666 is not supported under KMS yet.
Keep an eye on this PR and when it’s merged give it go:
-
I finally updated to kernel 5.10 now that it has been released officially.
However, I'm still trying to figure out how I can switch to the kms driver, so that I can get rid of my screen tearing.
My problem is that I am using Pi Marquee 2 to power my second display. If I switch to the kms driver, that stops working.
I looked through the source code of Pi Marquee 2, and it looks like it using "omxiv" to display pngs to the second display. And from what I've been reading, omxiv is based on omxplayer, and omxplayer will never be supported on the kms driver. At least, that is my very shallow understanding of the current state of the world.
But really I don't need the video support in all this as I'm not using it at all. All I'm using this for is displaying a simple png to the second display (though the image fades as it switches images are a nice touch!). I'm wondering if anyone knows of a way to do that other than omxiv? if such a program exists that can do that, maybe I'll try editing the python script myself and pointing it at some other program. No idea if it's that simple, but thought I'd ask!
-
@jigidyjim said in Screen tearing in pi 4:
I'm wondering if anyone knows of a way to do that other than omxiv?
Try using
fbi
, it's an image viewer that works on the console also.
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.