Regarding the HDMI CEC, here is a log excerpt;
# logcat | grep -i cec
07-04 09:55:13.871 255 275 D hdmicec : poll revent:02
07-04 09:55:13.872 255 275 I hdmicec : poll receive event
07-04 09:55:13.872 255 275 D hdmicec : event:1
07-04 09:55:13.872 255 275 D hdmicec : adapt state change,phy_addr:ffff,flags:2
07-04 09:55:13.892 255 275 D hdmicec : poll revent:02
07-04 09:55:13.892 255 275 I hdmicec : poll receive event
07-04 09:55:13.892 255 275 D hdmicec : event:5
07-04 09:55:13.892 255 275 I hdmicec : CEC_EVENT_PIN_HPD_LOW
07-04 09:55:14.906 258 1132 D RKATVAudioPolicyManager: setDeviceConnectionState() this= 0xf2ef2000, device: 0x400, state 0, address name
07-04 09:55:22.230 255 275 D hdmicec : poll revent:02
07-04 09:55:22.230 255 275 I hdmicec : poll receive event
07-04 09:55:22.230 255 275 D hdmicec : event:6
07-04 09:55:22.230 255 275 I hdmicec : CEC_EVENT_PIN_HPD_HIGH
07-04 09:55:22.234 255 255 I hdmicec : hdmi_cec_clear_logical_address
07-04 09:55:22.234 255 275 D hdmicec : poll revent:02
07-04 09:55:22.234 255 275 I hdmicec : poll receive event
07-04 09:55:22.234 255 275 D hdmicec : event:1
07-04 09:55:22.234 255 275 D hdmicec : adapt state change,phy_addr:ffff,flags:0
07-04 09:55:22.234 255 255 D hdmicec : kernel logic addr:ff, preferred logic addr:04
07-04 09:55:22.235 255 255 I hdmicec : kernel logaddr is not existing
07-04 09:55:22.235 255 255 D hdmicec : set_kernel_logical_address, logic addr:04
07-04 09:55:22.235 255 255 I hdmicec : primary_device_type:04,log_addr_type:03,log_addr[0]:ff
07-04 09:55:22.235 255 255 E hdmicec : phy addr not ready
07-04 09:55:22.242 258 258 D RKATVAudioPolicyManager: setDeviceConnectionState() this= 0xf2ef2000, device: 0x400, state 1, address name
07-04 09:55:22.435 255 255 E hdmicec : phy addr not ready
07-04 09:55:22.447 255 275 D hdmicec : poll revent:02
07-04 09:55:22.447 255 275 I hdmicec : poll receive event
07-04 09:55:22.447 255 275 D hdmicec : event:1
07-04 09:55:22.447 255 275 D hdmicec : adapt state change,phy_addr:2000,flags:0
07-04 09:55:22.476 255 275 D hdmicec : poll revent:02
07-04 09:55:22.476 255 275 I hdmicec : poll receive event
07-04 09:55:22.476 255 275 D hdmicec : event:1
07-04 09:55:22.476 255 275 D hdmicec : adapt state change,phy_addr:2000,flags:0
07-04 09:55:22.567 460 460 I HdmiCecLocalDevice: Not ready to start action. Queued for deferred start:com.android.server.hdmi.DevicePowerStatusAction@66f7e18
07-04 09:55:22.636 255 255 D hdmicec : kernel logic addr:04, preferred logic addr:04
07-04 09:55:22.636 255 255 I hdmicec : kernel logaddr is existing
07-04 09:55:22.636 255 255 I hdmicec : kernel logaddr is preferred logaddr
07-04 09:55:22.636 255 255 D hdmicec : kernel logic addr:04, preferred logic addr:04
07-04 09:55:22.637 255 255 I hdmicec : kernel logaddr is existing
07-04 09:55:22.637 255 255 I hdmicec : kernel logaddr is preferred logaddr
07-04 09:55:22.637 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:22.638 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:22.638 255 255 I hdmicec : hdmi_cec_get_vendor_id
07-04 09:55:22.639 255 255 D hdmicec : set_kernel_logical_address, logic addr:04
07-04 09:55:22.639 255 255 I hdmicec : primary_device_type:04,log_addr_type:03,log_addr[0]:04
07-04 09:55:22.639 255 255 D hdmicec : LA is existing, not need to set logic addr
07-04 09:55:22.639 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:22.640 255 255 I hdmicec : hdmi_cec_get_vendor_id
07-04 09:55:22.640 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:22.640 255 255 I hdmicec : send msg LEN:5,opcode:84,addr:4f
07-04 09:55:22.640 460 460 I HdmiCecLocalDevice: Starting queued action:com.android.server.hdmi.DevicePowerStatusAction@66f7e18
07-04 09:55:22.768 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:22.768 255 255 I hdmicec : send msg LEN:5,opcode:87,addr:4f
07-04 09:55:22.896 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:22.896 255 255 I hdmicec : send msg LEN:4,opcode:82,addr:4f
07-04 09:55:22.999 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:23.000 255 255 I hdmicec : send msg LEN:2,opcode:0d,addr:40
07-04 09:55:23.029 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:23.330 255 255 I hdmicec : send msg LEN:2,opcode:0d,addr:40
07-04 09:55:23.359 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:23.659 460 571 W HdmiCecController: Failed to send <Text View On> src: 4, dst: 0 with errorCode=1
07-04 09:55:23.660 255 255 I hdmicec : send msg LEN:2,opcode:8f,addr:40
07-04 09:55:23.690 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:23.991 255 255 I hdmicec : send msg LEN:2,opcode:8f,addr:40
07-04 09:55:24.020 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:24.321 460 571 W HdmiCecController: Failed to send <Give Device Power Status> src: 4, dst: 0 with errorCode=1
07-04 09:55:26.511 255 275 D hdmicec : poll revent:02
07-04 09:55:26.511 255 275 I hdmicec : poll receive event
07-04 09:55:26.512 255 275 D hdmicec : event:1
07-04 09:55:26.512 255 275 D hdmicec : adapt state change,phy_addr:ffff,flags:2
07-04 09:55:26.535 255 275 D hdmicec : poll revent:02
07-04 09:55:26.535 255 275 I hdmicec : poll receive event
07-04 09:55:26.535 255 275 D hdmicec : event:5
07-04 09:55:26.535 255 275 I hdmicec : CEC_EVENT_PIN_HPD_LOW
07-04 09:55:27.299 255 275 D hdmicec : poll revent:02
07-04 09:55:27.299 255 275 I hdmicec : poll receive event
07-04 09:55:27.299 255 275 D hdmicec : event:6
07-04 09:55:27.299 255 275 I hdmicec : CEC_EVENT_PIN_HPD_HIGH
07-04 09:55:27.300 255 255 I hdmicec : hdmi_cec_clear_logical_address
07-04 09:55:27.300 255 275 D hdmicec : poll revent:02
07-04 09:55:27.300 255 275 I hdmicec : poll receive event
07-04 09:55:27.300 255 275 D hdmicec : event:1
07-04 09:55:27.300 255 275 D hdmicec : adapt state change,phy_addr:ffff,flags:0
07-04 09:55:27.301 255 255 D hdmicec : kernel logic addr:ff, preferred logic addr:04
07-04 09:55:27.301 255 255 I hdmicec : kernel logaddr is not existing
07-04 09:55:27.301 255 255 D hdmicec : set_kernel_logical_address, logic addr:04
07-04 09:55:27.301 255 255 I hdmicec : primary_device_type:04,log_addr_type:03,log_addr[0]:ff
07-04 09:55:27.301 255 255 E hdmicec : phy addr not ready
07-04 09:55:27.501 255 255 E hdmicec : phy addr not ready
07-04 09:55:27.540 258 290 D RKATVAudioPolicyManager: setDeviceConnectionState() this= 0xf2ef2000, device: 0x400, state 0, address name
07-04 09:55:27.578 258 290 D RKATVAudioPolicyManager: setDeviceConnectionState() this= 0xf2ef2000, device: 0x400, state 1, address name
07-04 09:55:27.701 255 255 E hdmicec : phy addr not ready
07-04 09:55:27.902 255 255 E hdmicec : phy addr not ready
07-04 09:55:27.968 255 275 D hdmicec : poll revent:02
07-04 09:55:27.968 255 275 I hdmicec : poll receive event
07-04 09:55:27.968 255 275 D hdmicec : event:1
07-04 09:55:27.968 255 275 D hdmicec : adapt state change,phy_addr:2000,flags:0
07-04 09:55:27.998 255 275 D hdmicec : poll revent:02
07-04 09:55:27.999 255 275 I hdmicec : poll receive event
07-04 09:55:27.999 255 275 D hdmicec : event:1
07-04 09:55:27.999 255 275 D hdmicec : adapt state change,phy_addr:2000,flags:0
07-04 09:55:28.070 460 460 I HdmiCecLocalDevice: Not ready to start action. Queued for deferred start:com.android.server.hdmi.DevicePowerStatusAction@4743071
07-04 09:55:28.102 255 255 D hdmicec : kernel logic addr:04, preferred logic addr:04
07-04 09:55:28.102 255 255 I hdmicec : kernel logaddr is existing
07-04 09:55:28.102 255 255 I hdmicec : kernel logaddr is preferred logaddr
07-04 09:55:28.102 255 255 D hdmicec : kernel logic addr:04, preferred logic addr:04
07-04 09:55:28.102 255 255 I hdmicec : kernel logaddr is existing
07-04 09:55:28.102 255 255 I hdmicec : kernel logaddr is preferred logaddr
07-04 09:55:28.103 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:28.103 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:28.103 255 255 I hdmicec : hdmi_cec_get_vendor_id
07-04 09:55:28.103 255 255 D hdmicec : set_kernel_logical_address, logic addr:04
07-04 09:55:28.103 255 255 I hdmicec : primary_device_type:04,log_addr_type:03,log_addr[0]:04
07-04 09:55:28.103 255 255 D hdmicec : LA is existing, not need to set logic addr
07-04 09:55:28.104 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:28.104 255 255 I hdmicec : hdmi_cec_get_vendor_id
07-04 09:55:28.104 255 255 I hdmicec : send msg LEN:5,opcode:84,addr:4f
07-04 09:55:28.252 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:28.253 255 255 I hdmicec : hdmi_cec_get_physical_address val = 2000
07-04 09:55:28.253 255 255 I hdmicec : send msg LEN:5,opcode:87,addr:4f
07-04 09:55:28.253 460 460 I HdmiCecLocalDevice: Starting queued action:com.android.server.hdmi.DevicePowerStatusAction@4743071
07-04 09:55:28.260 460 460 W Looper : Slow dispatch took 157ms main h=android.os.Handler c=com.android.server.hdmi.HdmiCecController$4@7ea63c4 m=0
07-04 09:55:28.380 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:28.381 255 255 I hdmicec : send msg LEN:4,opcode:82,addr:4f
07-04 09:55:28.484 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:28.485 255 255 I hdmicec : send msg LEN:2,opcode:0d,addr:40
07-04 09:55:28.514 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:28.815 255 255 I hdmicec : send msg LEN:2,opcode:0d,addr:40
07-04 09:55:28.844 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:29.145 460 571 W HdmiCecController: Failed to send <Text View On> src: 4, dst: 0 with errorCode=1
07-04 09:55:29.146 255 255 I hdmicec : send msg LEN:2,opcode:8f,addr:40
07-04 09:55:29.175 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:29.476 255 255 I hdmicec : send msg LEN:2,opcode:8f,addr:40
07-04 09:55:29.505 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:29.806 460 571 W HdmiCecController: Failed to send <Give Device Power Status> src: 4, dst: 0 with errorCode=1
The interesting lines are the ones with “send msg”, and the results of them.
# logcat | grep -i cec | grep "send msg" -A3
07-04 09:55:22.640 255 255 I hdmicec : send msg LEN:5,opcode:84,addr:4f
07-04 09:55:22.640 460 460 I HdmiCecLocalDevice: Starting queued action:com.android.server.hdmi.DevicePowerStatusAction@66f7e18
07-04 09:55:22.768 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:22.768 255 255 I hdmicec : send msg LEN:5,opcode:87,addr:4f
07-04 09:55:22.896 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:22.896 255 255 I hdmicec : send msg LEN:4,opcode:82,addr:4f
07-04 09:55:22.999 255 255 E hdmicec : HDMI_RESULT_SUCCESS
07-04 09:55:23.000 255 255 I hdmicec : send msg LEN:2,opcode:0d,addr:40
07-04 09:55:23.029 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:23.330 255 255 I hdmicec : send msg LEN:2,opcode:0d,addr:40
07-04 09:55:23.359 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:23.659 460 571 W HdmiCecController: Failed to send <Text View On> src: 4, dst: 0 with errorCode=1
07-04 09:55:23.660 255 255 I hdmicec : send msg LEN:2,opcode:8f,addr:40
07-04 09:55:23.690 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:23.991 255 255 I hdmicec : send msg LEN:2,opcode:8f,addr:40
07-04 09:55:24.020 255 255 E hdmicec : HDMI_RESULT_NACK
07-04 09:55:24.321 460 571 W HdmiCecController: Failed to send <Give Device Power Status> src: 4, dst: 0 with errorCode=1
07-04 09:55:26.511 255 275 D hdmicec : poll revent:02