Set active source to TV with cec-client
Asked Answered
L

5

12

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?

Levania answered 6/7, 2013 at 19:50 Comment(0)
B
3

On my Samsung:

echo "txn 40 9D 00 00" | cec-client -s

works fine. So, do no Broadcast!

Bounteous answered 1/2, 2015 at 18:51 Comment(1)
Just wondering, how does setting 0.0.0.0 (TV) to 9D (inactive source) make your Samsung switch to tuner?Government
H
5

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

Hotshot answered 18/9, 2013 at 17:16 Comment(0)
B
3

On my Samsung:

echo "txn 40 9D 00 00" | cec-client -s

works fine. So, do no Broadcast!

Bounteous answered 1/2, 2015 at 18:51 Comment(1)
Just wondering, how does setting 0.0.0.0 (TV) to 9D (inactive source) make your Samsung switch to tuner?Government
B
3

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.

Bluegill answered 12/11, 2015 at 18:38 Comment(0)
S
2

Try using : as delimiters (for those who aren't 2013; it probably have changed since then). Otherwise it sends only the first byte (according to debug messages).

I have a Sony receiver (str-dg710) and the as command didn't work for me either. Even tx 15:82:11:00 didn't work. It has to be the broadcast address (f) – tx 1f:82:11:00 finally worked. Although my rasp has its physical cec address 1.0.0.0, switching the receiver inputs manually while running cec-client showed that the first HDMI input has address 11:00 and not 10:00, thus the address in the working tx command.

Streaming answered 24/10, 2018 at 16:47 Comment(0)
H
1

what about:
echo 'tx 4f 9d 10 00' | cec-client -s -d 1

4 - the source
f - broadcast
9d - <Inactive Source> command
10 00 - physical address (ID) of currently active source = 1.0.0.0

Replace the ID with the one for currently active source.

It does NOT work on my Philips TV, but CEC standard says that "The TV may display its own internal tuner and shall send an <Active Source> with the address of the TV;...", so it may work on some other system.

Horseradish answered 19/9, 2013 at 7:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.