Help - Search - Members - Calendar
Full Version: High CPU usage with MP3
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
Pages: 1, 2
Wizard
I use W2K+SP3 and Fb2k shows 14% cpu usage in the task manager when playing mp3 and 1% when playing ogg, while winamp2 shows 1% for playing either one. huh.gif Does that have to do with the mp3 decoder being used?
Somebody
Probably the decoding, the limiting, and the dithering. But I could be wrong.
Wizard
I found out why: the default output method for WinNT version is waveOut huh.gif Shouldn't it be set to DirectSound instead?
Peter
output device detection added in current build (dont feel like uploading now)
Guillaume
~12% when playing MP3 (fb2k settings: 16bit/48000Hz - DirectSound, WinXP). Is this normal?
Peter
12% of what CPU ?
i believe there is strange conflict between fb2k and other running programs, fb2k stays at 0% here, but when i run mplayer2.exe it suddenly goes up to 4-8% (old good athlon700), i need to research it more.
TURBO
Here stays in 0% and sometimes goes to 2%. Playing MPC'S only. All other dlls and extras deleted!


Microsoft Windows XP Workstation 5.1 Service Pack 1 (Build 2600)
Intel Pentium 4 2528 MHz MMX / Memory: Total - 523 MB, Free - 334 MB

Internet Explorer: 6.0.2800.1106 / ComCtl32.dll: 6.00.2800.1106 / Shlwapi.dll: 6.00.2800.1106
Shell32.dll: 6.00.2800.1145wnaspi32.dll: 4.71 (0001) , ASPI for Win32 (95/NT) DLL, Copyright © 1989-2002 Adaptec, Inc. / Aspi32.sys: 4.71 (0001)

B)
skip
Such conflict with other applications definitely exists, and they shouldn't be necessarily related to music playback for that.
Guillaume
QUOTE(zZzZzZz @ Jan 1 2003 - 08:15 PM)
12% of what CPU ?
i believe there is strange conflict between fb2k and other running programs, fb2k stays at 0% here, but when i run mplayer2.exe it suddenly goes up to 4-8% (old good athlon700), i need to research it more.

Athlon 1200MHz, 256MB Ram...

Programmes running:

