CPU Usage

Started by Tsorovan,

Tsorovan

I've noticed XMPlay using an exceptionally (at least according to my standards) high CPU usage when playing MP3s. On my XP1600+ XMPlay is using 1-2 % CPU (WinXP Pro pre-SP) at all times just idly playing (i.e. not doing stuff with the UI), which to me seems abnormally high. Most other decent players take at most 1%, whilst the in other ways abominable Winamp 2.x takes...well, immeasurable amounts. I had Winamp 2.8 with the built-in mp3 decoder running for about 96 hours straight, and it had been using under 20 secs total CPU time (according to WinXP Task Manager). XMPlay tops that figure after just a few minutes.

I'm not sure if this is something that's been there since 2.4, because I haven't had time to compare with it.

Also, for a while I thought that maybe XMPlay still polled the level meter even though it's not visible (I removed it in the main panel in my skin), but I shortly thereafter ruled it out.

I can't play a game like for instance Quake 3 whilst at the same time playing a few MP3s in XMPlay; Quake 3 stutters like mad, plus the audio gets chopped off now and then. That sounds very strange if I might say so.

I'd say this has nothing to do with my soundcard (M-Audio Audiophile 2496) as no other app inhibits this behaviour. I'd say this is sort of a show-stopper for me. I know just "losing" one user isn't important, plus I'm not trying to threaten you Ian or anything...I would just appreciate you maybe take a look at this...no huge performance profiling required I guess...but wouldn't you agree these numbers are a tad odd?

Conversely, whilst playing an MP3 on my brother's PIII 750, the CPU usage fluctuates between 0 and 8 %, pretty steadily (Win2K Pro SP3).

Olego

:o  2% CPU!?  Unthinkable! :laugh:

I've never had that problem, and while it does sound odd, I can't really understand it.  I've played it fine with UT, and it didn't matter all that much, everything was nice and smooth, unless you listen to a reverberating filtered IT with dozens of virtual channels.  Gotta love those.  :)

But that is weird...  *shrugs*

~Olego~

Zarggg

#2
QuoteGotta love those.
Says who? :P

Olego

QuoteSays who? :P

Say I, because my 1.7GHz Pentium back in Berkeley can handle up to 90 channels and that already sounds good enough for me.  ;D

~Olego~

Guan

Hi Tsorovan my XMPlay are only taking 0% of CPU (according to WinXP Task Manager) and i have a AMD Duron 800  :o

But i only play mp3 that have 128kb/s (because i listening to mp3 radio mostly) and that can be the problem that you have are you playing 128kb/s mp3's or is it higher bit rates you are playing?

Ralesk

Let's admit: the x86 architecture -- and mainly intel -- sucks. ;D

Tsorovan

Ralesk: does not :)

Aaaanyway...

Guan: never really thought of that. It sounds fairly ludicrous, but possible I guess, as most of my mp3s are well above 128 kbps (sorry, but 128 kbps doesn't cut it I'm afraid :)) so, I checked it. There seems to be some truth to that statement, but even 96 kbps MP3s made it use 1% every other second -- way too much for an XP1600+. VBR vs. CBR doesn't seem to matter much though, but I would require some better profiling software to really come to any conclusive analysis.

Rest assured though, that my XP Pro is tweaked as much as possible. Every worthless little thing disabled (and there are quite a lot of those... Sadly, you can't disable disk performance counters in XP as you could in 2K though...evil MS :( ).

Torkell

On a Duron 800 w/ Win2k Pro SP2:

0-2% no vis
10-40% with vis

You shouldn't have problems while playing Q3A, it's not going to miss a couple percent on your XP1600+. You should check your Quake settings, your sound settings (in both Quake and XMPlay), and system drivers. Make sure that Quake isn't trying to use the sound system, as DirectSound-based games often want all or nothing with the sound, and they don't like nothing. Your sound drivers could need upgrading, plus make sure that you don't have a vis running in XMPlay at the same time.

Hope this helps

Tsorovan

Thanks for replying BobbyB. Nice to see users actually caring about the application and its users, I like this friendly community :D. However, I seriously doubt this is a driver issue (can't update them anyhow, because I already have the latest Delta drivers) as XMPlay is the only (out of a dozen or so tested mp3 players) app that does this. I wonder (layman-wise) if there's some kind of faulty multithreading going on, as 1-2% wouldn't make games like Quake3 hickup in the first place. I mean, I've got 300-400 fps with that Gainward GF4Ti4200 :). As the non-expert I am, I would say that the high CPU usage is a symptom of something wrong, and not the actual cause, but what the heck do I know? :\

Josh

I have an AMD k6-2 450MHz... and it fluctuates (depending on the MP3, actually), between 7% and 11%, without visualizations. Most of my MP3's hover around 8%, which is bloodly brilliant, considering Winamp is around 15%!! The only thing more efficient is Windows Media Player, which is just a little faster (by no more than 3% in most cases).

Also, playing .it/.mod/.xm files is a lot more efficient than Winamp. Personally, I would say it was your system, because the size and speed of XMPlay, to me, is simply brilliant.

Olego

Pentium I, 233 MHz:

No Vis: 16-22%
Vis: 65-85 %

*smiles*  He he he.

~Olego~

Rah3D

#11
AMD Athlon XP 1800+
No vis: 0-2% (Increases up to 38% when I move the main window over the screen like mad)
Vis: Spectrum: 2%
      "The Rabbit Hole" - up to 75% ;)

