Ubuntu – Pulseaudio lags horribly only when Android Studio is running

19.10android-studiopulseaudiosound

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

Best Answer

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

Related Question