Kodi Community Forum

Full Version: Black flashes with Ubuntu 20.04 and intel j4105
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

During a slow lock down Saturday night I decided to upgrade my working Ubuntu 19.10 install to Ubuntu 20.04 and I am now seeing random black flashes and I cant work out what is causing them. Some observations:
  • Reading the kodi.log file after a flash seems to indicate that the flashes are related to the error "ERROR: CVaapi2Texture::Map: vaSyncSurface - Error: internal decoding error (23)"
  • Its happening fairly frequently with x264 content streamed from my local network samba shares. I havent noticed it with x264 live tv served up via the MythTV pvr addon, but the log timestamps show the above error message during live TV playback.
  • I can see vaapi is being used by Kodi via the player process screen.
  • I never saw these flashes with Ubuntu 19.10
  • Apart from the software upgrade, nothing else has changed in my setup.
  • Log files:

dpkg -l |grep mesa | pastebinit
https://paste.ubuntu.com/p/GKnkhbpkT7/

DISPLAY=:0 vainfo | pastebinit
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
https://paste.ubuntu.com/p/vTT899SHDf/

cat ~/.kodi/temp/kodi.log | pastebinit
https://paste.ubuntu.com/p/DzRqWZ7DSJ/

dmesg | pastebinit
https://paste.ubuntu.com/p/dtvHKsXy97/

id | pastebinit
https://paste.ubuntu.com/p/DRwM7syxyp/

amixer | pastebinit
https://paste.ubuntu.com/p/pg2NmXpz7K/

cat /var/log/Xorg.0.log | pastebinit
https://paste.ubuntu.com/p/5S9px8VSZG/

Any have any ideas as to what the issue is?
So i have gotten somewhere. Ubuntu 20.04 ships with mesa and a new intel driver called iris for gen 8+ GPUs.
Adding the LIBVA_DRIVER_NAME=i965 environment variable to /etc/environment fixes the black flashes for me. I'm guessing this forces vaapi to use the old i965 driver.
The Archi wiki intel driver page mentions that you can force OpenGL applications to use the i965 driver with the following environment variable MESA_LOADER_DRIVER_OVERRIDE=i965. I haven't tried this instead of the previous environment variable yet because kodi is currently in use, but its something I will try because Kodi's GUI doesnt feel as smooth since the upgrade to 20.04.
I have a Asrock J5005 (Intel HD605) machine, which has Ubuntu 20.04 installed newly on it (no update). Although I haven't used Kodi not that much on it yet, I haven't come across any flashing or flickering yet.

I'll keep the added environment variable in mind, should it happen.
Using just MESA_LOADER_DRIVER_OVERRIDE=i965 the GUI is smoother and FPS was higher when sitting in a menu by about 10fps, but the flashes still persist.
Ive enabled both environment variables now which is working well, though vainfo still shows the iHD driver in use:
Quote:DISPLAY=:0 vainfo
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Intel iHD driver for Intel® Gen Graphics - 20.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

I need to do some more digging, but I wonder if there is a way to completely disable the new iris driver.
(2020-05-27, 12:22)teeedubb Wrote: [ -> ]Bug report submitted here:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3052

The iHD VAAPI driver is not part of Mesa. You should report the bug here: https://github.com/intel/media-driver .
(2020-05-27, 16:35)yasij Wrote: [ -> ]The iHD VAAPI driver is not part of Mesa. You should report the bug here: https://github.com/intel/media-driver

Thanks for the heads up. Ive closed the mesa issue and raised one on the media-driver repo
https://github.com/intel/media-driver/issues/947
(2020-05-26, 11:06)teeedubb Wrote: [ -> ]install to Ubuntu 20.04 
Hello ,j4105 in ubuntu 20.04 , youtube 4k is played in chrome fine? hw acceleration work fine?
(2020-09-19, 14:50)alexandru82 Wrote: [ -> ]j4105 in ubuntu 20.04 , youtube 4k is played in chrome fine? hw acceleration work fine?

Why is this a Kodi question?
Install Chrome onto your Ubuntu J4105 box, and find out.