XBMC SVN performance regression on ION
#1
At the risk of pointing out a possible issue with what is obviously still in development, I wanted to raise this in the forums in case there's already a solution or if it's already a known issue. The bug tracker instructions make it clear to post in the forums first 'If you're not sure...'

Firstly, just discovered XBMC and am extremely impressed. Which is why I'm posting, because I want to see it get better.


Platform -- Viewsonic VOT132, aka re-badged Foxconn nt330i: Atom 330, 1.6GHz, 2GB RAM.

Repeatable source -- the main video I'm testing with is Big Buck Bunny (1080p MP4).

Issue:
  • 1080p stuttering playback on XBMC SVN when XBMC interface overlays playing video.
  • In general, that stuttering actually occurs (and which bringing up menus compounds).
And note that (after testing):
  • Issue does not occur using the XBMC 9.11 release. Both full screen playback and overlaying XBMC GUI is seamless in 9.11.
  • Issue does not occur using mplayer -vo vdpau (including overlaying other GUI elements from Ubuntu)

VDPAU is working, at least going by mplayer and XBMC 9.11. But something appears to have changed since 9.11 in the XBMC SVN that's causing a slowdown. This is using both XBMC SVN repos and compiling current XBMC SVN.

Elements ruled out through testing:
  • Ubuntu versions 9.10 and Ubuntu 10.04 as a base
  • Xorg versions (1.6.4 and 1.7, aka bundled with Ubuntu 9.10 and 10.04)
  • Kernel versions (2.6.31, 2.6.32 and 2.6.33 series tested)
  • Nvidia driver versions 195.36.24, 256.25, and 256.29 (and yes, VDPAU always enabled in XBMC)

Conclusions so far:
  • Turning on debugging in XBMC SVN, CPU-XBMC shows > 100% usage when stuttering. XBMC-CPU monitor reports 0.0% usage static under XBMC 9.11, so hard to compare. But there is no stuttering in XBMC 9.11 during playback when menus are overlaid. What has become more CPU intensive in XBMC SVN?

  • Log reports the following snippet:
    Code:
    23:06:46 T:140187886941968 M:1609838592   DEBUG: CDVDFactoryCodec: compiled in hardware support: CrystalHD:no OpenMax:no VDPAU:yes VAAPI:no
    23:06:46 T:140187886941968 M:1609838592   DEBUG: FactoryCodec - Video:  - Opening
    23:06:46 T:140187886941968 M:1609838592   DEBUG: Loading: /usr/local/lib/xbmc/system/players/dvdplayer/swscale-0.6.1-x86_64-linux.so
    23:06:46 T:140187886941968 M:1609838592  NOTICE: CDVDVideoCodecFFmpeg::Open() Creating VDPAU(1920x1080, 13)
    23:06:46 T:140187886941968 M:1607634944  NOTICE: vdp_device = 0x00000001 vdp_st = 0x00000000
    23:06:46 T:140187886941968 M:1607634944  NOTICE: VDPAU Decoder capabilities:
    23:06:46 T:140187886941968 M:1607634944  NOTICE: name          level macbs width height
    23:06:46 T:140187886941968 M:1607634944  NOTICE: ------------------------------------
    23:06:46 T:140187886941968 M:1607634944  NOTICE: MPEG1             0  8192  2048  2048
    23:06:46 T:140187886941968 M:1607634944  NOTICE: MPEG2_SIMPLE      3  8192  2048  2048
    23:06:46 T:140187886941968 M:1607634944  NOTICE: MPEG2_MAIN        3  8192  2048  2048
    23:06:46 T:140187886941968 M:        0  NOTICE: H264_MAIN        41  8190  2032  2048
    23:06:46 T:140187886941968 M:1607634944  NOTICE: H264_HIGH        41  8190  2032  2048
    23:06:46 T:140187886941968 M:1607634944  NOTICE: VC1_SIMPLE        1  8190  2048  2048
    23:06:46 T:140187886941968 M:1607634944  NOTICE: VC1_MAIN          2  8190  2048  2048
    23:06:46 T:140187886941968 M:1607634944  NOTICE: VC1_ADVANCED      4  8190  2048  2048
    23:06:46 T:140187886941968 M:1607634944  NOTICE: ------------------------------------
    23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION
    23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_SHARPNESS
    23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL
    23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL
    23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE
    23:06:46 T:140187886941968 M:1607634944   ERROR:  (VDPAU) Error: An invalid/unsupported VdpDecoderProfile value was supplied.(14) checking for decoder support
    23:06:46 T:140187886941968 M:1607634944  NOTICE: CDVDVideoCodecFFmpeg::Open() Failed to get VDPAU device
    23:06:46 T:140187886941968 M:1607634944  NOTICE:  (VDPAU) Close
