13

I've been facing a problem to access to HDMI CEC on this Android dongle.

I'm trying to turn on the tv and change the input source of the tv but I was unable to do it.

Android API Approach

I'm running a system app and I have settled

<uses-permission android:name="android.permission.HDMI_CEC" /> 

on AndroidManifest.xml.

I'm accessing to HDMI service through reflection since I was not able to access it directly, even being a system app.

public class HdmiHelper {

    public HdmiHelper(Context context) {
        init(context);
    }

    public void init(Context context) {

        try {

            //Interface Callback Proxy
            Class<?> hotplugEventListenerClass = Class.forName("android.hardware.hdmi.HdmiControlManager$HotplugEventListener");
            Class<?> vendorCommandListenerClass = Class.forName("android.hardware.hdmi.HdmiControlManager$VendorCommandListener");
            Class<?> oneTouchPlayCallbackClass = Class.forName("android.hardware.hdmi.HdmiPlaybackClient$OneTouchPlayCallback");
            Class<?> displayStatusCallbackClass = Class.forName("android.hardware.hdmi.HdmiPlaybackClient$DisplayStatusCallback");

            Object interfaceOneTouchPlaybackCallback = Proxy.newProxyInstance(oneTouchPlayCallbackClass.getClassLoader(),
                    new Class<?>[]{ oneTouchPlayCallbackClass } , new callbackProxyListener() );

            Object interfaceHotplugEventCallback = Proxy.newProxyInstance(hotplugEventListenerClass.getClassLoader(),
                    new Class<?>[]{ hotplugEventListenerClass } , new callbackProxyListener() );

            Object interfaceDisplayStatusCallbackClass = Proxy.newProxyInstance(displayStatusCallbackClass.getClassLoader(),
                    new Class<?>[]{ displayStatusCallbackClass } , new callbackProxyListener() );


            Method m = context.getClass().getMethod("getSystemService", String.class);
            Object obj_HdmiControlManager = m.invoke(context, (Object) "hdmi_control");

            Log.d("HdmiHelper", "obj: " + obj_HdmiControlManager + " | " + obj_HdmiControlManager.getClass());

            for( Method method : obj_HdmiControlManager.getClass().getMethods()) {
                Log.d("HdmiHelper", "   method: " + method.getName() );
            }


            Method method_addHotplugEventListener = obj_HdmiControlManager.getClass().getMethod("addHotplugEventListener", hotplugEventListenerClass);
            method_addHotplugEventListener.invoke(obj_HdmiControlManager, interfaceHotplugEventCallback);


            Method m2 = obj_HdmiControlManager.getClass().getMethod("getPlaybackClient");
            Object obj_HdmiPlaybackClient = m2.invoke( obj_HdmiControlManager );
            Log.d("HdmiHelper", "obj_HdmiPlaybackClient: " + obj_HdmiPlaybackClient + " | " + obj_HdmiPlaybackClient.getClass());
           
            Method method_oneTouchPlay = obj_HdmiPlaybackClient.getClass().getMethod("oneTouchPlay", oneTouchPlayCallbackClass);
            method_oneTouchPlay.invoke( obj_HdmiPlaybackClient, interfaceOneTouchPlaybackCallback);
            

            Method method_queryDisplayStatus = obj_HdmiPlaybackClient.getClass().getMethod("queryDisplayStatus", displayStatusCallbackClass);

            method_queryDisplayStatus.invoke( obj_HdmiPlaybackClient, interfaceDisplayStatusCallbackClass);

            Method method_getActiveSource = obj_HdmiPlaybackClient.getClass().getMethod("getActiveSource");
            Log.d("HdmiHelper", "getActiveSource: " + method_getActiveSource.invoke(obj_HdmiPlaybackClient));


        }catch (Exception e) {
            e.printStackTrace();
        }

    }

    public class callbackProxyListener implements java.lang.reflect.InvocationHandler {

        public callbackProxyListener() {

        }

        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

            try {
                Log.d("HdmiHelper", "Start method " + method.getName() + " | " + proxy.getClass() + " | " + method.getDeclaringClass() );

                if ( args != null ) {

                    // Prints the method being invoked
                    for (int i = 0; i != args.length; i++) {
                        Log.d("HdmiHelper", "  - Arg(" + i + "): " + args[i].toString());
                    }

                }

                if (method.getName().equals("onReceived")) {

                    if (args.length == 1) {
                        onReceived(args[0]);
                    }else
                    if (args.length == 3) {
                        onReceived( (int) args[0], BytesUtil.toByteArray( args[1] ), (boolean) args[2]  );
                    }


                }else
                if (method.getName().equals("onComplete")) {
                    onComplete( (int) args[0] );
                }else
                if (method.getName().equals("toString")) {
                    return this.toString();
                }else {
                    return method.invoke(this, args);
                }

            }catch (Exception e) {
                e.printStackTrace();
            }

