Android - 将HDMI CEC命令发送到电视 - minix - libCEC [英] Android - send HDMI CEC commands to TV - minix - libCEC

查看:557
本文介绍了Android - 将HDMI CEC命令发送到电视 - minix - libCEC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Minix NEO X8-H(Android媒体中心,4.4.2),我需要向电视发送HDMI-CEC命令:当我的应用程序接到电话时,我想自动将电视源更改为Minix hdmi源码。

i'm working on a Minix NEO X8-H (Android media center, 4.4.2) and i need to send HDMI-CEC command to TV: when my App receives a call i want to change automatically the TV Source to the Minix hdmi source.

实际上,Minix提供了一些启用HDMI-CEC的选项,据报道媒体中心软件XBMC支持CEC。但我只想在接收模式中:用户可以使用电视遥控器命令Android设备。我想以相反的方式工作。我浏览了XBMC的源代码,我发现了非常有趣的代码,但不知道它是否对我有用。

Actually the Minix offer some options to enable HDMI-CEC and the media center software XBMC is reported to support CEC. But only in "receive mode" i guess: the user can command the Android device using TV remote. I want to work the opposite way. I browse XBMC's source code and i found very interesting code but do not know if it can be useful to me.

我发现获得HDMI-CEC输入命令的串行设备

I found the serial device that get HDMI-CEC input commands

/dev/input/event7

内核引用位于:/ sys / devices / virtual / input / input7 /

The kernel references are placed at: "/sys/devices/virtual/input/input7/"

# cat /sys/devices/virtual/input/input7/name
cec_input

这是dmesg日志的一部分:

This is a part of dmesg log:


http://pastebin.com/raw.php?i=A5dE3qLu



<5>[    0.000000@0] Kernel command line: init=/init console=ttyS0,115200n8 no_console_suspend storage=5 cvbsdrv=0 vdaccfg=0xa007 logo=osd1,loaded,0x15100000,4k2ksmpte,full hdmimode=4k2ksmpte cvbsmode=576cvbs androidboot.firstboot=0 hdmitx=cec0
<4>[    0.000000@0] kernel get hdmimode form uboot is 4k2ksmpte
<4>[    0.000000@0] hdmitx: cec: Function List: disable, , , 
<4>[    0.000000@0] hdmitx: cec: HDMI aml_read_reg32(P_AO_DEBUG_REG0):0x0
<4>[    0.000000@0] hdmitx: cec: HDMI hdmi_cec_func_config:0x0
<4>[    1.392440@1] hdmitx: cec: CEC not ready
<4>[    4.872752@0] hdmitx: cec: CEC init
<4>[    4.876194@1] hdmitx: cec: CEC task process
<4>[    4.876398@0] hdmitx: cec: hdmitx_device->cec_init_ready:0x1

证明了HDMI-CEC内置支持的有效存在。

that proves the effective presence of HDMI-CEC built-in support.

我找到了 libCEC ,我设法使用Android NDK工具链进行交叉编译,我能够安装 libcec.so和一个演示客户端二进制文件cec-client到Minix上。

I found libCEC and i managed to cross-compile it using Android NDK toolchain and i was able to install "libcec.so" and a demo client binary "cec-client" onto the Minix.

这些是构建选项:

asd@vm-ubuntu:~/Desktop/libcec/libcec-master/build$ cmake ..
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
-- Could NOT find SWIG (missing:  SWIG_EXECUTABLE SWIG_DIR)
-- Configured features:
-- Pulse-Eight CEC Adapter:                no
-- Pulse-Eight CEC Adapter detection:      no
-- lockdev support:                        no
-- xrandr support:                         no
-- Raspberry Pi support:                   no
-- TDA995x support:                        no
-- Exynos support:                         no
-- Python support:                         no
-- lib info: compiled on Linux-3.13.0-35-generic, features: P8_USB
-- Configuring done
-- Generating done
-- Build files have been written to: /home/asd/Desktop/libcec/libcec-master/build

我知道libcec可以与外部hdmi-cec控制器配合使用,或者,如果使用Raspberry支持功能构建,它可以使用集成视频在raspi上顺利运行控制器。

I know that libcec works with an external hdmi-cec controller or, if build with Raspberry support feature it can runs smoothly on a raspi, using its integrated video controller.

如果它可以在raspi上运行,它必须能够在Minix上运行,我想。

If it can run on raspi it must be able to run on a Minix, i guess.

cec-client是一个演示客户端,开发用于与串行接口通信,实际上由于某些错误它无法与/ dev / input / evet7通信:

The cec-client was a demo client, developed to communicate with a serial interface and actually it can not communicate with /dev/input/evet7 because of some errors:

root@NEO-X8:/data # cec-client -t p -p 4 /dev/input/event7                    
== using device type 'playback device'
using HDMI port '4'
CEC Parser created - libCEC version 3.0.0
opening a connection to the CEC adapter...
DEBUG:   [               7]     Broadcast (F): osd name set to 'Broadcast'
ERROR:   [            3520]     error opening serial port '/dev/input/event7': Invalid argument
ERROR:   [            3521]     could not open a connection (try 1)
ERROR:   [            6355]     error opening serial port '/dev/input/event7': Too many open files
ERROR:   [            6355]     could not open a connection (try 2)
ERROR:   [            8243]     error opening serial port '/dev/input/event7': Too many open files
ERROR:   [            8243]     could not open a connection (try 3)
ERROR:   [            9501]     error opening serial port '/dev/input/event7': Too many open files
ERROR:   [            9501]     could not open a connection (try 4)
unable to open the device on port /dev/input/event7
NOTICE:  [           10506]     connection opened

但AFAIK Hdmi-CEC使用了串行通信协议使用HDMI连接器的引脚13,所以即使cec-client是一个演示客户端,它也必须能够正常工作!如您所见,锁定设备或类似设备时出现问题。

But AFAIK Hdmi-CEC use a serial communication protocol using pin 13 of the HDMI connector so even if "cec-client" is a demo client it must be able to work properly! As you see there is a problem on locking the device or something similar.

问题:


  • 可以通过Android使用Java发送CEC命令吗?

  • 如果没有,有人知道如何调整libCEC / cec-client以使用Minix吗?

如果Java方式不可能没有问题:我自己的应用程序是使用Qt构建的,实际上我已经使用了几个本机共享库.so

If Java way is not possible there are no problems: my own app is built using Qt and actually i'm already using a couple of native shared librare ".so"

任何人都有提示?如何实现?

Anyone has tips? How can accomplish that?

推荐答案

首先,非常令人印象深刻的逆向工程工作!

First of all, very impressive reverse engineering work!

其次,我面临类似的问题(但是使用非Minix产品)。您是否尝试升级到较新的固件,例如:

Secondly, I'm facing a similar issue (but with a non Minix product). Have you tried upgrading to a newer firmware, such as this one:

http://minixforum.com/threads/x8-x8-plus-x8-h-official -firmware-004a-not-for-x8-h-plus.5567 /

我建议这是一个可能的解决方案,因为其中一个问题它解决了这个问题:

I am suggesting this as a possible solution, because one of the issues it fixes is this:

修复了HDMI-CEC多设备问题

Fixed HDMI-CEC multi devices issues

这意味着该设备不仅仅是一个slave,但也是master(即可以向其他hdmi设备发送命令)。

This means the device is not only a "slave", but also a "master" (i.e. can send commands to other hdmi devices).

请注意,如链接中所述,它不适用于加号。

Please note that as stated in the link, it is not intended for the plus version.

祝你好运!

这篇关于Android - 将HDMI CEC命令发送到电视 - minix - libCEC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