CEC volume control for AVR not working after upgrade to latest kodi version

I’ve upgraded to the latest dev release of kodi, but ever since, I’m unable to control the volume of my AVR with the volume keys of the vero 4K+ remote.

My vero 4k+ is connected to my AVR (Onkyo), so volume control should happen on my AVR. This works perfectly fine with Kodi 17.6 (and the corresponding kernel that vero uses). After specifying that kodi is connected to an AVR in the peripheral > input devices > cec settings.

I’ve upgraded to the latest Kodi version (as documented here, and that also installed a new kernel.

I guess something has changed here, since now, the volume keys don’t controll the avr anymore, but the kodi volume itself (what should be at 100% at all times).

I have a debug log here: http://paste.osmc.tv/oyovebiciy

Interesting to note is the bunch of CecLogMessage - Write: write failed messages.

How can I further try to solve this issue? I’m seeing other remarks of this breaking, on various other situations, but no clear fix for this.

Using cec-client on the CLI works fine, so there is no issue with the HDMI cable or something.

Allright, I dug into the Kodi code, and I might have a clue, but I don’t see why it worked fine before the upgrade, unless something has changed with the cec-driver…
@sam_nazarko or @gmc knows this maybe?

When I look at the code that handles the cec stuff in kodi:

At line 1561: xbmc/PeripheralCecAdapter.cpp at 0c2d5431050e1cf3bfa2139bfc0644049a60127b · xbmc/xbmc · GitHub

Kodi is asking always first for the TV OSD name, but my tv isn’t responding since CEC is turned off. I assume this is where CecLogMessage - Write: write failed has something to do. I guess this makes the call to GetDeviceOSDName fail, causing the entire SetInitialConfiguration function to fail.

If it would succeed, it would get to the UpdateAudioSystemStatus function, and that functions makes kodi see my avr, and setup everything so it controls the avr instead of its own volume.

If I enable CEC on my TV, the avr is detected and volume control works fine, I can disable the CEC on my TV afterwards and it will keep working. After a reboot however, it is again broken.

Looking at the blame of that file, I don’t see any recent change that could cause a difference, but there might be a different driver for AOCEC? This is just guessing. Maybe that driver is reporting an error on the GetDeviceOSDName call?

The CEC driver is the same as it comes from the kernel.

@gmc could try a test build of v18 with a patch. It may produce some side effects however

@sam_nazarko die you check that kodi function? Do you agree that that function to set the osd on the TV should only be executed when it is connected to a TV?

Hi – I didn’t get a chance to check it yet.
@gmc could try the changes in a v18 build to see if it makes a difference.


I could apply a patch for the v18 build, but not sure what needs to be in the patch.

I guess that code to check the cec of the tv needs to be commented out, or at least be behind an if statement. I would gladly do this myself, but I’m not sure what the ideal workflow is to compile this myself to check out the patches.

I’ve tried to look into this a bit more, but there are quite some patches in the osmc repo that change cec behavior, so I’m not really sure where to look. Maybe a patch from below breaks it?

Okay, sorry guys. It seems that if you keep the option “Switch source to this device on startup” selected (like it is by default). It will not use CEC with my AVR, because it gets stuck in the waitReady() function. This seems unlogical. I only noticed this by reading the source code of the waitReady() function.

It may be worth reporting that upstream or to the libCEC maintainer if if it effects Kodi as a whole.

Whats the status on that?
currently im facing the same issue, but im new to the cec thing!

Can this problem be solved?

CEC will be updated as part of v18; so the issue may be solved for you.


1 Like

Has anybody tried it now as v18 is out?

Hi, is there any update to this?

My Vero4K+ is updated and I can’t get CEC volume control to work, the volume buttons keep wanting to change the normal Kodi volume which of course doesn’t help for passthrough audio.

I don’t think we ever implemented this in to a test build.
@michael.arnauts – is this still an issue?


I think it is. I don’t use the “Switch source to this device on startup” setting anymore, but this really is a Kodi bug. The whole CEC implementation feels (and looks, I checked the code) rather hacky.

Do you have a patch against Leia? I can make some testing available.

I have no patch. As said, I just unchecked the “Switch source to this device on startup” option.

For me, this issue is resolved, but for all the rest, maybe we should at least set that option off by default.