Clementine icon indicating copy to clipboard operation
Clementine copied to clipboard

Very high cpu usage when playing on OSX

Open bwat47 opened this issue 11 years ago • 33 comments

When playing any track in clementine on OSX, I am observing constant, extremely high cpu usage. As long as clementine is playing a track, it consistently gobbles up 25-30% cpu usage, which really hammers the battery life on my macbook air. CPU usage is fine as long as a track isn't playing. I've disabled all of clementine's cpu intensive features/options (Moodbar generation disabled, current track glowing animation disabled, analyzer disabled)

I also tested this with a totally empty library and just dragged a single mp3 into the playlist and played it, nothing helps, always 25-30% cpu usage while clementine is playing. this is also a totally clean install of osx 10.10. I also observed this same issue on osx mavericks. computer is a macbook air 2013. screen shot 2015-02-02 at 10 35 25 am

bwat47 avatar Feb 02 '15 15:02 bwat47

I've noticed this too.

agargara avatar Feb 03 '15 08:02 agargara

I also just tried the latest 1.2.3 build. cpu usage isn't as bad with that compared to 1.2.2 (constant ~15% instead of ~30%), but still way too high for playing an mp3:

screen shot 2015-02-04 at 5 32 33 pm

bwat47 avatar Feb 04 '15 22:02 bwat47

Does it apply to any type of file format? (flac, ogg, aac, wav...)

I would try to change buffer size to 4x times, just to test the impact on cpu usage.

hsantanna avatar Feb 10 '15 22:02 hsantanna

Just tested with mp3, flac, aac and wav. CPU usage for aac and mp3 was the same. It was slightly lower with FLAC and WAV but not by much. I changed the buffer from 4000ms to 10000ms and that didn't seem to make any difference.

playing the same mp3/aac files in itunes results in only 1-4% cpu usage vs 14+ with clementine 1.2.3 (and higher than that for the current stable release)

bwat47 avatar Feb 13 '15 15:02 bwat47

I also have the same issue.

plsrspnd avatar Feb 14 '15 01:02 plsrspnd

Using yesterdays nightly, it's at 11% on MP3 and 9% on FLAC.

For some comparison, iTunes is at 1-2% on MP3 and 1% on ALAC

tmikaeld avatar Mar 03 '15 08:03 tmikaeld

Hi, same thing for me, between 25 - 30% cpu. OSX put it as the biggest energy consumer. Clementine Version 1.2.3-1031-gb6fd781

AoDev avatar Mar 17 '15 15:03 AoDev

Is this issue being worked upon?

shantanukhanwalkar avatar Jan 15 '16 09:01 shantanukhanwalkar

#5511 shows that removing the glowing animation on the current track makes a difference. I just turned it off manually in Preferences | General | Playback (at the very top) and CPU went from ~25% to ~15%. It's still hungry, but less.

@Shannaro it looks like the action is happening in #1079

jeanrajotte avatar Oct 18 '16 15:10 jeanrajotte

Suddenly found out this extremely strange CPU harvesting... Turning off the glowing animation doesn't seem to change anything at all for me.

Macbook Pro 13, El Capitan

monosnap_h773z

dazewell avatar Dec 16 '16 04:12 dazewell

I'm getting around 9% CPU usage while playing an MP3 with the main window closed. iTunes uses around 1.5% CPU for the same MP3. This is on macOS 10.12.3, Clementine Version 1.3.1-281-g9967bd4

