Kodi Community Forum
Intel VAAPI howto with Leia v18 nightly based on Ubuntu 18.04 server - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: Intel VAAPI howto with Leia v18 nightly based on Ubuntu 18.04 server (/showthread.php?tid=231955)



RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - qp9013625 - 2016-06-05

(2016-06-05, 13:36)fritsch Wrote: which also explains why 0% is the most non smart thing you can do.

Then why is 0% the default in a fresh Kodi installation Huh?

(2016-05-18, 08:17)fritsch Wrote: it makes absolutely no sense to allow HQ scaling when _no scaling_ (0 %) is applied -> therefore 20% should be considered.

Sorry, but there are several issues with this sentence:

1. 0% is the default setting in a fresh Kodi installation.

2. The setting is called "Enable HQ Scalers for scalings above: 0%". To me that means: It begins to use HQ scaling for things that require more than 0% (i.e. 0.000000000000001%). Yet you seem to suggest that it kicks in HQ scaling even when 0% scaling is required? Clearly there is some confusion here. Could you please explain?

(2015-07-12, 20:06)fritsch Wrote: If you have a Limited Range TV - you need to set "Use Limited Range" to On additionally. Also make sure that your GPU itself is running at full range, which this howto and also all OpenELEC images will do by default.

[...]

now we write the following into the created /home/kodi/.config/openbox/autostart file, this will automatically switch your TV to full range (please copy the lines, don't try to type the '` and so on, this code only works for one (1) connected TV, if you have multiple devices extend it to a loop):
Code:
OUTPUT=`xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q'`
xrandr -display :0 --output $OUTPUT --set "Broadcast RGB" "Full"
/usr/bin/kodi --standalone
openbox --exit

If I understand it correctly, doing it like this on a limited range TV would give you proper colors in Kodi but will give you crushed blacks on the desktop, since it will also output the dektop in full range, even though the TV expects limited range.

Is there any way to let the GPU output at full range in Kodi (with "Use Limited Range" option enabled in Kodi to counteract the crushed blacks) but at the same time ensure that the desktop is displayed in limited range?

Regards


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - fritsch - 2016-06-05

For the colors: No you don't understand correctly. Please use the forum search I explained this with great details and examples at least 10 times.

For the "above" as "really larger as". The scaling uses the max from two dimensions. As most 1920x1080 movies are ripped with the black bars removed they are 1920x800 or something - so this 0% would always trigger the scaling and technically:

Code:
float scaleX = fabs(((float)m_sourceWidth - m_destRect.Width())/m_sourceWidth)*100;
float scaleY = fabs(((float)m_sourceHeight - m_destRect.Height())/m_sourceHeight)*100;
int minScale = CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_HQSCALERS);
if (scaleX < minScale && scaleY < minScale)
  return false;

if (g_Windowing.IsExtSupported("GL_EXT_framebuffer_object") && (m_renderMethod & RENDER_GLSL))
{
  // spline36 and lanczos3 are only allowed through advancedsettings.xml
  if(method != VS_SCALINGMETHOD_SPLINE36
  && method != VS_SCALINGMETHOD_LANCZOS3)
   return true;
  else
    return g_advancedSettings.m_videoEnableHighQualityHwScalers;
}

not lower means: larger or equal ... so even 1920x1080 will tick it. The default is bad. PR is pending: https://github.com/xbmc/xbmc/pull/9915


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - qp9013625 - 2016-06-05

(2016-06-05, 14:54)fritsch Wrote: For the colors: No you don't understand correctly. Please use the forum search I explained this with great details and examples at least 10 times.

I only found the following thread:

http://forum.kodi.tv/showthread.php?tid=255197

And I don't see how this threads explains how I am wrong...

When you set the GPU to output at full range and your TV can only do limited range, then of course blacks will be crushed.

I understand that you can circumvent crushed blacks inside Kodi by enabling "Use Limited Range" in "Settings -> System -> Video Output".

But XFCE4 / MATE / GNOME / Unity / Cinnamon and so on do not have a "Use Limited Range" setting, so they will be displayed with crushed blacks when you set the GPU to output at full range and your TV can only do limited range.

So, what I am asking for is:

How can I apply your settings (setting GPU output to full range and setting Kodi to limited range), but at the same time keep the desktop at limited range (if at all possible)?

Besides, if you have explained it in great detail already, maybe make that thread (which I apparently did not find) a sticky thread (please)?

(2016-06-05, 14:54)fritsch Wrote: The default is bad. PR is pending: https://github.com/xbmc/xbmc/pull/9915

Okay, thank you.

