Samsung CEC bug since fw 1470.3

  • Hey guys,

    I have a Samsung UE48JU7000 and I experience problems with CEC since the tv auto-updated to version 1470.3. Basically I have to setup CEC on the tv everytime I turn it on (Go to the menu... Go to Settings ... Anynet Settings ... Search for devices ... select Kodi). The CEC works until I turn the tv off again (using the red button on the tv remote, I guess that's standby). So now I've switches to yatse to control Kodi as I did in the past. This works fine, but I like to control everything with one remote.

    I personally don't think it's an issue with either Kodi or LibreElec but I wanted to make this post anyways to see if there are other people experiencing the same problems.

    A bit of history:
    When I noticed the problem I contacted Samsung Phone support. They couldn't help me immediately but made an appointment for the support engineers to access my tv remotely. During the phone support and remote support we did the basic stuff (resetting the tv to factory defaults, reselecting Kodi as the CEC device, the engineer reinitialized the HDMI port, etc.)

    Sad thing was that engineer didn't even ask what the problem was before he started. So he got CEC working again (using the steps I described already) and thought that the problem was solved. When I explained it to him, after his actions obviously hadn't solved it, he told me that Anynet is their CEC flavor and that they don't guarantee any compatibility with anything other than Samsung devices.

    When I stressed to him that the update broke something that was functioning fine before, he told me that I should consider myself lucky to have had it working in the first place, but that there's nothing to be done to solve it (other then hope for another firmware update). He supposedly was going to pass on the information but I seriously doubt he did that based on how annoyed he sounded, admittedly, I was annoyed as well as he just was going to leave me there without actually having achieved anything (the tv is under warranty for about one more year...).

    When I told him that imo they have to downgrade the firmware on my tv as I never asked for it in the first place, he told me that that was not possible. It's such bullshit that a company like Samsung has an auto update mechanism but no safeguards in place to go back in case of issues. Thank god not all suppliers have structural design errors like that.

    I told Samsung support over Facebook support that I will not recommend Samsung as a brand until this is either fixed or until they come up with a decent explanation why they can't or won't but in that case tbh they should give me a possibility to go back to previous firmware. So far I haven't received a single response to the 4 messages I have sent them over Facebook...

    I'm quite disappointed indeed. Too bad, because so far I've been very happy with Samsung products.

    Things I've tested so far:
    -other HDMI cable, didn't change anything
    -tried Pi3 instead of the 2 I usually use, didn't change anything
    -was using OpenElec before, now using LibreElec, didn't change anything
    -tried alpha 7.90.008 instead of the stable 7.0.2 version I run as main system, didn't change anything
    -looked for errors in the kodi logs when turning the tv off and on, only thing that appeared when turning the tv back on was:

    Code
    16:40:14 593.188293 T:1858073504   DEBUG: SetMenuLanguage - language set to 'resource.language.en_gb'


    I know that several people are experiencing the same problem. I've seen a post over at Samygo.tv and met someone on IRC with the same problem.

    Here's to hoping that somehow the problem gets solved, either by a samsung update or by a workaround/bugfix in the CEC library.

    I any testing needs to be done, or any additional info is needed, let me know.

    Edit:
    To make it clear, the setting on the tv doesn't actually get changed when turning it of and on, because when I do the search for devices Kodi still shows up as checked. It's just that I have to reconfirm the setting for the CEC-connection to be reestablished.

    Kind regards,
    ScHAmPi.

    Edited once, last by ScHAmPi (November 9, 2016 at 8:32 PM).

  • Do you have any other devices connected to the TV/AVR? And do CEC work for these devices after a standby cycle without explicitly searching for devices?

    Please try the following:
    - Use Milhouse's latest Testbuilds for RaspberryPi from LibreELEC Testbuilds for RaspberryPi (Kodi 17.0) (contains latest libcec)
    - Make sure your Pi is the only HDMI-device connected to your TV to minimize CEC interference
    - Enable debug logging and libCEC component logging in kodi
    - Disable CEC setting for turning off/on TV or device in kodi
    - Restart your Pi while your TV is on and the Pi is the current input
    - Wait until kodi is fully started
    - Put your TV in standby and power it back up a minute later
    - After a minute, setup CEC like your described (Menu -> Search for devices -> Select Kodi)
    - Post your kodi log

    Above should help determine if there is any new vendor specific cec commands that needs to be implemented

    Edited once, last by Kwiboo (November 9, 2016 at 9:43 PM).

  • Hello Kwiboo, the behavior is the same on my cable providers set top box.

    Disconnected the settop box and I followed your procedure exactly and this is the log:
    AaPN

    Timings:
    17:08:00 reboot
    17:10:07 scan cec devices
    17:11:00 select kodi in results
    17:12:00 tv off
    17:13:00 tv on
    17:14:00 scan cec devices
    17:15:00 select kodi in results
    17:16:00 pressed down arrow on tv remote as test

    Raybuntu, will do your test later.

  • While developing the CEC driver for Amlogic S905 with @gda I saw a similar issue on my Samsung TV's. Took me a while to figure it out. I'm not 100% sure but in my case Kodi was sending CEC messages too fast and some got dropped by the TV. We fixed in in the kernel driver by delaying the CEC write a little bit. Remember CEC is a very sloooooow protocol according to the CEC spec.

    Don't get emotional with Samsung. It might be a feature not a bug. Anyone with S905 and Recent samsung firmware having this issue please ping me.

    Edited once, last by GDPR-1 (November 10, 2016 at 7:57 PM).

  • All right Raybuntu here it goes :).

    Here's the output of the cec-client:
    GVZL

    -First turned the client on while the TV was off
    -Turned on the tv
    -Did the CEC device scan on the tv and selected the CECTester device
    -Then pressed up, right, down, left in sequence
    -Then turned the tv off
    -Turned it back on and pressed the arrow sequence again
    -Then stopped the client

    Judging from the log file I see that the first arrow sequence is recorded. I turned off the tv somewhere shortly after message 88849. When I turn the tv back on there seems to be at least some CEC traffic come up (starting from 140253) but the arrow sequence doesn't seem to be sent by the tv to the CEC client. Message 158865 and later happen due to me terminating the CEC-client.

    I hope that helps.

    In the meantime I also received a response from Samsung over Facebook:

    Quote


    Hi, it is unfortunate to hear that the Anynet system is not working perfectly. If you already reset the tv and re-install everything, then the only option is wait for the new software update. My apology for the inconveniences.

    Unfortunately not a solution but at least I received a response.

  • I tried it with cec-client, and it seems to be some sort of timing issue ?
    Ubuntu Pastebin (cec-client log)

    If the Pi CEC client is marked as active source, it is getting keys. Then at message 11850, the tv is turned off, then at 17327 it is turned back on. Then it is not getting key presses until i type "as" into cec-client, marking it as an active source again - and at that moment, i am getting the key presses again (message 39055 and later).

    This is with LE 7.0.1, Samsung 55JU6400, firmware 1470.

    Edited once, last by faugusztin (November 11, 2016 at 10:23 AM).

  • After testing I noticed that command

    Code
    kodi-send -a "CECActivateSource"


    brings cec working again after tv suspend/resume.

    So I was thinking if I can automatically send this 'active source' command from kodi. And here is the patch. Probably wrong way to do it but it is working. From kodi log after resume

    Quote


    17:58:07 T:2740974496 DEBUG: CecCommand: got 'Active Source' command from TV, let's call CECActivateSource
    17:58:07 T:3032768512 DEBUG: ToggleDeviceState - waking up CEC device...

    But I also noticed that after first boot or reboot cec doesn't always work. So there should be something else wrong. And only tested on my imx6 system + Samsung UE40JU6090.

    Update: I was informed that this patch will not be good. When watching for example DVB then after suspend/resume input will be switched to kodi :(

    Edited once, last by vpeter (November 11, 2016 at 6:39 PM).


  • I tried it with cec-client, and it seems to be some sort of timing issue ?
    Ubuntu Pastebin (cec-client log)

    If the Pi CEC client is marked as active source, it is getting keys. Then at message 11850, the tv is turned off, then at 17327 it is turned back on. Then it is not getting key presses until i type "as" into cec-client, marking it as an active source again - and at that moment, i am getting the key presses again (message 39055 and later).

    This is with LE 7.0.1, Samsung 55JU6400, firmware 1470.


    You are probably correct. Thats what I assume. Unfortunately I don't have a TV with that issue. Amlogic CEC driver had a similar issue (read my previous post). But I can only speculate.

    Edited once, last by GDPR-1 (November 11, 2016 at 6:16 PM).


  • I tried it with cec-client, and it seems to be some sort of timing issue ?
    Ubuntu Pastebin (cec-client log)

    If the Pi CEC client is marked as active source, it is getting keys. Then at message 11850, the tv is turned off, then at 17327 it is turned back on. Then it is not getting key presses until i type "as" into cec-client, marking it as an active source again - and at that moment, i am getting the key presses again (message 39055 and later).

    This is with LE 7.0.1, Samsung 55JU6400, firmware 1470.

    Yup, that worked. At least in the build I'm using (#1109 by Milhouse).
    [hr]


    After testing I noticed that command

    Code
    kodi-send -a "CECActivateSource"


    brings cec working again after tv suspend/resume.

    So I was thinking if I can automatically send this 'active source' command from kodi. And here is the patch. Probably wrong way to do it but it is working. From kodi log after resume

    But I also noticed that after first boot or reboot cec doesn't always work. So there should be something else wrong. And only tested on my imx6 system + Samsung UE40JU6090.

    Update: I was informed that this patch will not be good. When watching for example DVB then after suspend/resume input will be switched to kodi :(

    Perhaps as extra info. That trick works on the LE 7.90 release I'm using (#1109 by Milhouse), but it doesn't seem to work on the stable release 7.02.

    Edited once, last by ScHAmPi (November 11, 2016 at 6:50 PM).

  • vpeter: this change has to go into the libcec. The libcec gets informed when it lost the active source, because someone switched to live TV, or blueray player. If it still has the acitve source it can remember the TV after power on.
    But there are several reason why I will not investigate:

    • Most important, I don't have the problem, so testing is impossible
    • I am not really sure that this is a bug fix, or a workaround for another problem we don't see
    • the last reason you know very well ;)


    Gerald