3

I have Samsung TV (UE46B8000XW) and Raspberry PI with OpenELEC install (cec-client is there). I found how to switch it off and how to change sources:

echo "standby 0" | cec-client -s' # switch off
echo "tx 2F:82:10:00" | cec-client -s' # hdmi1
echo "tx 2F:82:20:00" | cec-client -s' # hdmi2

But I can not find commands to change channels, increase/decrease volume. cec-o-matic.com doesn't help - it looks like many commands are not supported (see sample log at https://pastebin.com/VYFu0zYk).

Is there any way to get a full list of supported commands?

Update 1:
I think about the following approach - what if I try to send all possible commands one-by-one and then parse the result somehow. Looks like I can send all possible commands with bash. What is about checking result? What is the correct approach to understanding if the command is supported or not? Should I look for the reply TRAFFIC message?

Update 2: I am experimenting now with the following (value equal to 36 is switching off my TV, so I skip it):

for z in 10 e0 2f
do
    for i in $(seq 16 1 256)
    do
       i=$(printf "%0x\n" $i)
       if [[ $i != "36" ]]
       then
            echo "$z:$i"
            echo "tx $z:$i" | cec-client -s >> cectest-$z.txt
        fi
    done
done

Then I use the following regex to find non-standard replies:

TRAFFIC: \[.{16}\]  >> (?!01:90)(?!0f:87)
5
  • Have you read the wiki?
    – Seamus
    Commented Jan 5, 2020 at 9:35
  • Try echo h | cec-client -s -d 1 to get the list. raspberrypi.stackexchange.com/a/9147/44221 Commented Jan 5, 2020 at 10:11
  • @Seamus, yes, I did. What am I missing there?
    – LA_
    Commented Jan 5, 2020 at 13:15
  • @M. Rostami, it shows the list of commands cec-client knows. It doesn't mean that TV supports them.
    – LA_
    Commented Jan 5, 2020 at 13:16
  • Only that when you look at the matrix of supported commands (under 5 Manufacturer Support), it appears to be sparsely filled/mostly unsupported by the manufacturers. I'm suggesting you may be at an impasse. Hope that's not the case, but...
    – Seamus
    Commented Jan 6, 2020 at 3:57

2 Answers 2

2

Maybe you need to change the command's structure to:

echo "txn 2F:82:10:00" | cec-client -s
echo "txn 2F:82:20:00" | cec-client -s  

Or:

echo "txn 2F 82 10 00" | cec-client -s
echo "txn 2F 82 20 00" | cec-client -s  

However, I've found that someone has had your problem. At the first, deactivate the AnyNet. Next, turn off the Samsung TV and unplug it from the grid. Finally, plug it again and restart the AnyNet.

I've searched but there is no reason for this problem, I didn't, at least.


If it's possible and you have an active source, try it:

echo "as" | cec-client -s -d 0  

Some timely wait...

echo "standby 0" | cec-client -s -d 0  

1, 2, 3

1
  • Thanks. This is exactly what I tried, I was thinking about another approach - I'll update my question now.
    – LA_
    Commented Jan 9, 2020 at 11:47
2

I am not aware of a way to get a list of all supported commands (and I have read through most of the specs).

I would test to see if your TV supports User Control Pressed (e.g. echo tx "10:44:34" | cec-client to try Input Select). If it sends back a feature abort (e.g. 01:00:8e:04), you should check the following:

  1. Is the feature abort that is returned even for the same command (as you see from the example feature abort, my TV says that it doesn't support Menu Status when I try to send a User Control Pressed command...). The 3rd number (8e in my example) should be 44.
  2. Why is the feature abort returned (the 4th number, 04 in my example)?
    • 00 - command not supported
    • 01 - TV not in correct mode to respond
    • 02 - cannot provide source (obviously this one is unlikely)
    • 03 - invalid operand (presumably this would be returned if User Control Pressed is supported, but the specific control (e.g. Input Select) isn't.
    • 04 - refused (TV recognized the command and the control, but something else prevented it from working)
    • 05 - Unable to determine (TV is in a state where it can't determine if the command is supported)

If your TV doesn't support User Control Pressed, then you can hope that it has Vendor Specific commands or RC codes, but I don't know how you would go about figuring that out.

Notes

  • My examples assume that your Raspberry Pi is device 1 (default for mine), but you may want to read my answer here to make sure you understand CEC addressing and find your device numbers.
  • Make sure you run cec-client without to -s flag to make sure it's still running to see the response.
3
  • Many thanks. The given command captures buttons I press on TV remote, here is the log - pastebin.com/2LpHkBUN (no volume buttons are supported ;(). Now the question is how to send the same buttons back (for ex., to change channel on TV).
    – LA_
    Commented Jan 12, 2020 at 13:23
  • Yeah, to my knowledge, TV's don't support receiving volume commands; I think you would need an audio receiver with HDMI support. As far as sending the same button back, you should be able to switch the 0 and the 1 at the beginning of the command e.g. tx 10:44:21 instead of tx 01:44:21 (instead of your TV telling your Pi what was pressed, your Pi will be telling your TV). You can ignore the button release messages, the specs set a default time out which is very short, so it'll generally not be necessary. Commented Jan 22, 2020 at 19:54
  • You can try to send the volume buttons following this, just in case (I've not done any testing myself, the specs just led me to believe it's not supported). 1 start cec-client as an audio device cec-client -t a 2 you will now see the volume key presses. Keep track of these (you will be switching the 0 and the 1 at the first of the command) 3 You need to stop cec-client, and then send tx 10:72:00 to let the TV know it's in charge of audio again. 4 Try sending the commands that you saw (making sure that you switch the 0 and the 1) Commented Jan 22, 2020 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.