Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set active source to TV with cec-client

I have cec-client running on my raspberry pi, and I'm able to switch between active sources HDMI 1 - 4 on my Sony TV with:

echo "tx 4F 82 10 00" | cec-client -s
echo "tx 4F 82 40 00" | cec-client -s

What I haven't been able to achieve is switching back to TV as active source. Since the TV normally has ID 0.0.0.0, I would expect the following command would do the trick, but no response from TV:

echo "tx 4F 82 00 00" | cec-client -s

4 = Recorder 1 (raspi)

F = Broadcast

82 = Active Source

00 00 = ID

Has anyone successfully done this pretty basic operation?

like image 981
MartinR Avatar asked Jul 06 '13 19:07

MartinR


2 Answers

I like tarapitha's answer because it has an explanation.

The TV switchs back to active source if there is no other device that reports to be active (in response to a [Request Active Source] message, so this is the reason why the [Inactive Source] message works.

The only problem is that [Inactive Source] message has to be directly addressed to the TV, so the correct frame would be 40 9d 10 00, if the physical address of the active source is 1.0.0.0

eman's answer probably worked because the TV is forgiving the wrong physical address, it just performs the active source request and finds no active source so sets itself as active.

I recommend this page to understand CEC framing.

like image 149
Alex Vazquez Fente Avatar answered Sep 20 '22 13:09

Alex Vazquez Fente


try this: echo "as" | cec-client -s

like image 27
Mike Avatar answered Sep 21 '22 13:09

Mike