I've got a very weird problem - my audio works perfectly, even under massive CPU load, but as soon as I start the Android Studio IDE, it becomes super laggy and distorted with glitches, cracks and pops. And this problem only occurs with Android Studio, and no other program!

I tried a lot of things:

  • Disabling timer-based scheduling
  • Giving pulseaudio better niceness value
  • Enabling realtime settings
  • Trying another sound card
  • Trying other Java applications, they don't show the same problem
  • Disallow resampling
  • Setting the default sample rate
  • Trying out IntelliJ IDEA, since Android Studio is based on that. The problem does not appear here.

Nothing fixed the issue. Does anybody know a solution for this?

My specs are:

  • Amd Ryzen 9 3900X 12 core CPU
  • 32 GB DDR4 RAM
  • Main drive is a M.2 SSD

P.S. I'm not using the Android emulator, just the IDE

  • Android studio needs some RAM, so it's possible that your computer is swapping because Android studio (+ other loaded programs) are filling the RAM, and pulseaudio must use swapped RAM (I experimented that with a 4 Go RAM computer, Android Studio + Chrome were filling almost 3 Go/ 4 Go, add Windows programs - I code on Windows for Java, sorry :( ). Best thing to share is your computer specs as RAM + CPU – damadam Oct 24 '19 at 14:32
  • @damadam Its definitely not the RAM, as I have 32GB and its only 4GB full when the problems occur. I added the specs :) – nshct Oct 24 '19 at 15:02
  • Does this happen just opening Android Studio or actually doing something with it? – WinEunuuchs2Unix Oct 26 '19 at 23:30
  • @WinEunuuchs2Unix It happens on just opening Android Studio with a project. I don't even have to click anything. Weird thing is that Android Studio is based on the IntelliJ IDE, and that one does not give me these problems. – nshct Oct 27 '19 at 0:43
  • 2
    I've faced with the same issue. I see no answers here, so I'm trying to investigate with attraction affected projects: * youtrack.jetbrains.com/issue/IDEA-252399 * issuetracker.google.com/issues/170230081 * gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1003 – AlexWayfer Oct 8 '20 at 15:41

Finally I found the root of the issue - it's the ADB daemon.

Killing the daemon fix the problem, but AS will restart it anyway (and for sure it's a bad solution).

The right way is to check the Use libusb backend option in Settings > Build, Execution, Deployment > Debugger > Android Debug Bridge


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.