Question

high cpu usage when SoundCloud tab is selected

  • 31 October 2014
  • 47 replies
  • 3799 views

Userlevel 1
Hi SoundCloud team!

I've noticed that when I leave SC open in a tab that's "selected"—whether or not this tab is covered by another window—that the CPU usage of this tab increases significantly.

For example... I'm listening right now to SC in the background.
CPU usage is about 5%, up to a bit less than 10%.

When I click over to the SC tab, the CPU usage instantly spikes up to >80%!

This is annoying for me because I listen to SC constantly on my computer, and if I don't switch away from the tab, I notice my laptop fans kick on after a few minutes (I have a mid-2012 MacBook Air).

I think this issue started around a month ago (maybe less), but I'm not sure.

Other details...
Chrome - Version 38.0.2125.111
Adobe Flash Player (2 files) - Version: 15.0.0.189
Shockwave Flash 15.0 r0

Looking forward to your response!

Best,
Felix

47 replies

Userlevel 7
Badge +2
Hey Felix,

Thanks for writing to the forum. Here's the thing, many things (or combinations of things) can cause your CPU usage to spike. Do you normally run any other processing intensive programs at the same time that you run SoundCloud?

To check, open up your Activity Monitor, which can be found in the /Applications/Utilities folder.Here you will be able to see if it is just SoundCloud or something running along with SC.

Let me know what your detective work uncovers!

-Gina
Userlevel 1
Hi Gina, Thanks for your reply.

I have isolated SoundCloud as the cause of the CPU usage by looking at Chrome's built-in Task Manager (https://support.google.com/chrome/answer/95672?hl=en)

The activity I'm describing is definitely coming from SoundCloud. Please LMK if there's any diagnostic info that I can send to confirm this issue.
Userlevel 7
Badge +2
Hey again Felix,

Thanks for taking a look and letting me know what you gathered from the Task Manager. This is tricky because I am using SoundCloud on the same version of Chrome/Flash but not getting the same overload as you. Do you get these same results in different browsers?

Could you switch over to Safari and Firefox to see if CPU usage is affected the same? Also, one of our developers suggested keeping your cache cleared. Having a heavy cache means that your browser is hanging onto and managing a lot more data than it needs to.

Hopefully this is clear, let me know if you have any further questions.

Hope you had a lovely weekend!
Gina
Userlevel 1
Hi Gina,

Thanks for your reply. I tried in Firefox and found the CPU usage while playing SC with the tab selected/visible to be ~35%–40%, much less than Chrome.

I cleared my cache in Chrome, and voilà! The CPU usage has decreased to a much more manageable ~25%–40% (for the SC tab alone, when selected).

Thanks for your help in troubleshooting this issue, please mark it resolved.
Userlevel 7
Badge +2
Hi Gina,

Thanks for your reply. I tried in Firefox and found the CPU usage while playing SC with the tab selected/visible to be ~35%–40%, much less than Chrome.

I cleared my cache in Chrome, and voilà! The CPU usage has decreased to a much more manageable ~25%–40% (for the SC tab alone, when selected).

Thanks for your help in troubleshooting this issue, please mark it resolved.

Awesome! Thanks for letting me know. Hopefully this conversation will help others in the future with similar issue.

:)
-G
Hi Gina,

Thanks for your reply. I tried in Firefox and found the CPU usage while playing SC with the tab selected/visible to be ~35%–40%, much less than Chrome.

I cleared my cache in Chrome, and voilà! The CPU usage has decreased to a much more manageable ~25%–40% (for the SC tab alone, when selected).

Thanks for your help in troubleshooting this issue, please mark it resolved.

Hi,

I have Win7, chrome 40.0.2214.93 m and have exact same issue.

Clearing cache doesn't help 😞
Userlevel 7
Badge +2
Hi Gina,

Thanks for your reply. I tried in Firefox and found the CPU usage while playing SC with the tab selected/visible to be ~35%–40%, much less than Chrome.

I cleared my cache in Chrome, and voilà! The CPU usage has decreased to a much more manageable ~25%–40% (for the SC tab alone, when selected).

Thanks for your help in troubleshooting this issue, please mark it resolved.

Hi Vojta,

Can you please give another browser a try? Also, see if this is occurring with other websites.

Thanks,
Gina
Same issue here running on Mac Mini late 2012 on OS X 10.10.2 with chrome 40.0.2215.111 (64 bit). I noticed it only happens when the page is visible and music is playing. In chrome's task manager, I can see the soundcloud tab using around 90% CPU usage and the GPU process at 10%. Pausing the music or switching tab temporarily fixes the issue.

This leaves me to think that it might be related to the various animations on the page. For instance, the CPU usage drops when the currently playing song waveform is not visible.