Olego

42
#12
QuoteIncreases up to 38% when I move the main window over the screen like mad

 :laugh:

~Olego~

Tsorovan

Josh: Winamp taking 15% on a K6-2 450 MHz with no visualizations and other crap? I find that hard to believe. Winamp never even took more than 1% on my Celeron 400@510 MHz. So, I wouldn't imagine Winamp ever taking more than max 4-5% on that K6-2...
On the other hand, if this is Winamp 3 or maybe 2.4 you're talking about...did you try 2.8a? All in all, it sounds very strange to me.

Okay, it seems most of you people are happy with that 2% CPU drain...weird. I sort of assumed that XMPlay was a lot more efficient than that ghastly Winamp in this regard...well, I guess you should never assume things so lightly :)

Josh

Winamp: http://img.ranchoweb.com/images/joshcryer/winampwtop.jpg

XMPlay: http://img.ranchoweb.com/images/joshcryer/xmplaywtop.jpg

Both images were taken after everything settled and WinTop stopped fluctuating very much. Both images were taken at lows within the fluctuation range (say it fluctuates between 9.30% and 10%... I took the image at 9.30%). This goes for both images. I did this to show that even Winamp's lowest usage percentage is a lot higher than XMPlay.

Ralesk

Seems that AMD and intel differ a lot? *shrugs*

Josh

Hmm, I think pre-Athlon AMD chips were slightly inferior to Intel on a lot of things, but I am totally unsure of that.

Torkell

