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

    Video modes, from command-line?

    Scheduled Pinned Locked Moved Help and Support
    question
    6 Posts 2 Posters 654 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.
    • S
      sleve_mcdichael
      last edited by

      When I use runcommand launch menu to set a video mode (640x480, etc.), what's actually happening? How can I replicate this on command-line?

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

        Not sure how you want to start from the command line (using runcommand or not). The video mode selection is kept in a configuration file, so launching from the command line with runcommand it should be all it takes.

        S 1 Reply Last reply Reply Quote 0
        • S
          sleve_mcdichael @mitu
          last edited by

          @mitu said in Video modes, from command-line?:

          Not sure how you want to start from the command line (using runcommand or not).

          Yeah I mean bypassing runcommand, me launching the port commands myself and doing whatever it was that runcommand would be doing if I was using runcommand, but without actually using it. Is it switching modes with tvservice, or what is going on under the hood, there?

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

            @sleve_mcdichael said in Video modes, from command-line?:

            . Is it switching modes with tvservice, or what is going on under the hood, there?

            tvservice works for Pi3 and older models (for now). Basically the resolution change has 3 methods:

            • using tvservice, where supported (i.e. Pi3 and older, using the Broadcom GPU drivers)
            • using xrandr, for x11 platforms (PC).
            • using the Linux kernel modesetting support (Pi4 and other KMS platforms), as implemented in SDL2 or RetroArch:
              • if the app is using SDL2, then there are 2 env vars that are set during startup here that instruct SDL2 video driver to switch to that resolution. This is a RetroPie specific extension/patch for SDL2 (see for instance here).
              • if the emulator is a Libretro core, just set the desired resolution in the /dev/shm/retroarch.cfg runtime configuration file (see here).

            If your port is SDL2 based, then you can run it with SDL's env vars for mode switching:

            SDL_VIDEO_KMSDRM_MODELINE=WxH[@hz] <command>
            

            For instance:

            SDL_VIDEO_KMSDRM_MODELINE=800x600 pppsspp game1.iso
            SDL_VIDEO_KMSDRM_MODELINE=1024x768@75 pppsspp game2.iso
            
            S 1 Reply Last reply Reply Quote 0
            • S
              sleve_mcdichael @mitu
              last edited by

              Thank you. Much of that is over my head but it gives me a place to start.

              @mitu said in Video modes, from command-line?:

              For instance:

              SDL_VIDEO_KMSDRM_MODELINE=800x600 pppsspp game1.iso
              SDL_VIDEO_KMSDRM_MODELINE=1024x768@75 pppsspp game2.iso
              

              Are these arbitrary values, or there's only certain ones that will work? Is it based on what modes my TV can display?

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

                Are these arbitrary values, or there's only certain ones that will work? Is it based on what modes my TV can display?

                Only values supported by your display will have an effect.

                runcommand will query the available modes and set the values depending on what you choose in the menu.

                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.