Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5320

Troubleshooting • libcec-utils Switch HDMI TV On Active Source RPi4 vc4-kms-v3d

$
0
0
The follow script switches my tv on and to hdmi x default 1

/usr/local/bin/hdmi

Code:

#!/bin/shlock=/run/lock/hdmi.lockhdmi() { { echo p /dev/cec0 ${1:-1};echo on 0;echo as;} |         timeout 9 cec-client -d 1 -t p /dev/cec0       ; } ! [ -d $(dirname "$lock") ]   &&   hdmi $1   ||(  # Wait for lock on fd 9 for 1 second  flock -x -w 1 9 || { echo hdmi in use; exit 9; }  hdmi $1) 9>$lockrm -f $lock

Code:

 sudo apt-get install cec-utils sudo chmod a+rx /usr/local/bin/hdmi

Statistics: Posted by iwl — Wed Feb 28, 2024 10:53 am



Viewing all articles
Browse latest Browse all 5320

Trending Articles