I can be reproduce it by playing a song, then using the developer tools, inspect the corresponding soundList__item and setting its style to "display: none". The CPU usage will drop to more a more normal range.
Userlevel 7
Badge +3
Same issue here running on Mac Mini late 2012 on OS X 10.10.2 with chrome 40.0.2215.111 (64 bit). I noticed it only happens when the page is visible and music is playing. In chrome's task manager, I can see the soundcloud tab using around 90% CPU usage and the GPU process at 10%. Pausing the music or switching tab temporarily fixes the issue.

This leaves me to think that it might be related to the various animations on the page. For instance, the CPU usage drops when the currently playing song waveform is not visible.

I can be reproduce it by playing a song, then using the developer tools, inspect the corresponding soundList__item and setting its style to "display: none". The CPU usage will drop to more a more normal range.

Hey there,

Thanks for reporting this. I've tried, yet wasn't able to reproduce the issue from here. Can you make sure that you've disabled any extensions in Chrome (type chrome://extensions into your browser's address field and press enter to get there straight away).

Also, is a similar behavior apparent when you're using a different browser?

Looking forward to hearing from you.
Cheers,
Mathis
Same issue here running on Mac Mini late 2012 on OS X 10.10.2 with chrome 40.0.2215.111 (64 bit). I noticed it only happens when the page is visible and music is playing. In chrome's task manager, I can see the soundcloud tab using around 90% CPU usage and the GPU process at 10%. Pausing the music or switching tab temporarily fixes the issue.

This leaves me to think that it might be related to the various animations on the page. For instance, the CPU usage drops when the currently playing song waveform is not visible.

I can be reproduce it by playing a song, then using the developer tools, inspect the corresponding soundList__item and setting its style to "display: none". The CPU usage will drop to more a more normal range.

I am experiencing the same issue with or without any extensions and on the latest version of Chrome (64 bit) and Safari.

I do not know if you will be able to read much into this considering I am obviously running a minified version of the site, but I have profiled the application using the Chrome profiler in both Playing+Focused and Playing+Blurred scenario. Here are the links to the files, you can clearly see that something is wrong as the focused CPU time is at least twice as high.

https://dl.dropboxusercontent.com/u/3461498/SoundCloud-Stream-Playing%26Blurred.cpuprofile
https://dl.dropboxusercontent.com/u/3461498/SoundCloud-Stream-Playing%26Focus.cpuprofile

A key point that I can see is a jump from 0.35% to 12.23% of the time is being spent in Chrome itself, the (program) function, from one session to the other. The top three javascript function also double in CPU time between the two cases.

Hopefully this will help a little.
Userlevel 2
I have the same problem.
The problem occurs when the tab is selected and a song is playing. This leads to a CPU usage of ~12% with a Core I7@4GHZ, on my i3 Notebook I get ~25%.
Both running Win8.1x64 and Chrome.

I think the problem is, that a js functions is triggerd by 'onfocus' or 'window.active'. I took a look in the JavaScript memory usage and it looks all normal when the window is not selected, but when it's selected the js-live-memory increases with 250kb/s. Which show that js is really constantly performing some tasks when the tab is selected.

Anyway, thanks for this great plattform!
Userlevel 2
I have the same problem.
The problem occurs when the tab is selected and a song is playing. This leads to a CPU usage of ~12% with a Core I7@4GHZ, on my i3 Notebook I get ~25%.
Both running Win8.1x64 and Chrome.

I think the problem is, that a js functions is triggerd by 'onfocus' or 'window.active'. I took a look in the JavaScript memory usage and it looks all normal when the window is not selected, but when it's selected the js-live-memory increases with 250kb/s. Which show that js is really constantly performing some tasks when the tab is selected.

Anyway, thanks for this great plattform!

Update: If I click play on a track and switch the webpage on soundcloud the CPU-usage goes back to normal (~2%).
So this may help you to find the bug. Perhaps the spectrum graph, which constantly reflect the time of the track and shows the comments, is the source of the problem. Moreover, the problem is only present on soundcloud-sites where the spectrum graph is shown - so e.g. playing tracks on the like-page works just fine, playing on the stream-page in comparence not.
Same problem here with Win8.1x64 and Chrome40.0 on an i5 laptop:

- I get 33% CPU usage when looking at an active spectrum graph in my stream (fan spinning)
- 2-6% when switching to another tab
- 10-20% when scrolling down so that the spectrum graph is no longer visible (further down seems better)

Annoying because it causes my fan to start spinning and drains my battery quickly.
As Martin said, CPU usage is normal when playing tracks on pages without the graph (e.g. likes).

If the CPU consumption cannot be brought down by the engineering team I would prefer a setting that allows to switch to a simplified spectrum graph with less CPU utilization.
Userlevel 1
Same problem here with Win8.1x64 and Chrome40.0 on an i5 laptop:

