How to send HDMI-CEC commands from Amlogic 905x board to the TV using sysfs
Asked Answered
M

1

3

I want to send raw HDMI-CEC commands (adb shell) from an Amlogic 905x ARM board (Android 6) to test the functionality. The board is rooted (tested, 'adb root' works) and connected to a TV with CEC capabilities (enabled, tested with video game console too).

First of all I want to clarify if the core functionality is built in, so I guess that if the right CEC command is sent to the right channel, I should notice a change of any kind to the TV set.

I want to test it at a lower abstraction level (sysfs i guess is ok and http://www.cec-o-matic.com/ is pretty straightforward on how to build the command strings) to avoid the complexity of a system library as of this step.

I noticed that some guys had positive results on turning the TV on, by using:

#echo 0x40 0x04 > /sys/class/cec/cmd

It didn't work on my end.

I think that I might have a different class file allocated for this purpose and I found '/sys/class/amhdmitx/amhdmitx0' which has a lot of endpoints/files that offers IO capabilities.

I got back from the device the details of the TV set connected to (EDID - Extended Display Identification Data), by using:

#cat /sys/class/amhdmitx/amhdmitx0/edid

That means there has to be a way to send commands to the TV too, like turning the TV on/off, changing source ...

Tried by sending to debug file because there is no cmd file available like in '/sys/class/cec/cmd':

#echo 0x40 0x04 > /sys/class/amhdmitx/amhdmitx0/debug

Does anyone know how can I do this, to test the sending procedure (device)-->(TV)?

Why there is no activity on the TV when using '/sys/class/cec/cmd'?

Which is the right file to use to send hex data to the TV?

The result of

cat /system/build.prop |grep hdmi && ls -l /dev/cec && ls -laht /sys/class/cec/ && settings list global |grep hdmi && echo 0x40 0x04 > /sys/class/cec/cmd && sleep 0.1 && cat /sys/class/cec/dump_reg && sleep 1 && cat /sys/class/cec/dump_reg

is

ro.sys.hdmiin.enable=true
mbx.hdmiin.switchfull=false
mbx.hdmiin.videolayer=false
ubootenv.var.hdmimode=
ro.hdmi.device_type=4
persist.sys.hdmi.keep_awake=false
crw-rw-rw- root     root     222,   0 2014-12-31 16:00 cec
-r--r--r-- root     root         4096 2018-05-08 08:47 arc_port
lrwxrwxrwx root     root              2018-05-08 08:47 cec -> ../../devices/aocec/cec
--w------- root     root         4096 2018-05-08 08:47 cmd
-rw-rw-r-- root     root         4096 2018-05-08 08:47 dbg_en
-rw-rw-r-- root     root         4096 2018-05-08 08:47 device_type
-r--r--r-- root     root         4096 2018-05-08 08:47 dump_reg
-rw-rw-r-- root     root         4096 2018-05-08 08:47 fun_cfg
-rw-rw-r-- root     root         4096 2018-05-08 08:47 menu_language
-r--r--r-- root     root         4096 2018-05-08 08:47 osd_name
-rw-rw-r-- root     root         4096 2018-05-08 08:47 physical_addr
-r--r--r-- root     root         4096 2018-05-08 08:47 port_num
-r--r--r-- root     root         4096 2018-05-08 08:47 port_seq
-r--r--r-- root     root         4096 2018-05-08 08:47 port_status
-rw-rw-r-- root     root         4096 2018-05-08 08:47 vendor_id
-r--r--r-- root     root         4096 2018-05-08 08:47 wake_up
Meadows answered 26/3, 2018 at 10:11 Comment(8)
Can you please share the result of: cat /system/build.prop |grep hdmi && ls -l /dev/cec && ls -laht /sys/class/cec/ && settings list global |grep hdmi && echo 0x40 0x04 > /sys/class/cec/cmd && sleep 0.1 && cat /sys/class/cec/dump_reg && sleep 1 && cat /sys/class/cec/dump_regForta
i've edited my question with the info you requested. tks for your help and sorry for the delayMeadows
please confirm that you've added all output cause I'm not seeing the file dump_reg neither the output of it. thanksForta
i've got an error at some point saying that ls -h and -t is not recognized and i had to delete them to get that output. basically I dumped everything to a file and copy/paste from there. that's the entire output i gotMeadows
@whiletrue i need your help about cec i had execute that command and having resultsEichman
I'm not with this in hands anymore but I can try to help you. Let me know what are the commands, results and your question. You can also post a new question on stackoverflow and point me to there, if you want to write with more detail.Forta
@whiletrue can u share/suggest something that can help me for how to pass commands from android tv box to tv via hdmi-cec to turn on/off tv.Glossographer
Did you check this https://mcmap.net/q/878546/-hdmi-cec-on-android/… ?Forta
B
1

Are you simply missing how to write to file? It is

echo "0x40 0x04" > /sys/class/cec/cmd

That works for me on s905x3 unit.

Bimestrial answered 7/9, 2022 at 21:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.