Detecting if HDMI input is currently the TV's selected source, using Raspberry PI

主宰稳场 提交于 2019-12-24 00:33:27

问题


I am using a RPi connected through HDMI to a Samsung TV. I am attempting to trigger RPi processes so that they are only active when the HDMI output is being used by the TV. Effectively, I would like to start the process when the correct HDMI input is selected from the TV and terminate it when another TV source is selected.

I have tried to use tvservice –s for that end, but the command’s output does not change depending on whether the TV is configured to use the RPi’s HDMI or any other source.

Therefore, I welcome suggestions on what other mechanisms could be used (e.g. low-level drivers, libCEC, xrandr) to determine if the TV is currently using the RPI’s HDMI.

Thanks!


回答1:


HDMI sink devices (like TVs) no longer break the HDMI “handshake” when switching sources. When HDMI was young, switching sources would take 3-6 seconds... generally with a black screen during the interim. TV consumers found this unacceptable, so manufacturers created inputs which were “always on.” This makes the connection appear to remain on even when switched.




回答2:


You may try "tvservice --name" I have tried without connecting display it replied with "[E] No device present" Maybe it replies with Name of Tv when connected.



来源:https://stackoverflow.com/questions/45558291/detecting-if-hdmi-input-is-currently-the-tvs-selected-source-using-raspberry-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!