- I get 33% CPU usage when looking at an active spectrum graph in my stream (fan spinning)
- 2-6% when switching to another tab
- 10-20% when scrolling down so that the spectrum graph is no longer visible (further down seems better)

Annoying because it causes my fan to start spinning and drains my battery quickly.
As Martin said, CPU usage is normal when playing tracks on pages without the graph (e.g. likes).

If the CPU consumption cannot be brought down by the engineering team I would prefer a setting that allows to switch to a simplified spectrum graph with less CPU utilization.

Agreed, I would also appreciate a "simple mode" with a less demanding spectrum visualization.
Also high CPU here, on Chrome desktop (41.0.2272.101 m) on Vista.
BUT I found out how to disable it (but it's a real nuisance having to do this EVERY time) :
-> Pause the track, wait for CPU to go down, start it again.
-> Also, don't jump to a new track while one is still playing. If you (or soundcloud) did this and CPU stays up, then go back to the old one and play-wait-pause-wait it.
-> Else, minimizing the tab also helps usually.

I haven't done a full scientific test on this, but this tiresome procedure saves me from the crazy-spinning fan.

I admire you, Soundcloud, for your amazing UI!
But with a bug like that, it's starting to wear thin, just saying...
Hey Felix,

Thanks for writing to the forum. Here's the thing, many things (or combinations of things) can cause your CPU usage to spike. Do you normally run any other processing intensive programs at the same time that you run SoundCloud?

To check, open up your Activity Monitor, which can be found in the /Applications/Utilities folder.Here you will be able to see if it is just SoundCloud or something running along with SC.

Let me know what your detective work uncovers!

-Gina

Hi, just a bump so you'll be notified of my detective work below 🙂
Same problem, Chromium version 37.0.2062.120 Built on Debian 7.6, running on Debian 7.7 (281580)
Hardware is 1.8GHz, 32 bits on a non-PAE computer. When tab is selected the CPU hits 100%. Chrome task manager blames the soundcloud tab. Moving window to background makes no difference.

Actually CrunchBang linux, but thats based on Debian yes.
Hi, the very same situation here - on Soundcloud HTML5 playback Chromium causes up to 50% load on my i5 2.4Ghz CPU, there is a screenshot:



Version 42.0.2311.90 Built on 8.0, running on Debian 8.0

Hoping for a fix!
Userlevel 5
Badge
Same problem here with Win8.1x64 and Chrome40.0 on an i5 laptop:

- I get 33% CPU usage when looking at an active spectrum graph in my stream (fan spinning)
- 2-6% when switching to another tab
- 10-20% when scrolling down so that the spectrum graph is no longer visible (further down seems better)

Annoying because it causes my fan to start spinning and drains my battery quickly.
As Martin said, CPU usage is normal when playing tracks on pages without the graph (e.g. likes).

If the CPU consumption cannot be brought down by the engineering team I would prefer a setting that allows to switch to a simplified spectrum graph with less CPU utilization.

it doesnt get any simpler than plain ole html5.

<audio src="https://api.soundcloud.com/tracks/TRACKID/stream?client_id=YOURCLIENTID" controls="controls"></audio>

for a limited time you can see this in action here: http://www.dubstep.fm/simple_player.php
Userlevel 2
FYI:
@Mathias of the soundcloud team is looking into this problem and has forwarded it to the soundcloud-engineers.
I have the same problem 😕 But only in Chrome (Firefox and Explorer can cause moderate CPU load).

My laptop's idle CPU temperature: ~40 °C.
The CPU temp with Soundcloud in Explorer or Firefox: 45 - 50 °C.
Chrome: ~65 °C.

Chrome 43.0.2357.65 m / Windows 8.1
I have the same issue! I wish Soundcloud engineers could look into this issue. I tried different browsers on different platform, either Mac or Windows, same issue. I think it's the wave graphs issue.

Again, thumb up for my KTH alumni, Eric and Alex!
Same here, Ubuntu + chrome.
Jeezz.. this support site keeps spamming me!

SoundCloud, please make note of this ridiculous unsubscribe scenario that it put me through:
https://www.soundcloudcommunity.com/soundcloud/topics/i-need-to-unsubscribe-soundcould
Hi Gina,

Thanks for your reply. I tried in Firefox and found the CPU usage while playing SC with the tab selected/visible to be ~35%–40%, much less than Chrome.

I cleared my cache in Chrome, and voilà! The CPU usage has decreased to a much more manageable ~25%–40% (for the SC tab alone, when selected).

Thanks for your help in troubleshooting this issue, please mark it resolved.

i have Yosemite, and 8 Gb RAM. It is not good at all...

Reply