Make a TV behave like a PC monitor: wake it, select the PC input, and put it in standby automatically. A Raspberry Pi Pico handles HDMI-CEC and a tiny Linux client runs only at boot, shutdown, suspend, and resume (no app consuming system resources all the time!).
Current support: The host integration currently supports Linux with systemd and udev. Windows and macOS clients are not yet available, but are planned where practical. TV behavior varies, so only the setups in the compatibility table below should be considered verified.
- Raspberry Pi Pico (RP2040);
- spare HDMI cable to cut/modify for CEC (or a female HDMI breakout board and male HDMI cable);
- USB data cable;
- normal HDMI connection from the PC to the TV;
- Podman or Docker for the reproducible build.
The tested setup is an older Samsung Anynet+ TV, but it uses standard HDMI-CEC commands and should work with many CEC-enabled TVs.
| HDMI Type A pin | Signal | Raspberry Pi Pico |
|---|---|---|
| 13 | CEC | GP11, physical pin 15 |
| 17 | DDC/CEC ground | GND, physical pin 18 |
Plug and receptacle views are mirrored. Read the short wiring guide and verify both wires with a continuity meter before connecting the TV. Do not connect HDMI +5 V or DDC to the Pico.
git clone --recurse-submodules https://github.com/AtahanAlp/cec-controller.git
cd cec-controller
./tools/build-firmware
./tools/build-hostHold the Pico's BOOTSEL button while plugging in USB, then copy:
build/firmware/pico-cec.uf2
to the RPI-RP2 drive.
Turn on HDMI-CEC in the TV settings. With exactly one controller attached:
device=/dev/serial/by-id/usb-Couch_CEC_Couch_CEC_Controller_*-if00
build/host/cecctl --config /nonexistent --device $device protocol
build/host/cecctl --config /nonexistent --device $device detect
build/host/cecctl --config /nonexistent --device $device status
build/host/cecctl --config /nonexistent --device $device standby
build/host/cecctl --config /nonexistent --device $device onIf detect cannot identify the video input, add its CEC physical address to
the command, for example --physical-address 3.0.0.0 for TV HDMI 3.
After both manual power commands work:
sudo ./tools/install-host
cecctl detect
cecctl status
sudo systemctl start cec-controller-boot.serviceThat enables:
- PC boot/resume → wake TV and select the PC input;
- PC suspend/shutdown → put TV in standby.
The included automatic integration supports Linux with systemd and udev, including Bazzite, Fedora, Ubuntu, Debian, and Arch-based systems. Other operating systems can implement the small documented USB protocol.
Host settings live in /etc/cec-controller.conf. Most setups need no changes.
Useful fallbacks are:
# Select one GPU output when several HDMI displays are connected.
connector=card1-HDMI-A-1
# Or set the PC video input directly.
physical_address=3.0.0.0To build for another Pico GPIO or change the TV's device name:
CEC_GPIO=7 CEC_OSD_NAME="Living Room PC" ./tools/build-firmwareOnly the original Pico on GP11 has been hardware-tested so far.
Verified on the test TV: logical-address allocation, power query, standby, wake, and automatic switch to HDMI 3 using only CEC and ground. The next step is repeated lifecycle testing on the Bazzite couch PC. Compatibility reports and native clients for more operating systems are welcome.
| TV | CEC name | Connection | Host test | Standby | Wake | Select input |
|---|---|---|---|---|---|---|
| Older Samsung Smart TV (exact model unknown, replacement mainboard) | Anynet+ | CEC on HDMI 2, video on HDMI 3 | Fedora, manual commands | Yes | Yes | Yes |
Automatic suspend, resume, boot, and shutdown integration on Bazzite is still pending real-world testing. Please include the details listed in CONTRIBUTING.md when reporting another TV or operating system.
This project is derived from gkoh/pico-cec and retains its original notices. It is available under the MIT License. See CONTRIBUTING.md to help.