If I understand correctly, 20% is the proper setting for 1080p TVs/monitors?

Could you please also suggest a percentage value for 720p TVs/monitors?

Or would 20% also be fine for 720p?

Also, I see that you have changed the description to say "A value below 5% makes limited sense as video is processed with high GPU load whithout any visible picture quality improvements.".

But at the same time you have left the minimum value at 0%.

Why not raise the minimum value to 5% then?

Also, why are the steps set to "10"?

Why not change the steps to "1"?

Regards


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - fritsch - 2016-06-05

:-( Read the PR my dear friend: https://github.com/xbmc/xbmc/pull/9915/commits/a9bb82ae82cfce000fcfc17bd2f90efccde2cd42#diff-92b91a5c902936f6e9a03f26b054d7d6R103 - new default 20 %

For your other question: Yes, this is kodi only. No chance for your desktop environment. For best desktop practice nowadays:

#if TV is Limited Range
1) When starting kodi, set xrandr to FULL (or set xrandr to VideoRange 16:235, which is _NOT_ in any mainline kernel, but in openelec / libreelec) - as this is a kodi appliance. Use it in combination with "Use Limited Range in kodi".
2) When exiting kodi, set xrandr to Limited 16:235 - that way all desktop applications which compute in Full Range anyways are "properly" scaled to your Limited Range TV
#else
1) When starting your computer (!) the whole computer. Set xrandr range to full to match your TV / monitor. Don't use kodi's Use Limited Range setting, but enable 8 bit dithering.
#endif


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - qp9013625 - 2016-06-05

(2016-06-05, 17:35)fritsch Wrote: :-( Read the PR my dear friend: https://github.com/xbmc/xbmc/pull/9915/commits/a9bb82ae82cfce000fcfc17bd2f90efccde2cd42#diff-92b91a5c902936f6e9a03f26b054d7d6R103 - new default 20 %

Yes, but you're always talking about 1080p output there.

What if the output is 720p? Is 20% good for 720p output as well?

(2016-06-05, 17:35)fritsch Wrote: #if TV is Limited Range
1) When starting kodi, set xrandr to FULL (or set xrandr to VideoRange 16:235, which is _NOT_ in any mainline kernel, but in openelec / libreelec) - as this is a kodi appliance. Use it in combination with "Use Limited Range in kodi".
2) When exiting kodi, set xrandr to Limited 16:235 - that way all desktop applications which compute in Full Range anyways are "properly" scaled to your Limited Range TV

Ah, thanks, this sounds like a good idea.

But how would you do this?

Could you please give an example on how one could set xrandr to full range upon starting Kodi and setting xrandr to limited range upon exiting Kodi?

Regards


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - fritsch - 2016-06-05

For a) as you currently spam my PR, here another math for you:

Which value would you need to set so that 720 x 576 content would be upscaled to 1280 x 720 with HQ scalers but everything > 1024 x 768 should not be upscaled / downscaled with this value.

Use the formula given here: http://forum.kodi.tv/showthread.php?tid=231955&pid=2352252#pid2352252

For b) no idea what distribution you use - startup scripts are distribution dependend. It is shown for this howto here - as this is what the thread is all about.


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - qp9013625 - 2016-06-05

(2016-06-05, 19:15)fritsch Wrote: For b) no idea what distribution you use - startup scripts are distribution dependend. It is shown for this howto here - as this is what the thread is all about.

This thread is about Ubuntu 16.04 and I am using Ubuntu 16.04 (Xubuntu 16.04 to be precise).

And in this thread here (specifically the first post) I do not see an example on how one could set xrandr to full range upon starting Kodi and setting xrandr to limited range upon exiting Kodi...


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - fritsch - 2016-06-05

This thread is about a minimal howto while providing a systemd script for automatically starting kodi. It's not about any full blown desktop. You already showed the code, that does it via openbox's autostart script. As you run lubuntu with openbox yourself -> you already have your answer.

Image


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - qp9013625 - 2016-06-05

(2016-06-05, 19:36)fritsch Wrote: As you run lubuntu with openbox yourself -> you already have your answer.

This shows how well you read my posts. I said I am running Xubuntu, not Lubuntu.

(2016-06-05, 19:36)fritsch Wrote: You already showed the code

This code only sets xrandr to full range upon startup.

What would the code look like for setting xrandr back to limited range upon exit?


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - fritsch - 2016-06-05

Open your own thread. You are offtopic here (just to show you how well you read the threads you are posting in).


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - Wagg - 2016-06-06

Installed the latest Ubuntu version but can't seem to get any of the PVR add-ons to show up. Any ideas?


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - fritsch - 2016-06-06