Implies VDPAU isn't being used, but XBMC 9.11 and mplayer don't appear to have a problem.

Log:
Reply
#2
im sure a debug log would help the devs.
Reply
#3
neil.j1983 Wrote:im sure a debug log would help the devs.

Thankyou for the reminder, updated above.


And this is interesting (snippet from XBMC SVN 1080p log):
Code:
23:06:46 T:140187886941968 M:1609838592   DEBUG: CDVDFactoryCodec: compiled in hardware support: CrystalHD:no OpenMax:no VDPAU:yes VAAPI:no
23:06:46 T:140187886941968 M:1609838592   DEBUG: FactoryCodec - Video:  - Opening
23:06:46 T:140187886941968 M:1609838592   DEBUG: Loading: /usr/local/lib/xbmc/system/players/dvdplayer/swscale-0.6.1-x86_64-linux.so
23:06:46 T:140187886941968 M:1609838592  NOTICE: CDVDVideoCodecFFmpeg::Open() Creating VDPAU(1920x1080, 13)
23:06:46 T:140187886941968 M:1607634944  NOTICE: vdp_device = 0x00000001 vdp_st = 0x00000000
23:06:46 T:140187886941968 M:1607634944  NOTICE: VDPAU Decoder capabilities:
23:06:46 T:140187886941968 M:1607634944  NOTICE: name          level macbs width height
23:06:46 T:140187886941968 M:1607634944  NOTICE: ------------------------------------
23:06:46 T:140187886941968 M:1607634944  NOTICE: MPEG1             0  8192  2048  2048
23:06:46 T:140187886941968 M:1607634944  NOTICE: MPEG2_SIMPLE      3  8192  2048  2048
23:06:46 T:140187886941968 M:1607634944  NOTICE: MPEG2_MAIN        3  8192  2048  2048
23:06:46 T:140187886941968 M:        0  NOTICE: H264_MAIN        41  8190  2032  2048
23:06:46 T:140187886941968 M:1607634944  NOTICE: H264_HIGH        41  8190  2032  2048
23:06:46 T:140187886941968 M:1607634944  NOTICE: VC1_SIMPLE        1  8190  2048  2048
23:06:46 T:140187886941968 M:1607634944  NOTICE: VC1_MAIN          2  8190  2048  2048
23:06:46 T:140187886941968 M:1607634944  NOTICE: VC1_ADVANCED      4  8190  2048  2048
23:06:46 T:140187886941968 M:1607634944  NOTICE: ------------------------------------
23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION
23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_SHARPNESS
23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL
23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL
23:06:46 T:140187886941968 M:1607634944  NOTICE: Mixer feature: VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE
23:06:46 T:140187886941968 M:1607634944   ERROR:  (VDPAU) Error: An invalid/unsupported VdpDecoderProfile value was supplied.(14) checking for decoder support
23:06:46 T:140187886941968 M:1607634944  NOTICE: CDVDVideoCodecFFmpeg::Open() Failed to get VDPAU device
23:06:46 T:140187886941968 M:1607634944  NOTICE:  (VDPAU) Close
It would seem that perhaps VDPAU isn't being triggered by the XBMC SVN version (on this ION system at least). VDPAU is working however, I tested it with mplayer -vo vdpau when I first thought this might be a problem. I presumed XBMC was utilising it as per its settings, but if it's not this would likely explain the issue.
Reply
#4
VDPAU is not used at all there because the ion gpu doesn't support mpeg4.
Reply
#5
I'm just really surprised that an atom-based nettop could play an unaccelerated 1080p video without stuttering in the first place. Conventional wisdom is that you need around a 2Ghz core2duo to play 1080p in software.

