本人已成功使用该方法修改HDMI Mode为10 (1080P60),启动后由于显示器分辨率只有1280x1024,显示不完整,使用显示器上的自动调整后显示正常。另外选择HDMI Mode为27,显示器无显示,不知驱动支持多少种模式。在此感谢原文作者Bill。
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 theevb.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 toevb.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 |
10 | 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.