If you followed the howto - the pvr addons are there ... if you did not follow the howto open your own thread.

Quote:fritsch@t440s:~$ apt-cache search kodi-pvr
vdr-plugin-vnsiserver-dbg - VDR plugin to provide PVR backend services for Kodi
vdr-plugin-vnsiserver - VDR plugin to provide PVR backend services for Kodi
kodi-pvr-dev - Kodi Media Center (PVR Add-on Dev package)
kodi-pvr-argustv - ArgusTV PVR for Kodi
kodi-pvr-demo - Demo PVR for Kodi
kodi-pvr-dvbviewer - DVBViewer PVR for Kodi
kodi-pvr-iptvsimple - Simple IPTV PVR for Kodi
kodi-pvr-mediaportal-tvserver - MediaPortal PVR for Kodi
kodi-pvr-mythtv - MythTV PVR for Kodi
kodi-pvr-nextpvr - NextPVR for Kodi
kodi-pvr-njoy - NJOY PVR for Kodi
kodi-pvr-tvheadend-hts - transitional dummy package
kodi-pvr-vdr-vnsi - VDR PVR for Kodi
kodi-pvr-vuplus - Vu+ PVR for Kodi
kodi-pvr-hts - TVHeadEnd PVR for Kodi
kodi-pvr-hts-dbg - debugging symbols for TVHeadEnd PVR for Kodi
kodi-pvr-vdr-vnsi-dbg - debug symbols for VDR PVR for Kodi
kodi-pvr-nextpvr-dbg - debug symbols for NextPVR for Kodi
kodi-pvr-argustv-dbg - debug symbols for ArgusTV PVR for Kodi
kodi-pvr-mediaportal-tvserver-dbg - debug symbols for MediaPortal PVR for Kodi
kodi-pvr-vuplus-dbg - debug symbols for Vu+ PVR for Kodi
kodi-pvr-njoy-dbg - debug symbols for NJOY PVR for Kodi
kodi-pvr-iptvsimple-dbg - debug symbols for Simple IPTV PVR for Kodi
kodi-pvr-dvbviewer-dbg - debug symbols for DVBViewer PVR for Kodi
kodi-pvr-wmc - WMC PVR for Kodi
kodi-pvr-wmc-dbg - debugging symbols for WMC PVR for Kodi
kodi-pvr-mythtv-dbg - debug symbols for MythTV PVR for Kodi
kodi-pvr-demo-dbg - debug symbols for Demo PVR for Kodi
kodi-pvr-pctv - PCTV PVR for Kodi
kodi-pvr-pctv-dbg - debug symbols for PCTV PVR for Kodi
kodi-pvr-dvblink - DVBLink PVR for Kodi
kodi-pvr-dvblink-dbg - debug symbols for DVBLink PVR for Kodi
kodi-pvr-filmon - FilmOn PVR for Kodi
kodi-pvr-filmon-dbg - debug symbols for FilmOn PVR for Kodi
kodi-pvr-stalker - Stalker PVR for Kodi
kodi-pvr-stalker-dbg - debugging symbols for Stalker PVR for Kodi
kodi-pvr-vbox - VBox Home TV Gateway PVR client for Kodi
kodi-pvr-vbox-dbg - debug symbols for VBox Home TV Gateway PVR client for Kodi
kodi-pvr-hdhomerun-dbg - debug symbols for HDHomeRun PVR for Kodi
kodi-pvr-hdhomerun - HDHomeRun PVR for Kodi



RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - Wagg - 2016-06-07

Nevermind, I figured it out. For some reason the packages weren't loading properly.

Anyways, one thing I did notice was that the HDHomerun PVR addon is stuck in PCM even when I am getting bitstreaming with file playback (this is with sync framerate to display OFF). DD, DTS-HD and everything else plays back
properly, but live TV does not. This must be a problem with the addon because the standalone HDHomerun addon plays back DD just fine.


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - fritsch - 2016-06-07

Passthrough is disabled for LiveTV out of technical reasons. If you want AC3 output from LiveTV enable AC3 Transcode and set your number of speakers to 2.0 - PCM output is far superior to passthrough, especially with live media.


RE: Intel VAAPI howto with Krypton v17 based on Ubuntu 16.04 server - Wagg - 2016-06-08

Interesting. So you're saying don't even bother with passthru/transcoding and stick to PCM for live TV? What about everything else, like DTS-HD encoded movies?

Also, I noticed that for all my file playback (like 1080p video) I will get considerable jitter with VAAPI - Motion Compensated. Vaapi Motion Adaptive or BOB doesn't seem to exhibit this.