0

I would like to set the TV volume to 50% how do I achieve this with the cec-client command or other. I am aware of the [volup] [voldown] but that must be a dumb API comparable to walking blind-folded.

Thanks for providing your insights and hopefully a solution.

I tried the following command but the post never explained what it meant nor can I intrepet the output :(

pi@raspberrypi:~ $ echo "tx 20:71" | cec-client RPI -s -d 4
opening a connection to the CEC adapter...
NOTICE:  [               3]     connection opened
NOTICE:  [             268]     registering new CEC client - v4.0.4
NOTICE:  [             960]     CEC client registered: libCEC version = 4.0.4, client version = 4.0.4, firmware version = 1, logical address(es) = Recorder 1 (1) , physical address: 4.0.0.0, compiled on Linux-4.15.0-48-generic ... , features: P8_USB, DRM, P8_detect, randr, RPi, Exynos, AOCEC
NOTICE:  [            3535]     unregistering client: libCEC version = 4.0.4, client version = 4.0.4, firmware version = 1, logical address(es) = Recorder 1 (1) , physical address: 4.0.0.0, compiled on Linux-4.15.0-48-generic ... , features: P8_USB, DRM, P8_detect, randr, RPi, Exynos, AOCEC
pi@raspberrypi:~ $ cec-client -h

Once I figure out this my next step would be how to issue these commands from a TypeScript(JS) web app running inside the Chromium browser on the Pi4 of course.

Meryan
  • 131
  • 6
  • After reading this you can probably use : echo volup | cec-client -s -d 1 or echo voldown | cec-client -s -d 1 X times neccessary starting with known sound level value. For web application you can make AJAX request to web server running PHP (python, perl or another langage) and use system() (or other related function) or CGI for running your cec-client command. – Ephemeral May 20 '20 at 11:00
  • Are you confirming there is no command for a direct value? If I issue the volup command the TV stays ALWAYS at "7" out of 100, the command spits out 7F repeatedly, is that a hex value or am I expected to interpret it as 7 and discard the "F" ? I am able to turn off/on the TV with "tx 20:04" and "tx 20:36" – Meryan May 20 '20 at 11:27
  • Are you confirming there is no command for a direct value no sorry I don't know for that. 7F seem's to be hex. If cec-client still does not respond to the remote control, type "as" directly in the output of cec-client to switch the television to active source. – Ephemeral May 20 '20 at 11:31
  • Have you tried to sniff the volume buttons on the remote control with the cec client? Maybe some useful information can be displayed. (using -d 1 not -d 4) – Ephemeral May 20 '20 at 11:39
  • 1
    Also, from here : unfortunately almost no TVs support volume control via CEC , you can also read here – Ephemeral May 20 '20 at 11:49
  • Can you explain what command lines are used to "sniff" the remote control. By this you mean pickup the signals from the remote volume/up down. Then some how you can have cec-client transmit them? Thanks. – Meryan May 20 '20 at 11:54
  • With cec-client but if cec-client still does not respond to the remote control, type as directly in the output of cec-client to switch the television to active source. But if volup command not work , it's a bad starting point. – Ephemeral May 20 '20 at 11:57

0 Answers0