Re: CPU Usage difference
Re: CPU Usage difference
- Subject: Re: CPU Usage difference
- From: William Stewart <email@hidden>
- Date: Fri, 6 Mar 2009 18:08:01 -0800
Hi Alex
The reason this measures so high is that we are very aggressive in
clocking down the CPU when it is in low power modes (little activity
on the system). We try to conserve energy, etc...
You can verify this, by doing the following:
Open a terminal window and enter the following:
% yes > /dev/null
Do the above again (so you have two terminal windows running). If you
have a look in top now you will see both CPU cores being used to their
max - the processor will also be put into its highest usage case.
Now, run your playback tests again and you should see the numbers go
down from the numbers you report below.
In both cases (this power-tripped one and the one below), the code
executes the same amount of instructions, but the %CPU times aren't
counting instructions so you see the difference.
Bill
On Mar 6, 2009, at 4:43 PM, Alex ROUGE wrote:
So,
I set all devices, internal speaker and lineout / headphone to be
44100hz
The mp3 file is 44100hz
The same phenomena occured.
If you want me to perform other test I'd be pleased to do so.
I already did a few of them and the result is always the same. With
internal speaker it's 3 to 4 times more cpu consuming.
I also ask friend who had the same issue with Macbook (not sure how
it works with Macbook Pro but friend told me they didn't had this
behavior).
Regards
Alex
On 7 mars 09, at 01:30, William Stewart wrote:
Could you tell me:
What is the sample rate of the file
What is the sample rate of the device - have a look at this in
Audio MIDI Setup
Thanks Alex
Bill
On Mar 6, 2009, at 3:24 PM, Jens Alfke wrote:
What I found is that, all application who requiere audio output
doesn't have the same CPU usage depending if the audio output is
internal speaker or headphone/line out.
The difference is impressive.
For instance, if we use the Finder to play an audio file :
Line out : CPU charge = 3.5%
Internal speaker : CPU charge = 10.9%
I think Apple ® is doing a software filtering to compensate very
small sized speaker but this difference is really huge.
The speaker and line-out interfaces may be running at different
sample rates. (I've seen this myself; I had a bizarre bug that was
triggered by plugging in headphones. Turned out this reset the HAL
to change between 44k and 48k.) That would mean that sample-rate
conversion is involved in playback over one or the other interface.
If you're curious you could always run 'sample' or Xray on the app
while it's playing, and see where the time goes.
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden