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

#1

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.

[TESTING] Kodi 18 (Leia) builds for Vero 2 & 4K
#2

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

#3

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: https://github.com/xbmc/xbmc/blob/0c2d5431050e1cf3bfa2139bfc0644049a60127b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp#L1561

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?

#4

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

#5

@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?

#6

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.

Sam

#7

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

#8

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.

#9

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?

#10

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.

#11

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

#12

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

Can this problem be solved?

#13

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

Sam

1 Like
#14

Has anybody tried it now as v18 is out?