- WinBar 1.2.95 (www.winbar.nl)
- Foxmail 4.2 (www.foxmail.com.cn)
- DU Meter 3.03 (www.dumeter.com)
- Trillian 1.0b Pro (www.trillian.cc)
- MyIE2 0.6.835 (http://myie2.yeah.net)
- F-Secure AntiVirus 5.40 (www.f-secure.com)

[edit]
Note that I resample (no fast mode) to 48000Hz!!
psy_jc
It seems like MSN Messenger is one of the conflicting programs.
Even with resampling on, it usually takes up between 0 and 1% on my computer (Athlon classic 750MHz). But then, as soon as I open MSN Messenger 5.0, the CPU usage of foobar goes up to somewhere between 17 and 21%. I close MSN Messenger, and the CPU usage settles back into somewhere between 0 and 1%.
Right now I'm thinkin, "What the hell? blink.gif "
What could be the cause here?
Peter
QUOTE(Guillaume @ Jan 2 2003 - 03:22 AM)
Athlon 1200MHz, 256MB Ram...

Programmes running:

- WinBar 1.2.95 (www.winbar.nl)
- Foxmail 4.2 (www.foxmail.com.cn)
- DU Meter 3.03 (www.dumeter.com)
- Trillian 1.0b Pro (www.trillian.cc)
- MyIE2 0.6.835 (http://myie2.yeah.net)
- F-Secure AntiVirus 5.40 (www.f-secure.com)

[edit]
Note that I resample (no fast mode) to 48000Hz!!

then it's resampling what eats your cpu time, if you want to save cpu resources, don't use resampling.
Peter
QUOTE(psy_jc @ Jan 2 2003 - 11:17 AM)
It seems like MSN Messenger is one of the conflicting programs.
Even with resampling on, it usually takes up between 0 and 1% on my computer (Athlon classic 750MHz). But then, as soon as I open MSN Messenger 5.0, the CPU usage of foobar goes up to somewhere between 17 and 21%. I close MSN Messenger, and the CPU usage settles back into somewhere between 0 and 1%.
Right now I'm thinkin, "What the hell? blink.gif "
What could be the cause here?

yep, similar effect here with mplayer2.exe (win2k, athlon700)
i need to look into it when i don't have anything more important to do, sounds like something with OS-level sound playback interaction to me but i can't be sure now.
Ghim
Guillaume> I don't think the resampler is this only thing causing your high CPU usage....
I've got a similar config to yours (just an Athlon 1800+ instead of Athlon 1200) and with resampler ON and fast mode OFF, I still got 0% CPU usage...
Try leaving Trilian... it works like MSN messenger for some things... so perhaps it has the same effects...
Peter
ahem,
resampling without fast mode IS slow. fast mode hardly eats any cpu time here either.
Ghim
Yes, fast mode eats less CPU... but even without fast mode, I still got 0% CPU... (perhaps it's a bigger 0 compared to fast mode biggrin.gif )
SK1
What's the difference with fast mode on? Is fast mode less quality than regular?
vh1
fb2k used to only use up about 1,600 k of my mem usage, w/o resampler DSP, but thne I added that to my dsp list to see what it was all about, and my mem usage shot up to 7 - 9 000 k!
I was like whoa, that's weird
So then I took it out of my seleted dsp's, and my mem usage is still up that high

This happen to anyone else?
Guillaume
QUOTE(Ghim @ Jan 2 2003 - 11:47 AM)
Guillaume> I don't think the resampler is this only thing causing your high CPU usage....
I've got a similar config to yours (just an Athlon 1800+ instead of Athlon 1200) and with resampler ON and fast mode OFF, I still got 0% CPU usage...
Try leaving Trilian... it works like MSN messenger for some things... so perhaps it has the same effects...

Even when shutting down all these programmes and restarting fb2k, the cpu level remains the same...
Peter
QUOTE(Guillaume @ Jan 2 2003 - 01:34 PM)
Even when shutting down all these programmes and restarting fb2k, the cpu level remains the same...

way to read replies you get.
QuantumKnot
I've noticed this problem too. Usually it uses 0 to 1%, but as windows continues running longer and more applications are opened, closed, etc., both fb2k and winamp use up to 14% CPU (directsound, win2k, sp3).

There was one time when even a loaded plugin in winamp affected fb2k....I unloaded it from winamp and CPU was back to normal (0%) for both WA and fb2k.

Bizarre.....
Guillaume
QUOTE(zZzZzZz @ Jan 2 2003 - 01:37 PM)
QUOTE(Guillaume @ Jan 2 2003 - 01:34 PM)
Even when shutting down all these programmes and restarting fb2k, the cpu level remains the same...

way to read replies you get.

huh?
kotrtim
QUOTE(Ghim @ Jan 2 2003 - 02:52 AM)
Yes, fast mode eats less CPU... but even without fast mode, I still got 0% CPU... (perhaps it's a bigger 0 compared to fast mode  biggrin.gif )

Me too, fb2k uses 0% (P4 Willamate 1400MHz) to play all kind of files B)
kode54
QUOTE(Guillaume @ Jan 2 2003 - 04:54 AM)
QUOTE(zZzZzZz @ Jan 2 2003 - 01:37 PM)
QUOTE(Guillaume @ Jan 2 2003 - 01:34 PM)
Even when shutting down all these programmes and restarting fb2k, the cpu level remains the same...

way to read replies you get.

huh?

You seem to have missed the part where you disable the resampler or turn on fast mode.



From the SSRC source code used by foo_dsp_extra:
CODE
#ifndef HIGHPREC
if (c.fast)
{
 AA = 96;
 DF = 8000;
 FFTFIRLEN = 1024;
}
else
{
 AA=120;
 DF=100;
 FFTFIRLEN=16384;
}
#else
AA=170;
DF=100;
FFTFIRLEN=65536;
#endif
...
CODE
 double aa = AA; /* stop band attenuation(dB) */

And DF is a frequency, with a significance I cannot explain with my level of understanding.
kjoonlee
QUOTE(zZzZzZz @ Jan 2 2003 - 07:35 PM)
QUOTE(psy_jc @ Jan 2 2003 - 11:17 AM)
It seems like MSN Messenger is one of the conflicting programs.
Even with resampling on, it usually takes up between 0 and 1% on my computer (Athlon classic 750MHz). But then, as soon as I open MSN Messenger 5.0, the CPU usage of foobar goes up to somewhere between 17 and 21%. I close MSN Messenger, and the CPU usage settles back into somewhere between 0 and 1%.
Right now I'm thinkin, "What the hell? blink.gif "
What could be the cause here?

yep, similar effect here with mplayer2.exe (win2k, athlon700)
i need to look into it when i don't have anything more important to do, sounds like something with OS-level sound playback interaction to me but i can't be sure now.

another conflicting program: flash plugin for Internet Explorer 6.

Normal CPU usage shows up as 0% for me, but goes to around 4 or 6% when IE6 is showing flash.

1.4GHz P4, WinXP, Via8233 DirectSound.
kode54
QUOTE(kjoonlee @ Jan 2 2003 - 05:28 AM)
Normal CPU usage shows up as 0% for me, but goes to around 4 or 6% when IE6 is showing flash.

Total usage, or FB2k itself?
Guillaume
I didn't miss any reply, but why doesn't resampling to 48000Hz have as much influence on slower PC's (like psy_jc's Athlon) as on mine? Still don't get that...

0-1% with resample dsp off...

[edit]
This is so odd: now I have a 17% CPU usage (v0.36b and v0.38 test)
tangent
QUOTE(vh1 @ Jan 2 2003 - 08:25 PM)
fb2k used to only use up about 1,600 k of my mem usage, w/o resampler DSP, but thne I added that to my dsp list to see what it was all about, and my mem usage shot up to 7 - 9 000 k!
I was like whoa, that's weird
So then I took it out of my seleted dsp's, and my mem usage is still up that high

This happen to anyone else?

minimize foobar to tray, it should go back down to 1.5Mb
psy_jc
QUOTE(Guillaume @ Jan 2 2003 - 06:33 AM)
I didn't miss any reply, but why doesn't resampling to 48000Hz have as much influence on slower PC's (like psy_jc's Athlon) as on mine? Still don't get that...

0-1% with resample dsp off...

When I used resampling in Winamp through a DirectSound ouput plug-in, it used up about 22%. I was surprised to find that foobar does the same thing while using just 1% CPU. Perhaps its another one of your programs that's conflicting...

Could this be a DirectSound issue? Flash, mplayer2.exe, and MSN Messenger all use DirectSound don't they?

But then, on the other hand, the CPU% still remains high even when I select wave output in foobar dry.gif ...

Anyone got a clue??
Cobra
HIGH CPU USAGE?

1) Optimize code generally.
2) Make optimized build for P4 and other processors. If you don`t know how to make these builds - ask somebody OR (if you are too lazy/don`t know) relase full sourcecode and let someone to make these builds.

