Richard Hall - 2020-02-28

I've been developing an application in python on the Raspberry Pi and trying to get 100% clean audio from a microphone. Various attempts using the Pyaudio and sounddevice modules give a variety of clicks and pops due to dropped samples. I have also tried spawning both arecord and ffmpeg as sub-processes and then using a named pipe to read the output into my app. These last two were more successful until I increased the number of other threads in the app when once again I started getting dropped samples.

I recently came across the axfer app which is pre-installed with Raspian Buster. An initial 20 second test suggested that this was more effective than arecord, however when I increased the recording time to 60 seconds the CPU utilisation on the axfer task was seen to increase to 100% after 45 seconds at which point recording ceased. I found I can also replicate this 100% behaviour with a simple test piping the output of axfer into aplay.

Has anyone else observed this behaviour with axfer with output pipes? More importantly is there is fix?

My axfer version is 1.1.8 on latest Raspian Buster using an RPi 3