iTunes CPU usage

Posted:
in macOS edited January 2014
My iTunes takes up to 10-15% of CPU Power while playing an MP3 tune on my iMac 1GHz machine. Is this normal? Seems a bit too high?!



Regards,



Peter
«1

Comments

  • Reply 1 of 25
    overhopeoverhope Posts: 1,123member
    Pretty normal, to be honest. iTunes has always been cycle-hungry.
  • Reply 2 of 25
    lucaluca Posts: 3,833member
    All I know is that when playing some music and typing in Safari, Safari got slow to respond.
  • Reply 3 of 25
    equinoxequinox Posts: 43member
    *lol* the g4 gets down when playing mp3s and surfing? Man, the wintel world will laugh at us...this can't be possible???!



    Regards,



    Peter
  • Reply 4 of 25
    thuh freakthuh freak Posts: 2,664member
    itunes, and all mac audio players, are processor hungry becuase macs don't use a separate sound card (like peecees do). so the encoding/decoding of the music files is done on the proc and that takes cycles. if you find itunes is overstepping its bounds, you can alter its nice value [nice values tell the kernel what priority to give processes]. in terminal, type: `ps aux | grep iTunes.app`. (note, you may have to widen the terminal window a bit for that command). the first number printed is the "process id". the next command to type is `renice +1 PROCESSID`, replacing "PROCESSID" with the number you found in the first command. if you repeat the renice step several times, iTunes will gain a high nice value (up to positive 20), and consequently will use less proc time. unfortunately, you have to do this everytime you quit/relaunch iTunes. if you want to return iTunes to its normal nice-ness, use `sudo renice 0 PROCESSID` (note: sudo may require you to type in an administrator's password).
  • Reply 5 of 25
    thats sound logical to me. \ isn't it possible to make startup-script fot that? Sorry for my ignorance, but i switched to Mac few days ago..



    Regards,



    Peter
  • Reply 6 of 25
    mggmgg Posts: 124member
    Quote:

    Originally posted by equinox

    My iTunes takes up to 10-15% of CPU Power while playing an MP3 tune on my iMac 1GHz machine. Is this normal? Seems a bit too high?!



    Regards,



    Peter




    Seems that mine wakes up a lot too and takes up at least 32 mb of ram when playing a good song and using the graphic thing.
  • Reply 7 of 25
    thuh freakthuh freak Posts: 2,664member
    Quote:

    Originally posted by equinox

    thats sound logical to me. \ isn't it possible to make startup-script fot that? Sorry for my ignorance, but i switched to Mac few days ago..



    Regards,



    Peter




    you can actually make a script for it (not necessarily a startup script). here's a version written in sh:

    Code:


    #!/bin/sh

    /usr/bin/open /Applications/iTunes.app/

    pid=`/bin/ps aux | /usr/bin/grep "iTunes.app" | /usr/bin/grep -v "grep" | cut -b "7-14"`;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    exit 0;







    copy and paste that into a text editor (make sure, if you use textedit, that its not saved as an rtf and that no formatting is added). save the file as "iTunesFix.command" inside your home directory. Open up terminal, and do the following command: `chmod +x ~/iTunesFix.command`. now you can move the .command file anywhere you'd like, and even add it to the login items (in sys prefs). The unfortunate part (for people who don't regularly keep terminal open) is that 2x clicking that file will open up terminal. If you wrap it inside an applescript, i think you can avoid that, but i'm not very familiar with applescript.
  • Reply 8 of 25
    On my B&W G3 iTunes takes up 15 to 20% of the CPU. Anyway, on the new PMs I've noticed that iTunes is in the single digit range.
  • Reply 9 of 25
    I must have the lowball iTunes.



    Mine fluctuates between 7% and 13%, occasionally spiking to about 20%.



    This is with the equalizer on... no visualization, though.
  • Reply 10 of 25
    xmogerxmoger Posts: 242member
    Quote:

    Originally posted by thuh Freak

    itunes, and all mac audio players, are processor hungry becuase macs don't use a separate sound card (like peecees do). so the encoding/decoding of the music files is done on the proc and that takes cycles. if you find itunes is overstepping its bounds, you can alter its nice value [nice values tell the kernel what priority to give processes]. in terminal, type: `ps aux | grep iTunes.app`. (note, you may have to widen the terminal window a bit for that command). the first number printed is the "process id". the next command to type is `renice +1 PROCESSID`, replacing "PROCESSID" with the number you found in the first command. if you repeat the renice step several times, iTunes will gain a high nice value (up to positive 20), and consequently will use less proc time. unfortunately, you have to do this everytime you quit/relaunch iTunes. if you want to return iTunes to its normal nice-ness, use `sudo renice 0 PROCESSID` (note: sudo may require you to type in an administrator's password).



    It's not necessarily hardware acceleration. I just disabled hardware acceleration on my athlon box and winamp still averages 0% of the cpu.



    Like encoders, not all decoders are created equally.
  • Reply 11 of 25
    123123 Posts: 278member
    Quote:

    Originally posted by thuh Freak

    itunes, and all mac audio players, are processor hungry becuase macs don't use a separate sound card (like peecees do). so the encoding/decoding of the music files is done on the proc and that takes cycles.



    complete bullcrap.
  • Reply 12 of 25
    defiantdefiant Posts: 4,876member
  • Reply 13 of 25
    123123 Posts: 278member
    Quote:

    Originally posted by thuh Freak

    you can actually make a script for it (not necessarily a startup script). here's a version written in sh:

    Code:


    #!/bin/sh

    /usr/bin/open /Applications/iTunes.app/

    pid=`/bin/ps aux | /usr/bin/grep "iTunes.app" | /usr/bin/grep -v "grep" | cut -b "7-14"`;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    /usr/bin/renice +1 $pid;

    exit 0;











    I'm sure someone can come up with an even longer script that is even more useless.



    Until then, try renice 20 pid (but honestly, it's a bad idea to lower itunes' priority)
  • Reply 14 of 25
    dfilerdfiler Posts: 3,420member
    Quote:

    Originally posted by equinox

    My iTunes takes up to 10-15% of CPU Power while playing an MP3 tune on my iMac 1GHz machine. Is this normal? Seems a bit too high?!



    My iTunes takes up to 10-15% of my brain's processing power while playing an MP3 tune on my iMac 1GHz machine.





    It seems that this drop in overall productivity should concern users at least as much as the consumed CPU time.

  • Reply 15 of 25
    thuh freakthuh freak Posts: 2,664member
    Quote:

    Originally posted by 123

    I'm sure someone can come up with an even longer script that is even more useless.



    Until then, try renice 20 pid (but honestly, it's a bad idea to lower itunes' priority)




    i thought i had read that regular users could only increment their nice values one value at a time. i didn realize they could skip up to 20.



    Quote:

    complete bullcrap.



    are you trying to imply that macs do have separate sound cards?



    Quote:

    It's not necessarily hardware acceleration. I just disabled hardware acceleration on my athlon box and winamp still averages 0% of the cpu.



    Like encoders, not all decoders are created equally.



    well, that's the reason i always heard relating to iTunes proc percentage. if a sound card isn't working on the sound and the proc isn't working on the sound, then what is?
  • Reply 16 of 25
    123123 Posts: 278member
    Quote:

    Originally posted by thuh Freak

    i thought i had read that regular users could only increment their nice values one value at a time.



    You can't do that.

    renice +1 pid

    renice +1 pid

    renice +1 pid

    renice +1 pid

    renice +1 pid

    renice +1 pid == renice 1 pid (absolute number)

    No -n support and we're not on linux either...



    "monotonic increment" doesn't mean one by one, it just means that you can't lower the number unless you are a superuser.





    Quote:

    Originally posted by thuh Freak



    are you trying to imply that macs do have separate sound cards?





    I'm trying to imply that:

    a) While PCs had separate sound cards since ever (btw this has been changing recently) only 2 years or so ago mp3 hardware decoding capable cards came to market. Playing an mp3 on a two year old Athlon system (no hw support) uses almost no CPU.



    b) It's not impossible to develop hardware acceleration just because the Mac's sound chips aren't on a PCI card.



    -> Whether the audio stuff is on a separate PCI card or not has nothing to do with hardware acceleration whatsoever.



    However this is not really the point at all.

    mpg123 uses 5% (and I don't think much altivec optimization went into that one) while itunes uses 10-15% to play the same song. Now that's the point.
  • Reply 17 of 25
    airslufairsluf Posts: 1,861member
  • Reply 18 of 25
    airslufairsluf Posts: 1,861member
  • Reply 19 of 25
    123123 Posts: 278member
    Quote:

    Originally posted by AirSluf

    Yep. It's combination of a higher quality but less optimized algorithm running on a slower clockspeed processor that only has one FPU vice two. Raw cycles are a HUGE difference here, not to mention getting to do twice as much work per cycle. It's like boxing with both hands tied behind your back, but baby you've got the nicest [no pun intended!] gloves on back there!



    1) So why isn't it optimized? Altivec has 4x single precision FP (or whatever is used to decompress mp3).



    2) I think you misunderstood me. mpg123 (no altivec) uses 5% while AT THE SAME TIME ON THE SAME MACHINE itunes uses 10% with quality enhancments and equalizer TURNED OFF.



    I just came accross this player: http://www.lounging.com/monoware/tempe.html

    It uses an altivec optimized mpg123 library and uses 2% CPU. It even has a very simple GUI which means that the app has to listen for events etc. just like iTunes, unlike CL mpg123.



    So what's with the other 8%? iTunes probably uses them to do the song name scrolling...
  • Reply 20 of 25
    jlljll Posts: 2,713member
    Quote:

    Originally posted by 123

    So what's with the other 8%? iTunes probably uses them to do the song name scrolling...



    Correct, the display uses a lot of power.



    By making the iTunes window so small that you can't see the display, it only uses half as much processor power.
Sign In or Register to comment.