QuoteThanks for replying BobbyB. Nice to see users actually caring about the application and its users, I like this friendly community :D. However, I seriously doubt this is a driver issue (can't update them anyhow, because I already have the latest Delta drivers) as XMPlay is the only (out of a dozen or so tested mp3 players) app that does this. I wonder (layman-wise) if there's some kind of faulty multithreading going on, as 1-2% wouldn't make games like Quake3 hickup in the first place.
Could be something to do with multithreading (XMPlay generally has a few going), but again, those threads are using a total of 2%, which Q3A won't even notice. My guess is it's something to do with the way XMPlay is playing the MP3 (thru DirectSound or whatever), and that Quake is objecting to that in some way. If possible, tell Quake to use a different sound system (I don't know if that's possible, as I'm more of an Unreal Tournament fan). Does this happen with just Quake, or do other games have the same problem?
QuoteI mean, I've got 300-400 fps with that Gainward GF4Ti4200 :). As the non-expert I am, I would say that the high CPU usage is a symptom of something wrong, and not the actual cause, but what the heck do I know? :\
The high CPU usage could be due to your XMPlay settings. Resampling, reverb, equalizer, vis, they all add to the work XMPlay's got to do. Oh, and have you tried minimizing XMPlay to the tray (right-click on the minimize button), as that will remove the UI and so free up resources?

My guess (as a programmer) is that XMPlay and Quake 3 Arena are confilicting over control of the sound hardware, and that's what's causing the stuttering. Is it just Quake where the sound dies, or do you lose your XMPlay sound as well?

BTW, when I said update your drivers I meant check things like your DirectX install and sound drivers. You could also check your sound settings (strange things have been solved by decreasing the acceleration of apparently unrelated devices...)

Tsorovan

Well, judging by others' comments here, I'm not the only one.
Minimising to tray does nothing.
XMPlay is the only application doing this together with the Quake3 engine plus Unreal Tournament and UT2K3, which are the games I've tested with.
Quake3 uses DirectSound. UT2K3 does too, though via its OpenAL implementation. UT1 is using its own shitty Galaxy sound system which ultimately plays DirectSound streams if I'm not mistaken. Oh, and I was using both the standard and the gapless DirectSound mp3_out thingamabob in Winamp.

Also, I'm not allowing XMPlay to do any sound processing at all; neither EQ nor reverb (I thought reverb was only applicable on mods btw? Oh well, no matter, as I would never use that either).

No resampling going on, the Delta control panel is reporting a 16-bit sample rate of 44.1kHz, and I haven't forced it to use 96 kHz/24-bit (which my semi-professional/prosumer card supports fully, as opposed to that Audigy joke) or anything that stupid either.

And as I said in the beginning, other people showed similar results in this thread, and I've tested on three systems here, all with different soundcards and OSes:

1:
Athlon XP 1600+
WinXP non-SP1
M-Audio Delta Audiophile 2496

2:
dual Celeron 400@520 (both in SMP and uniprocessor mode)
Win2K Server SP3
Diamond Vortex2 MX300

3:
Intel coppermine PIII 500@750 (or was it 700?)
Win2K Pro SP3
Creative SoundBlaster PCI128

Tsorovan

So, I gather there's no "looking into" this one eh? Oh well...I guess it'll make me start calling the otherwise excellent XMPlay a resource hog. Nothing works as good as a couple of nice application insults, wouldn't you say? :D

JimVonMoon

OS: Windows 98 SE
CPU: P2 350MHz
CPU usage: (according to SYSMON.EXE)
- no vis - about 7% while playing 128kbps mp3
- vis - dunno, I'm not using this things :)

...and I must say that I feel perfectly good with this results. I use my compy mainly for internet (IRC, email, usenet, www and such stuff), programming, spreadsheets and word prosessing. I have got lots of unused CPU power and this 7% result suites me fine. 8)

Pike84

#21
Hmmm... I'm not sure if people get this CPU drain correctly (if I do :P). When I see Xmplay in the task manager and the respective percentage, it means Xmplay is using that amount of CPU power of ALL drainage.. so if the Xmplay's percentage would be 100, that would only mean Xmplay used all CPU power of all CPU power in use at that time - not that all CPU power would be in use (of Xmplay in this case).

So I can't really tell right away, how much Xmplay consumes of my total CPU capability. The task manager does tell how much CPU is used at any time, but other tasks add to that too. Even if Xmplay was the only program running, there's always "system idle process", which in my case at least, takes most of the CPU power in use (around 90%), while the total CPU drain with XMplay running, is around 10%.

Sounds complicated? With me explaining it brilliantly?? :P No, I'm not sure if anyone gets my point, but think about it ;)

Ralesk

In NT/2k/XP ("NT" from now on), there is an idle thread with process ID 1.  This uses up the unused CPU power, and gives amounts of CPU times to the other processes.  From my view it seems similar to UNIX's idea of having init as the parent-of-everything process.

Uh.  So in NT you measure percentages from the whole.  I'm not really sure if the numbers are anywhere accurate in the bogus multitasking of win9x.

Ian @ un4seen

QuoteSo, I gather there's no "looking into" this one eh? Oh well...I guess it'll make me start calling the otherwise excellent XMPlay a resource hog. Nothing works as good as a couple of nice application insults, wouldn't you say? :D
The thing is I'm not sure there is really anything to look into, regarding CPU usage atleast (I don't have Q3, so can't look into that :))... I'm pretty confident that XMPlay has amongst the lowest CPU usage of any player, especially when minimized (time/level/vis displays are not updated then).

I think what you're seeing is down to Task Manager (or rather the way NT-based systems measure CPU usage). For example, when you say "Winamp never even took more than 1% on my Celeron 400@510 MHz", I can assure you that was not really the case - Winamp 2.8 (with no extra plugins in action) takes almost 3% CPU playing an MP3 on my XP1700 setup.

From what I can see in this thread, the Win9x users (ie. using WinTop rather than Task Manager) are reporting lower CPU usage for XMPlay than Winamp. And from personal experience, WinTop is a much more accurate judge... see this thread, for more info on why Task Manager is not to be trusted :D
http://www.un4seen.com/music/YaBB.cgi?board=bass&action=display&num=1030698202

Regarding the Q3 problems, my guess would be the same as BoggyB's. I've never tried Q3, but have not had problems running XMPlay with any other games. Do you get the same problems with other games? What about if you try XMPlay+Q3 on your other computers?

Tsorovan

Thanks for caring :) I tested with perfmon, and I could see the same thing, though it of course shows the decimals, in the case of Winamp. I'm fully aware of the fact that the Task Manager has a shittier resolution and update time (if you don't fix it that is, you can choose the speed somewhat at least), so this is why I compared with the "CPU Time" counter reported, which I believe is somewhat more correct?
I get stutters in the sound even when rendering a scene in for instance 3dsmax or Maya, or encoding an MP3 with Lame using the "higher" thread priority, things that never happened with Winamp.

Quake3 + XMPlay was totally unplayable on a P3 700 w/Sound Blaster PCI128 (I know, it's not my computer :) and a GF2MX. Q3 + Winamp is fine. Doesn't matter which output stuff I use in the player.

So, if now Windows reports all this erroneously, what did you do that everyone else always fails to do with their programs to not report a correct usage to Task Manager and perfmon? :
I'm sort of stumped....