[quote]Originally posted by stimuli:
<strong>Morte, I don't follow your explanation. Also, I really doubt there are kernel modules for mp3 playback. That (playing mp3s) is strictly user space. The kernel merely allows the software to 'talk' to the hardware, and vice versa. CPU usage is independant from this.
Well, it wasn't a very good explanation, because I oversimplified, or maybe I didn't simplify enough. Or something. <img src="graemlins/bugeye.gif" border="0" alt="[Skeptical]" />
Anyway, let's take it from the bottom...I'll probably screw this up somewhere, but it's Monday, so I have a fresh week's alottment of mistakes to work with:
A vastly simplified view of how a MP3 player such as XMMS or Maccast plays a MP3 would be as follows. The player makes a call to a sound library/framework (LibC5(?) and Quicktime, respectively), the library interfaces with the sound driver (usually a kmod/kext, unless the sound chip is actually supported by the kernel, as is the case with the occasional chip and Linux 2.4
), the driver with the kernel, and the kernel with the hardware.
Now, since the library/framework that the MP3 players use is not unique to the player, and are loaded as a part of the system, the CPU time taken by the decoding and playback isn't included in the player's process. I can't think of anywhere else that the CPU usage could be slotted in than kernelspace (which I'm using as a kludgy term for system processes in general).
iTunes, on the other hand, has a sound library that is unique to it, so the CPU time that it uses is put under the iTunes process.
That, at least, is how I understand it. I could be utterly wrong. Wouldn't be the first or last time. <img src="graemlins/smokin.gif" border="0" alt="[Chilling]" />
In any case, MP3 playing is going to take a certain amount of processing power, and that figure is going to be pretty static because no codec is going to improve on the effeciency of the algorithm, and the algorithm isn't a very good one compared to the newer sound compression formats. The only way that Apple could make iTunes consume less CPU time would be to include support for a more effecient format, such as Ogg Vorbis. It would be awesome if Apple were to start pushing Ogg.