在linux上获取已连接电视的电源状态
I'm currently trying to turn my display off and on when I leave / enter the house.
我正在试图在我离开/进入房子时关掉我的显示器。
I'm running an Ubuntu HTPC which is connected to a Samsung TV by HDMI (Intel HD4600). Using 'xset dmesq ...' results in switching the HDMI output off/on and doesn't change the power status of the TV (it just looses the signal). Therefore I connected an IR transmitter which is able to turn the tv off or on - sadly both commands are using the same IR code, resulting in the power status to tip over.
我正在运行一个Ubuntu HTPC,它通过HDMI(Intel HD4600)连接到三星电视。使用'xset dmesq ...'会导致HDMI输出关闭/打开,并且不会改变电视的电源状态(它只是丢失了信号)。因此,我连接了一个能够关闭或打开电视的红外发射器 - 遗憾的是两个命令都使用相同的红外代码,导致电源状态翻倒。
The xset status also doesn't return the right status, it's always seen as "On", regardless of the power status:
xset状态也不会返回正确的状态,无论电源状态如何,它始终显示为“On”:
<hashworks:~> DISPLAY=:0 xset q | grep 'Monitor is'
Monitor is On
I could save the last display status, but this will result in wrong values when I turn the TV off using the remote etc. The IR transmitter isn't getting anything back as well.
我可以保存最后的显示状态,但是当我使用遥控器等关闭电视时,这将导致错误的值。红外线发射器也没有得到任何回复。
Is there any other way to check the current status?
有没有其他方法来检查当前状态?
1 个解决方案
#1
1
It sounds like what you need is CEC.
听起来你需要的是CEC。
This thread ("Turn on / off TV via HDMI CEC") appears informative:
此线程(“通过HDMI CEC打开/关闭电视”)显示信息:
http://www.raspberrypi.org/forums/viewtopic.php?f=35&t=15749
更多相关文章
- linux获取网线插拔状态的实现
- mysql--查看mysql状态的常用命令
- 查看 SQL Server 作业(job)运行结果状态脚本
- mysql主从状态异常解决办法
- App在自己界面奔溃回到首页,状态栏沉浸式消失bug
- Android监控WIFI和GSM状态并绘制网络强度
- Java线程的生命周期和状态控制
- . io .IOException:setDataSource失败了。:状态= 0 x80000000
- fragment 状态保存时怎么执行一些需要在onResume、onPause方法里