LE changes default resolution settings automatically

  • Not sure if this is a bug or an uncoverable behaviour because of all those fancy screen features TVs have implemented nowadays.

    It happened a couple of times now but I cannot say exactly when this is happening but sometimes after starting LE I got the behaviour that LE has set the default screen resolution itself from 1080p/60Hz to 4096p/30Hz. Then I have to set it back to 1080p/60Hz manually.

    My TV is indeed a 4K TV but I want to keep 1080p/60Hz for different reasons.

    Now my questions are:

    Why is it even possible LE changes this by itself?

    Is there any way I can prevent this behaviour (I don't know if it would help but the idea of taking 4096p/30Hz out of the whitelist would not be an adorable option to me)?

    Could it be that LE loses this specific setting after a crash?

  • Kodi saves settings on exit and it’s possible for save actions to be incomplete.. and on restart of a partial file is detected you can lose settings.

  • OK, so can I set this setting on the start of LE via script so that I will not have to change it manually again?

    I made the following script which I have tested and is indeed working to change the according value within guisettings.xml when executing manually from command line but I am not sure whether I have to auto-start the script via autoexec.py (which runs before user-login AFAIK) or via autostart.sh (which runs after user-login AFAIK).

    I guess when running it via autostart.sh I would also need a command to restart some kind of screen service/process or similiar? I don't think the screen settings will apply on-the-fly automatically by just changing the videoscreen.screenmode value within guisettings.xml, will they? If I need to restart a specific service/process, which additional command would I need to restart the according service/process?

    Or could I just use autoexec.py to start the script? In this case, would the script being executed before the screen settings apply to the TV screen?

    Here's the script's content I made:

    Bash
    #!/bin/sh
    xmlstarlet ed --inplace -u '//setting[@id="videoscreen.screenmode"]' -v "0192001080060.00000pstd" /storage/.kodi/userdata/guisettings.xml

    Thank you.

  • After struggling around now with autoexec.py, cronjobs and autostart.sh I found out there is a much better solution:

    Add two according XML code lines into advancedsettings.xml to tie the screen resolution to fixed values like this (example for 1080p/60Hz):

    Code
    <advancedsettings>
        <videoscreen>
            <resolution>17</resolution>
            <screenmode>0192001080060.00000pstd</screenmode>
        </videoscreen>
    </advancedsettings>

    Sources:

    [HowTo] Audio- & Auflösungseinstellungen fest in Kodi einstellen - Kodi allgemein - Kodinerds.net - Deutschsprachiges Forum zum Kodi Entertainment Center

    and

    AdvancedSettings.xml overriding guisettings.xml.

    Edit:

    After lots of tests now I mentioned the "abstracted" XML entries as shown above are not very reliable and pretty unstable.

    But it's really stable with the "full" XML entries instead, like this:

    Code
    <advancedsettings>
        <setting id="videoscreen.resolution">17</setting>
        <setting id="videoscreen.screenmode">0192001080060.00000pstd</setting>
    </advancedsettings>

    Have a look into the last provided link above for further explanation.