RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Update retroarch.sh to enable KMS/DRM on x11 platform?

    Scheduled Pinned Locked Moved Ideas and Development
    buildretroarchretropie x86update
    5 Posts 2 Posters 1.5k 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.
    • ethelingE
      etheling
      last edited by etheling

      In projects and themes forum we've had an active discussion thread about 'wrapper' script to install RetroPie on Ubuntu (20.04) LTS on x86 platform in a manner that produces experience similar to RetroPie pre-made images do on rpi. One of the recent additions to the install script has been ability to run Emulationstation and RetroArch cores (and other emulators) in Linux KMS/DRM mode (e.g. without X). However in order to achieve that, install script needs to patch retroarch.sh under RetroPie-Setup to enable running it in KMS/DRM mode. This means adding --enable-kms and --enable-egl configure flags and libdrm-dev and libgbm-dev dependencies for x11 platform. Please see patch file below.

      I am hoping/asking if RetroPie could update RetroPie-Setup/scriptmodules/emulators/retroarch.sh to have these changes enabled by default for x11? It appears that RetroArch works with these changes just as well as before when executed under X, but now can also be used without. That said, my testing has been superficial at best.

      Having these changes implemented would remove a need to patch RetroPie-Setup scripts during install - something I feel would be nice to avoid.

      What are your thoughts? @mitu (tagged you as I saw you as one of contributors to retroarch .sh).

      RetroPie-Setup/scriptmodules/emulators/retroarch.sh.patch

      23c23
      <     isPlatform "x11" && depends+=(libx11-xcb-dev libpulse-dev libvulkan-dev)
      ---
      >     isPlatform "x11" && depends+=(libx11-xcb-dev libpulse-dev libvulkan-dev libdrm-dev libgbm-dev)
      66c66
      <     isPlatform "x11" && params+=(--enable-vulkan)
      ---
      >     isPlatform "x11" && params+=(--enable-vulkan --enable-kms --enable-egl)
      
      
      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        I don't think this is the correct solution, since x11 means this is running under Xorg. If you wish to use kms as a platform flag, use these settings.

        ethelingE 2 Replies Last reply Reply Quote 0
        • ethelingE
          etheling @mitu
          last edited by etheling

          @mitu Thanks for the pointer! I wish I had asked / noticed that earlier! :) I'll give it a test soon! Thanks again!

          1 Reply Last reply Reply Quote 0
          • ethelingE
            etheling @mitu
            last edited by

            @mitu Thanks. Setting __has_kms=1 in the install script works nicely. The problem I have is that when I enable it, then __platform_flags does not appear to end up containing x11, and if platform flags don't contain x11, e.g. retroarch won't include vulkan (or pulse audio) support.

            So what I'd like to have is both kms and x11 in platform flags to get dependencies and features for both compiled in.

            Other than patching files under RetroPie-Setup, is there some way to achieve this that I didn't realize?

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

              @etheling said in Update retroarch.sh to enable KMS/DRM on x11 platform?:

              Other than patching files under RetroPie-Setup, is there some way to achieve this that I didn't realize?

              No, you need to patch the scriptmodule to have both vulkan and KMS support.

              1 Reply Last reply Reply Quote 1
              • 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.