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

    [Wiki] Adding tvservice to Video Issues

    Scheduled Pinned Locked Moved General Discussion and Gaming
    wikivideo issuestvservicefbsetresolution
    8 Posts 4 Posters 1.6k 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.
    • ClydeC
      Clyde
      last edited by Clyde

      Hi folks,

      I would like to add some common uses of tvservice to the Video Issues page. This thread is for their discussion and (hopefully) approval.

      ------------------------ snip ------------------------

      Show and set the current video mode

      Note: This guide is only for operating systems that use tvservice to change the video mode, e.g. Raspbian, Xbian, and OSMC.

      tvservice -swill show the current video mode. Example:

      tvservice -s
      state 0x12000a [HDMI DMT (51) RGB full 4:3], 1600x1200 @ 60.00Hz, progressive
      

      The option -m will show the CEA (HDMI) and DMT (DVI) modes that are supported by the display device:

      tvservice -m CEA
      tvservice -m DMT
      

      The preferred mode that is listed as (prefer) can be set by the -p option:

      tvservice -p
      

      Any other mode has to be specified by its Group (CEA or DMT) and the mode number that was listed by the -m option. Example for the mode 1600x1200 @ 60.00Hz in the example above:

      tvservice -e "DMT 51"
      Powering on HDMI with explicit settings (DMT mode 51)
      

      Reset the frame buffer after changing the video mode

      After changing the video mode via tvservice, it may neccessary to reset the frame buffer. This can be achieved by changing its colour depth to 8 and then back to 16:

      fbset -depth 8 && fbset -depth 16
      

      Switch the display off and on again

      The -o (off) option of tvservice disables the video output. It can be switched on again by either the -p (preferred) option or the -e (explicit) option, see above. Example:

      tvservice -o
      Powering off HDMI
      tvservice -p
      Powering on HDMI with preferred settings
      

      ------------------------ snip ------------------------

      So much for now.

      Many guides on the web also use the fbset command twice with different depth values afterwards, but I don't know anything about it. (When) Is that neccessary, and why twice?

      A stylistic question: Should I put a prompt indicator $ before the commands (only) in the examples to separate them visually from their output?

      Any feedback and suggestions are welcome. :)

      Cheers
      Clyde

      edit: Aaand found the first typo myself ("exampla"). :)

      BuZzB mituM 2 Replies Last reply Reply Quote 2
      • BuZzB
        BuZz administrators @Clyde
        last edited by

        @Clyde regarding fbset, switching to 8 then 16/32 bit has the side effect of resetting the framebuffer. Can be needed after switching videomode for example.

        To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

        ClydeC 1 Reply Last reply Reply Quote 0
        • ClydeC
          Clyde @BuZz
          last edited by

          @BuZz Aahh, that makes sense! It seemed so very strange to repeat the same command just with a different value, and no guide that I found on the web explained it. Thanks! :)

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

            @Clyde IMHO you should leave out the $ prompt, it usually hampers copying and pasting - users will copy the command with the prompt and they'll get an error.
            As a suggestion, specify that tvservice is Raspbian only - it's not present for other SBCs or on PC (where xrandr can be used to change the resolution).

            H 1 Reply Last reply Reply Quote 0
            • H
              hhromic @mitu
              last edited by

              Beware that other OSes for the RPI also come with tvservice. As far as I know two of these are Xbian and OSMC.

              ClydeC 1 Reply Last reply Reply Quote 0
              • ClydeC
                Clyde @hhromic
                last edited by Clyde

                @mitu Thanks for the suggestion, I will add a note about it. edit: And I will omit the $.

                @hhromic Also thanks for the information, I will use a more general wording.

                Update: I added a section about fbset and a remark about tvservice being only available on certain OS.

                A question about fbset: Is my wording okay that resetting the fb "may be neccessary", or is it neccessary every time?

                ClydeC 1 Reply Last reply Reply Quote 0
                • ClydeC
                  Clyde @Clyde
                  last edited by

                  Hi again. I was occupied with a heavy cold, but I'm better know and I want to finish this little project.

                  If nobody has further contributions until this time tomorrow, I'll put it up in the Wiki.

                  Thanks for any of your assistance. 😊

                  1 Reply Last reply Reply Quote 2
                  • ClydeC
                    Clyde
                    last edited by

                    Done!

                    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.