How can I change the HDMI resolution of my running Raspbian (Jessie) system without rebooting my Raspberry Pi 3?

migrated from stackoverflow.com Mar 28 '17 at 21:16

This question came from our site for professional and enthusiast programmers.


You can sort of. But it is not working really well. At least in the command line you can turn off the HDMI port and get it back on with a different resolution. So you are good for Raspbian Lite.

Here is what you have to do:

tvservice --off                  ; turn off tv service
tvservice -e "DMT 68 DVI"        ; set it on (you will see a black screen)
sudo chvt 2                      ; change to different virtual terminal
sudo chvt 1                      ; change back to the previous virtual terminal
fbset -g 1920 1200 1920 1200 32  ; adjust the size of the framebuffer

(Adapt the values as needed.)

This also works for OpenGL applications but it does not with a desktop environment. There is something different missing after powering on the HDMI port to get xserver back instead of chvt.

I think Unix StackExchange is a better place to ask about that.

  • Worked for me with RPi Model B. – Ruslan Jun 13 '18 at 20:21

You cant. You have to set it in the /boot/config.txt which is used for the boot config. Once you change the default there - it will use the resolution you specified on boot. Each time you change it will require a reboot.

  • I thought you were looking for a Windows or Mac type solution. Use 'tvservice -d edid' and 'edidparser edid' in the commandline to pull a list of display modes supported by your connected monitor. tvservice -m CEA and tvservice -m DMT will list ALL display modes supported by PI. This is only partially helpful as it does not denote which your display supports. Once you identify your supported display mode(s) - you can update them using the command line. These changes are not permanent - the moment you reboot it will default. To set permanently you will need to update the boot config. – Korgrue Mar 27 '17 at 22:20
  • I have no problem finding the supported solution and executing those commands. However the resolution does not change properly. The screen goes black sometimes or looks messed up so that I have to reboot. I am looking for the commands to change e.g. from 1920x1080 to 800x600 and back. – Frank Breitling Mar 27 '17 at 23:15
  • If the screen goes black or appears distorted then it is likely the result of trying to enable a video mode not supported by your monitor. If you run the commands that I provided, it should output the modes your monitor supports. Make sure that you are implementing one of the listed options that are returned. – Korgrue Mar 28 '17 at 15:58
  • That's exactly what I did and these resolutions work when I set them in /boot/config.txt. – Frank Breitling Mar 28 '17 at 16:17

You can use the "tvservice" command for this. For example

tvservice --explicit="DMT 35 HDMI"

This powers on HDMI explicitly with "DMT mode 35" which is 60 HZ at 1280x1024 pixels.

There is also tvservice --off if you've want to turn the output off completely.

For more information try both

tvservice --help and looking here for a tabular listing of modes.

  • Thank you, but unfortunately this doesn't work for me. The screen remains black. – Frank Breitling Jul 11 '17 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.