21

I have an MK809 and would like to send an HDMI CEC command to turn on/off the TV that the device is connected to. Is there a way or library to send CEC command as I can't see anything documented anywhere?

nickponline
  • 25,354
  • 32
  • 99
  • 167
  • I don't know if it helps, but my Sony Xperia Arc phone under Android 4.1 has HDMI CEC. When I connect it to my Sharp TV, I can use the TV remote to drive the phone. Here is an exemple (not from me) : http://www.xperiablog.net/2011/02/21/hdmi-on-new-xperia%E2%80%99s-allows-control-via-tv-remote-video/ – nash68 Jul 29 '13 at 08:53
  • This problem might finally make some progress following [Android 5.0 (Lollipop)](http://source.android.com/devices/tv/HDMI-CEC.html) – John Mee Feb 23 '15 at 07:16
  • @nichponline u got solution? how you have connect and turn off tv? – PankajAndroid Oct 03 '16 at 12:35
  • @nickponline - Were you able to find a Java library for CEC commands so that I can send HDMI CEC commands from an Android Device? – jay Dec 17 '16 at 09:37

1 Answers1

7

"HDMI-CEC is a one-wire bidirectional serial bus that uses the industry-standard AV.link protocol to perform remote control functions. CEC wiring is mandatory, although implementation of CEC in a product is optional. It was defined in HDMI Specification 1.0 and updated in HDMI 1.2, HDMI 1.2a and HDMI 1.3a (the last added timer and audio commands to the bus). USB to CEC Adapters exist that allow a computer to control CEC-enabled devices." Source

Assuming MK809 follows HDMI specification, it should possible from a hardware point of view. However, the issue lies in the software. I was unable to find a Java library for CEC commands during my cursory search, although I was able to find some for C and even Arduino.

Questions to ask:

  1. Does your device support CEC? Does the OS current support it with its driver?
  2. Does your hardware support it? (It does if it follows HDMI specification)
  3. Does your TV(s) support CEC? Will it actually turn off when it receives the command or just ignore it?

P.S.: Congrats, your question is the first I've answered since joining this website. :D

Update as of 2016: Android Lolipop does support new HDMI controls in the OS as the Android source code shows. The API documentation can be found here. Keep in mind it is still up the device manufacturer to actually support the API in the device drivers. Also, most TVs do now support CEC commands, but they are often not enabled by default.

Skylion
  • 2,696
  • 26
  • 50
  • 1
    Since it has been 3+ years, I'm asking this again. Were you able to find a Java library for CEC commands so that I can send HDMI CEC commands from an Android Device? – jay Dec 17 '16 at 09:36
  • 3
    Any chance I can get a look at some example using these apis? – jay Dec 19 '16 at 07:35
  • 1
    Ok i repeat same question as above its just its 2020 now. still cant find any libraries for core android on java or kotlin – babbin tandukar Oct 15 '20 at 17:56
  • did you find any solution for this problem??! – Malo Oct 20 '22 at 11:47