HDMI disabled in Android - how to enable?

I’m trying to connect a 5" HDMI display running at 800x480 resolution on the factory Android 7.1 image. The display is powered externally, not over USB.

The problem is that the HDMI display interface seems to be disabled:

$ cat /sys/class/drm/card0-HDMI-A-1/enabled
disabled

What do I need to do to enable the external HDMI interface?

Thanks,

David

You probably should update to master branch instead of using factory installed build. If it can run that display, newer code is much more likely to do it. There have definitely been changes in the HDMI code.

Okay, have successfully built and installed Android 8.1 using the following:

http://builds.96boards.org/snapshots/hikey960/linaro/aosp-master/latest/
https://www.96boards.org/documentation/ConsumerEdition/HiKey960/Installation/LinuxFastboot.md.html (steps 4, 5 & 6)

…but the HDMI port still doesn’t seem to be active:

$ cat /sys/class/drm/card0-HDMI-A-1/enabled
disabled

…and here are some more logs:

hikey960:/ # dmesg | grep -i hdmi
[ 2.866010] [drm] wait for external HDMI bridge driver.
[ 6.619783] [drm] client change to HDMI
[ 7.769794] asoc-simple-card soc:sound: hdmi-hifi.0 <-> e804f800.hisi_i2s mapping ok
[ 7.845199] #0: hikey-hdmi

hikey960:/ # uname -a
Linux localhost 4.9.77-geae6367a9237 #1 SMP PREEMPT Fri Jan 19 21:54:03 UTC 2018 aarch64

hikey960:/ # cat /system/build.prop | grep “ro.build.version.sdk”
ro.build.version.sdk=27

I understand that HDMI hot plug isn’t working, but I would expect the HDMI port to be enabled and for a display to be detected at startup, even if it detects the wrong resolution or is unsupported.

Appreciate any help anyone can offer to get this HDMI display working.

First try with a different monitor. Possibly multiple different monitors.
There are some limitations to the HDMI output on these boards. In particular, it is not capable of generating the clock rates needed for all HDMI standard resolutions (and I note the fact that your monitor is not even a standard HDMI resolution). Some monitors are very particular about the clock rates being within specifications, and others are more flexible. Also somewhere in the kernel there is a WHITELIST of supported monitor configurations.

The information in the hardware notes is confusing. It says the following:

