RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Screen tearing issue....

    Scheduled Pinned Locked Moved Help and Support
    screen tearing
    23 Posts 2 Posters 5.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      FormulaFox
      last edited by FormulaFox

      Build info:

      Raspberry Pi 3 B+
      Retropie 4.5.1 (prebuild from Retropie website)
      2.4A USB power bank
      Waveshare 4-inch HDMI display

      Hello, all. Some may recall from my previous posts that I've been building my own version of ETA Prime's GhettoPi Boy. While still not finished, I've got it mostly ready and have been going through emulator setup, but I've hit a snag. Everything's running smoothly except I'm getting a fair bit screen tearing. It could be a bad screen(sadly it's too late to replace for free), but since the severity of the screen tearing differs depending on the system I'm using I've still got some hope that the right settings can address it.

      I've seen some threads at various places advising turning Vsync on or off, using Sync to Exact Content Framerate, and enabling Bilinear Filtering. None of these have had any discernible effect on the screen tearing.

      I sadly simply don't have the knowledge to really know what might fix things, and Retorach has a LOT of settings to try and adjust.

      This is the exact display I'm using: https://www.waveshare.com/product/mini-pc/raspberry-pi/displays/hdmi-touch-display/4inch-hdmi-lcd-h.htm

      Thank you in advance for any assistance.

      EDIT: Shoulda put this in here before, but this is WaveShare's recommend setup and config info for the screen, in case it could help any diagnosis - https://www.waveshare.com/wiki/4inch_HDMI_LCD_(H)

      1 Reply Last reply Reply Quote 0
      • F
        FormulaFox
        last edited by FormulaFox

        Okay, I haven't sat idly by while waiting for a response, I have continued to try and find solutions. Realized I'd had skipped a troubleshooting step along the way: Plugging unit into a proper HDMI TV or monitor to see if it tears. It did not. However, in the process of getting it to cooperate with the TV I had to change the display options on the config file, and noticed a redundant entry: I had added display_rotate=1 to get the orientation where I wanted it for my setup, which was in addition to Waveshare's entry of the same entry. I removed the redundant entry and changed the initial one to the correct setting.

        This has actually stopped the TEARING, but now it is a different issue; A diagonal wave across the screen from side to side. Like it's not refreshing correctly. But moreover, the issue no longer occurs on all systems. Running PS1 or arcade games produces no such issue. But running Genesis/Megadrive, SMS, SNES, GBA, and NES produces this issue. It's clearly not the display(or at least not the display ALONE), but I still don't know if there are any settings that can help alleviate this issue.

        I am, unsurprisingly, completely out of ideas at this point...

        For some reason, now, the system is also refusing to set itself to auto login. Doesn't matter how many times I set it to auto login, it will not do it.

        mituM 1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator @FormulaFox
          last edited by

          @FormulaFox said in Screen tearing issue....:

          This has actually stopped the TEARING, but now it is a different issue; A diagonal wave across the screen from side to side. Like it's not refreshing correctly. But moreover, the issue no longer occurs on all systems. Running PS1 or arcade games produces no such issue. But running Genesis/Megadrive, SMS, SNES, GBA, and NES produces this issue. It's clearly not the display(or at least not the display ALONE), but I still don't know if there are any settings that can help alleviate this issue.

          Looks like a Vsync issue - make sure that RetroArch has video_vsync = true set in its configuration file (/opt/retropie/configs/all/retroarch.cfg).

          For some reason, now, the system is also refusing to set itself to auto login. Doesn't matter how many times I set it to auto login, it will not do it.

          How are you setting it to auto-login ?

          F 1 Reply Last reply Reply Quote 0
          • F
            FormulaFox @mitu
            last edited by FormulaFox

            @mitu

            Sorry for going so long without responding - had a busy day.

            Yes, that setting is in the cfg file as listed.

            I had an issue trying to access it in the terminal while checking - kept giving me a no file/folder error. Had to use some software that lets me view the partition in Windows to check the file(and I can't edit it through the program if we need to change anything).

            As for the autologin, I took care of it. It was my own noob goof - I forgot to close emulationstation before entering raspi-config, I just loaded up the terminal. Realized that error when I shut down ES to try and load retroarch.cfg.

            EDIT: Nevermind on the autologin. It just decided to be nice for one bootup, I guess. I've used raspi-config, both via ES, the terminal, and the terminal after quitting ES, to try and set it to both console and desktop autologin. Neither work.

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @FormulaFox
              last edited by

              Sorry for going so long without responding - had a busy day.

              No need for that, we all have our own schedules.

              Yes, that setting is in the cfg file as listed.
              I had an issue trying to access it in the terminal while checking - kept giving me a no file/folder error. Had to use some software that lets me view the partition in Windows to check the file(and I can't edit it through the program if we need to change anything).

              I'd advise against opening the Linux partition from a Windows - you can either edit it on the Pi, from the terminal, or from a PC on the same network, via file shares. The config folder is shared at \\retropie\configs.

              I wonder what's the refresh rate supported by the screen. Can you run - from the terminal:

              tvservice -s
              

              and post the output ?
              Are you using the RetroArch core (lr-pcsx-rearmed) for PS1 games or the standalone emulator (pcsx_rearmed).

              [...]
              EDIT: Nevermind on the autologin. It just decided to be nice for one bootup, I guess. I've used raspi-config, both via ES, the terminal, and the terminal after quitting ES, to try and set it to both console and desktop autologin. Neither work.

              It doesn't matter how you start raspi-config, the result should be the same. Can you try the alternate method - described here and set the Start Emulationstation at boot option ?

              1 Reply Last reply Reply Quote 0
              • F
                FormulaFox
                last edited by

                Refresh rate is listed at 60Hz, which is what is listed as being sit in Retroarch.

                Using the retroarch core for PS1 games.

                Like I said before, trying to load the retroarch.cfg file in the terminal(or in ssh) keeps bringing up a no file or folder error. Not sure why since with viewing through a program in Windows I can find the correct file on the exact path stated. I am getting a sinking feeling that figuring out what's the issue here and overcoming it is going to be bigger headache than finding the issue with the display itself, since everything I've seen says it should be working - the specific command IS "sudo nano /opt/retropie/configs/all/retroarch.cfg" isn't it? Or have I completely misunderstood the process? (to date, I have only had to edit the config file on the boot partition, which of course I can do in Notepad on Windows)

                The alternate method for setting the autologin has also failed - sort of. It is now requiring me to login only if I need to use the terminal, not before it even loads EmulationStation.

                1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator
                  last edited by mitu

                  The RetroArch main config file is in /opt/retropie/configs/all/retroarch.cfg indeed, if that file is not there, then I suggest re-installing the retroarch package from the RetroPie-Setup menu.

                  The alternate method for setting the autologin has also failed - sort of. It is now requiring me to login only if I need to use the terminal, not before it even loads EmulationStation.

                  I don't quite understand how is sort of working: auto-login will automatically log in to the terminal, after which the autostart.sh script is started, which in turn starts Emulationstation. I presume that the auto-login is not working, so you have to log in, after which Emulationstation starts automatically (through the autostart.sh script). Is that correct ?

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    FormulaFox @mitu
                    last edited by

                    @mitu said in Screen tearing issue....:

                    The RetroArch main config file is in /opt/retropie/configs/all/retroarch.cfg indeed, if that file is not there, then I suggest re-installing the retroarch package from the RetroPie-Setup menu.

                    It's there - I know that from looking via the program in Windows. But when I try to access it via the terminal, it just gives me that error.

                    The alternate method for setting the autologin has also failed - sort of. It is now requiring me to login only if I need to use the terminal, not before it even loads EmulationStation.

                    I don't quite understand how is sort of working: auto-login will automatically log in to the terminal, after which the autostart.sh script is started, which in turn starts Emulationstation. I presume that the auto-login is not working, so you have to log in, after which Emulationstation starts automatically (through the autostart.sh script). Is that correct ?

                    No, as I just said, it loads EmulationStation, but if I have to do anything in the terminal it requires me to log in before I can. Before trying the alternate method, I had to log in before it would even load ES.

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @FormulaFox
                      last edited by

                      @FormulaFox said in Screen tearing issue....:

                      No, as I just said, it loads EmulationStation, but if I have to do anything in the terminal it requires me to log in before I can. Before trying the alternate method, I had to log in before it would even load ES.

                      Then it's a different issue - can't say I've heard about it before. It's like you're logged off after exiting Emulationstation.

                      1 Reply Last reply Reply Quote 0
                      • F
                        FormulaFox
                        last edited by

                        Okay, I've FINALLY gotten retroarch.cfg to load in the terminal. I still do not know why it was giving me the error before(I compared the entries so many times in the previous errors and could not find any typo), and just as with when looking in the Windows program, vsync=true is present.

                        1 Reply Last reply Reply Quote 0
                        • F
                          FormulaFox
                          last edited by

                          While waiting for further input I tried changing the vsync entry in the retroarch.cfg from true to false, and also tried switching adaptive_vsync from false to true. Neither made a difference. (I have switched both back to their previous values)

                          But at least now I'm getting the file to consistently load in the terminal even if I can't figure out where I was typoing the previous attempts. Next step? (if any)

                          1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator
                            last edited by

                            Looking at the Waveshare configuration instructions, I see it rotates the display using the firmware options in config.txt - which is known to cause a performance drop. Can you try to disable the rotation and set the rotation to be done in RetroArch ? I think the options for rotating 270 CCW are

                            video_allow_rotate = "true"
                            video_rotation = "3"
                            

                            This way you'd see if at the tearing is because of the rotation of the screen. Emulationstation has a similar option (--screenrotate) which you can use.

                            1 Reply Last reply Reply Quote 0
                            • F
                              FormulaFox
                              last edited by

                              Removing Displayrotate causes the display in retroarch to go vertical, and will not allow the game to fill the screen when I rotate it into proper orientation. It squeezes the side into the same space as if it were still in vertical orientation. In this "squished" condition, I cannot evaluate any issues it may still be having. Tweaking zoom and resolution settings don't seem to be changing anything.

                              1 Reply Last reply Reply Quote 0
                              • mituM
                                mitu Global Moderator
                                last edited by

                                Try teaching RetroArch about your non-standard resolution, add this to your config, in addition to the rotation options:

                                aspect_ratio_index = 22
                                custom_viewport_width = 800
                                custom_viewport_height = 480
                                custom_viewport_x = 0
                                custom_viewport_y = 0
                                
                                1 Reply Last reply Reply Quote 0
                                • F
                                  FormulaFox
                                  last edited by FormulaFox

                                  No change. Same squished image.

                                  (off to work now - don't be waiting at they keyboard for next reply)

                                  1 Reply Last reply Reply Quote 0
                                  • mituM
                                    mitu Global Moderator
                                    last edited by

                                    Hm, I don't have any more ideas besides modifying the viewport WxH to match the natural size. I think the aspect_radio_index correct version is 23 instead of 22 (23 = custom), so you might want to try to correct that also.
                                    What I noticed though is that the RGUI (RA's menu) doesn't obey the rotation configuration, so entering the RGUI would show it rotated.

                                    1 Reply Last reply Reply Quote 0
                                    • F
                                      FormulaFox
                                      last edited by FormulaFox

                                      Whelp.... I figured it out. Apparently Retroarch does not understand this screen well enough to manage things when the aspect ratio is set to anything other than the specific one a game demands. (in the case of old 4:3 games, it requires it be set to 3:4 because it understands the screen as being vertical)

                                      I can confirm that, which the aspect ratios set, the issues I was having are cleared up. There is still some odd artifacting on some things here and there, but they're such small details that I only noticed them because I was specifically looking for anything off.

                                      Fortunately, all my games are 4:3(save for a couple of low-stress PSP games that this thing is JUUUUUST able to handle with barely any visible trouble if Frameskip is on), so I'll be able to set Retroarch to 3:4 globally to fix it.

                                      Now... How do I get the ES menu to display the same way? :P

                                      (I hope I don't have this much trouble when I upgrade this device to a Pi 4 once a Retropie build for it comes out)

                                      1 Reply Last reply Reply Quote 0
                                      • mituM
                                        mitu Global Moderator
                                        last edited by

                                        EmulationStation has a few command line parameters that need to be set in order to get the screen rotation working

                                        • --screenrotate (1 to 3 - see https://github.com/RetroPie/EmulationStation/pull/348).
                                        • --screensize H W to set the resolution.
                                        F 1 Reply Last reply Reply Quote 0
                                        • F
                                          FormulaFox @mitu
                                          last edited by

                                          @mitu Where do I go to change those settings? I can't find them in any of the settings in the UI and I'm not sure where the config file to edit in terminal/ssh is located, and the link you provided doesn't specify(or at least if it does, I keep missing it).

                                          mituM 1 Reply Last reply Reply Quote 0
                                          • mituM
                                            mitu Global Moderator @FormulaFox
                                            last edited by

                                            @FormulaFox You need to add the to the command that starts emulationtation on boot. That's done in the /opt/retropie/configs/all/autostart.sh, but you also just exit Emulationstation and experiment from the command line (SSH works also) by running emulationstation <parameter> until you find the right combination to add in the autostart file.

                                            F 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.