Android - send HDMI CEC commands to TV - minix - libCEC

吃可爱长大的小学妹 提交于 2019-12-02 18:44:40

First of all, very impressive reverse engineering work!

Secondly, I'm facing a similar issue (but with a non Minix product). Have you tried upgrading to a newer firmware, such as this one:

http://minixforum.com/threads/x8-x8-plus-x8-h-official-firmware-004a-not-for-x8-h-plus.5567/

I am suggesting this as a possible solution, because one of the issues it fixes is this:

Fixed HDMI-CEC multi devices issues

This means the device is not only a "slave", but also a "master" (i.e. can send commands to other hdmi devices).

Please note that as stated in the link, it is not intended for the plus version.

Good luck!

My two cents on the issue:

Chapter I: Compassion

I went through all the trouble you went, too, especially with libCEC, so I'd like to describe the only way I got any interaction going between an Android TV box and the TV connected to it with HDMI cable.

Chapter II: Cooking low and slow

Send a request for connected device's power status echo 0x40 0x8F > /sys/class/cec/cmd

To get the response, you can:

  1. read the "registry" cat /sys/class/cec/dump_reg

  2. wait and look for the response in logcat

// Example:
02-06 16:33:10.568  4012  4105 D CEC     : [cec_rx_loop]msg:04 90 00
02-06 16:33:10.570  4012  4105 D HdmiCecExtend: onCecMessageRx
02-06 16:33:10.657  4012  4012 W HDMI    : [1]:Unhandled cec command:<Report Power Status> src: 0, dst: 4, params: 00
02-06 16:33:10.762  4012  4104 D CEC     : [cec_send_message][4 -> 0]len:3, body:00 90 00 , result:success

Magic numbers (codes) explanation:

40 - Playback device #1
04 - TV device #1
On - 90 00
Off - 00 00 // in registry or no response at all in logcat

Other available codes can be constructed or read on Cec-O-Matic.

Chapter III: New hope

I still have to try and get to Android's HdmiControlService but I still don't know how, probably through Java reflection. You can see HdmiCecExtend: onCecMessageRx so the API is available on the device, but you cannot use it in Android Studio, as far as I know, it's only available to Android TV vendors.

Will update if anything comes along.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!