Super cool, I'm definitely going to have to grab a pi and set this up. Now if we could also solve the ps5/switch/etc not turning off the TV, my setup would be perfect!
Assuming you’re ok with connecting your receiver to the network, you should be able to wake the receiver if you detect the tv is on without any cables at all - if your tv is also on the network (I’ve got a home assistant automation doing exactly that) or you can use a $10 smart plug with power metering.
That said props for actually using HDMI-CEC! And it’s cheaper than most smart plugs (and probably safer, too)
This was actually the first route I considered. Unfortunately the latency was too much.
> My first instinct was to lean on traditional automation stacks: HomeKit scenes to chain “TV on” into “receiver on” or wattage triggers via an Eve Energy plug. This kind of worked, but every extra layer added 30 seconds of lag or more.
Yup, my AppleTV is the only device that gets CEC right. Even my LG TV and LG soundbar get confused. And don’t get me started on the PS4 Pro’s garbage implementation. I’m sad that Logitech killed Harmony because CEC was supposed to make universal remotes obsolete — they’re still the only way my full home theater can function without juggling a dozen remotes.
The first time I "discovered" CEC was when the arrow keys on my TV remote inadvertently navigated the PS3 system menu. I thought I was hallucinating because there was no mechanism for this magic to happen.
I know it's called a bus, but I'm still surprised that all devices get the HDMI-CEC stream of all other devices. Being able to watch the Apple TV from the Pi was super cool, and I never would have guessed it was possible to see what was going on there (short of building a man in the middle hardware proxy)!
I am using a raspberry pi pico with a modified pico-cec program to control my Jellyfin-client media PC. CEC is actually really fun to hack on, and once you get a custom setup working, it is (at least in my experience) rock solid.
Jellyfin even has a TV mode that you can enable in a normal desktop browser. So my media PC runs the browser in kiosk mode, and it has CEC buttons mapped to keyboard presses. Guests have used it, and I don't think anyone could tell that it wasn't a "smart" TV.
Modern AV stuff is insane. I have no interest in taking it up as a hobby. I have an xbox, a TV, and a pair of bookshelf speakers. How am I supposed to get the audio to the speakers without a bulky expensive receiver box? Luckily, I have one of the last remaining TVs with a headphone jack. I don't use a remote for any of it.
Side note: Sometimes the TV doesn't come on when you press its power button. After a tremendous amount of experimentation, I determined this was because the "brain" was on, but the backlight was not. Power cycling it blind usually fixes it. That's harder than it sounds though because you have to navigate the menu blind using short and long button presses with the one button. But I'm scared to try a new TV, because then I'm going to have to figure out how to get audio out of the TV.
It seems like AV stuff used to be so simple. Now the simplest scenarios seem to require more and more knowledge about arcane connection standard interactions and network topology. Ugh.
(I'd gotten a large LG monitor instead of a flatscreen tv, and it didn't talk HDMI-CEC but it had a serial-over-TRRS control interface, so I listened for messages on the bus and my media PC translated and relayed them to the monitor.)
I saw the Steam Machine bragging about CEC and being able to turn the TV on when it does, which made me wonder why my setup doesn't do that.
Turns out that there's a special pin on your APU that has to be wired up, and AMD didn't bother for the Z1 Extreme chips. I wish "wake on signal" was a universal option.
“every console behaves like it missed the last week of CEC school. They wake the TV, switch the input, then leave the Denon asleep so I’m back to toggling audio outputs manually.”
My Roku does this! It will turn on the TV but not the soundbar, which is so frustrating. Guess it’s somewhat normal.
In my home media setup (LG UQ81 TV, WiiM Amp via ARC, Xbox Series X, Chromecast with Google TV), the CEC setup _almost_ works perfectly.
* I can use the LG TV’s remote alone to control everything including the Chromecast and amp’s volume controls.
* The amp automatically switches on and off with the TV.
* Turning the Xbox on/off via its controller also turns on/off the TV and the amplifier together.
Mostly good, except sometimes when I have my Chromecast on and switch the Xbox on via the controller it gets stuck in an endless loop of flicking back and forth between HDMI 1 and HDMI 2, between Chromecast and Xbox. Nothing I can do will stop it except to power cycle the TV.
If anyone has experienced anything similar or has any tips on how to debug this that would be much appreciated!
This is the lord’s work. It’s ridiculous that in 2025 my $500 gaming PC GPU cannot tell the receiver to change inputs. Even my Apple TV, which is considered a model citizen here, steals the receiver’s input every few hours if I have another device active.
A side note: I am very sad that HDMI-CEC apparently can only support like 3 "console-like" devices. I have an Apple TV, Nintendo Switch 2, Sound Bar (eARC) and PS5 hooked up, but only 3 can really interact with CEC.
It took me a long time to diagnose why it seemingly wouldn't work with my Nintendo Switch 2.
I ended up disabling it on my PS5 because I never use the darn thing, but it kind of stinks since most TV's have 4 HDMI inputs.
Where I talk about the craziness that happens when more than 3 playback devices are on in my system:
> ...if the one playback device (e.g. PS5) was on, changing input to another playback device (e.g. Xbox) was impossible, I'd get a quick black screen and the input snaps back to PS5. This is wild, but fortunately I only use one console at a time so it’s not a big deal.
I remember when I wad losing my mind diagnosing this, I ended up asking ChatGPT for help with deciphering the HDMI-CEC frames when this was happening. It told me about the 3 device limit being the culprit with the line "You’re not crazy, HDMI-CEC is."
An analogous audio binding issue used to happen with my Jabra Bt headphones. It was generally connected to my phone and my computer. After finishing a phone call — if previously the computer was playing some music — the music would turn back on but it would be a very poor quality, I suspect the audio "mode" was stuck at "transmitting" phone call audio quality even though the BT software on the headset detected devices being switched from phone -> computer. Toggling the BT sound output on the mac to and fro between Computer and Headphones, fixed it.
I suspect it was probably a vendor — jabra — software issue when sending a signal to apple's BT stack when switching between types of devices? But probably not worth fixing on my own.
Just looks like a Rube Goldberg server to me. This is really illustrative of the nonsense that media copyright has manufactured. I'm not going to solve "HDMI-CEC weirdness with a XYX" I'm going to download the movie from a torrent or run an emulator.
I am not sure why the author specifically mentions a $7 cable when the Raspberry Pi and accessories are going to set you back close to $100. That is by far the most expensive component. The money is possibly better spent buying a programmable remote.
I wrote a program in Golang to control my a/v setup. Included within are small pkgs to control Linux CEC and LIRC devices (ioctl/read/write) as well a pkg for LG TV commands over serial port. Link here: https://github.com/EBADBEEF/tvman
One really useful thing when getting started was to use `cec-ctl -M` to monitor the CEC traffic live. Like the author, I used the v4l-utils commands to interact with CEC but eventually got frustrated with them and rewrote my program in in Go!
I have found CEC to be flaky and hard to work with. I had to turn off CEC on my TV because it breaks everything, almost randomly switching inputs and turning on and off devices.
I have an Apple TV and Nvidia Shield connected to a home theater receiver which is connected to the LG TV.
Sometimes when turning any of the set top boxes, the other one would turn on and its HDMI would become the active one. I couldn't simply turn off the box I didn't want to use because all the system would turn off.
The solution was to disable CEC on the TV. I still get CEC between the boxes and the receiver (for volume and HDMI active input) but I need to manually turn the tv on and off.
My TV and soundbar have the same issue: CEC works for everything except the "turn on" command. I ended up fixing it with an arduino-ish IR blaster that's powered by the TVs USB port - so as soon as the TV powers on, the Arduino boots up and tells the soundbar to turn on too. https://www.nfriedly.com/techblog/2015/01/samsung-tv-turn-on...
I also had a NUC that I installed a Pulse Eight CEC module into, but I never ended up using it, so it got passed on to someone else.
36 comments
[ 5.3 ms ] story [ 51.3 ms ] threadThat said props for actually using HDMI-CEC! And it’s cheaper than most smart plugs (and probably safer, too)
> My first instinct was to lean on traditional automation stacks: HomeKit scenes to chain “TV on” into “receiver on” or wattage triggers via an Eve Energy plug. This kind of worked, but every extra layer added 30 seconds of lag or more.
Better hurry befor-, too late it’s cloned in china.
Actually it would be funny if somebody integrated this fix into a cable
Jellyfin even has a TV mode that you can enable in a normal desktop browser. So my media PC runs the browser in kiosk mode, and it has CEC buttons mapped to keyboard presses. Guests have used it, and I don't think anyone could tell that it wasn't a "smart" TV.
https://github.com/gkoh/pico-cec
Side note: Sometimes the TV doesn't come on when you press its power button. After a tremendous amount of experimentation, I determined this was because the "brain" was on, but the backlight was not. Power cycling it blind usually fixes it. That's harder than it sounds though because you have to navigate the menu blind using short and long button presses with the one button. But I'm scared to try a new TV, because then I'm going to have to figure out how to get audio out of the TV.
It seems like AV stuff used to be so simple. Now the simplest scenarios seem to require more and more knowledge about arcane connection standard interactions and network topology. Ugh.
(I'd gotten a large LG monitor instead of a flatscreen tv, and it didn't talk HDMI-CEC but it had a serial-over-TRRS control interface, so I listened for messages on the bus and my media PC translated and relayed them to the monitor.)
Turns out that there's a special pin on your APU that has to be wired up, and AMD didn't bother for the Z1 Extreme chips. I wish "wake on signal" was a universal option.
My Roku does this! It will turn on the TV but not the soundbar, which is so frustrating. Guess it’s somewhat normal.
* I can use the LG TV’s remote alone to control everything including the Chromecast and amp’s volume controls.
* The amp automatically switches on and off with the TV.
* Turning the Xbox on/off via its controller also turns on/off the TV and the amplifier together.
Mostly good, except sometimes when I have my Chromecast on and switch the Xbox on via the controller it gets stuck in an endless loop of flicking back and forth between HDMI 1 and HDMI 2, between Chromecast and Xbox. Nothing I can do will stop it except to power cycle the TV.
If anyone has experienced anything similar or has any tips on how to debug this that would be much appreciated!
It took me a long time to diagnose why it seemingly wouldn't work with my Nintendo Switch 2.
I ended up disabling it on my PS5 because I never use the darn thing, but it kind of stinks since most TV's have 4 HDMI inputs.
https://johnlian.net/posts/hdmi-cec/#fn:3
Where I talk about the craziness that happens when more than 3 playback devices are on in my system:
> ...if the one playback device (e.g. PS5) was on, changing input to another playback device (e.g. Xbox) was impossible, I'd get a quick black screen and the input snaps back to PS5. This is wild, but fortunately I only use one console at a time so it’s not a big deal.
I remember when I wad losing my mind diagnosing this, I ended up asking ChatGPT for help with deciphering the HDMI-CEC frames when this was happening. It told me about the 3 device limit being the culprit with the line "You’re not crazy, HDMI-CEC is."
I suspect it was probably a vendor — jabra — software issue when sending a signal to apple's BT stack when switching between types of devices? But probably not worth fixing on my own.
Just looks like a Rube Goldberg server to me. This is really illustrative of the nonsense that media copyright has manufactured. I'm not going to solve "HDMI-CEC weirdness with a XYX" I'm going to download the movie from a torrent or run an emulator.
One really useful thing when getting started was to use `cec-ctl -M` to monitor the CEC traffic live. Like the author, I used the v4l-utils commands to interact with CEC but eventually got frustrated with them and rewrote my program in in Go!
I have found CEC to be flaky and hard to work with. I had to turn off CEC on my TV because it breaks everything, almost randomly switching inputs and turning on and off devices.
Sometimes when turning any of the set top boxes, the other one would turn on and its HDMI would become the active one. I couldn't simply turn off the box I didn't want to use because all the system would turn off.
The solution was to disable CEC on the TV. I still get CEC between the boxes and the receiver (for volume and HDMI active input) but I need to manually turn the tv on and off.
I also had a NUC that I installed a Pulse Eight CEC module into, but I never ended up using it, so it got passed on to someone else.