Build a Large-Screen Command Center with the RPi 2

Configure Memory Split

Now you can make the modification that will make the biggest difference for this project—changing how the RPi allocates its 1GB of on-board memory:

$ sudo raspi-config

Enter the Advanced Options menu again, this time selecting the Memory Split (A3) option (Figure 6).

Figure 6. Memory Split

You'll be offered several choices: 16, 32, 128, 256 and 512. Out of the box, the RPi commits 64MB of its 1GB to the GPU. That's not nearly enough to give the pixel resolution we want. After some experimenting, I found that maxing out the memory for the GPU (512) worked best (Figure 7).

Figure 7. Maxing Out the Memory

This relatively massive amount of video memory delivers the graphical performance you'll need for Ultra HD screens. Still, don't expect it to perform like a desktop. Some graphical lag will remain when you resize or move application windows.

Tab to Ok, tab to Finish and return to the command line. Reboot to make the memory changes take effect.

Modify the Boot Configuration

Once the overscan, overclocking and memory split modifications are complete, the rest of the heavy lifting for this project is done in the boot configuration script: /boot/config.txt. See the Resources section for a link to the complete description of all its features.

Use your favorite text editor to open the file as root:

$ sudo vi /boot/config.txt

The in-file documentation is helpful and will give you easy-to-follow tips about the various parameters. In this file, you'll also see some of the changes you previously made using raspi-config. If you didn't use raspi-config, you can make the necessary modifications to overscan, overclocking and memory split in the following steps.

First, disable overscanning:


If you set this in raspi-config, this already will be uncommented and set to 1. Below that entry, you'll see overscan adjustments. These all should be commented out. The same goes for the framebuffer_width and framebuffer_height settings. Unless you have a particular display in mind, comment out these lines:

# uncomment this if your display has a black border 
# of unused pixels visible and
# your display can output without overscan

# uncomment the following to adjust overscan. Use 
# positive numbers if console goes off screen, 
# and negative if there is too much border

If the RPi doesn't automatically detect your HDMI display, uncomment the hdmi_force_hotplug=1 line. That should fix it.

In order to get the RPi to support the Ultra HD screen resolution, you'll need to use hdmi_group and hdmi_mode to enable custom settings. The hdmi_group parameter sets the type of display you're using: 0 will auto-detect, 1 will set CEA (typical for televisions), and 2 will set DMT (typical for monitors).

Although I'm using a Vizio TV, I needed to set hdmi_group to 2:

# Set monitor mode to DMT

Depending on the screen you choose, you may need to experiment with these settings a bit. Remember, if something goes wrong and you no longer can read the screen, ssh in to your RPi and back out your changes.

Driving the Vizio TV requires a custom resolution that is not offered in any of the preset modes, so you'll need to set the HDMI output format to 87, a custom mode:

# Make our custom resolution the default

For a complete list of hdmi_mode values (including resolution and frequency), see the Config.txt link in the Resources section of this article.

With the custom mode set, you now need to add the specific parameters for Coordinated Video Timings (CVT). The format is:

hdmi_cvt=<width> <height> <framerate> <aspect> 
 ↪<margins> <interlace> <rb>

So, a simplified version of this entry for the 3840x2160 Vizio TV looks like this:

hdmi_cvt 3840 2160 24

Again, you can modify these settings to match your screen's parameters. It's much like adjusting the screen resolution on any computer monitor—width, height and framerate are key.

I also set the framebuffer width and height to match my hdmi_cvt width and height, and then set a high pixel frequency limit:


After some trial and error, these settings worked well. Additional details are available in the RPi Config (see Resources).

If you didn't use raspi-config to set overclocking and the GPU memory split, add those parameters to the end of /boot/config.txt now:


Your entire /boot/config.txt settings now should look something like this:

hdmi_cvt 3840 2160 24

Save /boot/config.txt and reboot. When the RPi comes back up, you should have the high-resolution view you want.

Deploying a second RPi is as simple as duplicating the SD card from the RPi you just set up and plugging it in to a second RPi. (See Resources for information on how to do that.)


John S. Tonello is Director of IT for NYSERNet, Inc., in Syracuse, New York. He's been a Linux user and enthusiast since he installed his first Slackware system from diskette 20 years ago. You can follow him @johntonello.