Every time that I set up my Raspberry PI with a new version of the Raspbian operating system, I seem to have to use different settings for the HDMI screen — even though I am using the same hardware every time. I am not sure if this has to do with installing Raspbian using NOOBS versus using the Raspbian image file.
When I wrote the article on 10 things to do after buying a Raspberry PI, I only needed to change the disable_overscan parameter to disable_overscan=1 in the /boot/config.txt file to remove the black border on the screen.
I recently installed a new version of Raspbian (2015-02-16-raspbian-wheezy.img) directly from the image file i.e. not using NOOBS. Nothing would display on the screen — the screen was just black / blank. I did discover that if I powered up the screen first, waited a few seconds and then powered up the PI, that the PI boot up and login prompt then displayed on the screen, although with wide black borders. At least this allowed me to configure Raspbian using the default configuration screen that appears after first boot of a new Raspbian install.
Below are the steps that I had to take to fix the blank screen and black border problems on my Raspberry PI.
Fixing the Blank Screen Problem
You may need to change different settings for your screen, depending on which screen you are using. The following is what worked for me, but this will show you where you can start changing settings to see what works for you.
I had to switch the screen on first with the PI power off, wait a few seconds and then plug the PI power in. The screen now worked. If the PI and screen were ever switched on at the same time, the screen went blank, even though the PI booted up.
If you can’t get anything to display on your screen, you may need to remove the SD card and access it from a PC to make changes to the config.txt file.
Changing the Settings
The config.txt file needs to be modified to make changes to the screen configuration. This file is found in the /boot directory on the SD card which is a separate partition as well. If you plug the SD card into a Windows PC, you will be prompted to open the boot folder of the SD card and you will find config.txt in this folder which you can then modify. Linux desktop operating systems will usually open both the boot partition and the contents of the SD card in two separate file managers.
In my case, I could modify the config.txt file on the PI without the need of a PC. This can be done from the command line using the nano text editor. It can also be done from the graphical desktop. In both cases the file must be opened using super user privileges or modifications will not be able to be saved.
To open the config.txt file as super user using the nano text editor from the command line, enter:
sudo nano /boot/config.txt
To open the config.txt file as super user from the PI desktop:
- Press Alt + F2 to bring up the Run box.
- Enter gksudo pcmanfm in the run box and press enter or click OK. This opens the file manager with super user privileges.
- You can click Close in the dialog box that pops up.
- Navigate to the boot folder by clicking the boot partition in the left pane of the file manager.
- You can now open config.txt in the main pane of the file manager by double-clicking it.
- It is best to close the file manager now, as it has been opened with super user privileges and can be used to modify or delete other files from the file system.
- Changes can now be made to config.txt and saved.
With the config.txt file now open with super user privileges, we can fix the blank screen problem. The problem may be fixed by uncommenting (i.e. removing the # sign in front of) the following line:
NOOBS users be aware that the parameters that are changed usually appear at the top of the config.txt file commented out and then again at the bottom of the file uncommented. Make changes to the bottom uncommented parameters, unless you can’t find the parameter that you are looking for at the bottom of the file.
This did not solve the problem in my case. I had to do two things – uncomment the hdmi_force_hotplug line and uncomment and change the settings of hdmi_group and hdmi_mode.
Every time that a parameter is changed in config.txt, the system must be rebooted in order for the changes to be seen. You may need to change a parameter at a time and reboot to see the effect.
The settings that solved my problem are shown here:
# uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=1 hdmi_mode=4
The hdmi_group and hdmi_mode settings are obtained from the video mode options on the RPiconfig page. You will need to scroll down a bit to see the options. The settings that I used above mean the following:
hdmi_group=1 # define screen resolution in CEA format hdmi_mode=4 # 720p 60 Hz
Rebooting after changing these settings fixed the blank screen problem and I could now switch the screen and PI on at the same time.
Fixing the Black Border Problem
The black border can be removed and adjusted by changing parameters in the config.txt file again. Open the config.txt file as super user again as described above.
Reminder: NOOBS users be aware that the parameters that are changed usually appear at the top of the config.txt file commented out and then again at the bottom of the file uncommented. Make changes to the bottom uncommented parameters, unless you can’t find the parameter that you are looking for at the bottom of the file.
Now uncomment the disable_overscan parameter and set it to 1:
Reboot and see if the black borders have gone. If they are still there, you will need to adjust the size of the borders to remove them using the following parameters:
overscan_left=28 overscan_right=28 overscan_top=12 overscan_bottom=12
Increasing the number in these parameters decreases the size of the border.
With the above settings changed, my PI and screen were fully functional and looking good. Here is my complete config.txt file to for you to see all the changes together:
# For more options and information see # http://www.raspberrypi.org/documentation/configuration/config-txt.md # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border overscan_left=28 overscan_right=28 overscan_top=12 overscan_bottom=12 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 # uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=1 hdmi_mode=4 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. #arm_freq=800