Fix HDMI-CEC weirdness with a Raspberry Pi and a $7 cable
Posted by jlian 21 hours ago
Comments
Comment by recursive 20 hours ago
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.
Comment by jimmaswell 20 hours ago
Also, I collect a lot of old receivers and speakers. It's really not that complicated and the basics have been the same since the 70s and 80s. Any flatscreen TV made in the past 20 years typically has a TOSLINK output which will be compatible with receivers stretching back to the 80s - I have my LG C1 connected to some 90s Marantz receiver this way. Any old receiver you find on Facebook Marketplace for $20 will typically suffice here as long as you check for the TOSLINK port first, but you do need a separate actual amplifier somewhere along the line to drive a speaker larger than a pair of headphones unless the speaker has its own amp built-in.
I find all this stuff fun so my own setup has that chained to a series of other receivers acting as subwoofer amplifiers as well as using the pre-amp output to drive a Mesa Baron tube amplifier/Acoustat electrostats I was gifted, but most people don't need anything so complex.
Comment by recursive 19 hours ago
Comment by tmnvix 17 hours ago
All very cheap really. Total cost I think was about $550 (refurbished TV, second hand Apple TV, new Fosi DAC and amp). All this and I get to keep the TV in 'dumb' mode. Never even use the TV remote.
Comment by mikepurvis 18 hours ago
Comment by recursive 1 hour ago
Comment by mikepurvis 1 hour ago
https://www.marantz.com/en-ca/category/av-separates/
The output of these units is line-level signals feeding high-impedance loads. They could definitely be a fraction of the size they are.
Comment by Lammy 17 hours ago
S.M.S.L. make some good ones: https://www.smsl-audio.com/portal/product/index
I use their AD-18 and really love it: https://www.smsl-audio.com/portal/product/detail/id/566.html
Comment by tonyarkles 18 hours ago
Comment by timdorr 18 hours ago
Sonos makes this specifically. Has an RCA and HDMI input, along with being a Sonos device for streaming audio.
The only downside is the price.
Comment by ryandrake 18 hours ago
Comment by s3graham 18 hours ago
I had a houseful of overpriced speakers, some only 3 years old when they decided they were too old to support in their rewritten app, or some lazy crap like that.
For GP; I use some cheapo (sub $50) "100W mini amps" from Amazon. They seem fine to me.
Comment by jimmaswell 18 hours ago
Comment by ryandrake 19 hours ago
1. A decoder with at least 5.1 output since that's how many speakers I have
2. At least 3 HDMI inputs + 1 HDMI output to my TV
3. An amplifier with a volume control
That's it! I don't need an FM tuner. I don't need multiple zones. I don't need wild listening modes and DSP effects. I don't need an on-TV setup display. I don't need fiber optic digital audio inputs. I don't need fucking rows and rows of 20 RCA jack inputs, composite video, component video, S-Video. You'd think I could find a small cheap box the size of an AppleTV that I could just hide somewhere that could do this, but I couldn't find anything sufficient. So I got another $20 gigantic, ugly, old 18-inch receiver again from Craigslist and just leave all those features and inputs unused.
Comment by jimmaswell 18 hours ago
Comment by ryandrake 17 hours ago
I've got a great sounding 5.1 system with a receiver and a game console and everything set up. You know where it is? My garage.
Comment by literallywho 15 hours ago
Comment by db48x 15 hours ago
Comment by andersa 12 hours ago
Comment by aidenn0 14 hours ago
https://www.snapav.com/shop/en/snapav/episode-mini-51-avr-ea...
the only way it could have a smaller back-panel and all of your requirements would be to eliminate the ethernet connector.
Comment by LargoLasskhyfv 12 hours ago
https://www.highfidelityreview.com/creative-sbs260-speakers....
Clear and distortion-free. Probably depending on how you drive your line-out, but mine just worked.
Stereo 2.0! (Giggle..)
The room isn't that large, but they really could fill it with sound, or the nearest neighborhood, if put on the balcony on summer evenings :-)
Comment by ssl-3 16 hours ago
Others have mentioned toslink and I'd like to expand upon that.
When you get a new TV and no longer have a headphone jack to plug your powered speakers into, then you can just add a DAC that converts the toslink digital audio that your new TV outputs into the bog-standard line-level analog audio that your speakers understand.
DACs like this are available at all price points.
At the low end of the scale, some are less than $15 -- and they're tiny. If you can't hide it somehow then I might insist that you're not really trying.
And that's it. That's the entire missing link for where we are in 2025, wherein: A new TV will still have a toslink output, and your powered speakers still have an analog input.
(Tomorrow? Who knows, man. We aren't there yet.)
Comment by hebejebelus 7 hours ago
My old TV had real analogue out for speakers and it really did sound a lot better than what I've been getting through TOSLink and this cheapo DAC. Same Hi-Fi and speakers. I'm sure the problem could be solved with a more expensive DAC, but which one? How could I know?
I find this is one of those things where it's quite hard for the uninitiated to see through the cloud of 'audiophiles' saying that you must buy gold cables or your audio will sound like garbage, and still getting decent quality audio.
Comment by dontlaugh 12 hours ago
Comment by ssl-3 11 hours ago
If future-TV lacks this functionality: DACs that have remote volume controls are very nearly as inexpensive as those that don't.
Comment by recursive 10 hours ago
Comment by p1necone 19 hours ago
Comment by recursive 19 hours ago
Comment by k4rli 5 hours ago
I had my LG C9 audio via the headphone jack going to amp and it worked fine. On one of the cheaper LGs I set it up similarly with optical cable and a tiny optical->rca converter.
Comment by amluto 20 hours ago
You can get a small ARC/eARC audio extractor with RCA or S/PDIF output and use your favorite amplifier or DAC with it.
Comment by adamweld 18 hours ago
Personally I use an eARC extractor to run S/PDIF to an audio interface (MOTU Ultralite Mk5) and an RPi running camilladsp handles room correction and active crossovers. Overkill at the moment for just a few studio monitors and a sub, but it'll be a great solution when I get around to building some custom speakers.
Comment by ewoodrich 19 hours ago
Comment by monster_truck 19 hours ago
Comment by recursive 18 hours ago
If the only possible way of doing this is with a bulky receiver, I'd feel justified in complaining about modern AV stuff. Not because of the cost, but because of the size.
Anyway, thanks for your input.
Comment by moduspol 18 hours ago
Comment by nottorp 9 hours ago
Comment by da768 17 hours ago
Comment by kevin_thibedeau 17 hours ago
Comment by systemtest 20 hours ago
You can have bookshelf speakers with an integrated amplifier and HDMI-ARC. All you need is an HDMI cable between the TV and the speakers.
Comment by recursive 18 hours ago
Comment by muti 17 hours ago
There's also the compact, simple alternatives to bulky receivers that are becoming available: Wiim amp, Sonos amp, Eversolo play, and the cheaper chinese makers like SMSL and Fosi. Each of those brands has a small device the size of an apple tv that will take an HDMI Arc input, and output an amplified signal to power some passive bookshelf speakers.
Comment by systemtest 18 hours ago
Comment by kristianp 17 hours ago
Comment by rhinoceraptor 19 hours ago
Comment by jonhohle 19 hours ago
On the other hand, HDMI switchers haven’t fared as well. I built a mini console rack with a switch and it doesn’t recognize several devices, even when manually selected.
Comment by exmadscientist 19 hours ago
In my limited experience, Yamaha handles HDMI-CEC significantly better than Denon/Marantz. As evidenced by the fact that I currently own a Marantz receiver and am reading this page, but back when I owned a Yamaha receiver, I had no need to care about all of this crud. Things somehow worked on the first try! I did not expect that. However, it conditioned me to expect that again with a different receiver (the sources and sinks are the problems, right? the receivers are super well tested because sitting in the middle and passing these commands around is their entire job, right? right?) which was a mistake.
(The actual issue with the Marantz is that it seems to be eating some kind of power-on command from the source, and not passing it on, so the TV never turns on if you try to turn on the receiver or the source. I have no idea how to fix this, short of following in the path of this article.)
Comment by mschuster91 19 hours ago
I desperately need to work with CEC though lol, never had the time to actually test that.
[1] https://www.amazon.de/Yinker-hintergrundbeleuchteter-Unterst...
Comment by justinsaccount 19 hours ago
> without a bulky expensive receiver box
A "receiver" has been one of the standard options for making bookshelf speakers work for more than 50 years. A receiver is also not expensive. You can get a basic used one for under $100. I paid $30 for a perfectly working 5.1 Denon receiver with HDMI.
Your problem is that you aren't even using "Modern" AV stuff. If you were, your speakers and TV would both have HDMI Arc ports. Arc has been a thing since 2009.
> 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.
Or you could unplug it and plug it back in.
Comment by recursive 19 hours ago
Comment by gabrielhidasy 1 hour ago
If your speakers are active and don't need an amp, you can use a HDMI audio extractor, those are pretty small (mine is about half the size of my phone)
Comment by ianburrell 14 hours ago
I suspect that some of this is tradition because there are small solid state amplifiers. I'm surprised no one has made a small receiver for 2.1 system cause would be pretty common.
Comment by kenhwang 12 hours ago
They do make half size receivers, but they typically only have half the power output. The space savings comes from removing space for airflow and the heatsink, and using smaller capacitors for less heat and smaller power output.
If you only need 2.1 output and a quarter of the power, there are offerings that are basically the size of the minimum amount of ports: 2 pairs of speaker terminals, a pair of RCA terminals for subwoofer out, a HDMI port, a optical port, and power. But then it's not really a receiver and more just of an amplifier+DAC because they only have one HDMI input/output, having space for multiple HDMI ports or speaker terminals basically increases the size to the offering above.
They're big mostly because consumers demand a lot of big connectors on them.
Comment by jauntywundrkind 20 hours ago
The article here seemed to dive in, look at what was happening, and figure out some altogether decent & not absurd flows. It wasn't "easy", but it also wasn't totally absurd.
I get why you'd whinge & argue for a simple cable. But this was also a wonderful study, that showed steps, that I hope can bring joy & not just derision. That said, I also have no receiver box & rely on headphone out... which my not that old LG C4 has. Also, if that goes away: SPDIF decoder boxes are very cheap!
Comment by lysace 20 hours ago
Find a tiny TPA3255- or TPA3116-based amp. These are class D amplifier chips made by TI.
https://en.wikipedia.org/wiki/Class-D_amplifier
Buy one of these from e.g. Amazon.
Optionally: Throw away/recycle away the supplied chinese noname power supply. Buy a used laptop PSU from a reputable brand locally for cheap instead. I scored a Lenovo 135W/20V laptop PSU for $5 at my local Goodwill equivalent. Solder on a 5.5mm barrel jack connector.
My fav for your use case: Fosi Audio TB10D.
Comment by jtbayly 19 hours ago
Comment by lysace 18 hours ago
2. "Luckily, I have one of the last remaining TVs with a headphone jack."
Comment by recursive 19 hours ago
Comment by lysace 19 hours ago
Comment by recursive 17 hours ago
You suggested an amp. The fact that I'm able to use a headphone jack to connect my speakers should tell you I don't need an amplifier. The question posed is how to connect those speakers if I no longer had access to a headphone jack. Currently the headphone jack is working fine.
For what it's worth, here's a comment that seems like it's get a perfect solution for me.
Sorry if I was unclear.
Comment by davidczech 19 hours ago
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.
Comment by Terretta 13 hours ago
But long press on Xbox logo button to e.g. accept a party invite -- switches to Apple TV. Not great.
The consoles are indeed awkward, but so are soundbars. And really, it seems like the TVs are the worst.
All can be solved with the boxes from HD Fury like VRRoom.
Comment by hackernudes 15 hours ago
Comment by dwood_dev 17 hours ago
Comment by codepoet80 21 hours ago
Comment by Spoom 20 hours ago
(To be clear, they still work today if you can get a second hand remote / hub.)
Comment by tacoman 18 hours ago
I will use Harmony for my home setup until it no longer functions.
The horrors I have seen related to CEC and ARC are something else.
Comment by ssl-3 14 hours ago
And no matter what bizarro-world co-dependent cacophony of AV gear I manage to pile up together, any person can pick up the remote and watch TV or play a game or whatever.
I will be particularly unhappy when Logitech finally pulls the plug on Harmony servers.
At that point, I'll definitely need something different.
But IR codes are only part of the puzzle. And that is perhaps the easiest part to solve: We've already got lots of databases with IR-stuff available. There's databases focused on RC5, and the sleepy LIRC project, and some other things (all of which tend to be very Old Web in appearance).
License-permitting, it's simple enough to use this work as a foundation onto which newer codes can be placed.
That just leaves making the Harmony hardware interface work (hah, hahah -- and it's a dead-end anyway), or developing a new open-source remote to rule them all (which actually might not be too terrible of a task).
That all covers the first 90% of the problem.
The remaining 90% of the problem is just creating software that has a usable UI and actually works.
Comment by lsaferite 17 hours ago
I really REALLY want someone to manufacture the thin harmony RF remote with a simple receiver puck with an open firmware. That's all we'd need because the HA crowd would be all over it and have it doing anything you want.
Comment by artificialLimbs 4 hours ago
Comment by zimpenfish 19 hours ago
(I've tried updating the AppleTV, replugging the HDMI cable, unplugging the HDMI cable for <period of time>, etc. Nothing has worked. TV does not have any network which means it can't have had any nefarious updates.)
Comment by daoistmonk 10 hours ago
Comment by spacecrafter3d 19 hours ago
Comment by zimpenfish 10 hours ago
Comment by jnaina 18 hours ago
Comment by SchemaLoad 20 hours ago
Comment by crtasm 19 hours ago
Once it's awake buttons presses on the LG remote are passed through to it but I have to keep the Apple remote around for that first step.
Comment by codepoet80 18 hours ago
Comment by robflynn 17 hours ago
Comment by skunkworker 13 hours ago
Comment by rblatz 16 hours ago
Comment by star-glider 1 hour ago
It works well, but CEC most definitely is the buggiest part of the setup. It's a reasonably elegant system, but it's just not implemented very well by most electronics. I ended up putting in a lot of retries: stuff like "send active source command; wait five seconds and send it again." Still, if you're willing to dive into the weeds, you can do some nifty stuff.
Comment by sudobash1 20 hours ago
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.
Comment by bsimpson 20 hours ago
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.
Comment by extraduder_ire 19 hours ago
The common workaround if you had a kodi PC or something was to buy one of these things: https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter and run a HDMI cable through it. Because CEC is open drain like i2c is, connecting to it anywhere in your network of devices should work. (the HDMI spec mandated that the CEC pin needs to be connected, even if you aren't using it, from the first version) Just connect it to a spare HDMI port anywhere and you're off to the races.
Comment by bsimpson 12 hours ago
Real shame these gaming-tailored devices don't support it natively. I wonder if the DP vs HDMI licensing battle is involved.
Comment by sedatk 20 hours ago
Comment by jonah-archive 20 hours ago
(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.)
Comment by kimos 6 hours ago
It has been worse than doing all the remote juggling switching mysel because it is non-deterministic. This article will help me debug it, but it’s a toss up which audio device the screen will pick, if game mode activates or not, and if some device waking in the wrong order will put another one right back to sleep. Even if I follow the same steps every time.
Comment by baq 21 hours ago
That said props for actually using HDMI-CEC! And it’s cheaper than most smart plugs (and probably safer, too)
Comment by FatherOfCurses 4 hours ago
Comment by rgovostes 19 hours ago
Comment by avidiax 18 hours ago
Other devices like an nVidia Shield or the XBOX require that you press power/home a couple of times to take control of the receiver and switch inputs.
Comment by nullhole 16 hours ago
Worked pretty well, was nice to CEC-ify a pi program and eliminate the need for special-purpose hw/sw to interact with the audio player.
The CEC spec has all of the user control codes on the 2nd last page[1], in table 27.
[1] https://storage.googleapis.com/google-code-archive-downloads...
Comment by sho_hn 16 hours ago
Why? Because Google Home's TV remote stuff can do a lot, but not turn on the TV. CEC can.
Comment by InterlooperX 9 hours ago
I have accepted that I am apparently in the minority with my setup. In fact I was actually surprised to read that OP has a Denon as, just by what I have read about the topic of home theater", everyone else seems to be doing just fine with a simple soundbar which has one! hdmi socket.
So, here is my setup: -Dumb TV (Panasonic. So old it doesn't have a CI+ module built in, it is "just" a CI module) -Denon AV Receiver -Nintendo Wii -Nintendo Switch Dock -Original Xbox -Blueray Player -HTPC -Satellite Receiver -AppleTV
Excessive? Maybe but I still own all that stuff, have room for it in my cabinet so I like to convenience of powering each of these on when I feel like it without having to unearth them from a storage room and then fiddle with cables to connect everything for just a short time of usage.
Basically everything is plugged into the Denon. And then a single HDMI cable goes from the Denon to the TV. So the TV stays on one HDMI channel and everything else happens on the Denon. Switch Inputs on there and you get the corresponding Audio/video signal from the chosen device.
So far I have been lucky that in order to switch everything on, I could use a Harmony One. I could simply program the power on command for the TV, then switch to HDMI1 and turn on the Satellite receiver. This was the default. Put it on a news station and you got yourself some background noise. If you want to switch, you just had to tell the Harmony to switch its input to any other device listed above.
It really irks me that the Harmony line is dead and I don't know what I will do should the remote, one day, stop to function. Now I wonder if I would have to go the Pi route to have that switch things around depending on devices announcing themself when turned on.
Comment by kayson 20 hours ago
Comment by pottertheotter 20 hours ago
My Roku does this! It will turn on the TV but not the soundbar, which is so frustrating. Guess it’s somewhat normal.
Comment by davidmurdoch 17 hours ago
Comment by hackernudes 17 hours ago
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.
Comment by nfriedly 17 hours ago
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.
Comment by ghm2199 19 hours ago
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.
Comment by deepspace 18 hours ago
Comment by ihaveone 18 hours ago
Comment by Arbortheus 19 hours ago
* 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!
Comment by retsyx 15 hours ago
Amity, too, is based on a Raspberry Pi but also uses a very simple custom PCB to hook into the HDMI-CEC bus between the TV and the receiver. One of the most common problems encountered with HDMI-CEC is that different components will often compete to be displayed by the TV (for example, turning on your Apple TV, turns on the TV, which turns on the PlayStation, which requests to be displayed, which switches the TV to displaying the PlayStation. So you end up viewing the PlayStation when you wanted to stream Netflix on your Apple TV). I found that the only way to fix this problem is to sit between the receiver and the TV to break the cycle. Hence, the PCB.
Amity is available here:
Comment by pier25 17 hours ago
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.
Comment by paulbgd 21 hours ago
Comment by Hackbraten 20 hours ago
Comment by thebruce87m 20 hours ago
Comment by askvictor 19 hours ago
Comment by theLegionWithin 19 hours ago
Comment by VerifiedReports 16 hours ago
Yay!
Comment by rcarmo 19 hours ago
Comment by colechristensen 20 hours ago
Comment by neilv 20 hours ago
(I was sad at having to give up my nice PS4 universal remote, and not finding an equivalent for the PS5.)
However, I couldn't find a button on the remote that was the equivalent of pressing a PS5 controller's PS Button, and that's pretty important to the messy PS5 UI. But the TV had menus that could simulate pressing that button. So I upgraded to a Sony RM-VLZ620, which added programmable macro buttons, which I kludged hard to navigate the TV menus. From my notes:
### Programming PS Button
1. SET(Hold 3 seconds, for LED, then keep holding)
2. middle-circle
3. (Release SET)
4. System-Control-1
5. 9, 8, 1
6. Options
7. Up
8. Down, Down, Down, Down
9. middle-circle, middle-circle
10. SET
Note: The **Up** is a timing NOP, since otherwise
the TV usually only sees only 3 Down rather than 4.Comment by Crespyl 17 hours ago
The Deck can pretty consistently turn the TV on from standby(/picture mode) and grab the input, but if the TV is completely off (black screen) CEC doesn't work anymore.
Comment by sandos 10 hours ago
Now absolutely nothing of that works. The audio output on the TV is set seemingly semi-randomly depending on content!?. The volume controls just stopped working, and I can not FIND THE SETTINGS in the menus? I suspect it is required to completely redo the remote setup to see those settings, OR as I rather suspect: they broke this shit in purpose to get us to buy a new Google TV Streamer.
Comment by jauntywundrkind 20 hours ago
Comment by tylerflick 20 hours ago
Comment by amluto 20 hours ago
Comment by extraduder_ire 19 hours ago
Version 1.0 and later of the HDMI spec even mandate that you have to connect those pins across all HDMI ports on your device even if you don't do anything with them.
Comment by amluto 18 hours ago
Comment by waerhert 19 hours ago
Comment by tylerflick 17 hours ago
Comment by extraduder_ire 19 hours ago
Comment by rogerallen 16 hours ago
Comment by neuroelectron 19 hours ago
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.
Comment by bijant 15 hours ago
Comment by pyrolistical 20 hours ago
Better hurry befor-, too late it’s cloned in china.
Actually it would be funny if somebody integrated this fix into a cable
Comment by mongol 20 hours ago
Comment by lawlessone 20 hours ago