Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
How do I get Multithreading in Windows XBMC?
#1
I'm wrestling with whether to build an XP or Linux based htpc to run XBMC, and I'm wondering if someone can clear up some questions I have about multithreading. When I build the Linux version from the source using build.sh, it automatically detects how many cores are present and compiles accordingly, whereas I've only used the prebuilt Windows binaries, which seem to be compiled for one core only. Even with a very fast processor (Core 2 Quad @ 3.2Ghz) I can't decode things like the killasample 1080p test file without dropping a lot of frames in Windows, but it plays fine in Linux (35-40% overall CPU utilization). I know this file is pretty ridiculous, but that's exactly why it's a good test: if you can play that smoothly, you're going to be able to play anything.

While I would consider using either platform, I can think of a lot of reasons I would prefer to use a very slim XP install (this is me personally, not making a general statement). What do I have to do to get multithreading working on XBMC for Windows?
Reply
#2
Just to be clear I'm basing the assumption that there is no multithreading going on in Windows on the fact that XBMC's own stats break out usage percentages for different cores in my Linux build, but shows Windows with only one core. Process monitoring tools on both platforms also show XBMC using more than 25% (I have a quad core in the pc I'm testing on) in Linux, but not XP.
Reply
#3
I'd also say SMP is not working in the movie player. Attached a screenshot, the last two peaks on core1 is a DIVX AVI and a 720p movie. You can see a slight peak on core2, but not evenly distributed, as it maybe should be.
I however am still amazed that XBMc plays the 720p on a U2500 (1.2Ghz) with onboard graphics

Image
XBMC Equipment:
Nvidia Ion + Atom 330, HDMI out
Panasonic TH-42PX80FV
Windows Server 2008 R2
Reply
#4
Image
XBMC Equipment:
Nvidia Ion + Atom 330, HDMI out
Panasonic TH-42PX80FV
Windows Server 2008 R2
Reply
#5
I've noticed the same. The Linux version seems to do a much better job of splitting the decoding across multiple CPU cores.

I suspect there is some difference in the code base between the pre-compiled Linux and Windows builds. Perhaps a different version of ffmpeg/libavcodec? I may attempt my own Win32 build.
Reply
#6
This is because the video decoder is not utelising multi-cores, so the one codebase can be compiled to Linux/Mac/Xbox/Windows, instead of having splinters for each.
Reply
#7
so to enable mutil-core usage, you'd need to replace ffmpeg/decoder with some multi-core compatable decoder.
Reply
#8
that doesn't really explain why Linux builds utilize multiple cores so much better though does it? (seriously I don't know)
Reply
#9
I have also wondered about the multi core support under Windows. I get much lower processor usage running VLC player (which should just support one core) than with the same movie under XBMC Atlantis.

How much should the second core help? As I understand it, it shouldn't be a 50/50 usage, since not all parts of the rendering is multithreaded?

Best regards
at

(ati x1950pro, Core Duo 2 3.0GHz, Vista x64)

(have tried a few other configs also)

By the way, thanks for the great work.Smile
Reply
#10
CPU0 is only reported because MS reports only the overall value for all CPUs
Linux and Windows uses the ffmpeg dlls to decode videos. The dvdplayer configures ffmpeg with the amount of available cores which just crashes on windows with more than one core. Once threading will be smooth in ffmpeg for windows we can enable more than one core and see how it goes than.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
WinterMuteAu Wrote:so to enable mutil-core usage, you'd need to replace ffmpeg/decoder with some multi-core compatable decoder.

ffmpeg IS using multiple cores on Linux via the CABAC patch. this patch wasn't accepted into the mainstream ffmpeg releases last I heard but the XBMC guys embraced it and it works WELL. There's no reason to replace ffmpeg IMO, just get it working threaded on other platforms is all - which is apparently the goal.
Openelec Gotham, MCE remote(s), Intel i3 NUC, DVDs fed from unRAID cataloged by DVD Profiler. HD-DVD encoded with Handbrake to x.264. Yamaha receiver(s)
Reply
#12
WiSo Wrote:CPU0 is only reported because MS reports only the overall value for all CPUs
Linux and Windows uses the ffmpeg dlls to decode videos. The dvdplayer configures ffmpeg with the amount of available cores which just crashes on windows with more than one core. Once threading will be smooth in ffmpeg for windows we can enable more than one core and see how it goes than.

Is this really true? I'm no developer, but there are countless applications out there that will report cpu usage per core. You should be able to get it through WMI, no?
Reply
#13
Yes WMI is possible but slow since we request it synchronously.
It might work asynchronously but this requires a lot more changes to the code.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#14
First of all i'm no developer. But i work with all developers on a daily basis.

At work the devs are using a program from Intel called "Intel Thread Profiler" and "Intel Vtune Performance analyzer"
This program can attach to any application and monitor all threads in that app. Guys at work uses this app to check their code for errors and areas for improvment of code.

This proggy is not free.

I have tested it with xbmc, my problem is that im not a developer so i'm having diffculties reading the reports it gives me.

Is there any devs in team xbmc that has knowledge about this software ?
I know that devs at work are very impressed by what this proggy can analyze... If there would be interest in it i could donate a license..
Reply
#15
forgot the link:
http://www.intel.com/cd/software/product...239144.htm
Reply

Logout Mark Read Team Forum Stats Members Help
How do I get Multithreading in Windows XBMC?0