Performance regression from Eden (ubuntu repo) to Frodo (PPA)
#1
I was happily using XBMC Eden on Xubuntu 12.04, from standard packages of ubuntu repository : version 2:11.0~git20120423.cd20772-1 from http://packages.ubuntu.com/precise/xbmc
Videos were running smoothly on my old laptop

Then I upgraded to Frodo, using the PPA package : version 2:12.0~git20130128.1315-frodo-0precise from https://launchpad.net/~team-xbmc/+archive/ppa
I lost a lot of fps on HD videos with this version (lots of frame drops). See debug log : http://pastebin.ubuntu.com/5580060/
It's like the video decoding was handled by only one core of the CPU instead of both.

If I revert back to Eden from ubuntu repo, the fps is back to normal (almost no frame drops). See debug log on the same file, with the same .xbmc directory : http://pastebin.ubuntu.com/5580062/

I also tried the xvba version from https://launchpad.net/~wsnipex/+archive/xbmc-xvba-frodo ; same frame drops.
I tried xbmcbuntu 12.00 liveCD from http://mirrors.xbmc.org/releases/XBMCbun...NVIDIA.iso : same frame drops
I tried xbmcbuntu 11.00 liveCD from http://mirrors.xbmc.org/releases/XBMCbun...u-11.0.iso : same frame drops.

All in all, it appears to me that only the packages from ubuntu repositories give me the good fps.
I suspect it to come from the different compilation options, that I found in the "rules" file of each repo : https://launchpad.net/~team-xbmc/+archiv...ian.tar.gz and http://archive.ubuntu.com/ubuntu/pool/un...ian.tar.gz
In particular, in the ubuntu repo, the option --enable-external-libraries is set, and it's not set in the PPA repo : the comment says "Enable external libraries for all architectures except i386 and amd64"

Do you know for which reason these compilation options are different?
Do you have any other idea why I have such a performance regression when using other packages/versions?

I tried to recompile xbmc Frodo myself in Virtualbox, inside a freshly-installed Ubuntu 12.04.2, in order to check the behavior with different compilation options. But I did not succeed. I followed the instructions from http://wiki.xbmc.org/index.php?title=How...ian/Ubuntu and from the readme inside source.
I'm currently stuck on this error message given by ./configure :
Code:
configure: error: You need either libswresample or libavresample.
I did not manage to find a suitable version of libswresample or libavresample for Ubuntu 12.04

Any hint to solve this build issue?

Some more info on my configuration :
Machine : Inspiron 1525 laptop
CPU : Intel Core 2 Duo T5550 @1.83GHz
Graphics card : Intel integrated 965GM (no hardware video decoding)
Resolution : 1280x720 fullscreen, on HDMI
OS : Xubuntu 12.04.2, x86_64 version, with upgraded kernel from raring, version 3.8.0-7
Reply
#2
Mmmh : I see no reply in this thread : did I post it in the wrong place?
I was tempted to post it in the developer section, but read the disclaimer that said that you should not post there if you did not manage to compile XBMC...
Reply
#3
audio settings errors can result in slow playback.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#4
Thanks for your answer nickr.

Which audio settings settings are you refering to? I'm ready to try some different settings.

