I get this on every AOSP rom. I've tried for months to fix it, but all i've managed so far is to minimize it.
Here's what i did:
- Installed Performance Profile xposed module, and added a spotify profile.
- - Upped the NICE priority for foreground and background.
- - Set min CPU frequency to 384Mhz.
- - Set CPU governor to interactive and IO scheduler to row.
- Installed Trickster Mod
- - Changed Read Ahead Buffer Size from 128 to 256, as this is what it is on Sense.
- Disable wi-fi optimization
- - Settings > Wi-fi > Advanced > Uncheck Wi-Fi optimization
- (Optional) Installed Viper4Android
Now i get pretty much flawless sound with minimal and barely audible stutters/crackles once every hour or so.
It seems to be too random to reproduce, and everybody has different methods of dealing with it. And some people seem happy enough to put up with it, but it drives me crazy! Doesn't happen on GPE or Sense though, but they're not as good in terms of features
Edit: Thought i was on the HTC One forum. This should work on both though!