            return null;
        }

        void onComplete(int result) {
            Log.d("HdmiHelper", "onComplete: " + result);
        }

        void onReceived(Object event) {

            Class eventClass = event.getClass();

            Log.d("HdmiHelper", "onReceived(1): " + event.toString() + " | " + eventClass);

            try {
                Method method_getPort = eventClass.getMethod("getPort");
                Method method_isConnected = eventClass.getMethod("isConnected");
                Method method_describeContents = eventClass.getMethod("describeContents");

                Log.d("HdmiHelper", "    - " + method_getPort.invoke(event) + " | " + method_isConnected.invoke(event) + " | " + method_describeContents.invoke(event) );

            }catch (Exception e) {

                e.printStackTrace();

            }


        }


        void onReceived(int srcAddress, byte[] params, boolean hasVendorId) {
            Log.d("HdmiHelper", "onReceived(3): " + srcAddress + " | " + params + " | " + hasVendorId);
        }


    }

Log answers:

D/HdmiHelper: obj: android.hardware.hdmi.HdmiControlManager@7bca63c | class android.hardware.hdmi.HdmiControlManager

D/HdmiHelper: obj_HdmiPlaybackClient: android.hardware.hdmi.HdmiPlaybackClient@6345d1a | class android.hardware.hdmi.HdmiPlaybackClient

D/HdmiHelper: Start method onReceived | class $Proxy2 | interface android.hardware.hdmi.HdmiControlManager$HotplugEventListener
D/HdmiHelper: onReceived(1): android.hardware.hdmi.HdmiHotplugEvent@4c5c04b | class android.hardware.hdmi.HdmiHotplugEvent
D/HdmiHelper:     - 1 | true | 0  
  • Question 1:

I received true: which means that tv is on what is true. If the tv is off I receive false. That seems to work.

Though, I was expecting to receive a callback every time I change the tv state, which is not happening. Any idea?

  • Question 2:

continuing with the logs for the OneTouchPlayCallback:

D/HdmiHelper: Start method onComplete | class $Proxy1 | interface android.hardware.hdmi.HdmiPlaybackClient$OneTouchPlayCallback
D/HdmiHelper: onComplete: 2