Anyway, it would be strange because I ran the tests with the same .xbmc directory.
Are the audio settings stored in a different place (inside ~/.xbmc) between Eden and Frodo?
Reply
#5
get rid of pulseaudio
Reply
#6
Regarding pulseaudio, I modified the settings inside XBMC : in system/audio, I changed the audio output device from "Playback/recording through the pulseaudio sound server" to "HDA Intel HDMI" (the audio device that outputs to my TV display".
The sound worked ok but it gave no difference on the frame drops.

Maybe tou were meaning something else by "get rid of pulseaudio"?
Reply
#7
Regarding the compile issues, I noticed that this error "configure: error: You need either libswresample or libavresample" disappears if I don't put the --enable-external-libraries option : in this case, I can compile XBMC fine.
Reply
#8
(2013-03-16, 13:08)mossroy Wrote: Regarding the compile issues, I noticed that this error "configure: error: You need either libswresample or libavresample" disappears if I don't put the --enable-external-libraries option : in this case, I can compile XBMC fine.

thats expected if you don't have ffmpeg installed.

external libraries are _not_ recommended, don't use this option unless you really know what you are doing.
Reply
#9
Thanks for your answer wsnipex.
You're right about the fact that it's expected behavior in Frodo. It seems to come from this commit : https://github.com/aballier/xbmc/commit/...e328dfd3ed , done between Eden and Frodo.
But I have ffmpeg installed : version 0.8.5-4:0.8.5-0ubuntu0.12.04.1 from standard Ubuntu repos. What is missing is the avresample/swresample library. I could not manage to find them for Ubuntu 12.04.2.

Regarding external libraries, this option is indeed disabled in the XBMC packages from PPA.
But it's enabled on the XBMC Eden package from Ubuntu standard repos ( http://packages.ubuntu.com/precise/xbmc ). See the rule file inside http://archive.ubuntu.com/ubuntu/pool/un...ian.tar.gz
It is also enabled in the package from Debian standard repos : http://ftp.de.debian.org/debian/pool/mai...ian.tar.gz
The XBMC Eden package from ubuntu repo works really fine for me. For which reason is this option not recommended?

I think this option might be the reason of my performance loss. But I'm not sure yet.
In any case, I suspect it comes from a compile option. Because I have the issue on xbmcbuntu Eden live CD, and I don't have it on ubuntu 12.04 with xbmc eden installed from ubuntu repos (without a pre-existing ~/.xbmc directory)
But maybe there is another explanation?

I think it would be worth trying an Eden version from PPA.
There used to be a package for Eden on Precise on https://launchpad.net/~team-xbmc/+archive/ppa/+packages
But I suppose it has been removed in between, and I did not keep it.

If somebody knows where to find it (in amd64 version), I would be able to easily compare it with the package from ubuntu repos, on the same OS
Reply
#10
ubuntu/debian does not have ffmpeg in standard repos. They have libav and libav != ffmpeg

Either way, I don't believe your hardware was ever able to flawlessly play 1080p(at least not with decent bitrate), since all you can do is decode in software. For that matter, it doesn't really make a big difference if you use internal or external libraries.

Make sure your audio setup is correct, specially that you didn't enable any passthrough settings your hardware does not support and check that you didn't enable any advanced upscaling option.

Then while playing a video, press "o" and check if your CPU is at its limits. Also play something with lower resolution and see if that works ok.
Reply
#11
My CPU/GPU can only do software decoding, that's right. But it is a dual core.
After some more tests, I think that Eden version from ubuntu repo enables multi-core decoding, where Frodo from PPA does not (at least on h.264 high profile). I don't know if it's related to internal or external libraries.
But that makes a big difference : with one core, it can decode h.264 high profile 1080p with a bitrate up to ~15Mbps
With 2 cores, it can decode more than 30Mbps.

I can reproduce that easily, by switching between different XBMC packages.
I used the following file for this test :
http://www.demo-world.eu/trailers/redire..._house.jpg
H.264 High Profile, with bitrate up to ~25Mbps

Using Frodo package from PPA with debugging enabled (and after deleting my ~/.xbmc directory) here is the result :
- when coming to the high-bitrate part, I see one of the 2 cores at 100%, and the other one is around 15%
- the debug log can be found here : http://pastebin.ubuntu.com/5620626/ . You can notice line 225 the line "ffmpeg[5EFFD700]: [h264] Cannot parallelize deblocking type 1, decoding such frames in sequential order"
- I reach 87 frame drops, as you can see on these videos : http://mossroy.free.fr/xbmc/frodo-ppa-repo.html

Then I remove this package and replace it with the one from ubuntu repo :
Code:
rm -rf ~/.xbmc
sudo apt-get remove "xbmc*"
sudo add-apt-repository -r ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install xbmc xbmc-bin xbmc-eventclients-wiiremote

Here is the result :
- when coming to the high-bitrate scene, I see both CPUs at around the same level (70 - 90%)
- the debug log can be found here : http://pastebin.ubuntu.com/5620666/
- I have 0 frame drops, and the playback is smooth, as can be seen on these videos : http://mossroy.free.fr/xbmc/eden-ubuntu-repo.html

I can then come back to Frodo from PPA :
Code:
rm -rf ~/.xbmc
sudo apt-get remove "xbmc*"
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install xbmc xbmc-bin xbmc-eventclients-wiiremote
And I see the same frame drops again

On both Eden and Frodo, every 720p h.264 file that I could test worked with no frame drop.
In the above tests, I kept all the default settings of XBMC (except for enabling debugging, and setting video playback to basic shaders to avoid a "snow" issue, see http://forum.xbmc.org/showthread.php?tid=156537 )

After searching with the string in the log of Frodo, I ended up on this thread : http://forum.xbmc.org/showthread.php?tid=151680
Could it be that software multi-threaded h264 decoding have been disabled in Frodo?
Reply
#12
yes, you found out the hard way that xbmc disables multi threaded decoding in ffmpeg for all material but h264 Hi10p, because it can cause issues, specially with hardware acceleration. This is probably not the case with external libraries(never checked).
You could try patching xbmc to enable multithreading and see if that works without causing problems.

removing "m_isHi10p &&" from line 259 in
https://github.com/xbmc/xbmc/blob/master...FFmpeg.cpp
should do the trick.
Reply
#13
The 259 is only used for printing. The real "single threading" is set in the else cause. Remove line 259 including to 265. This will keep default ffmpeg threading settings.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#14
Bingo!
After recompiling xbmc, it solved the performance regression. Thanks for your hints!

Instead of patching the latest git code, I patched the source code used by the PPA : https://launchpad.net/~team-xbmc/+archiv...rig.tar.gz
If anyone is interested, I've uploaded the resulting xbmc.bin here : http://mossroy.free.fr/xbmc/recompile_fr...d/xbmc.bin
Of course, it's not a long-term solution.

In any case, that's great news!

Let's sum up what I learnt :
- on my computer, there is a serious performance regression between Eden and Frodo, when decoding videos that could be multi-threaded
- multi-threaded decoding has been disabled between Eden and Frodo, because it caused problems when you have hardware acceleration
- it has been re-enabled for Hi10p videos (after Frodo), because there is no known hardware acceleration for this format for now
- on my computer (with no hardware acceleration), activating multi-threaded decoding restores the performance, and does not seem to cause issues (so far)

I understand the choices that have been made by the dev team.
But hardware-accelerated decoding is not available all the time. And, when it's not available, using multi-threaded decoding multiplies the decoding power by the number of cores, which matters a lot.
I'm wondering why multi-threaded decoding was not an issue on Eden, but is on Frodo.
Maybe there is a chance it would be fixed in next XBMC version?
Should I talk about it in the development section of this forum? Should I file a bug somewhere?
Reply
#15
just to clear this up: Eden also had multithreading disabled in our official builds, but the debian/ubuntu package used external libraries(needed to be included in debian). This causes a slew of problems and is one of the reasons it doesn't work well with hardware decoders.

It is currently not possible to properly detect if a hardware decoder is used, so we can't enable multithreading for software decoding only in general builds.

Nice it works for you now.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Performance regression from Eden (ubuntu repo) to Frodo (PPA)00