Also somebody can make external plugins optimized versions.

Technical question: Is making of P4 optimized (ICL7 compiled) versions hard? What must i have and what must i know to make P4 optimized builds?
Dibrom
QUOTE(Cobra @ Jan 2 2003 - 02:20 PM)
HIGH CPU USAGE?

1) Optimize code generally.
2) Make optimized build for P4 and other processors. If you don`t know how to make these builds - ask somebody OR (if you are too lazy/don`t know) relase full sourcecode and let someone to make these builds.

Also somebody can make external plugins optimized versions.

Technical question: Is making of P4 optimized (ICL7 compiled) versions hard? What must i have and what must i know to make P4 optimized builds?

Aren't you making a lot of assumptions here?

1. Do you know that foobar2000 is unoptimized for a fact? Peter seems to be a pretty solid programmer, so I think that telling him to "optimize" his code is at best unnecessary, and at worse kind of foolish. We know for a fact that Peter is focused on minimalism and low memory usage in foobar (and low cpu usage if you consider the fact that this issue is regarded as abnormal behavior), so you already have evidence that he is "optimizing" his code.

2. If the problem is related to Windows or directsound, then P4 optimization won't do squat. I know you that you really want P4 optimization, but there's no evidence to suggest that it would make a single bit of difference. The fact that the cpu usage jumps up only under some circumstances, but usually remains extremely low (0-5% on most peoples system), suggests that there are no general speed problems with foobar itself.
Peter
thanks, Dibrom.
to all others - reminder: fb2k STAYS at 0% on my 2.5 year old athlon700 box, playing mp3 with no DSPs enabled. if you are having CPU usage "problems" on newer computers ("problems" as in: numbers in task manager scare you away), it's something with either your settings, or some interaction between fb2k and other running programs, NOT "unoptimized" code (whatever that means).
Cobra
For Dibrom:
1) - it was posted generally, not (only) for FB2K. PP is (very) good programmer indeed - i use ONLY FB2K and my conservative brother (he hates OGG, MPC etc.) uses FB2K too smile.gif