Anyway, I would open a bug report so it's tracked, etc.
Reply
#6
Mpeg4 is a lot faster to decode than for example h264, that would explain it.
Reply
#7
bobo1on1 Wrote:Mpeg4 is a lot faster to decode than for example h264, that would explain it.

Right, so this little box would have even more problems with a 1080p x264 file -- I've encoded one recently so I'll try that out next, out of curisosity.

One thing though -- XBMC 9.11 has no problem. There's no stuttering with the XBMC menu overlays while playing Big Buck Bunny at 1080p on this box. Everything else the same, XBMC SVN current stutters at peak times (here easily measured when Buck crawls out of hole, and 30 seconds later when butterfly flies over his head).

As a trial, seeing as XBMCFreak's 9.11 build comes with the 195 Nvidia drivers, I updated to the 256 drivers on it that I was using on the XBMC SVN build. No change -- i.e, worked just as smoothly. So there's still something specific to XBMC SVN that's changed since 9.11.
Reply
#8
Martigen Wrote:Updated analysis:
It seems top isn't the best way to measure CPU usage. Turning on logging showed in fact CPU-XBMC using > 100% CPU at the exact moment stuttering occurs (btw Viewsonic VOT132 is Atom 330, dual-core 1.6GHz, 2GB RAM). So yes, this would appear to be the cause.

The stuttering doesn't appear under XBMC 911, however I couldn't tell if CPU usage was staying under 100% as the CPU-XBMC debug output reported 0.0% static, it clearly wasn't properly calculating this.

Actually top is the best way. Look at percent idle, that's a true representation of how much total CPU is being used. The atom 330 is a dual core, HT thread capable. Depending how you have this setup, Linux could see 2 or 4 CPUs and the CPU percent will change depending on how many CPU are seen as it's a percent of one CPU. So 2 CPUs max is 200 percent, 4 CPUs, max is 400 percent. Percent idle does not play these games, 100 - percent idle is true CPU usage.
Reply
#9
can confirm this on my foxconn nt330i with latest stable SVN

big buck bunny is decoded via ff-mpeg4, no VDPAU support, CPU load is a little strangely distributed throughout the "4" cores but does not max out

when you activate the menu overlay there's additional CPU load to draw the menu so it can max out the dual core atom. exactly why it is stuttering so badly in the SVN version you use I have no idea, maybe the devs changed something so the "background" load of the menu is even higher then before.

a properly encoded x264 file on the other hand will play extremely well as you have full VDPAU support there.
OpenElec Standalone --> Asus Chromebox 'Panther' --> Onkyo TX-NR709 --> Sony 55" X85C Android TV (also with Kodi!)
Asus Chromebox EZ Script
Kodi on Sony Bravia Android TVs
Reply
#10
Can you turn off pixel buffer objects in player settings.
Reply
#11
i have the same setup as you. when you run ./configure in svn trunk. make sure to use this: sudo ./configure --enable-vdpau --enable-vaapi --prefix=/usr

in gui, enable use of vdpau and vaapi, render method, choose advanced gl shaders, this works like a charm for me, 1080p content is using vdpau and anything else gl shaders.. try it out.
Reply
#12
also check your guisettings.xml under video settings i have this:
<videoplayer>
<adjustrefreshrate>true</adjustrefreshrate>
<displayresolution>10</displayresolution>
<errorinaspect>10</errorinaspect>
<highqualityupscaling>1</highqualityupscaling>
<maxspeedadjust>5.000000</maxspeedadjust>
<rendermethod>4</rendermethod>
<resamplequality>1</resamplequality>
<resumeautomatically>2</resumeautomatically>
<stretch43>0</stretch43>
<strictbinding>false</strictbinding>
<synctype>0</synctype>
<teletextenabled>false</teletextenabled>
<upscalingalgorithm>8</upscalingalgorithm>
<usechd>true</usechd>
<usedisplayasclock>true</usedisplayasclock>
<usepbo>true</usepbo>
<usevaapi>true</usevaapi>
<usevdpau>true</usevdpau>
<vdpau_allow_xrandr>true</vdpau_allow_xrandr>
<vdpaustudiolevel>true</vdpaustudiolevel>
<vdpauupscalinglevel>true</vdpauupscalinglevel>
</videoplayer>


