Linux NUC - high CPU usage for some h264 files
#1
I have installed KodiBuntu on NUC DN2820FYKH box and I observe frame drop and high CPU usage for some but not all HD movies.

I have installed latest KodiBuntu image but then I also upgraded it to Ubuntu 14.10 (I also tried 15.04 but that broke too many things I had to reinstall it again and stop at 14.10). Kodi version is 14.2 Git:7cc53a9, enabled acceleration, disabled VDPAU, enabled VAAPI.

For files that play normally I see this sort of messages in the log:
Quote:07:15:19 T:140678160283840 NOTICE: GL: Using VAAPI render method
07:15:19 T:140678160283840 NOTICE: GL: NPOT texture support detected
07:15:19 T:140678160283840 NOTICE: GL: Using GL_ARB_pixel_buffer_object

Files that drop frames ad cause 140% CPU load show something like this:
Quote:07:21:28 T:140678160283840 NOTICE: GL: Selecting Single Pass YUV 2 RGB shader
07:21:28 T:140678160283840 NOTICE: GL: NPOT texture support detected
07:21:28 T:140678160283840 NOTICE: GL: Using GL_ARB_pixel_buffer_object

Running with debug the difference that I can see is in the message (this is for "good" files):
Quote:DEBUG: OutputPicture - change configuration. 1920x1080. framerate: 23.98. format: VAAPI

vs one for "bad" files:
Quote:DEBUG: OutputPicture - change configuration. 1920x1080. framerate: 23.98. format: VAAPI_NV12

Looking at MediaInfo for those files I do not actually see any difference in their subsampling, color space or bit depth, so I'm not sure why is this difference in formats (VAAPI vs VAAPI_NV12).

Could someone tell me why kodi does things differently for those files and how to force it use GPU for VAAPI_NV12 files as well?

Thanks,
Andy
Reply
#2
Don't cut logfiles ... nobody can see the issue. VAAPI_NV12 means, that you have set: Prefer VAAPI Render Method to Off or you force the Deinterlace Method: Deinterlace.

VAAPI_NV12 copies all frames back to system memory for CPU post processing after decoding.

Edit: As you talk about 140% load - It seems you have force Deinterlace to On and use Deinterlacing-Method to Deinterlace. This is pure BS for progressive content. For interlaced content, update to latest wsnipex vaapi ppa und use VAAPI_MADI and _never_ force Deinterlace, keep this setting to Auto.

Methods that need CPU copy: Deinterlace (high load 100% on a celeron C1007, 140% on a weak BYT), Bob (+ 10% cpu load) <- Copy is done with sse4 intrinsics and very performant.
Methods that use VPP: VAAPI-Motion adaptive(*), VAAPI-Motion compensation(*), VAAPI-BOB

Never set Deinterlace to On, keep it on Auto
Deinterlace-Method: SNB, IVB, Baytrail: VAAPI-Motion adaptive with (*), HSW, BDW, BSW: VAAPI-Motion compensated


* If you want to run these methods on IVB / SNB based systems (which the Baytrail NUC is), you need at least libva-driver-intel 1.6.0.pre1 or use wsnipex vaapi ppa for ubuntu.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#3
Frankly I have no idea what you are talking about. I browsed through all settings but none of them talks about Deinterlace. I'm sure I did not change anything (except trying to disable VDPAU) and this is fresh install so all other setting should be at their defaults. What is peculiar is that some HD files play with 30% CPU load, while others take 140% and I do not see anything obviously different in those files (looking with MediaInfo) and all of them are progressive.

I made debug logs, hope someone can get some info from them.

Here is the log for the file which causes high CPU (140%) load: http://xbmclogs.com/p5e7vli9n

Here is the log for the file which runs with normal CPU (30%): http://xbmclogs.com/pik8rbhsv

Here is media info for video stream from high-cpu file:
Code:
Video
ID/String                        : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format_Profile                   : [email protected]
Format_Settings_CABAC/String     : Yes
Format_Settings_RefFrames/String : 5 frames
CodecID                          : V_MPEG4/ISO/AVC
Duration/String                  : 2h 12mn
BitRate/String                   : 17.5 Mbps
Width/String                     : 1 918 pixels
Height/String                    : 800 pixels
DisplayAspectRatio/String        : 2.40:1
FrameRate_Mode/String            : Constant
FrameRate/String                 : 23.976 fps
ColorSpace                       : YUV
ChromaSubsampling                : 4:2:0
BitDepth/String                  : 8 bits
ScanType/String                  : Progressive
Bits-(Pixel*Frame)               : 0.476
StreamSize/String                : 16.2 GiB (87%)
Encoded_Library/String           : x264 core 135 r2345 f0c1c53
Encoded_Library_Settings         : cabac=1 / ref=5 / deblock=1:-3:-3 / analyse=0x3:0x113 / me=tesa / subme=10 / psy=1 / psy_rd=1.05:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=7 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=17.0 / qcomp=0.65 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.30 / pb_ratio=1.30 / aq=1:0.80 / zones=180660,190031,crf=30
Language/String                  : English
Default/String                   : Yes
Forced/String                    : No

And here is the same for normal-cpu file:
Code:
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                                 : 2h 6mn
Bit rate                                 : 9 232 Kbps
Width                                    : 1 920 pixels
Height                                   : 800 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.251
Stream size                              : 7.98 GiB (79%)
Writing library                          : x264 core 76 r1271 496d79d
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=9232 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

LEt me know if this helps
Reply
#4
Quote:19:03:06 T:140125104219904 DEBUG: ffmpeg[7F716B0FA700]: [out] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_yadif_0' and the filter 'out'

Like I said.

Play a Video, press enter, go to the film role. Here select:
Deinterlace: Auto
Deinterlace-Method: VAAPI-BOB
Scaling: Bilinear

Navigate down and choose: Save for all files.

done.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#5
Thanks, works perfectly! It never occurred to me to look into that menu for clues (and I would never know what to select even if I looked). Why is that option not default one?

Thanks again for quick help.
Reply
#6
Default is:

Deinterlace: Auto
Deinterlace-Method: Auto
Scaling: Auto

which would also work perfectly fine - yeah - we did not alter those settings :-)
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#7
Interesting, I did not touch those settings until you told me how to get to them.
Reply
#8
Let me say you: You did :-) Be it by accident or you have just forgotten it, hehe.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
NUC - high CPU usage for some h264 files0