匿名
未登录
登录
百问网嵌入式Linux wiki
搜索
查看“CEC overview”的源代码
来自百问网嵌入式Linux wiki
名字空间
页面
讨论
更多
更多
页面选项
Read
查看源代码
历史
←
CEC overview
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
CEC (Consumer Electronics Control) provides enhanced functions to control devices connected through HDMI. As an example, it allows the control of a recorder through TV remote control. The CEC protocol is defined in the HDMI specification. == Purpose == The purpose of this article is to introduce the CEC framework: * General information * Main components/stakeholders * How to use the CEC framework * Use cases CEC is an HDMI feature designed to command and control devices connected through HDMI by using only one remote control. As an example, the remote control of a television set can be used to control a set-top box and a DVD player. Up to 15 devices can be controlled. CEC also allows individual CEC-enabled devices to command and control each other without user intervention.<ref>[https://en.wikipedia.org/wiki/Consumer_Electronics_Control Wikipedia article about CEC]</ref> ==CEC overview== [[File:CECOverview.png|link=]] ===Description of the main components=== ''From user space to hardware'' *'''CEC tools''' (User space) This component contains a set of useful tools to configure CEC features. It is hosted in v4l-utils <ref>[https://git.linuxtv.org/v4l-utils.git CEC tools source code]</ref>. *'''CEC core''' (Kernel space) CEC core is the standard Linux kernel CEC framework. It manages the CEC protocol. *'''stm32-cec''' (Kernel space) This is the ST CEC Linux driver that handles the CEC hardware block. *'''CEC''' (Hardware) This is ST microprocessor [[CEC internal peripheral|CEC]] hardware block. ===Description of the APIs=== The CEC kernel API is documented in the 'CEC kernel support' section of the Linux Kernel documentation<ref>[https://www.kernel.org/doc/html/latest/media/kapi/cec-core.html Linux CEC Kernel Support]</ref>. The CEC Userland API is documented in the 'Consumer Electronics Control API of v4l-utils documentation<ref>[https://www.linuxtv.org/downloads/v4l-dvb-apis-new/uapi/cec/cec-api.html CEC Userland API]</ref>. ==Configuration== By default, CEC is deactivated in ST deliveries. However, you can use Linux Menuconfig tool if a specific configuration is required: [[Menuconfig or how to configure kernel | Menuconfig or how to configure kernel ]] then select: <pre> [*] Device Drivers ---> [*] Multimedia support ---> [*] HDMI-CEC support [*] CEC platform devices ---> [*] STMicroelectronics STM32 HDMI-CEC driver </pre> == How to use CEC framework== cec-ctl and cec-compliance tools are hosted in CEC tools use space. To register a CEC device on CEC bus, set its type and physical address: <pre> {{Board$}} cec-ctl --tuner -p 1.0.0.0 Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x000000ef Physical Address Logical Addresses Transmit Passthrough Monitor All Driver version : 4.19.9 Available Logical Addresses: 4 Physical Address : 1.0.0.0 Logical Address Mask : 0x0008 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Tuner' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 3 (Tuner 1) Primary Device Type : Tuner Logical Address Type : Tuner All Device Types : Tuner RC TV Profile : None Device Features : None </pre> To debug and monitor CEC messages on bus, use the following command line: <pre> {{Board$}} cec-ctl -M Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x000000ef Physical Address Logical Addresses Transmit Passthrough Monitor All Driver version : 4.19.9 Available Logical Addresses: 4 Physical Address : 1.0.0.0 Logical Address Mask : 0x0008 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Tuner' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 3 (Tuner 1) Primary Device Type : Tuner Logical Address Type : Tuner All Device Types : Tuner RC TV Profile : None Device Features : None Initial Event: State Change: PA: 1.0.0.0, LA mask: 0x000 </pre> Run CEC compliance to check CEC bus typology: <pre> {{Board$}} cec-compliance -A cec-compliance SHA : not available Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x000000ef Physical Address Logical Addresses Transmit Passthrough Monitor All Driver version : 4.19.9 Available Logical Addresses: 4 Physical Address : 1.0.0.0 Logical Address Mask : 0x0008 CEC Version : 2.0 Vendor ID : 0x000c03 Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 3 Primary Device Type : Tuner Logical Address Type : Tuner All Device Types : Tuner RC TV Profile : None Device Features : None Compliance test for device /dev/cec0: The test results mean the following: OK Supported correctly by the device. OK (Not Supported) Not supported and not mandatory for the device. OK (Presumed) Presumably supported. Manually check to confirm. OK (Unexpected) Supported correctly but is not expected to be supported for this device. OK (Refused) Supported by the device, but was refused. FAIL Failed and was expected to be supported by this device. Find remote devices: Polling: OK CEC API: CEC_ADAP_G_CAPS: OK CEC_DQEVENT: OK CEC_ADAP_G/S_PHYS_ADDR: OK CEC_ADAP_G/S_LOG_ADDRS: OK CEC_TRANSMIT: OK CEC_RECEIVE: OK CEC_TRANSMIT/RECEIVE (non-blocking): OK (Presumed) CEC_G/S_MODE: OK CEC_EVENT_LOST_MSGS: OK Network topology: System Information for device 0 (TV) from device 3 (Tuner 1): CEC Version : 1.4 Physical Address : 0.0.0.0 Primary Device Type : TV Vendor ID : 0x00903e OSD Name : 'TV' Menu Language : fre Power Status : On Total: 10, Succeeded: 10, Failed: 0, Warnings: 0 </pre> Send a string to OSD: <pre> {{Board$}} cec-ctl --set-osd-string=disp-ctl=0x00,osd="hello" --to tv Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x000000ef Physical Address Logical Addresses Transmit Passthrough Monitor All Driver version : 4.19.9 Available Logical Addresses: 4 Physical Address : 1.0.0.0 Logical Address Mask : 0x0008 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Tuner' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 3 (Tuner 1) Primary Device Type : Tuner Logical Address Type : Tuner All Device Types : Tuner RC TV Profile : None Device Features : None Transmit from Tuner 1 to TV (3 to 0): CEC_MSG_SET_OSD_STRING (0x64): disp-ctl: default (0x00) osd: hello Sequence: 347 Tx Timestamp: 2626.350s </pre> Get topology: <pre> {{Board$}} cec-ctl -S Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x000000ef Physical Address Logical Addresses Transmit Passthrough Monitor All Driver version : 4.19.9 Available Logical Addresses: 4 Physical Address : 1.0.0.0 Logical Address Mask : 0x0008 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Tuner' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 3 (Tuner 1) Primary Device Type : Tuner Logical Address Type : Tuner All Device Types : Tuner RC TV Profile : None Device Features : None System Information for device 0 (TV) from device 3 (Tuner 1): CEC Version : 1.4 Physical Address : 0.0.0.0 Primary Device Type : TV Vendor ID : 0x00903e (Philips) OSD Name : TV Menu Language : fre Power Status : On Topology: 0.0.0.0: TV 1.0.0.0: Tuner 1 </pre> Send a standby message to a tv: <pre> {{Board$}} cec-ctl --standby --to tv Driver Info: Driver Name : stm32-cec Adapter Name : stm32-cec Capabilities : 0x000000ef Physical Address Logical Addresses Transmit Passthrough Monitor All Driver version : 4.19.9 Available Logical Addresses: 4 Physical Address : 1.0.0.0 Logical Address Mask : 0x0008 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Tuner' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 3 (Tuner 1) Primary Device Type : Tuner Logical Address Type : Tuner All Device Types : Tuner RC TV Profile : None Device Features : None Transmit from Tuner 1 to TV (3 to 0): CEC_MSG_STANDBY (0x36) Sequence: 371 Tx Timestamp: 2747.236s </pre> == Use cases== Appplications must be added/developped in userland to support all the use cases related to CEC (eg recorder controled by TV remote control) .<br> {{ReviewsComments|This new paragraph section added in Framework overview template, to be completed {{=}}{{=}}How to trace and debug the framework{{=}}{{=}} {{=}}{{=}}{{=}}How to monitor{{=}}{{=}}{{=}} Please give instruction to help developer/user to get information about this framework in the Linux file system: {{=}}{{=}}{{=}}{{=}}How to monitor with debugfs{{=}}{{=}}{{=}}{{=}} {{=}}{{=}}{{=}}{{=}}Other ways to monitor{{=}}{{=}}{{=}}{{=}} ... '''Up to framework owner to add any relevant other ways to monitor the framework, e.g. Device entry''' {{=}}{{=}}{{=}}How to trace{{=}}{{=}}{{=}} Please give instruction to help developer/user for getting trace(s)via : * dynamic debug if exist, * specific log files if exist, * dmesg output information, *... '''Up to framework owner to add any relevant other ways to trace the framework''' {{=}}{{=}}{{=}}How to debug{{=}}{{=}}{{=}} Please give instruction to help developer/user for debugging this framework : * with specific debug configuration, * in case of specific use cases debug, * ... '''Up to framework owner to add any relevant other ways to debug the framework''' }} ==Generic source code location== *{{CodeSource | Linux kernel | drivers/media/cec | CEC core}} *{{CodeSource | Linux kernel | include/uapi/linux/cec.h | CEC API}} *{{CodeSource | Linux kernel | drivers/media/platform/stm32/stm32-cec.c | stm32 CEC driver}} ==References== <references /> <noinclude> {{ArticleBasedOnModel | Framework overview article model}} {{PublicationRequestId | 4962 | 2017-10-18 | AnneJ}} [[Category:CEC]] {{ReviewsComments|JCT 1840: alignment needed with the last version of the model<br> [[Category:ToBeAlignedWithModel]] }} </noinclude>
该页面使用的模板:
模板:=
(
查看源代码
)
模板:ArticleBasedOnModel
(
查看源代码
)
模板:CodeSource
(
查看源代码
)
模板:PublicationRequestId
(
查看源代码
)
模板:ReviewsComments
(
查看源代码
)
返回至
CEC overview
。
导航
导航
WIKI首页
官方店铺
资料下载
交流社区
所有页面
所有产品
MPU-Linux开发板
MCU-单片机开发板
Linux开发系列视频
单片机开发系列视频
所有模块配件
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志