Screen tearing issue with Nvidia GPU

  • Hi, I've just installed LibreELEC on my computer because I had some issues with Kodi on my regular Ubuntu install, but now I get huge screen tearing as I also did on my Ubuntu. This is as far as I know a well known issue with Nvidia on Linux. On Ubuntu I just had to enable "force full composition pipeline" in Nvidia settings to fix it, but I'm not sure how to do this on LibreELEC. Also, I'd like that to be permanent, because on Ubuntu it seems to go away after a restart. Any help would be greatly appreciated!

  • You can do that by adding a xorg.conf file to the .config folder.

    But there are issues with nvidia.

    I'll post my findings later today.

    Also look at my posts in the libreelec-RR thread.

  • Hi, I've just installed LibreELEC on my computer because I had some issues with Kodi on my regular Ubuntu install, but now I get huge screen tearing as I also did on my Ubuntu. This is as far as I know a well known issue with Nvidia on Linux. On Ubuntu I just had to enable "force full composition pipeline" in Nvidia settings to fix it, but I'm not sure how to do this on LibreELEC. Also, I'd like that to be permanent, because on Ubuntu it seems to go away after a restart. Any help would be greatly appreciated!

    Read this section X

    This worked for me on my intel system

  • bionor : With the help of 5Schatten (LibreElec-RR), I did some tests to fix screentearing. This seems to be a big issue in Linux, as there are lots of posts about it on the www.

    What did i find so far :

    On AMD/Ati videocards you fix the tearing bij adding this xorg.conf file to the .config folder: (i'll explain later how-to)

    Code
    Section "Device"
        Identifier  "Radeon"
        Driver      "radeon"
        Option "DRI" "3"
        Option "TearFree" "on"
        Option "AccelMethod" "glamor"
    EndSection

    If you have an Intel videocard, use this xorg.conf:

    Code
    Section "Device"
        Identifier  "Device0"
        Driver      "intel"
        VendorName  "INTEL Corporation"
        Option "TripleBuffer" "true"
        Option "TearFree" "true"
    EndSection

    I you have a Nvidia videocard, it is more complex, and there is the following issue:

    The screentearing fix works fine, as long as the screen-refresh rate stays on the same Hz as the initial Hz when Libreelec boots.

    If you use "Adjust display refresh-rate" (and then play f.i. a 24 fps video) the fix for the screen-tearing is disabled, until the next reboot.

    For Nvidia use the following xorg.conf file: (with the auto-select forcefullcompositionpipeline => mostly 60Hz )

    To force a 50Hz boot-up refesh-rate, you could use this option, instead of the auto-select :

    Code
     "metamodes" "1920x1080_50 +0+0 {ForceFullCompositionPipeline=On}"


    How to add the xorg.conf file to LibreElec:

    1) Make yourself "Expert" user.

    2) Find out which brand of video card is in your system : Settings/System_information/video.

    3) Make (on another PC) a 'plain text' file named: Xorg.conf, put the correct code in the file and save it on a USB-stick.

    You can use NotePad, but make sure, windows does NOT add the '.txt' extension at the end of the filename.

    4) In libreelec : Settings/Media/General , set all switches to "On".

    5) In libreelec : Settings/File manager, Add_source/browse/home folder, select the .config folder and click 'ok'.

    6) In file_manager, open the .config folder in the left pane, insert the USB-stick and open that in the right pane.

    7) Select the xorg.conf file, and use the context_menu (c key on the keyboard) to copy the xorg file to the .config folder.

    Now you have to reboot librelec to activate the video-card settings.

    WARNING: IF YOU SELECT THE WRONG FILE FOR YOUR VIDEO-CARD, LIBREELEC WILL NOT BOOT !!

    You need to SSH into the linux system to delete the wrong file, and reboot, or re-install libreelec from scratch.

    So make sure you have a full LibreElec system backup on your USB-stick before you start modifying the xorg.conf.

    I tested this on several AMD,Intel and Nvidia cards with Kodi Leia (Mesa 19.1.x), and it works fine. (except for the Nvidia issue)

    When you use the LibreElec build-in chrome browser, you need to do this, otherwise the screen will tear like hell...

    Good luck !

    Edited once, last by Meganiekje (August 12, 2019 at 1:21 PM).

  • Thank you so much, both of you :) This fixed it. Sorry for the late reply, but I didn't get the chance to look at it until now. In the end I ended up copying the xorg.conf from my Ubuntu install and adapting it with this here because I have two screens, one monitor connected via DVI and a TV connected via HDMI, so that way the setting got applied to the correct screen. In hindsight it might have sufficed to to just change from screen 0 to screen 1, but at least now it works :)