Posts: 118
Joined: Mar 2008
Reputation:
0
mpw222
Senior Member
Posts: 118
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?
Posts: 118
Joined: Mar 2008
Reputation:
0
mpw222
Senior Member
Posts: 118
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.
Posts: 18
Joined: Aug 2008
Reputation:
0
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.
Posts: 52
Joined: Jul 2008
Reputation:
0
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.
Posts: 52
Joined: Jul 2008
Reputation:
0
so to enable mutil-core usage, you'd need to replace ffmpeg/decoder with some multi-core compatable decoder.
Posts: 489
Joined: Apr 2004
Reputation:
13
Freddo
Skilled Skinner
Posts: 489
that doesn't really explain why Linux builds utilize multiple cores so much better though does it? (seriously I don't know)
Posts: 2,745
Joined: Oct 2003
Reputation:
1
WiSo
Team-Kodi Developer
Posts: 2,745
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.
Posts: 2,745
Joined: Oct 2003
Reputation:
1
WiSo
Team-Kodi Developer
Posts: 2,745
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.
Posts: 956
Joined: May 2005
Reputation:
17
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..