Announcements

Help Wizard

Step 1

NEXT STEP

Exceptionally high CPU Usage on Mac OS 10.14.6 Mojave

Exceptionally high CPU Usage on Mac OS 10.14.6 Mojave

Hello

 

I am reporting a very high (100% of one core) level of CPU usage of the Spotify desktop client on Mac OS. Profiling Spotify with the Instruments tool in Xcode, it is clear this CPU usage is inside `AudioFileOpenURL` and more specifically, inside `UnixFile_DataSource::ReadBytes` in AudioToolbox. It's unclear whether this is an issue with Spotify's use of AudioToolbox or in AudioToolbox itself, but the issue just started recently, and I have not recently changed anything about Mac OS, so suspect it is on Spotify's side. No other applications encounter this error.

 

Below is the profile from this capture. I didn't include the callers as Spotify is not symbolicated, so the addresses are meaningless. The next caller up is a function somewhere in Spotify.

```

Weight Self Weight Symbol Name
44.30 s 100.0% 0 s AudioFileOpenURL
44.30 s 100.0% 0 s AudioFileObject::DoOpen(__CFURL const*, signed char, int)
44.30 s 100.0% 0 s AudioFileObject::Open(__CFURL const*, signed char, int)
44.30 s 100.0% 0 s FLACAudioFile::OpenFromDataSource()
44.30 s 100.0% 583.00 ms FLACAudioFile::ParseAudioFile()
43.52 s 98.2% 1.01 s Cached_DataSource::ReadBytes(unsigned short, long long, unsigned int, void*, unsigned int*)
42.27 s 95.4% 980.00 ms UnixFile_DataSource::ReadBytes(unsigned short, long long, unsigned int, void*, unsigned int*)
41.23 s 93.0% 41.23 s pread
54.00 ms 0.1% 54.00 ms UnixFile_DataSource::UFCurrentOffset(unsigned short, long long)
187.00 ms 0.4% 187.00 ms _platform_memmove$VARIANT$Haswell
52.00 ms 0.1% 52.00 ms pread
7.00 ms 0.0% 7.00 ms DYLD-STUB$$pread
1.00 ms 0.0% 0 s <Unknown Address>
1.00 ms 0.0% 1.00 ms UnixFile_DataSource::UFCurrentOffset(unsigned short, long long)
190.00 ms 0.4% 190.00 ms DYLD-STUB$$_platform_memmove
1.00 ms 0.0% 1.00 ms DYLD-STUB$$memcpy

```

 

Looking at the capture, it is clear that no other thread is doing much work. 

 

This issue usually starts some time after the first song has started, e.g. it does not occur on first playback after restarting Spotify. Is it possible a recent update caused a bug with Spotify's interaction with AudioToolbox on MacOS?

Reply
5 Replies

Hi! 

 

I got the same thing! Tried replying 3 times but all my replies are getting marked as spam! (probably because of the callstacks I'm posting).

 

I'm also running Mohave.

 

Anyway, running spindump tells me the "Local File Scanner Thread" is acting up!

"cpu time 9.721s (36.8G cycles, 37.3G instructions"

 

Hi folks!

 

Thanks for reaching out about this! No worries, we're here to help. 

 

We suggest keeping the app updated to its latest version to ensure optimal performance. It's well worth running a clean reinstall by following these steps to see if that helps things.

 

If this doesn't do the trick, we suggest that you disable Hardware Acceleration by clicking Spotify in the menu bar. 

 

Further, it sounds like you're on an older MacOS version. If possible, we'd suggest updating your devices to the latest software version available. 

 

Let us know how it goes 🙂

KaterinaModerator
Help others find this answer and click "Accept as Solution".
If you appreciate an answer, maybe give it a Like.
Are you new to the Community? Take a moment to introduce yourself! 

Ok, I got it fixed!

 

Turned out Spotify was going crazy on a file in my downloads folder!

 

"Downloads/Image-ExifTool-7.76/t/images/FLAC.flac"!!

Why it is reading that files I don't know, but I did see "FLACAudioFile::ParseAudioFile()" in the callstack so I guess the file is malformed somehow and makes Spotify go crazy.

 

So, try opening Activity Monitor, find Spotify, click the "i" (information) button. Go to "Open files and ports". Look for any file that doesn't have "Spotify" in its name/path (start by looking at the bottom of the list). 

 

If you find any suspicious files, kill Spotify, remove the file and see if it fixes it.

 

Wow Rockets, are you me? This was exactly my situation. I had downloaded ExifTool and had that file in my Downloads folder as well. I don't know why Spotify is scanning my Downloads folder since I don't have local files turned on, but there you go. Thank you for saving me the headache on this 🙂

Hi again @rockets!

 

Fantastic news! Give us a shout if it starts misbehaving again; we're always here to help.

 

Have a nice day 🙂

ElenaModerator
Help others find this answer and click "Accept as Solution".
If you appreciate an answer, maybe give it a Like.
Are you new to the Community? Take a moment to introduce yourself!

Suggested posts