Taking a profile with Instruments.app, it seems that gstreamer is resampling audio for some reason, despite everything being 44100Hz (the MP3 file, the setting in Clementine's preferences, and the OS setting in "Audio MIDI Setup.app").

screen shot 2017-02-10 at 9 41 05 pm

ericwa avatar Feb 11 '17 04:02 ericwa

Something I didn't appreciate was the massive difference between minimising the window and closing it. With the window showing or minimised, it's 40-50% CPU usage on my Macbook Pro. With the window closed, it's 12%. (Because I've enabled the Mac option that windows minimise into the app itself rather than as a separate dock icon, there's no visual difference between closing and minimising, but there is a performance difference.)

neilccbrown avatar Mar 23 '17 16:03 neilccbrown

I have the same issue. When the window is shown it's about 50% of cpu during playback. When it's hidden it's dropping to 10%, which is still pretty high for a simple mp3 playback. But the playback itself is not the case. I see high cpu usage with opened window even if there is no playback at all.

I think this should be splitted to 2 different issues:

  1. High cpu usage for active gui.
  2. High cpu usage for playback.

deseven avatar Apr 23 '17 12:04 deseven

I'm willing to pay $50 via paypal for anyone who can solve those two problems and provide a pull request.

UPD: More than 2 months passed and no one seems to be interested in fixing this, so i finally decided to switch to another audio player. Obviously it means that there is no more bounty for those bugs, sorry.

deseven avatar Jul 12 '17 09:07 deseven

Uses over 100% CPU on FreeBSD. Switched to another player, 0.2%. Wow.

Ezerbeth avatar May 17 '18 14:05 Ezerbeth

@deseven & @Ezerbeth which did you switch to?

reagle avatar Jan 18 '20 01:01 reagle

@reagle DeaDBeeF

deseven avatar Jan 18 '20 01:01 deseven

Sorry Clementine :(

Thanks for the pointer @deseven . It wasn't so hot on the mac. I'm giving Quod Libet a spin at present. My search shows "quod libet" means something like "whatever". Whatever!

  • [x] 4.9% CPU usage streaming internet radio;
  • [x] ~10% CPU for an mp3 off my disk.

I don't think it's perfect, but it's not a hog. The UI is super "primitive", but I don't need more.

jeanrajotte avatar Jan 22 '20 21:01 jeanrajotte

@jeanrajotte 10% of cpu for simply playing some mp3 file is an insanely big number for any modern (2015+) PC. Deadbeef (or cmus, or sox) gives me about 0.5%.

deseven avatar Jan 22 '20 22:01 deseven

I hear you. It fluctuates between 5% - 11%... It's a Python app, if this makes a diff.

Maybe I didn't use DeaDBeef properly. I couldn't see where to register the folders for my library, so I added the root to the default playlist and it spun forever and a day and I gave up on it. If there's a better way, I'll give it another try.

jeanrajotte avatar Jan 22 '20 22:01 jeanrajotte

That's interesting... I tested Quod Libet and it takes a pretty constant 1.6%, which is not perfect, but far from your measurements. I wonder what experience you'll have with sox (i use it as a gold standard). Try it like that:

brew install sox
play /path/to/file.mp3

It's again 0.5% for me.

deseven avatar Jan 22 '20 22:01 deseven

Same mp3 with sox : 0.6% with quodlibet: 5.5%

macos 10.15.2

How do you use DeaDBeeF with a big library?

jeanrajotte avatar Jan 22 '20 23:01 jeanrajotte

I really wonder why Quod Libet eats so much cpu on your mac and why it doesn't do that for me... Could it be sample rate specific? Maybe you're trying to play a file with a sample rate your audio output doesn't support and it has to resample it?

As for the big library... Deadbeef doesn't organize your music in any way. I have one huge (~7000 tracks) playlist along some smaller ones and i navigate using search or scrolling. I used Clementine exactly the same way, so the lack of library functionality is not a problem for me, but i know it can be a problem for other people.

deseven avatar Jan 22 '20 23:01 deseven

On my machine:

Clementine: 8% idle 30% playing
Quod Libet: 3% idle 8% playing
Deadbeef: .4% idle 2% playing

However, Libet crashed overnight (doing nothing) and Deadbeef also broke (sound clicked loudly and discontinued during playback).

reagle avatar Jan 23 '20 12:01 reagle

@deseven @reagle

Thanks for all this digging, folks. In the end this isn't soooo important that I want to pursue this thread much more. Also, I confess I feel awkward discussing alternatives to Clementine in such details in a Clementine thread.

In the end, DeadBeef's UI doesn't suit on mac - its promises of customisability aren't delivered on the mac. As to Quod Libet's, I couldn't figure out how to use it simply. Maybe I'm thick.

I'm trying Musique now. Its focus on "pretty" makes it less powerful, IMO, but all I want is sounds while I code, so I'm giving it a spin, so to speak.

Ciao.

jeanrajotte avatar Jan 23 '20 16:01 jeanrajotte

I have a simiilar issue on Clementine 1.4 / OSX 10.15.7:

without playing any sound, 80% CPU when the window is shown, but 0.5% when the window is hidden.

liofeu avatar Oct 22 '20 09:10 liofeu

More people on Mac / Linux have similar issues there, but also without playing any file https://github.com/clementine-player/Clementine/issues/6636

liofeu avatar Feb 26 '21 15:02 liofeu

BTW: I moved to cog on MacOS.

reagle avatar Feb 26 '21 16:02 reagle

I'm willing to pay $50 via paypal for anyone who can solve those two problems and provide a pull request.

UPD: More than 2 months passed and no one seems to be interested in fixing this, so i finally decided to switch to another audio player. Obviously it means that there is no more bounty for those bugs, sorry.

I add 30€ for anyone who can solve those issues

liofeu avatar Mar 02 '21 09:03 liofeu

For those who have an extreme high CPU usage, it can be reduced by desactivating the analyzer (right click on it > No Analizer), but CPU still stays pretty high without the analyzer though, the analyzer is just a part of the problem.

liofeu avatar Mar 02 '21 09:03 liofeu