We're no longer updating This wiki!!

This is an old revision of the document!


Display Auto Detection using EDID

There are a variety of issue related to setting display mode with various monitors
and the available display modes that are provided on ODROID-C2 are limited to support all of them.
So, we are planning to release 'Display auto detection functionality using EDID on U-Boot stage'.

* Ubuntu : Version 3.14.79-107 (Feb 26, 2017) or higher is available.
* Android : Android 5.1.1 (v3.3) / 6.0.1 (v2.2) or higher version is available.

Setting Boot ini

In the following boot.ini, the variable “display_autodetect” is added.
When you want to use display auto detection logic, change the value to “true”.

With the official version including display auto detection, default mode is set as “display_autodetect is true”.
If you want to use the existing manual setting mode, modify display_autodetect to false
and uncomment the mode to be set.

# 1. to use display auto detection mode
setenv display_autodetect “true”

or

# 2. to use existing manual display mode
setenv m “1080p60hz”

setenv display_autodetect “false”

.....
.....
# HDMI DVI/VGA modes
# By default its set to HDMI, if needed change below.
# Uncomment only a single Line.
# setenv vout "dvi"
# setenv vout "vga"

# Display Auto Detection
# "false" or "true"
setenv display_autodetect "true"
 
# HDMI HotPlug Detection control
.....
.....

Once the value is set as “true”, the command, “hdmitx edid” is working.
And if you're using HK's multi-touch display, VU series (VU5, VU7/7+ and VU8C),
you need to add the command, “usb pwren” because usb power should be supplied to activate the display device via USB port.

.....
.....
###########################################
# Boot Arguments
if test "${display_autodetect}" = "true"; then usb pwren; hdmitx edid; fi
if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
.....
.....
boot.ini
ODROIDC2-UBOOT-CONFIG
 
########################################################################
# Changes made to this are overwritten every time there's a new upgrade
# To make your changes permanent change it on 
# boot.ini.default
# After changing it on boot.ini.default run the bootini command to
# rewrite this file with your personal permanent settings.
# Documentation: http://odroid.com/dokuwiki/doku.php?id=en:c2_persistent_bootini
########################################################################
 
# Possible screen resolutions
# Uncomment only a single Line! The line with setenv written.
# At least one mode must be selected.
 
# Custom modeline!
# To use custom modeline you need to disable all the below resolutions
# and setup your own! 
# For more information check our wiki: 
# http://odroid.com/dokuwiki/doku.php?id=en:c2_hdmi_autosetting
# Example below:
# setenv m "custombuilt" 
# setenv modeline "1920,1200,154000,74040,60,1920,1968,2000,2080,1200,1202,1208,1235,1,0,1"
 
# 480 Lines (720x480)
# setenv m "480i60hz" # Interlaced 60Hz
# setenv m "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz
# setenv m "480p60hz" # 480 Progressive 60Hz
# setenv m "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz
 
# 576 Lines (720x576)
# setenv m "576i50hz" # Interlaced 50Hz
# setenv m "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz
# setenv m "576p50hz" # Progressive 50Hz
# setenv m "576p_rpt" # Progressive for Rear Projection Televisions 50Hz
 
# 720 Lines (1280x720)
# setenv m "720p50hz" # 50Hz
# setenv m "720p60hz" # 60Hz
 
# 1080 Lines (1920x1080)
# setenv m "1080i60hz" # Interlaced 60Hz
setenv m "1080p60hz" # Progressive 60Hz
# setenv m "1080i50hz" # Interlaced 50Hz
# setenv m "1080p50hz" # Progressive 50Hz
# setenv m "1080p24hz" # Progressive 24Hz
 
# 4K (3840x2160)
# setenv m "2160p30hz"    # Progressive 30Hz
# setenv m "2160p25hz"    # Progressive 25Hz
# setenv m "2160p24hz"    # Progressive 24Hz
# setenv m "smpte24hz"    # Progressive 24Hz SMPTE
# setenv m "2160p50hz"    # Progressive 50Hz
# setenv m "2160p60hz"    # Progressive 60Hz
# setenv m "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
# setenv m "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
 
