How to override built in 175ms delay for 23.976 content?

  • Hi all,

    I'm a long time OE user who recently wiped my Intel NUC and did a fresh install of LibreElec 8. After doing this I observed about 1/5 seconds of delay in playback of 23.976 fps content on my setup.

    You can see information about what I tried and what was investigated in this thread on Kodi forums;

    Upgraded OE Gotham -> Libre Krypton, audio sync at 24fps still broken?

    It was eventually shown to me that LibreElec (like OpenElec before it) is introducing a built-in 175ms delay for 23.976 content via the built in settings file. This is unfortunate as I have a TV (Panasonic Plasma) that handles 23.976 playback much better than 60 fps playback for content like native BD rips.

    I tried setting up advancedsettings.xml myself and changing the delay from 175 to 0 but the system seems to ignore it.

    I know that the 175ms delay is the culprit because if I go into the OSD and manually set the delay to .175 the audio and video are properly in sync.

    A couple of people involved in Kodi development commented that maybe it is time to ditch this 175ms hard coded delay as it is an archaic fix to a problem that most users would no longer have and is not even part of any other Kodi distributions.

    In the immediate future my question is, how can I override this delay being introduced in the system advancedsettings file?

    Thanks!

    Edited once, last by voip-ninja (March 21, 2017 at 5:27 PM).

  • That's what i do, but i put it to 0.00ms and make it default.

    I actually have to set it to .175 ahead which negates the offset in the settings file.

    I would be more comfortable with this workaround if I didn't have other content (60fps, etc.) that would be negatively impacted by making the change through the OSD and applying it to all files.

  • I know what you mean, in my case i'm happy my plasma prefers 60hz so i set kodi at 60hz also and no more delay when setting in the OSD 0.00ms

    What do you have exactly in your advancedsettings.xml?

    Edited once, last by vitorp07 (March 21, 2017 at 5:37 PM).


  • I know what you mean, in my case i'm happy my plasma prefers 60hz so i set kodi at 60hz also and no more delay when setting in the OSD 0.00ms

    What do you have exactly in your advancedsettings.xml?

    This is the built in advancedsettings file where the problem is being introduced;

    All I did is copy this file and put it in the userdata folder with the one change of setting the delay from 175 to 0. Unfortunately it is having no effect on the problem.

  • You can try with only this below in the file;

    Can you provide logfiles we going to see if it reads your advancedsettings.xml file.

    Edited once, last by vitorp07 (March 21, 2017 at 6:07 PM).

  • you have to reboot after making changes to advancedsettings.xml for the settings to take effect (or restart kodi, systemctl restart kodi)


  • you have to reboot after making changes to advancedsettings.xml for the settings to take effect (or restart kodi, systemctl restart kodi)

    Yes, thanks, I know I have to reboot for advancedsettings file changes to take effect.

    I'm seeing below in logs so it looks like it is processing both settings files. This leaves me confused about why the 0 offset is not working. I will try -175 next.

    Code
    21:19:42.113 T:140460009465984  NOTICE: Loaded settings file from special://xbmc/system/advancedsettings.xml                                                           21:19:42.113 T:140460009465984  NOTICE: Contents of special://xbmc/system/advancedsettings.xml are...                                                                                                              <?xml version="1.0" encoding="UTF-8" ?>                                                                                                                                <advancedsettings>                                                                                                                                                       <showexitbutton>false</showexitbutton>                                                                                                                                 <remotedelay>1</remotedelay>                                                                                                                                           <cputempcommand>cputemp</cputempcommand>                                                                                                                               <gputempcommand>gputemp</gputempcommand>                                                                                                                               <video>                                                                                                                                                                  <latency>                                                                                                                                                                <delay>0</delay>                                                                                                                                                       <refresh>                                                                                                                                                                <min>23</min>                                                                                                                                                          <max>24</max>                                                                                                                                                          <delay>175</delay>                                                                                                                                                   </refresh>                                                                                                                                                           </latency>                                                                                                                                                           </video>                                                                                                                                                               <samba>                                                                                                                                                                  <clienttimeout>30</clienttimeout>                                                                                                                                    </samba>                                                                                                                                                             </advancedsettings>                                                                                                        21:19:42.115 T:140460009465984  NOTICE: Loaded settings file from special://profile/advancedsettings.xml                                                               21:19:42.115 T:140460009465984  NOTICE: Contents of special://profile/advancedsettings.xml are...21:19:42.113 T:140460009465984  NOTICE: Loaded settings file from special://xbmc/system/advancedsettings.xml                                                           21:19:42.113 T:140460009465984  NOTICE: Contents of special://xbmc/system/advancedsettings.xml are...                                                                                                              <?xml version="1.0" encoding="UTF-8" ?>                                                                                                                                <advancedsettings>                                                                                                                                                       <showexitbutton>false</showexitbutton>                                                                                                                                 <remotedelay>1</remotedelay>                                                                                                                                           <cputempcommand>cputemp</cputempcommand>                                                                                                                               <gputempcommand>gputemp</gputempcommand>                                                                                                                               <video>                                                                                                                                                                  <latency>                                                                                                                                                                <delay>0</delay>                                                                                                                                                       <refresh>                                                                                                                                                                <min>23</min>                                                                                                                                                          <max>24</max>                                                                                                                                                          <delay>175</delay>                                                                                                                                                   </refresh>                                                                                                                                                           </latency>                                                                                                                                                           </video>                                                                                                                                                               <samba>                                                                                                                                                                  <clienttimeout>30</clienttimeout>                                                                                                                                    </samba>                                                                                                                                                             </advancedsettings>                                                                                                        21:19:42.115 T:140460009465984  NOTICE: Loaded settings file from special://profile/advancedsettings.xml                                                               21:19:42.115 T:140460009465984  NOTICE: Contents of special://profile/advancedsettings.xml are...
  • You can see in the log that LE's default delay for 23/24p material is set to 175 and then some other advancedsettings file is processed where the delay is *still* 175, not 0 as you've indicated. So you've got an additional advancedsettings.xml file somewhere where you've set the delay to 0 and it doesn't get processed. I'm going to guess you created a symlink back to the LE advancedsettings file as it looks like the system/xbmc/advancedsettings.xml file is getting processed twice.

    And pastebin the full log and post the link.

    Edited once, last by doug (March 22, 2017 at 5:09 AM).

  • Like @doug said, it looks like it's loading at least 3 different "<refresh>" setting.
    You should delete every advancedsettings.xml file you created, reboot, create a new one with just what i posted before and place it in; storage/.kodi/userdata, reboot and check the (full)logfiles again.

    Edited once, last by vitorp07 (March 22, 2017 at 9:04 AM).


  • You can see in the log that LE's default delay for 23/24p material is set to 175 and then some other advancedsettings file is processed where the delay is *still* 175, not 0 as you've indicated. So you've got an additional advancedsettings.xml file somewhere where you've set the delay to 0 and it doesn't get processed. I'm going to guess you created a symlink back to the LE advancedsettings file as it looks like the system/xbmc/advancedsettings.xml file is getting processed twice.

    And pastebin the full log and post the link.

    OK, I only created one advanced settings file, which I've posted. I will get the full log and pastebin it in.

    I will also do a find from / on the file system and find all instances of advancedsettings.

    I did not create any symbolic links, etc.... I simply did a search in Kodi of where advancedsettings.xml needed to be for LibreElec and created one there.

    Edited once, last by voip-ninja (March 22, 2017 at 2:15 PM).


  • ssh in and post the results of:
    cat /storage/.kodi/userdata/advancedsettings.xml

    Here you go... not sure WTF is wrong with formatting of code in this forum... sorry for this looking like crap.

    Edited once, last by voip-ninja (March 24, 2017 at 1:16 AM).

  • Quote


    Here you go... not sure WTF is wrong with formatting of code in this forum... sorry for this looking like crap.


    Looks good if you're using Jarvis. Not sure if it works with Krypton.
    You do know that the proper script does not include first 3 lines.
    It should begin only with <advancedsettings> like in the code below:


  • Looks good if you're using Jarvis. Not sure if it works with Krypton.
    You do know that the proper script does not include first 3 lines.
    It should begin only with <advancedsettings> like in the code below:

    Code
    <advancedsettings>

    Never heard that one before.
    You do know that is the encoding declaration right?

    XML
    <?xml version="1.0" encoding="UTF-8"?>

    It might not be needed in this case, but it 100% creates no problem either.

    Edited once, last by vitorp07 (March 24, 2017 at 10:23 AM).

  • So it sounds like there's nothing wrong with my settings file I am using to try to override the built in 175ms delay?

    I will get a pastebin log later today and post it.

    Thanks all.