Looking into the class HdmiPlaybackClient.java if everything went good the answer would be 0 (@param result the result of the operation. {@link HdmiControlManager#RESULT_SUCCESS . You can find this variable in HdmiControlManager.java class}. Instead, I receive 2 which I assume that is RESULT_SOURCE_NOT_AVAILABLE.

Any idea why?

  • Question 3

Continuing now with the logs for the DisplayStatusCallback:

D/HdmiHelper: Start method onComplete | class $Proxy3 | interface android.hardware.hdmi.HdmiPlaybackClient$DisplayStatusCallback
D/HdmiHelper: onComplete: 2

According to the definition of this callback:

/**
     * Listener used by the client to get display device status.
     */
    public interface DisplayStatusCallback {
        /**
         * Called when display device status is reported.
         *
         * @param status display device status. It should be one of the following values.
         *            <ul>
         *            <li>{@link HdmiControlManager#POWER_STATUS_ON}
         *            <li>{@link HdmiControlManager#POWER_STATUS_STANDBY}
         *            <li>{@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_ON}
         *            <li>{@link HdmiControlManager#POWER_STATUS_TRANSIENT_TO_STANDBY}
         *            <li>{@link HdmiControlManager#POWER_STATUS_UNKNOWN}
         *            </ul>
         */
        public void onComplete(int status);
    }

and looking into the HdmiControlManager I receive 2 which means that is:

public static final int POWER_STATUS_TRANSIENT_TO_ON = 2;

Which is a strange result because that is not what's happening.

  • Continuing with logs for your information:

Answer for:

getActiveSource is null

I also tested this code that calls the getTvClient() method:

Method method_getTvClient = obj_HdmiControlManager.getClass().getMethod("getTvClient");
Object obj_HdmiTvClient = method_getTvClient.invoke( obj_HdmiControlManager );
Log.d("HdmiHelper", "obj_HdmiTvClient: " + obj_HdmiTvClient);

and the result is null.

I also tried the approach of sending a vendor command following CEC-O-MATIC website but I was unable to have success. If you have any instructions about this, please give me some directions and I will test it.

LibCEC approach:

I was able to cross compile libcec to android thanks to this post. But libcec is always answering to me "command 'PING' was not acked by the controller".

I've added the flags -DHAVE_EXYNOS_API=1 and -DHAVE_AOCEC_API=1 to libcec.

System Information

The device /dev/cec is settled:

q8723bs:/ # ls -l /dev/cec                                                                                                                                              
crw-rw-rw- 1 root root 218,   0 2017-12-19 16:33 /dev/cec

I also can find it on /sys/class/cec:

q8723bs:/ # ls -laht /sys/class/cec/                                                                                                                                    
total 0
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 arc_port
lrwxrwxrwx   1 root root    0 2017-12-19 16:45 cec -> ../../devices/aocec/cec
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 cec_version
--w-------   1 root root 4.0K 2017-12-19 16:45 cmd
-rw-rw-r--   1 root root 4.0K 2017-12-19 16:45 dbg_en
-rw-rw-r--   1 root root 4.0K 2017-12-19 16:45 device_type
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 dump_reg
-rw-rw-r--   1 root root 4.0K 2017-12-19 16:45 fun_cfg
-rw-rw-r--   1 root root 4.0K 2017-12-19 16:45 menu_language
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 osd_name
-rw-rw-r--   1 root root 4.0K 2017-12-19 16:45 physical_addr
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 pin_status
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 port_num
-rw-rw-r--   1 root root 4.0K 2017-12-19 16:45 port_seq
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 port_status
-rw-rw-r--   1 root root 4.0K 2017-12-19 16:45 vendor_id
-r--r--r--   1 root root 4.0K 2017-12-19 16:45 wake_up

But when I ran cec-client I receive this answer:

q8723bs:/ # id
uid=0(root) gid=0(root) groups=0(root) context=u:r:toolbox:s0
q8723bs:/ # cec-client -s /dev/cec                                                                                                                                      
opening a connection to the CEC adapter...
DEBUG:   [               1] Broadcast (F): osd name set to 'Broadcast'
DEBUG:   [               2] connection opened, clearing any previous input and waiting for active transmissions to end before starting
DEBUG:   [             396] communication thread started
DEBUG:   [            1396] command 'PING' was not acked by the controller

As a note, I also have the device /dev/input/event2 that is a read only cec_input:

q8723bs:/ # ls -l /dev/input/event2                                                                                                                                     
crw-rw---- 1 root input 13,  66 2017-12-19 16:33 /dev/input/event2
q8723bs:/ # ls /sys/devices/virtual/input/input2/                                                                                                                      
capabilities/  event2/        id/            modalias       name           phys           power/         properties     subsystem/     uevent         uniq
q8723bs:/ # cat /sys/devices/virtual/input/input2/name                                                                                                                  
cec_input

I tried to run it on /dev/input/event2 but obviously it didn't work because it could not open a connection:

q8723bs:/ # cec-client /dev/input/event2                                                                                                                                
No device type given. Using 'recording device'
CEC Parser created - libCEC version 4.0.2
opening a connection to the CEC adapter...
DEBUG:   [               1] Broadcast (F): osd name set to 'Broadcast'
ERROR:   [            3335] error opening serial port '/dev/input/event2': Couldn't lock the serial port
ERROR:   [            3335] could not open a connection (try 1)

in Summary:

I could not get the command to turn on or change the input source of tv working in either of the cases. Any direction would be very helpful. Thanks in advance.

note: I was able to accomplish it with libcec and raspberry pi on the same tv

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Eduardo Pinheiro
  • 3,409
  • 3
  • 30
  • 39

1 Answers1

9

So after a lot of work around this issue I figured out that, in order to have CEC control enabled in android you need to run this command on shell:

settings put global hdmi_control_enabled 1 

#if you want, you can also enable this self-explanatory command
settings put global hdmi_control_auto_wakeup_enabled 1 

#and this
settings put global hdmi_control_auto_device_off_enabled 1

After this, android automatically started to make use of cec, after a boot, for example, it change the input source of tv and/or turn on the tv.

Now, regarding developer control:

I understood, that when I call the method:

Method m2 = obj_HdmiControlManager.getClass().getMethod("getPlaybackClient");
         

I'm basically getting the access to CEC of the dongle itself (not the tv).

Though, I still continue to receive null when I run the method:

Method method_getTvClient = obj_HdmiControlManager.getClass().getMethod("getTvClient");

My guess here is that this is a normal behaviour since the dongle itself is a playback type and not a TV type.

So I tried to use the function sendVendorCommand but I was not able to figure out how to use it. I couldn't found any documentation/examples around this subject that could help me.

So I decided to go directly through OS level and it worked. Specifically in this dongle, you have at /sys/class/cec two important files:

. cmd (to send cec commands)

e.g. (as root @ android shell )

#turn on tv
echo 0x40 0x04 > /sys/class/cec/cmd

#change input source to HDMI 1
echo 0x4F 0x82 0x10 0x00 > /sys/class/cec/cmd

. dump_reg ( to read output of cec)

Use this site to check codes for other commands

And That's it! I would prefer to execute those commands through android framework, but at least, this works.

hio
  • 915
  • 8
  • 26
Eduardo Pinheiro
  • 3,409
  • 3
  • 30
  • 39
  • I tried to send raw commands from my device (amlogic 905x) to a tv but no luck. the commands seem to go nowhere. i found another file which when listed i can get info on the tv where the device is connected to. this is /sys/class/amhdmitx/amhdmitx0/edid. another file that is just writable (similar to /sys/class/cec/cmd) is /sys/class/amhdmitx/amhdmitx0/debug but sending same echo 0x40 0x04 to that file doesn't turn the tv on. Any suggestion on this matter? I'm out of inspiration.tks – orouwk Mar 24 '18 at 20:37
  • 1
    Please note that your hdmi cable may not support hdmi cec. Can you confirm that? Did you turned those global settings on? Do you see any output on the dump_reg? – Eduardo Pinheiro Mar 28 '18 at 10:16
  • root: yes i have elevated privileges on the device while doing the testing. cable: i'm not sure how should i check this but i'm able to read data from the tv set so i guess the cable is fine. is it possible that this motherboard is not build with hdmi cec hardware functionality? i have more details here: https://stackoverflow.com/questions/49488944/how-to-send-hdmi-cec-commands-from-amlogic-905x-board-to-the-tv-using-sysfs – orouwk Apr 21 '18 at 11:24
  • 1
    Are there any shell commands to send HDMI-CEC Commands in the rooted TV box to trigger the TV to switch from one source to other input source? Using Rooted Tv Box X96 – martinsaha May 30 '19 at 17:00
  • @whiletrue I am looking into the solution to sending CEC Commands from a rooted Android TV Box Application to a connected TV device. I am attempting to switch the TV input source from one source to another, I would also to try to adjust the volume in the TV and using rooted tv box x96 – martinsaha May 31 '19 at 17:52
  • Did you try to follow the steps of this answer? In the end, I've wrote some shell commands for your to try a change in the input source. There are some Tv's that you explicitly need to turn CEC on. There are some cheap hdmi cables that doesn't work. I would suggest you to try an existent app that makes use of CEC in that box and TV to make sure that your problem it's not hardware. – Eduardo Pinheiro Jun 02 '19 at 18:58
  • @whiletrue I tried shell command in rooted TV box and I don't see any output for cec in the logcat and in the connected TV. Could you please give name of the application which we can test the hardware problem. Is there any other way to send the CEC command to TV via HDMI cable. How to differentiate good r bad HDMI cable? – martinsaha Jun 03 '19 at 18:49
  • You can try install KODI and check if HDMI CEC works with it. It's hard to tell if the cable is ok or not by just looking into it, that's why the better option before you start to work on code/shell commands is to see if all your hardware setup works. – Eduardo Pinheiro Jun 04 '19 at 11:48
  • @Whiletrue I checked the KODI Application and don't find any peripherals device in it(System/Settings/System/Input Devices/Peripherals). Is this the way to check if the HDMI HAL CEC was implemented in the device or not? – martinsaha Jun 04 '19 at 16:01
  • @martinsaha I've created a chat room. Please go to: https://chat.stackoverflow.com/rooms/194480/hdmi-cec-on-android – Eduardo Pinheiro Jun 05 '19 at 11:01
  • 1
    Moving from chat to here. Glad that worked. To answer to your last 2 questions of the chat, visit this website: http://www.cec-o-matic.com/ You can see all commands there. Note that in this website you should transform e.g 0x40 0x04 into 40:04. You'll see that after you put that code on the textfield (after you click on the purple button on the right side), the website tells you exactly what that command does. You also can do the opposite. Select an option below, for example Supporting Features->Routing control->Request Active Source and click on the "up purple arrow" on the right side of it. – Eduardo Pinheiro Jun 05 '19 at 17:57
  • @Whiletrue Once again thanks for your help. Could you please help with new chat in chat room specified requests. – martinsaha Jun 06 '19 at 18:08
  • @Whiletrue Our requirement is to switch to the HDMI port in which the TV is connected with Android TV box. And Active Source command will trigger the device to switch the HDMI ports(We have requested earlier). To achieve the CEC for Active Source Command, we require a physical address of the device. Request for Physical Address by using the shell command - echo 0x40 0x83 > /sys/class/cec/cmd Could you please help us to define the "dump_reg" file and let us know what is the physical address in those files.Sharing two different TV response – martinsaha Jul 17 '19 at 13:02
  • dump_reg: A0_CECB_CLK_CNTL_REG0: 0xd02db2dc A0_CECB_CLK_CNTL_REG1: 0x0000a007 A0_CECB_GEN_CNTL:0x0000710a A0_CECB_RW_REG:0x0000001f A0_CECB_INTR_MASKN:0x0000001f AO_CECB_INTR_STAT:0x00000000 CEC MODULE REGS: CEC_CTRL:0x02 CEC_MASK:0x00 CEC_ADDR_L:0x10 CEC_ADDR_H:0x80 CEC_TX_CNT:0x04 CEC_RX_CNT:0x01 CEC_LOCK:0x00 CEC_WKUPCTRL:0x80 RX buffer:04 87 00 e0 91 00 00 00 00 00 00 00 00 00 00 00 TX buffer:4f 82 20 00 04 53 5f 56 33 31 31 00 00 00 00 00 – martinsaha Jul 17 '19 at 13:02
  • another dump_reg: A0_CECB_CLK_CNTL_REG0: 0xd02db2dc A0_CECB_CLK_CNTL_REG1: 0x0000a007 A0_CECB_GEN_CNTL:0x0000710a A0_CECB_RW_REG:0x0000001f A0_CECB_INTR_MASKN:0x0000001f AO_CECB_INTR_STAT:0x00000000 CEC MODULE REGS: CEC_CTRL:0x02 CEC_MASK:0x00 CEC_ADDR_L:0x10 CEC_ADDR_H:0x80 CEC_TX_CNT:0x02 CEC_RX_CNT:0x01 CEC_LOCK:0x00 CEC_WKUPCTRL:0x80 RX buffer:04 87 00 e0 91 00 00 00 00 00 00 00 00 00 00 00 TX buffer:40 8f 10 00 04 53 5f 56 33 31 31 00 00 00 00 00 – martinsaha Jul 17 '19 at 13:02
  • Look at the TX/RX buffer values. If you got to the website http://www.cec-o-matic.com/ and test "4f:82:20:00:04:53:5f:56:33:31:31" you will see the Physical Address. – Eduardo Pinheiro Jul 19 '19 at 12:30
  • @martinsaha how to send command from android to tv via hdmi can you share/suggest something !! – hio Oct 26 '20 at 05:48
  • @whiletrue now i can turn on/off volume up/down using command but i am not able to change input source to HDMI 1. do you have any suggestions ! – hio Nov 12 '20 at 14:11
  • i use echo 0x4F 0x82 0x10 0x00 > /sys/class/cec/cmd command but its not work in my case, – hio Nov 12 '20 at 14:58
  • Please be aware that you need to have CEC option turned on on you tv – Eduardo Pinheiro Nov 16 '20 at 10:34
  • Does any other command works? Like "echo 0x40 0x04 > /sys/class/cec/cmd" – Eduardo Pinheiro Nov 16 '20 at 10:37
  • yes turn tv on/off, volume up/down this commands are working properly but for port changing command is not work in my case. – hio Nov 24 '20 at 12:19
  • Go to the cec-o-matic.com website, write down this code under the textfield "4F:82:10:00" and click on the purple down arrow. You will see what that command does. Try to explore different commands there. Sorry I can't help you more than this. – Eduardo Pinheiro Nov 24 '20 at 19:23
  • @whiletrue ls -l /dev/cec return the below : ls: /dev/cec: No such file or directory – Malo Oct 24 '22 at 09:22
  • @whiletrue ls -l /dev/cec return the below : ls: /dev/cec: No such file or directory – Malo Oct 24 '22 at 09:23
  • @whiletrue mbox amlogic – Malo Oct 25 '22 at 07:41
  • can you check the room i created please? https://chat.stackoverflow.com/rooms/249006/room-for-malo-and-while-true – Malo Oct 25 '22 at 07:43
  • 1
    Sorry @Malo I don't play with cec for more than one year. I know that there are some devices that requires specific configuration to activate CEC. Try go to settings and check if CEC is enabled or eventually on your tv too. – Eduardo Pinheiro Oct 25 '22 at 07:45
  • it is on on both device and Samsung tv .. i am so confused why..i try another mbox and the command `echo 0x40 0x04 > /sys/class/cec/cmd` return `can't create /sys/class/cec/cmd: Permission denied` – Malo Oct 25 '22 at 07:47
  • 11: 0 12: 0 13: 0 14: 0 15: 0 CEC_RX_MSG_LENGTH: 0 CEC_RX_MSG_STATUS: 0 CEC_RX_NUM_MSG: 0 CEC_TX_MSG_STATUS: 0 CEC_TX_NUM_MSG: 0 this is another box and trying to get tail -f /sys/class/cec/dump_reg command result – Malo Oct 25 '22 at 07:48
  • Also how can i confirm if hdmi cable support cec ? how to use apps or how to do that? – Malo Oct 25 '22 at 08:00
  • @whiletrue it is necessary to have the mbox amlogic rooted to work with cec ?? or no need to make it rooted ? – Malo Oct 27 '22 at 07:53
  • @Malo or any one found proper solution that worked ? I have also raised one question with more details and some command and there output (https://stackoverflow.com/q/76635888/8078641) I just need to turn off tv using hdmi-cec command from Amlogic MBOX for that i use "echo 0x40 0x36 > /sys/class/cec/cmd" this command – Vishal Bhimporwala Jul 10 '23 at 05:02
  • Unfortonately i still didnt find any solution for this in most of my android box...what i did is i bought new android box with other type but it is more expensive... and what i found is that box have the hdmi cec working well without adding any command..just by turned on the option from settings..what i concluded is thah the problem is mot probably hardware problem try to chabging ur box – Malo Jul 11 '23 at 03:12
  • @Malo in which android device command worked perfectly ? can you give me that android device link ? – Vishal Bhimporwala Jul 12 '23 at 13:11
  • @Malo can you share your WhatsApp number or email address for help? – Vishal Bhimporwala Jul 12 '23 at 13:15
  • I suggest to open a room https://chat.stackoverflow.com/ instead of sharing personal info on behalf of privacy and specially the share of the knowledge for the community. – Eduardo Pinheiro Jul 13 '23 at 17:03
  • EduardoPinheiro can you tell me exactly which device or dongle stick will working with this all cec stuff ? @Malo can you also share the device details or device official purchase link? – Vishal Bhimporwala Jul 14 '23 at 13:29
  • Sorry, I don't remember. It was 5 years ago. I would suggest first to go with adb shell and try to exec commands like this - turn on tv: `echo 0x40 0x04 > /sys/class/cec/cmd`. Please read my answer to my own question since if I remember you need to run some commands before. – Eduardo Pinheiro Jul 20 '23 at 19:37
  • EduardoPinheiro I will already check all the things, but I doubt my device So I need some device links or details that confirm supporting CEC things. Can you suggest any devices for that? – Vishal Bhimporwala Jul 21 '23 at 13:29
  • @VishalBhimporwala sorry for my late reply if you have some problems with hdmi cec and the commands or the settings are not working then i insist to change the device it is most probably a hardware problem so dont waste your time..this is the name of the box which have the hdmi cec working well Qplove android tv box which have shape of hexagon – Malo Jul 24 '23 at 22:35
  • 1
    @Malo thanks for the help. [Check this link] (https://www.amazon.com/Android-Quadcore-Support-Multi-Lingual-Ethernet/dp/B0B8QNLML6) Are you use this one ? – Vishal Bhimporwala Jul 25 '23 at 09:45
  • 1
    @VishalBhimporwala yeah yeah exactly this one try it abosolutely it will work this is what happened to me and good luck – Malo Aug 03 '23 at 21:39