Kodi 17 on Ubuntu – strange freezing

Hello,
First of all let me describe you my setup. I have a small G8 server which i use as a HTPC. The server is running Ubuntu 16.04 and has a Nvidia GT 630 video card. The video card output runs through a receiver, and goes to a TV through HDMI. I’m running Kodi 17 as a desktop environment – as soon as the server is started it boots the Ubuntu directly to Kodi.

I use my server also for some other activities and i log into it through remote desktop. Two days ago i decided to switch the desktop environment from Unity to KDE. Everything went fine until i discovered some strange behavior from Kodi.

Even before the migration to KDE every time i turn off the TV and leave it for a longer period of time (for example turn it off in the evening with the server running in the background) i discover the picture like that:

[Image: 20170319_135236.jpg]

Everything was fine because when i started a movie or just hit play the picture just blinked and was fixed.

Right now about 50% of the time i can navigate through the Kodi menus, i can choose a movie, change setting etc but when i try to play something Kodi just freezes. It does not react on any kind of input and the pictures freezes on the menu. Sometimes i hear the sound of the movie playing in the background, but the picture is frozen and the only way to fix it is to reboot the server.

I’m attaching extracts from 2 logs, which i took this morning when it crashed. From the Kodi log i can see the time when i turned off the TV and than the time at which i tried to play a movie but it failed. The syslog extract shows the time when i turned on my TV when the driver was “discovering” the TV and than 10 mins later when i tried to play a movie and it crashed.

I remember back on my old setup i had to manually generate an EDID file and attach it to my xorg.conf file. But back then i was using Ubuntu 14 and a specific Nvidia driver which required this, otherwise when i turn off my TV and than turn it on after few hours i got only black screen. Is this a similar problem? Do you think the Nouveau driver requires something similar? I migrated from Ubuntu 14 to 16 just to avoid such issues.

Here are the two logs:

Kodi.log

Syslog