When I use CEC-Client to send the active source command to switch the TV input to a particular source, nothing happens. What am I doing wrong?
I have a Raspberry Pi 4 running Raspbian plugged into a Vizio TV. I've installed cec-client (via cec-utils), and I'm running commands using it from within Bash on the Raspberry Pi.
Here is the scan of the CEC bus of my setup:
CEC bus information
===================
device #0: TV
address: 0.0.0.0
active source: no
vendor: Unknown
osd string: TV
CEC version: 1.3a
power status: on
language: eng
device #1: Recorder 1
address: 4.0.0.0
active source: yes
vendor: Pulse Eight
osd string: CECTester
CEC version: 1.4
power status: on
language: eng
device #4: Playback 1
address: 1.0.0.0
active source: no
vendor: Unknown
osd string: Roku
CEC version: 1.4
power status: on
language: ???
currently active source: Recorder 1 (1)
A lot of things.
More specifically:
tx 1f:82:10:00
tx 1f 82 10 00
tx 4f:82:10:00
and tx 10:82:10:00
sp 1.0.0.0
spl 4
I know that the TV supports it, because the device that I am trying to switch to (a Roku) uses CEC to switch inputs to itself when I start using its remote. Watching CEC-Client when it does this, it sends 4f:82:10:00
to declare itself as the active source, which is exactly what I've tried except with itself as the initiator (which I've also tried just in case).
To make sure that the tx
command was working, I used it to successfully send the TV into standby.
Using as
to set the Pi as the active source works fine, but the corresponding tx command, tx 1f:82:40:00
, does nothing (even though the output of CEC-Client shows it using the exact same message).
I have only listed the CEC-Client commands above, but I have tried them all both directly in the CEC-Client's interactive prompt and by echoing it into cec-client (i.e. echo "tx 1F:82:10:00" | cec-client RPI -s -d 1
).
Any help/feedback would be greatly appreciated! I'm at my wits' end, and can't think of anything else to try that I haven't already.
(Also any feedback on my question is welcome; I'm still pretty new to posting on the StackExchange network)
So, it turns out setting the type (-t
or --type
) when launching the cec-client is necessary for me. It seems like -t t
and -t p
are the best working options. It's still super finicky (or I would do more testing to post a more deterministic answer).
I'm going with setting the type to tuner (t
) as it allows me to switch input, and doesn't prevent me from changing the volume on my TV with the remote like audio (a
) did, yet it is still a device type that I won't be plugging in to my TV, so I don't have to worry about getting it confused or anything. I may eventually switch to playback (p
) in the future if that seems to help with anything. Explicitly setting recorder (r
) actually also worked once, but I think the TV still thought it was an audio device (since I still couldn't change the volume. It took me a while and a lot of fiddling to fix that...).
(If anyone knows why this is necessary, even though using the built-in as
command works without specifying the type at launch, or more detail on the effects of changing the type, I'll accept their answer.)