Just me and what's going on… Bill

Setting pcDuino Display Resolution

Posted on 10-Mar-2013, Sunday | in Computers, pcDuino | by

One of the things I had noted earlier was that the HDMI output resolution is fixed at 720p (1280×720) and there was no documented way of setting a new resolution. There was a posting in the comments at Sparkfun that a script for setting the resolution was being worked on. Well, I decided to take a look at it myself and see what was required. It is actually quite simple once you have the right tools. With a little research, I had my display running at 1080p (1920×1080).

Background

The resolution of the frame buffer device and subsequently the X11 display is set at system boot. The default setting for the display is in the evb.bin configuration file. This is a binary configuration file compiled from a fex text file. Learn more about the fex file format at Sunxi Wiki in the Fex Guide. To change values in the /boot/evb.bin it must first be decompiled back to the text format, edited, then recompiled to the binary format. Luckily, there is an open source set of tools for accomplishing just what is needed — sunxi-tools.

Preparation

To install sunxi-tools, there some additional packages that must be installed on the pcDuino first. To fetch the sources, you need git. To compile sunxi-tools, you also need to have libusb and pkg-config. The following commands will need to be done from a terminal window.

Now that the prerequisites have been installed, the sunxi-tools source files can be fetched from github. The following commands will need to be done from a terminal window.

This will fetch the source files and build the binary programs needed to update the evb.bin configuration file.

Accessing evb.bin

The evb.bin file is stored in the NAND flash boot partition. By default, this is not available after the pcDuino boots. The default boot partition is /dev/nanda and can be mounted to /boot using the following command.

If you look at the directory of /boot, you will now see several files.

Editing Display Resolution

We are only interested in the evb.bin file at this time. Use the following commands make a backup of your original file and to extract the content of the evb.bin file to evb.fex.

Open the new evb.fex file and locate the disp_init section. It will look like this:

To change the default HDMI resolution, the line of interest is the screen0_output_mode line. The value to the right of the equal sign is the resolution selection. The available resolutions as listed on the Sunxi site are:

HDMI Mode Resolution
0 480i
1 576i
2 480p
3 576p
4 720p50
5 720p60 (default)
6 1080i50
7 1080i60
8 1080p24
9 1080p50
10 1080p60
11 PAL
12 PAL_SVIDEO
14 NTSC
15 NTSC_SVIDEO
17 PAL_M
18 PAL_M_SVIDEO
19 PAL_NC
21 PAL_NC_SVIDEO
23 1080p24-3D
24 720p50-3D
25 720p60-3D
26 1360×768-60
27 1280×1024-60

Change the screen0_output_mode to your desired resolution selection and save the file. As an example, for 1080p60:

Activate New Display Settings

To make the new display resolution settings active, the evb.bin file in the boot partition must be replaced with a compiled version of your new evb.fex file. This is accomplished with the following commands.

This compiles the new text configuration to a binary configuration file, copies the new file to the /boot partition, and unmounts the boot partition.

Moment of Truth

Once the configuration file has been updated, it is time to test. Reboot your pcDuino and enjoy the new setting.

WARNING

ONLY PERFORM THE ABOVE IF YOU UNDERSTAND WHAT YOU ARE DOING. Editing the evb.bin file has the potential to make your pcDuino unusable. If this occurs, you will need to restore your original evb.bin file from the backup. This can be done from a remote network login (you have set up the ssh server?) or using the debug serial port with the appropriate adapter.

Update 11-Mar-2013: Added additional HDMI modes to table.
Update 14-Mar-2013: Corrected HTML markup issue.
Update 5-Apr-2013: Corrected typo in HDMI mode table.

TAGS: , ,

42 Responses to “Setting pcDuino Display Resolution”

  1. Pingback: Getting Started with pcDuino

  2. Pingback: pcDuino安装synergy(添加PART2) | LinkSprite中文Blog

Leave a Reply

Your email address will not be published. Required fields are marked *