• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
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

Raspberry Pi 4 - Forced VSYNC?!

Scheduled Pinned Locked Moved Help and Support
raspberrypi4sdl2vsync
14 Posts 2 Posters 2.9k 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
    FranceMSR @mitu
    last edited by 31 Mar 2021, 06:56

    Hi @mitu, thanks for reply.

    I don't understand the point because if there is a bug on SDL 2.0.10 the same behaviour should happens with Raspberry Pi v3. So there is a difference between Raspberry Pi v3 and Raspberry Pi v4 that creates the problem. Video driver? Hardware?

    Anyway I tried with RetroPie 4.7.1 stock (5.4 kernel) and after a full upgrade (so new kernel). After that I changed this option in config.txt

    dtoverlay=vc4-fkms-v3d
    

    so, as I understand, Fake KMS in this

    dtoverlay=vc4-kms-v3d
    

    so Full KMS. The problem persists. I will try to use newer SDL version in order to continue my investigation.

    Maybe there is a wrong interaction between KMS and SDL2 that only appears on Raspberry Pi v4

    M 1 Reply Last reply 31 Mar 2021, 08:51 Reply Quote 0
    • M
      mitu Global Moderator @FranceMSR
      last edited by 31 Mar 2021, 08:51

      @francemsr said in Raspberry Pi 4 - Forced VSYNC?!:

      I don't understand the point because if there is a bug on SDL 2.0.10 the same behaviour should happens with Raspberry Pi v3. So there is a difference between Raspberry Pi v3 and Raspberry Pi v4 that creates the problem. Video driver? Hardware?

      The Pi3 (and previous models) has a different video driver in SDL2 - as I said the issue is with the KMS video driver (which is used on the Pi4).

      F 1 Reply Last reply 31 Mar 2021, 09:04 Reply Quote 0
      • F
        FranceMSR @mitu
        last edited by 31 Mar 2021, 09:04

        @mitu sorry but you wrote "I remember being a SDL2 issue with its KMS video driver." as kind of sort of SDL-ONLY-RELATED internal driver, not Raspberry Pi one :-)

        As I said before, I'll try SDL 2.0.14 and I'll report the result

        M 1 Reply Last reply 31 Mar 2021, 09:10 Reply Quote 0
        • M
          mitu Global Moderator @FranceMSR
          last edited by 31 Mar 2021, 09:10

          @francemsr Yes, it's the SDL2 driver, not the Linux kernel or Mesa drivers.

          F 1 Reply Last reply 31 Mar 2021, 09:18 Reply Quote 0
          • F
            FranceMSR @mitu
            last edited by 31 Mar 2021, 09:18

            @mitu good, thanks.

            Just for testing purpose: is there a way to use glxgears closing EmulationStation?

            M 1 Reply Last reply 31 Mar 2021, 09:23 Reply Quote 0
            • M
              mitu Global Moderator @FranceMSR
              last edited by 31 Mar 2021, 09:23

              @francemsr You can install the desktop part as a Port and start it from EmulationStation - https://retropie.org.uk/docs/FAQ/#where-did-the-desktop-go

              F 1 Reply Last reply 31 Mar 2021, 09:25 Reply Quote 0
              • F
                FranceMSR @mitu
                last edited by 31 Mar 2021, 09:25

                @mitu ok, I thought there was a different way instead of pass from Desktop Environment.

                Thanks for now

                M 1 Reply Last reply 31 Mar 2021, 09:28 Reply Quote 0
                • M
                  mitu Global Moderator @FranceMSR
                  last edited by mitu 31 Mar 2021, 09:28

                  @francemsr You can instruct the RetroPie launcher (runcommand) to start an emulator/program via xorg by adding XINIT to its command in emulators.cfg - for instance this is how steamlink is started (see here).

                  F 1 Reply Last reply 31 Mar 2021, 09:37 Reply Quote 0
                  • F
                    FranceMSR @mitu
                    last edited by 31 Mar 2021, 09:37

                    @mitu oh good thing!

                    F 1 Reply Last reply 31 Mar 2021, 10:16 Reply Quote 0
                    • F
                      FranceMSR @FranceMSR
                      last edited by 31 Mar 2021, 10:16

                      Built SDL2 with --enable-video-kmsdrm parameter, this is the result of pre-build configuration

                      SDL2 Configure Summary:
                      Building Shared Libraries
                      Building Static Libraries
                      Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly
                      Assembly Math   :
                      Audio drivers   : disk dummy oss alsa(dynamic) sndio(dynamic)
                      Video drivers   : dummy rpi x11(dynamic) kmsdrm(dynamic) opengl opengl_es1 opengl_es2 vulkan
                      X11 libraries   : xcursor xdbe xinerama xinput2 xinput2_multitouch xrandr xscrnsaver xshape xvidmode
                      Input drivers   : linuxev linuxkd
                      Enable virtual joystick APIs : YES
                      Using libsamplerate : YES
                      Using libudev       : YES
                      Using dbus          : YES
                      Using ime           : YES
                      Using ibus          : YES
                      Using fcitx         : YES
                      

                      When Raspberry Pi starts EmulationStation crashes on Creating window... log. Maybe I break something, any idea? This happens both with dtoverlay=vc4-fkms-v3d and dtoverlay=vc4-kms-v3d

                      P.S.: Building without --enable-video-kmsdrm option bring me to console with error related on creation of OpenGL window

                      M 1 Reply Last reply 31 Mar 2021, 10:25 Reply Quote 0
                      • M
                        mitu Global Moderator @FranceMSR
                        last edited by 31 Mar 2021, 10:25

                        Try to disable the rpi video driver when configuring SDL2.

                        F 1 Reply Last reply 31 Mar 2021, 13:10 Reply Quote 0
                        • F
                          FranceMSR @mitu
                          last edited by FranceMSR 31 Mar 2021, 13:10

                          @mitu Built SDL 2.0.14 with

                          --disable-video-rpi --enable-video-kmsdrm
                          

                          The FPS problem still exists with 5.4 kernel, or newer one after full SO upgrade (in this case with fkms or kms), and in this way when emulator is closed EmulationStation is frozen.

                          Anyway I found a solution, if VERTICAL SYNC is enabled also on emulator (I added a command line parameter for this) also Raspberry Pi v4 version is ok.

                          If you don't have any other idea I'll stop the investigation, I don't love VSYNC because if a user has a 50 Hz monitor all games with nominal 60 FPS framerate runs at 50 FPS.

                          Really appreciate your help

                          1 Reply Last reply Reply Quote 0
                          14 out of 14
                          • First post
                            14/14
                            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.

                            This community forum collects and processes your personal information.
                            consent.not_received