Documents‎ > ‎

Armbian GNU-LINUX VGA output mode

This article describes how to set Cubietruck output mode to VGA in Armbian Ubuntu 16.04 legacy kernel. It may work on other Armbian versions with legacy kernel or Cubian (Not Tested by me!).

1- Install sunxi-tools

1.1- Install required packages

     sudo apt-get install libusb-1.0-0-dev pkg-config

1.2- download the sinxi-tools source and compile it

     git clone https://github.com/linux-sunxi/sunxi-tools/
     cd sunxi-tools
     make

2- VGA output configuration

2.1- Backup the script.bin

     sudo cp /boot/script.bin /boot/script.bin.bck

2.2- Convert the script.bin into .fex file (text config file)

     sudo ./bin2fex /boot/script.bin /boot/script.fex

2.3.1- Open the script.fex with some text editor

     sudo vim /boot/script.fex

2.3.2- Find the block starting with „[disp_init]“ and edit the lines by following values:

  • disp_init_enable: 0 to disable;1 to enable
  • disp_mode: Display mode to use:

    Value Mode
    0 screen0(screen0, fb0)
    1 screen1(screen1, fb0)
    2 two_diff_screen_diff_contents(screen0, screen1, fb0, fb1)
    3 two_same_screen_diff_contents(screen0, screen1, fb0)
    4 two_diff_screen_same_contents(screen0, screen1, fb0)
  • screen0_output_type: Output type for screen0:

    Value Type
    0 none
    1 LCD
    2 TV
    3 HDMI
    4 VGA
  • screen1_output_type: Output type for screen1: same as previous

  • screen0_output_mode: Output mode for screen0:

    Mode Used for TV/HDMI output Used for VGA output
    0 480i 1680*1050
    1 576i 1440*900
    2 480p 1360*768
    3 576p 1280*1024
    4 720p50 1024*768
    5 720p60 800*600
    6 1080i50 640*480
    7 1080i60
    8 1080p24
    9 1080p50
    10 1080p60 1920*1080
    11 pal 1280*720
    14 ntsc
  • screen1_output_mode: Output mode for screen1: same as previous

  • fb0_framebuffer_num: fb0 buffer number, use 2 for double buffering
  • fb1_framebuffer_num: fb1 buffer number, use 2 for double buffering
  • fb0_format: pixel format for fb0:

    Value Format
    4 RGB655
    5 RGB565
    6 RGB556
    7 ARGB1555
    8 RGBA5551
    9 RGB888
    10 ARGB8888
    12 ARGB4444
  • fb1_format: pixel format for fb1: same as previous

  • fb0_pixel_sequence: fb0 pixel sequence (0 generally for linux, 2 for android):

    Value Sequence
    0 ARGB
    1 BGRA
    2 ABGR
    3 RGBA
  • fb1_pixel_sequence: fb1 pixel sequence (0 generally for linux, 2 for android): same as previous

  • fb0_scaler_mode_enable: 0 to disable; 1 to enable
  • fb1_scaler_mode_enable: 0 to disable; 1 to enable

so the part of .fex file can look like this:

     [disp_init]
     disp_init_enable = 1
     disp_mode = 0
     screen0_output_type = 4
     screen0_output_mode = 2
     screen1_output_type = 2
     screen1_output_mode = 14
fb0_width = 1360
fb0_height = 768
fb0_framebuffer_num = 2 fb0_format = 10 fb0_pixel_sequence = 0 fb0_scaler_mode_enable = 1 fb1_framebuffer_num = 2 fb1_format = 10 fb1_pixel_sequence = 0 fb1_scaler_mode_enable = 1

It is configured for VGA output with resolution 1360x768 on screen0 with framebuffer tb0 double buffered. The screen1 is disabled by „disp_mode=0“ and screen1 parameters are ignored.

2.4- Convert the edited script.fex back into .bin file

     sudo ./fex2bin /boot/script.fex /boot/script.bin

2.5- I recommend to change initial display resolution.

Open the armbianEnv.txt file:

     sudo vim /boot/armbianEnv.txt
now change disp_mode value to 1280x720p60.
so the content of file can look like this:
     verbosity=1
     console=both
     disp_mode=1280x720p60
     disp_mem_reserves=on
     rootdev=UUID=00000000-0000-0000-0000-000000000000
     rootfstype=ext4

2.6- Turn of the Cubietruck

     shutdown –h now

and then disconnect the power plug for a few seconds and connect it back. Now you should see the booting Armbian system on your VGA monitor.


Reference

Cubian VGA output: https://github.com/cubieplayer/Cubian/wiki/VGA-output

Fex Guide: http://linux-sunxi.org/Fex_Guide#.5Bdisp_init.5D

Sunxi-tools: http://linux-sunxi.org/Sunxi-tools#Building


Comments