Linux Intel VA-API Driver no smooth playback (help needed) with 30fps content
#1
Hi,

I have a problem with getting smooth playback on my Samsung TV 1920x1080 at 60 Hz via HDMI attached to my MacMini (Intel® Core™ i7-3615QM CPU @ 2.30GHz) running Debian 9.

The problem occurs with some 30fps (29.674fps actually) 1080p content but not with 24fps (23.976 actually) 720p content. The problem occurs especially with camera panning. Some parts of the screen start to stutter when the panning is occurring. Here is an example: https://imgur.com/aXM9WTL. The faster the panning, the longer the lines that are not aligned to each other.

The problem did not exist with my previous installation on the MacMini using macOS and Kodi 17. So it must be a software or configuration issue.

I'm honestly out of ideas what caused this and how to fix it. I tried all the common settings - see below.

Thank you in advance for any ideas how to fix this.

Cheers
Peter


Debian GNU/Linux 9 (stretch)
Kodi Version: 2:17.1+dfsg1-3
inteldrmfb driver initializes i915 with version 1.6.0 20160919


I tried Kodi settings "sync playback to display" and "adjust display refresh rate".

I've tried variations of multiple X11 settings:


driver "intel"
Option     "AccelMethod"        "uxa" / "glamor" / "sna"
Option     "DRI"                "3"
Option     "VSync"              "true"
Option     "TripleBuffer"       "true"
Option     "TearFree"           "true"


because I read that the intel driver is buggy:

driver "modesetting"

I also tried this:

Section "Extensions"
  Option "Composite" "Disable"
EndSection


I start Kodi without a window manager from lightdm:

/usr/sbin/lightdm
 \_ /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
 \_ lightdm --session-child 12 15
     \_ /bin/sh /usr/bin/kodi-standalone


Kodi indicates that VA-API (HW) is being used during playback:
decoder ff-h264-vaapi with 1.78 AR and 30.303 FPS (!= what mediainfo reports)

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3)
vainfo: Driver version: Intel i965 driver for Intel® Ivybridge Mobile - 1.7.3
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD


Bad content 30fps:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 49 min 0 s
Bit rate mode                            : Constant
Bit rate                                 : 8 000 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 29.674 FPS
Original frame rate                      : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.130
Stream size                              : 2.66 GiB (98%)
Default                                  : Yes
Forced                                   : No


Good content 24fps:

ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 44 min 24 s
Bit rate                                 : 6 017 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.272
Stream size                              : 1.87 GiB (92%)
Writing library                          : x264 core 155 r2901 7d0ff22
Reply
#2
(2018-03-16, 21:59)throwie1087 Wrote: Hi,

I have a problem with getting smooth playback on my Samsung TV 1920x1080 at 60 Hz via HDMI attached to my MacMini (Intel® Core™ i7-3615QM CPU @ 2.30GHz) running Debian 9.

The problem occurs with some 30fps (29.674fps actually) 1080p content but not with 24fps (23.976 actually) 720p content. The problem occurs especially with camera panning. Some parts of the screen start to stutter when the panning is occurring. Here is an example: https://imgur.com/aXM9WTL. The faster the panning, the longer the lines that are not aligned to each other.

The problem did not exist with my previous installation on the MacMini using macOS and Kodi 17. So it must be a software or configuration issue.

I'm honestly out of ideas what caused this and how to fix it. I tried all the common settings - see below.

Thank you in advance for any ideas how to fix this.

Cheers
Peter


Debian GNU/Linux 9 (stretch)
Kodi Version: 2:17.1+dfsg1-3
inteldrmfb driver initializes i915 with version 1.6.0 20160919


I tried Kodi settings "sync playback to display" and "adjust display refresh rate".

I've tried variations of multiple X11 settings:


driver "intel"
Option     "AccelMethod"        "uxa" / "glamor" / "sna"
Option     "DRI"                "3"
Option     "VSync"              "true"
Option     "TripleBuffer"       "true"
Option     "TearFree"           "true"


because I read that the intel driver is buggy:

driver "modesetting"

I also tried this:

Section "Extensions"
  Option "Composite" "Disable"
EndSection


I start Kodi without a window manager from lightdm:

/usr/sbin/lightdm
 \_ /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
 \_ lightdm --session-child 12 15
     \_ /bin/sh /usr/bin/kodi-standalone


Kodi indicates that VA-API (HW) is being used during playback:
decoder ff-h264-vaapi with 1.78 AR and 30.303 FPS (!= what mediainfo reports)

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3)
vainfo: Driver version: Intel i965 driver for Intel® Ivybridge Mobile - 1.7.3
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD


Bad content 30fps:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 49 min 0 s
Bit rate mode                            : Constant
Bit rate                                 : 8 000 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 29.674 FPS
Original frame rate                      : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.130
Stream size                              : 2.66 GiB (98%)
Default                                  : Yes
Forced                                   : No


Good content 24fps:

ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 44 min 24 s
Bit rate                                 : 6 017 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.272
Stream size                              : 1.87 GiB (92%)
Writing library                          : x264 core 155 r2901 7d0ff22
Hi Peter. The genius folk on here always seem to ask for logs. Can you repeat the issue with debugging turned in and repost with the attached logs?

Littlejeem.
Reply
#3
Sure: https://gist.github.com/anonymous/53b2ec...e5616331d8
Reply
#4
at the first look...outdated Kodi (17.1 instead of 17.6), wrong ffmpeg version (3.2.x instead of 3.1), probably outdated mesa driver (IIRC we are at 17.xxx instead of 13. But I could be wrong because of Debian) and:

10:15:49.569 T:140501651105536 DEBUG: ReadEditDecisionLists - Assuming 1080i interlaced content. Adjusted frames per second from 30.303 to 15.152

that sounds a bit strange to me as ffmpeg reports something different:

0:15:49.563 T:140501651105536 INFO: ffmpeg[7FC917012700]: Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 30.30 fps, 30.30 tbr, 1k tbn, 59.94 tbc (default)

Not too sure about that, someone else need to jump in.
Reply
#5
@littlejeem

You really need to quote the entire opening post for a single line reply? Smile
Reply
#6
In the Kodi UI it shows it's playing as 30.303 FPS.
Reply
#7
(2018-03-17, 15:47)throwie1087 Wrote: In the Kodi UI it shows it's playing as 30.303 FPS.
To be honest, we're not big fans of Debian, as it always seems to use its own rules on what and how to compile to run an earlier version of Kodi. Using plain Ubuntu works so much simpler and easier for Kodi.

Or, if you ONLY want to run Kodi, try LibreELEC as a tiny Kodi-only Linux setup. You can testdrive it via a bootable USB stick.
Reply
#8
Today, I built Kodi from source (17.6 Git:2018-02-12-7e52c1d). Problem is still there Sad

https://gist.github.com/anonymous/535486...559d342b3e

I guess I'll start testing the various X11 and Kodi settings again, as described in OP, with 17.6.
Reply
#9
what method did you choose for deinterlacing?
Reply
#10
https://en.wikipedia.org/wiki/Telecine
https://en.wikipedia.org/wiki/Three-two_pull_down

Originally 23.976Hz content looks horrible at 29.97Hz, inverse telecine (IVTC) technique might be able to fix it.

Picture problem might also be caused by lack of deinterlacing.
Reply
#11
It was set to VAAPI Bob. I tried VAAPI Motion Adaptive, VAAPI Motion Compensated, Bob, Deinterlace. I also played around with Video Scaling, defaulting to Bilinear, and trying Auto and Nearest Neighbour.
Reply
#12
Yeah, so it seems it's an issue with de-interlacing, or basically a full lack of de-interlacing. I tested using a SW decoder and also switching off HW VAAPI de-interlacing; the output looks the same, and the on screen shows "deinterlace method: none" despite the different settings. In 2014 @fritsch said that there is no de-interlacing but that is 4 years ago. The solution seems to be to switch to OpenELEC^WLibrelec, is that the only option?
Reply
#13
Why donˋt you provide a short sample for us to reproduce what you are observing
Reply

Logout Mark Read Team Forum Stats Members Help
Intel VA-API Driver no smooth playback (help needed) with 30fps content0