QUOTE
but there's no evidence to suggest that it would make a single bit of difference


but there's no evidence to suggest that it would NOT make a single bit of difference

For PP:
QUOTE
fb2k STAYS at 0% on my 2.5 year old athlon700 box

AthlonXP 1600+ 256mb ram DDR 2600 - approx 4% of CPU usage (NO DSP, OGG file, WinME)
For some people this value (4%) is too large (e.g. renderers of 3dmax scenes).

For same AthlonXP system with some DSP effects activated CPU usage jumps to 13-14%

Same as above but with resampler to 96000 (no-fast mode) there is approx 33% CPU usage.

You can`t say "if you don`t want high cpu usage, disable DSP effects" - Foobar should be as fast as possible with all options enabled, some people are using resampler and other effects.
RIV@NVX
It is 0-2% here without Resampler thing.
AthlonXP 1600+ 512 DDR266 WinXP SP1
Peter
for fucks sake, i repeat: if you get more than 0% CPU usage with no active DSPs on a machine faster than athlon700, its NOT caused by fb2k's audio processing.
and if you care about CPU usage, you should stay away from resampling first (wonder if you could actually abx the difference between resampling being active or not on your hardware), resampling will ALWAYS eat noticeably more CPU.
Cobra
QUOTE(zZzZzZz @ Jan 2 2003 - 11:36 PM)
(...) resampling will ALWAYS eat noticeably more CPU.

Yes, but P4 optimized version will (maybe/I think) consume less CPU (for P4 systems of course) biggrin.gif
Dibrom
QUOTE(Cobra @ Jan 2 2003 - 03:40 PM)
QUOTE(zZzZzZz @ Jan 2 2003 - 11:36 PM)
(...) resampling will ALWAYS eat noticeably more CPU.

Yes, but P4 optimized version will (maybe/I think) consume less CPU biggrin.gif

Maybe.

It also might make the executable 4x bigger and introduce new bugs. ICL isn't the most stable compiler...

At any rate, I think you could test some of this out yourself by downloading the SDK and compiling P4 versions of some of the plugins/etc. AFAIK, Peter doesn't have ICL.
Peter
QUOTE(Cobra @ Jan 2 2003 - 11:40 PM)
QUOTE(zZzZzZz @ Jan 2 2003 - 11:36 PM)
(...) resampling will ALWAYS eat noticeably more CPU.

Yes, but P4 optimized version will (maybe/I think) consume less CPU (for P4 systems of course) biggrin.gif

standard DSPs are in the SDK. what are you waiting for ? go compile them.

i guess i wouldn't have much trouble getting ICL, but i've used it before and i got sick of problems caused by it.
another thing, athlon700 is the faster box i have, not gonna upgrade anytime soon because it does it's job fine, so i couldn't even test / debug those "P4-optimized builds".
RIV@NVX
QUOTE(Cobra @ Jan 2 2003 - 02:40 PM)
Yes, but P4 optimized version will (maybe/I think) consume less CPU (for P4 systems of course) biggrin.gif

So what - you think that you are big ass because you have P$ (sorry, 4)?
If it is THAT powerful, than special builds aren't required. And if it is that powerful, how it comes that in_spc crashes it? ohmy.gif

