Re: High performance MP3 decoder (was Re: SoundComponentData to AudioStreamBasicDescription)
Re: High performance MP3 decoder (was Re: SoundComponentData to AudioStreamBasicDescription)
- Subject: Re: High performance MP3 decoder (was Re: SoundComponentData to AudioStreamBasicDescription)
- From: Jeff Moore <email@hidden>
- Date: Fri, 25 Jan 2002 11:56:21 -0800
on 1/25/02 2:04 AM, Lieven Dekeyser <email@hidden> wrote:
>
>> The SoundConverter works,
>
>> but it uses up to 90% cpu time on my iBook 500, which isn't acceptible at
>
>> all.
>
> If I playback an MP3 file with QT I only see about a
>
> 5-6% usage on a tibook. This is using the same decoder code exactly as the
>
> SoundConverter, so I'm very confused about why you're seeing a 90% load...
>
>
With QuickTime Player I get about 25% cpu usage... (didn't know tiBooks
>
were 5 times faster than iBooks, but 25% is acceptible)
Altivec makes a big difference.
>
But try out the SoundConverter FillBuffer example from:
>
http://developer.apple.com/samplecode/Sample_Code/Sound/MP3Player.htm
>
>
on my iBook I also get 80-90% cpu usage. maybe there's some overhead in
>
the FillBuffer proc that the Movie Toolbox doesn't have
There is not any throttling code in the sample code, so the decoder will
happily suck down as much time as you care to give it. You have to tune the
buffering and what not yourself to get the performance you want. If you spin
in a loop doing a conversion without yielding, the OS is more than happy to
give you all the cycles you need until your thread priority depresses enough
to allow for preemption by some other thread.
For the record, there is actually less overhead in the SoundConverter than
in play back with the Sound Manager.
--
Jeff Moore
Core Audio
Apple