Kodi Community Forum

Full Version: Video stuttering with VAAPI on specific streams
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi folks,

I am having problems with playback of specific streams when VAAPI hardware acceleration is enabled.
When I switch to software decoding everything is fine. As well the same stream plays well on a
Acer Revo with NVidia graphics, so it looks this is related to Intel / VAAPI. As well this is
related to KODI Helix since the same video plays well on XBMC Gotham. Other players
(vlc, avplay, mplayer) plays the stream wthout problems as well.

Obviously there is one frame in the stream on which KODI fails somehow and skips it (according
to the stream info overlay - skip counter is increased when this happens). Visually the video "hangs"
repeating quickly the same two frames for 2-3 seconds - then it continues to play well. Audio
is fine all the time.

This happens from time to time and is of course quite annoying Wink
The following messages appear in kodi.log:

Code:
16:35:16 T:140309585450752   ERROR: VAAPI::FFGetBuffer - no surface available - dec: 1, render: 3
16:35:16 T:140309585450752   ERROR: Decode - avcodec_decode_video returned failure
16:35:16 T:140309400909568  NOTICE: COutput::OnExit: Output Thread terminated
16:35:16 T:140309585450752  NOTICE: VAAPI::Close - closing decoder context
16:35:16 T:140309400909568  NOTICE: Thread Vaapi-Output start, auto delete: false
16:35:16 T:140309400909568  NOTICE: COutput::OnStartup: Output Thread created
16:35:16 T:140309551879936  NOTICE: Thread Vaapi-Output start, auto delete: false
16:35:16 T:140309551879936  NOTICE: COutput::OnStartup: Output Thread created

16:35:19 T:140311345567680  NOTICE: VAAPI::Close
16:35:19 T:140309400909568  NOTICE: COutput::OnExit: Output Thread terminated

That's the lspci output for my graphics controller:

Code:
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)

CPU is i5-4670S.

I am using KODIbuntu 64bit with everything up-to-date as of this post.

I uploaded a 16 seconds chunk (about 8.4 MB) which shows the error. It's not 100% reproducable, but
happens on 2 of 3 tries for me. The error is at position 0:03-0:06 in the video.

http://ul.to/file/tgbhf5yx/video-stutter-at-3s.mp4

That's the avprobe output of the video:

Code:
avprobe version 11-6:11-1, Copyright (c) 2007-2014 the Libav developers
  built on Sep 26 2014 14:36:31 with gcc 4.9.1 (Ubuntu 4.9.1-15ubuntu1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tmp/video-stutter-at-3s.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01 00:00:00
    title           : broken2.mp4
    encoder         : Lavf52.78.3
  Duration: 00:00:16.34, start: 0.000000, bitrate: 4294 kb/s
    Stream #0.0(und): Video: h264 (Main), yuv420p, 1280x720, 4158 kb/s, 59.94 fps, 59940 tbn, 119.88 tbc (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00
    Stream #0.1(und): Audio: aac, 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00

If you need more information just tell me what I should provide (and how).

Thanks a lot!
please post full debug log
Also provide: dmesg | pastebinit (Edit: _after_ it has hung).

It seems you are triggering a famous kernel bug with a stuck render ring.
Thanks for your response!

This is the debug log: http://paste.ubuntu.com/9646364/
This is dmesg output: http://paste.ubuntu.com/9646370/

In the debug log you see that the Log Uploader Addon crashed with a 504 gateway timeout, that's
why I uploaded it to pastebin as well.

The error happens at timestamp 17:57:39 T:140515391551232.

Thanks a lot!
You can verify the fix, by doing from a lubuntu terminal:
Code:
sudo apt-get build-dep xbmc
git clone https://github.com/xbmc/xbmc.git
cd xbmc
git remote add fernetmenta https://github.com/FernetMenta/xbmc.git
git fetch fernetmenta
git cherry-pick 41282d141de22c7553947f8cebeec88c936ec041
./bootstrap
./configure --enable-vaapi --disable-vdpau --disable-libcec --enable-optimizations
make -j5

You can then start kodi with:
Code:
./kodi.bin

from that folder.

As commit, you need to take: 41282d141de22c7553947f8cebeec88c936ec041 <- this forum formats that as a link, you need to take the hash 41282d141de22c____7553947f8cebeec88c936ec041 (remove the ____)
Thanks for the information, but I was little quicker Wink
Just checked out the source with "apt-get source"
and applied FernetMentas one-liner by hand. Rebuild is in
progress... I will report immediately if that fixes
it for me.
YOU GUYS ROCK! Smile

Stuttering is away with FernetMentas fix!

And my compilation at first failed on xbmc/peripherals/devices/PeripheralCecAdapter.o
but fritschs "configure --disable-libcec" line gave me the clue to change the correspondent entry
in debian/rules - then everything compiled well!

Thanks a bunch!!!!
Hi,
first of all sorry for my bad english.
I'am new in the linux world.
I have the same problem as nbaaddicted.
First i have searched for the file VAAPI.cpp, but i could not find it on my computer.
Next i tried the terminal commands accordingly to the attachement of fritsch.
At the command "git cherry-pick 41282d141de22c7553947f8cebeec88c936ec041" i became a failure, than i did the other commands.
I do not know more??
Could someone please help me?
Here is my log File.
Without the cherry-pick you probably compiled a vanilla KODI without the patch in question...

But if all the other commands worked and you got a usable kodi.bin afterwards you can apply the fix by hand (as I did).

Just edit the file xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp in the directory where you issued the git clone command and change the one line according to this patch:

https://github.com/FernetMenta/xbmc/comm...8c936ec041

Then issue "make -j 5" again.

Hope this helps.

Otherwise wait on KODI 14.1 which should the patch (as stated in the toplevel 14.1 beta thread).
Hello,
thank you nbaaddicted this works for me, the failure is no longer in the log file.
But my problem is not solved.
Problem in detail:
When i watch live tv in the preview mode (no fullscreen with channel list on the left side) or i switch between the channels (fullscreen)
than i have inital interferences. Also then become even interferences on while watching, but these are rare.
This happen especially at the hd channels.
I use the pvr tvheadend addon.

Could someone please help me?
Here my new log file:
SORRY!!! I have not been able to upload the file, so I have divided them. I know that does not meet the forum rules. SORRY

At the end of the session, xbmc crashes.

First part:
------remove log spam -------------
use pastebin.com !
Don't work, it says i will upload a empty file
Try with a recording. If it happens with the recording, upload a part of it. I think it's garbage coming from the backend - as always.
Ok.
I had uploaded a clip, see the link below.
https://www.mediafire.com/?c2xwwlrnp3j3cxr

Furthermore i uploaded the log.file from the previous post to pastebin.com, at this time i use the site not the terminal. See the link below
http://pastebin.com/6LjTm8e7#

fritsch i think you are right. I see the interferences in the vid..

edit:
Meanwhile I have interrupted audio and interferences in the remaining programs,
without changing somethingHuh
Pages: 1 2