The HDMI port on HiKey supports TVs and Monitors with an HDMI interface at display resolutions of 1920x1080 (or 1920x1200) pixels down to 640x480 pixels.`

But then it also says:

[Information on Android To Be Written] At the moment resolution is locked at 1280x720p.

It would be really helpful to definitively know whether the HiKey960 can support 800x480 over HDMI, and if so how to configure it.

That’s not even the same hardware.

On that subject I notice that whilst the link David posts is for the wrong board there is currently a similar page to the Hikey960 and it looks “dead” to me. It is not linked from anywhere in the docs. I think it is just an unmaintained copy 'n paste artefact that should be removed… we’ll see if anyone else agrees:

Is there any way to force DMT timings instead of CEA?

Couldn’t find any option in the modedb docs, but maybe it’s an option in the video chipset?

I’ve been struggling with this for three solid days and getting nowhere. Would really appreciate any help/assistance that anybody can offer.

I have an Elecrow 5" 800x480 HDMI panel which uses a RealTek RTD2660H chipset (datasheet).

The display works perfectly with my Windows desktop PC, Linux laptop and Raspberry Pi2. But it refuses to work with my HiKey960.

I followed the instructions on the source.android.com/setup/devices page to build the latest Android and kernel and flashed them to the device. I have also set the following options in BoardConfig.mk:

BOARD_KERNEL_CMDLINE += video=HDMI-A-1:800x480@60

On startup I see the Android bootloader icon flash up briefly, but it looks very corrupt with black lines running through it. After that it’s a black screen and nothing is displayed.

If I change the BOARD_KERNEL_CMDLINE options to 400x800@60 then the Android screen appears but again it’s very corrupt. I don’t have an image to hand, but it’s like the whole display is twisting and lines are running into each other.

I noticed adv7511_drv.c has the following entry so I would expect the display to work:

    (mode->hdisplay == 800  && mode->vdisplay == 480  && mode->clock == 32000)) {

Perhaps the clock value is wrong, although I couldn’t find the right one in the datasheet?

There are no useful entries in dmesg or logcat. I’ve previously posted the very few messages that are displayed. I couldn’t find any way of enabling any additional logging.

Really appreciate any help with this. Cannot believe I’ve been struggling with this for 3 days on the HiKey960 when the panel works perfectly on three other platforms.

Thanks.

Here is a photograph of what the display looks like with kernel option video=HDMI-A-1:400x800@60

This is the only mode I can find where something is displayed on the screen from the HiKey.

Any ideas whether this is a timing issue?

EDITED
Assuming your HiKey 960 is in developer mode, you could try to change its resolution and dpi with adb (in the Android SDK).
Connect HiKey 960 to PC with a USB cable. Windows PC : https://developer.android.com/studio/run/win-usb.html or https://developer.android.com/studio/run/oem-usb.html
Start Console window and type :
adb shell wm size 800x480
AND (186.59 ppi calculated here : https://www.sven.de/dpi/)
adb shell wm density 187
THEN (reboot the device)
adb reboot

Or if available : “Smallest width” in “Developer settings”.

Slowly making progress now but still several issues.

I’m forcing the HDMI output to be enabled with:

BOARD_KERNEL_CMDLINE += video=HDMI-A-1:e

When I connect the HiKey960 to my 800x480 display it doesn’t detect; the panel says “No Signal”. However if I first connect the HiKey960 to a large Samsung HDMI TV (1920x1080) then the Android interface is displayed. I can then disconnect from the Samsung and connect my 800x480 panel which then comes to life. Then I can set the right resolution with wm size commands.

So there seems to be a problem where the HiKey cannot activate the 800x480 panel at startup, but can activated the Samsung TV? Not sure why that is but it’s a pain having to keep swapping displays every time I reboot. Appreciate any thoughts on this?

The second problem is the HDMI output is landscape, but I need it to be in portrait like a cellphone. I’ve added the following to build.prop but the display remains in landscape. Does anyone know how to force portrait mode on HDMI outputs?

# Screen rotation options
persist.demo.hdmirotation=portrait
ro.sf.hwrotation=270
config.override_forced_orient=true

Thanks for any help you can offer.

Is your panel powered by USB?

If it is, then that is the reason why it isn’t working on boot. HDMI hot plug does not work on these boards at the moment, and the USB power has to be turned on by the kernel. By the time the display is powered on by USB, it is too late for the kernel to detect it during its normal startup routine.

If you can, try powering the display using an external power supply, before powering on the hikey960.

The panel is powered by USB, but I’m supplying it externally - not from the HiKey960 USB port.

Are you connecting the 800x480 panel before switching on the 960 ?
If so, it sounds like the exact opposite is happening of what’s written here under “Know Limitations” (the HDMI hotplug not working which @doitright mentioned):

Yes, the 800x480 panel is connected and powered externally before I switch on the HiKey960.

Type “adb shell wm size”. Watch the format of the resolution that is displayed. It’s usually “narrow X wide” (e.g. 480 x 800). If the output displays as “800x480” try specifying the resolution as “adb shell wm size 480x800” instead of “800x480”.

You can also try setting just the dpi in build.prop with “ro.sf.lcd_density=187”. Instead of the adb commands.
This will probably only make stuff smaller or bigger though.

AFAIK this should be enough. But I’m not an expert.

So the recommended method doesn’t work, but the unsupported method (hot swapping / hot plugging) does work. That is so weird.

Is there only a HDMI input on the panel ?
If not, make sure that the HDMI input on the display is active/selected before switching on the 960.

Have you checked if there are screen resolution kernel boot parameters for Android ?
Similar to “video=” and “vga=” that are in Linux, or fbpanel in U-boot.
Alas, I’m not familiar with those on Android.

He is NOT triggering hotplugging. He is booting it with a different monitor, and it sets up to THAT monitor. Then when he unplugs that monitor and switches to the small one, nothing in the hikey960 changes – the kernel retains the configurations for the monitor it booted with.

The theory that I’m going to go with is that there is some strange issue in the code running on the RTD2660H. I have two theories about what is going on with it;

  1. It is not supplying an EDID that the hikey kernel is able to work with,
  2. It is not supplying its EDID fast enough. Could be that it isn’t even booting up until after something in the HDMI signals for it to do so.

The problem with that monitor is that its made by some no-name shop in China, and Chinese vendors are notoriously useless for technical support and are code hoarders. And that means that the only way to get the monitor working on the hikey will likely be to find some way to force it into a specific mode, i.e., hardcode an appropriate EDID into the kernel and tell it to ignore any connections to the monitor.

I’ll see if I can get my hands on a Windows PC with an HDMI interface so I can run DumpEDID

http://www.nirsoft.net/utils/dump_edid.html

Hopefully that will have some useful information on supported resolutions.

Here is the output of DumpEDID showing the capabilities of my 5" HDMI panel:

Active                   : Yes
Registry Key             : DISPLAY\MPI5008\4&110b2ec7&0&UID206395
Monitor Name             : MPI5008
Serial Number            : B3432845
Manufacture Week         : 34 / 2011
ManufacturerID           : 2358 (0x0936)
ProductID                : 20488 (0x5008)
Serial Number (Numeric)  : 16843009 (0x01010101)
EDID Version             : 1.3
Display Gamma            : 2.20
Vertical Frequency       : 50 - 76 Hz
Horizontal Frequency     : 30 - 81 KHz
Maximum Image Size       : 41 X 26 cm (19.1 Inch)
Maximum Resolution       : 800 X 480
Support Standby Mode     : Yes
Support Suspend Mode     : Yes
Support Low-Power Mode   : Yes
Support Default GTF      : No
Digital                  : Yes

Supported Display Modes  :

     720 X  400  70 Hz
     640 X  480  60 Hz
     640 X  480  72 Hz
     640 X  480  75 Hz
     800 X  480  60 Hz