Distortion using ALSA inputs

I have a small GUI app running on a Raspberry Pi 3b+ with Rasbian Buster. The app inputs audio from an ALSA input PCM, does some processing, and plays the audio out of another ALSA PCM, a HifiBerry Amp2. After a short time the audio begins to distort, sounding like some samples are being skipped. There is no distortion unless the inputs are being used. For example, audio playback from a file sounds as expected.

I select the ALSA inputs and output using getAudioDeviceSetup() and setAudioDeviceSetup() of the AudioDeviceManager class. My processing is done inside a AudioSource::getNextAudioBlock(bufferToFill), which I set for playback using AudioSourcePlayer::setSource().

I’ve seen quite of few posts related to issues with JUCE and ALSA:

Has there been any progress? I saw mention of using a real-time kernel for the Raspberry Pi, but didn’t see anyone who tried. Just wanted to check before trying my hand at patching a new kernel.