### VESA modes ###
# setenv m "640x480p60hz"
# setenv m "800x480p60hz"
# setenv m "480x800p60hz"
# setenv m "800x600p60hz"
# setenv m "1024x600p60hz"
# setenv m "1024x768p60hz"  
# setenv m "1280x800p60hz"
# setenv m "1280x1024p60hz"
# setenv m "1360x768p60hz"
# setenv m "1440x900p60hz"
# setenv m "1600x900p60hz"
# setenv m "1680x1050p60hz"
# setenv m "1600x1200p60hz"
# setenv m "1920x1200p60hz"
# setenv m "2560x1080p60hz"
# setenv m "2560x1440p60hz"
# setenv m "2560x1600p60hz"
# setenv m "3440x1440p60hz"
 
# HDMI BPP Mode
setenv m_bpp "32"
# setenv m_bpp "24"
# setenv m_bpp "16"
 
# HDMI DVI/VGA modes
# By default its set to HDMI, if needed change below.
# Uncomment only a single Line.
# setenv vout "dvi"
# setenv vout "vga"
 
# Display Auto Detection
# "false" or "true"
setenv display_autodetect "true"
 
# HDMI HotPlug Detection control
# Allows you to force HDMI thinking that the cable is connected.
# true = HDMI will believe that cable is always connected
# false = will let board/monitor negotiate the connection status
setenv hpd "true"
# setenv hpd "false"
 
# Monitor output
# Controls if HDMI PHY should output anything to the monitor
setenv monitor_onoff "false" # true or false
 
# Server Mode (aka. No Graphics)
# Setting nographics to 1 will disable all video subsystem
# This mode is ideal of server type usage. (Saves ~300Mb of RAM)
setenv nographics "0"
 
# Meson Timer
# 1 - Meson Timer
# 0 - Arch Timer 
# Using meson_timer improves the video playback however it breaks KVM (virtualization).
# Using arch timer allows KVM/Virtualization to work however you'll experience poor video
setenv mesontimer "1"
 
# UHS (Ultra High Speed) MicroSD mode enable/disable
setenv disableuhs "false"
 
# MicroSD Card Detection enable/disable
# Force the MMC controlled to believe that a card is connected.
setenv mmc_removable "true"
 
# USB Multi WebCam tweak
# Only enable this if you use it.
setenv usbmulticam "false"
 
# Default Console Device Setting
setenv condev "console=ttyS0,115200n8 console=tty0"   # on both
 
# CPU Frequency / Cores control
###########################################
### WARNING!!! WARNING!!! WARNING!!!
# Before changing anything here please read the wiki entry: 
# http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq
#
# MAX CPU's
# setenv maxcpus "1"
# setenv maxcpus "2"
# setenv maxcpus "3"
setenv maxcpus "4"
 
# MAX Frequency
# setenv max_freq "2016"  # 2.016GHz
# setenv max_freq "1944"  # 1.944GHz
# setenv max_freq "1944"  # 1.944GHz
# setenv max_freq "1920"  # 1.920GHz
# setenv max_freq "1896"  # 1.896GHz
# setenv max_freq "1752"  # 1.752GHz
# setenv max_freq "1680"  # 1.680GHz
# setenv max_freq "1656"  # 1.656GHz
setenv max_freq "1536"  # 1.536GHz
 
 
 
###########################################
# Boot Arguments
if test "${display_autodetect}" = "true"; then usb pwren; hdmitx edid; fi
if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
 
setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro ${condev} no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam}"
 
# Booting
 
setenv loadaddr "0x11000000"
setenv dtb_loadaddr "0x1000000"
setenv initrd_loadaddr "0x13000000"
 
fatload mmc 0:1 ${initrd_loadaddr} uInitrd
fatload mmc 0:1 ${loadaddr} Image
fatload mmc 0:1 ${dtb_loadaddr} meson64_odroidc2.dtb
fdt addr ${dtb_loadaddr}
 
if test "${mesontimer}" = "0"; then fdt rm /meson_timer; fdt rm /cpus/cpu@0/timer; fdt rm /cpus/cpu@1/timer; fdt rm /cpus/cpu@2/timer; fdt rm /cpus/cpu@3/timer; fi
if test "${mesontimer}" = "1"; then fdt rm /timer; fi
 