Cobra, I must say that you beat me in annoyance thing - I think peter can definitly confirm this.
Thor
QUOTE(RIV@NVX @ Jan 3 2003 - 12:02 AM)
Cobra, I must say that you beat me in annoyance thing - I think peter can definitly confirm this.

OMG. LMAO.
Lamers fighting over who is more annoying... blink.gif
tangent
QUOTE(Cobra @ Jan 3 2003 - 06:24 AM)
AthlonXP 1600+ 256mb ram DDR 2600 - approx 4% of CPU usage (NO DSP, OGG file, WinME)

There you go.
Cobra
QUOTE(tangent @ Jan 3 2003 - 05:16 AM)
QUOTE(Cobra @ Jan 3 2003 - 06:24 AM)
AthlonXP 1600+ 256mb ram DDR 2600 - approx 4% of CPU usage (NO DSP, OGG file, WinME)

There you go.

RIV@NVX: If you have right, ask maker of OGGDropXP why he makes ICL7 builds. I have both AthlonXP 1.4 GHz and P4 2.4 GHz and i want to use power of both CPUs. There are some FB2K users that have P4.

So WinME is so bad ? Maybe on FB2K someone haveto wrote "Under WinME and WIN2K there is higher CPU usage"
kode54
Please do not be pairing those two together for any reason.
kljs
Use foobar2k without any programs running, and you will get 0% CPU usage......use it with either MSN Messenger or Kazaalite....and you get 2-7% CPU usage......
Blame it on MSN..........
psy_jc
Yup... blame it on Bill Gates and his crew...
If a small program like MSN Messenger is so full of sh*t, I wonder how Windows actually manages to run on my PC dry.gif .
But damn it, a lot of people use MSN Messenger and there's not that many compatible alternatives out there. What the hell's MS thinkin'? Leave his crappy work the way it is and change a program that's perfectly fine?
I say it ain't nobody's fault except Microsoft.
tonylu
Disable DSP~
It will be better,but..... wink.gif
RIV@NVX
QUOTE(tangent @ Jan 3 2003 - 05:16 AM)
RIV@NVX: If you have right, ask maker of OGGDropXP why he makes ICL7 builds. I have both AthlonXP 1.4 GHz and P4 2.4 GHz and i want to use power of both CPUs. There are some FB2K users that have P4.


Yes, the
OGGDropXP is encoder, which speed is important and makes very big difference if used with that compiler.
But I agree with Dibrom on this point: "It also might make the executable 4x bigger and introduce new bugs. ICL isn't the most stable compiler..."
Yes, there are P4 users, but I just think it isn't worth it.
And also, if fb2k is good optimized that uses 0% on peter's Athlon 700, I don't really get the point of making special build for much faster CPUs.
Maybe I am wrong, but this is what I think.
blueadam
For me the killer app is not Kaaza (dunno about MSN Messenger) but... kX Mixer. When the mixer sits in the tray, foobar2k takes 20-40% of my K6-2 300MHz processor time. If kX Mixer disabled, foobar only needs 0-6%. It's a shame because I'm so used to those kX Drivers (I've got a SB Live! Value). Actually this same happens to Winamp but it only needs up to 20% when kX Mixer started.
I'm dumb. Can anyone explain why is this happening? Is the kX Mixer somewhat broken?
SometimesWarrior
When I shake my mouse around on the screen, my CPU usage (on a dual XP1600+ machine) goes up to 20%, according to WinXP Task Manager. Whoop de doo.

Are any of you CPU whiners actually doing benchmarks while Foobar is running, to see if it makes the slightest difference in your performance? If you do a 3DSMax render with and without Foobar, and the render takes 61 minutes when Foobar is playing instead of 60 when Foobar is off, does it really matter? If so, stop typing on this forum and get back to work.

Or, if it's a matter of principle that Foobar be as fast as possible, and you have the programming knowledge necessary, take your best shot at optimizing stuff yourself. It would be interesting to hear if any significant speedups can be made.
Somebody
Also if cpu usage stays constantly above 10%, just stop foobar, close it, and then open it.
kode54
I found another "killer" app to add to the list... stupid fricking Quicktime tray icon that I never use.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.