问题
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
来源:https://stackoverflow.com/questions/49488944/how-to-send-hdmi-cec-commands-from-amlogic-905x-board-to-the-tv-using-sysfs