if test "${nographics}" = "1"; then fdt rm /reserved-memory; fdt rm /aocec; fi
if test "${nographics}" = "1"; then fdt rm /meson-fb; fdt rm /amhdmitx; fdt rm /picdec; fdt rm /ppmgr; fi
if test "${nographics}" = "1"; then fdt rm /meson-vout; fdt rm /mesonstream; fdt rm /meson-fb; fi
if test "${nographics}" = "1"; then fdt rm /deinterlace; fdt rm /codec_mm; fi
 
booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}

Information Binaries for Debugging

Once display auto detection is done, the following two binary files are generated in the FAT filesystem.
( Ubuntu : /media/boot , Android : /storage/internal/ )
They have edid data and detection logs so if display doesn't work normally, please share those files with Hardkernel Team through Forum page.
http://forum.odroid.com/

1. edid.bin

  • edid data in hex format

2. display.bin

  • Auto detection OK / FAIL
  • hdmi / dvi
  • display mode
  • modeline information

Brief Sequence Diagram

Here is a brief sequence diagram.

You can refer to the basic rules to choose the best display mode.

Timing Information Priority Order
(refer to E-EDID standard, Section 5)
1. Detailed Timings
2. Standard Timings
3. Established Timings

Extension block information
Extension block information will be excluded from candidates to find the best one.

The rules of DVI auto detect
1. extensions : 00h
2. IEEE registration identifier : 0x000c03h
(refer to E-EDID standard, Section 6.2)

How to update U-Boot

It's a beta test version so you need to upate u-boot binary
and modify boot.ini to activate the functionality.

1. Download the script

First, download the update script file as following
and then change the mode.

$ su
# wget http://dn.odroid.com/S905/BootLoader/ODROID-C2/display_autodetection/update_c2_boot.sh
# chmod  +x  ./update_c2_boot.sh
update_c2_boot.sh
#!/bin/sh
#
# Copyright (C) 2017 Hardkernel Co,. Ltd
# Joy Cho <joy.cho@hardkernel.com>
#
# SPDX-License-Identifier:      GPL-2.0+
#
# update c2 boot binaries on Ubunt
#
 
if [ -z $1 ]; then
        echo "Usage :"
        echo "    update : ./update_c2_boot.sh update"
        echo "    check version : ./update_c2_boot.sh version"
        exit 1
fi
 
uboot=/tmp/u-boot.bin
tmp=/tmp/temp.bin
 
case "$1" in
"update")
        # Download U-Boot binary
        wget -P /tmp/ http://dn.odroid.com/S905/BootLoader/ODROID-C2/display_autodetection/u-boot.bin
 
        if [ ! -f $uboot ];then
                echo "error: uboot binary doesn't exist"
                exit 1
        fi
 
        # Write
        dd if=$uboot of=/dev/mmcblk0 bs=512 seek=97 status=none
        echo "Update done!"
 
        rm $uboot
        ;;
"version")
        # check the U-Boot version
        echo "Now let's check if update has been completed..."
 
        dd if=/dev/mmcblk0 of=$tmp bs=512 skip=97 count=1334 status=none
        grep -a -r -E -o ".{0,0}U-Boot 2015.01.{0,50}" /tmp/temp.bin | grep -a "("
 
        rm $tmp
        ;;
*)
        echo "Usage :"
        echo "    update : ./update_c2_boot.sh update"
        echo "    check version : ./update_c2_boot.sh version"
        ;;
esac
2. Update U-Boot
$ ./update_c2_boot.sh update
3. Check the U-Boot version
$ ./update_c2_boot.sh version

If the update is completed, you can see the following version.

# ./update_c2_boot.sh version

Now let's check if update has been completed...
U-Boot 2015.01-00183-g731ba4c-dirty (Feb 22 2017 - 20:13:29)

After updating, you must run reboot the system.

en/c2_auto_detect_display.1488188771.txt.gz · Last modified: 2017/02/27 18:16 by joy.cho
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0