and my advancedsettings.xml:

<advancedsettings>
<cputempcommand>echo "$(sensors -u | tail -n4 | grep temp1_input | awk '{print $2 }' |awk '{printf("%d\n",$1 + 0.5);}') C"</cputempcommand>
<gputempcommand>echo "$(nvclock -T | sed -ne "s/=> GPU temp.*: \([0-9]\+\).*/\1/p") C"</gputempcommand>
<!-- <hddtempcommand>echo "$(hddtemp /dev/sda | awk '{ print $3}' | awk -F '°' '{ print $1}') C"</hddtempcommand>-->
<hddtempcommand>echo "$(hddtemp -n /dev/sda) C"</hddtempcommand>
<postprocessing>
<enable>true</enable>
<auto>false</auto>
<verticaldeblocking>true</verticaldeblocking>
<verticaldeblocklevel>100</verticaldeblocklevel>
<horizontaldeblocking>true</horizontaldeblocking>
<horizontaldeblocklevel>100</horizontaldeblocklevel>
<autobrightnesscontrastlevels>true</autobrightnesscontrastlevels>
<dering>true</dering>
</postprocessing>
</advancedsettings>
Reply
#13
toby, thank you very much for posting your settings.xml files! that's exactly what I was searching for/fiddling with the last weeks! have a beer on me!!!
OpenElec Standalone --> Asus Chromebox 'Panther' --> Onkyo TX-NR709 --> Sony 55" X85C Android TV (also with Kodi!)
Asus Chromebox EZ Script
Kodi on Sony Bravia Android TVs
Reply
#14
Hannes The Hun Wrote:can confirm this on my foxconn nt330i with latest stable SVN
Glad I'm not going mad!


bobo1on1 Wrote:Can you turn off pixel buffer objects in player settings.

Thanks for taking an interest in this.

Turned off pixel buffer objects, no change. Restarted XBMC to be sure change took effect too.

One thing I noticed: in the video options during playback, obviously using scaling algorithms like lanzcos would chew up CPU, but the default scaling setting is bilinear -- I'm using a 1080p source outputting to a 1080p display, why is any scaling being done at all?


toby77jo Wrote:i have the same setup as you. when you run ./configure in svn trunk. make sure to use this: sudo ./configure --enable-vdpau --enable-vaapi --prefix=/usr

in gui, enable use of vdpau and vaapi, render method, choose advanced gl shaders, this works like a charm for me, 1080p content is using vdpau and anything else gl shaders.. try it out.

I configured XBMC SVN with VDPAU when I built it, but didn't enable VAAPI (isn't that for ATI cards?). Note than using XBMC SVN PPA builds had the same problem, where I'm sure VDPAU would be enabled also, but thanks for the suggestion.


toby77jo Wrote:also check your guisettings.xml under video settings i have this:

Right, I'll try this and get back to you! Keen to get sensors set up correctly too.

UPDATE: no, didn't help Smile In fact, I think the video stuttered more with those settings!

Have updated first post to try and make it clearer/easier to read. There is a real change here from XBMC 9.11 to SVN, hopefully I can help get to the bottom of it.
Reply
#15
the nvclock reading is not necessarily working (I guess it's because I just don't have installed nvclock)

instead I use the command from the wiki:

Quote: <gputempcommand>echo "$(nvidia-settings -tq gpuCoreTemp) C"</gputempcommand>
OpenElec Standalone --> Asus Chromebox 'Panther' --> Onkyo TX-NR709 --> Sony 55" X85C Android TV (also with Kodi!)
Asus Chromebox EZ Script
Kodi on Sony Bravia Android TVs
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC SVN performance regression on ION0