DMIC pop / click sounds between each memory block

I'm trying to continuously stream data from the dmic interface, in this case over serial though only for testing.
Things seem to be largely working except for pop/click artifacts between every block.
In this case the memory slab is setup for 4 blocks with enough memory for 100ms of audio, default settings taken from the dmic sample.
The pop is usually about 0.5-1ms long and per recording looks exactly the same each time and occurs in intervals equal to the block size. Large block size means less frequent intervals.

This smells like either samples are dropped between each block or I'm getting garbage data inserted somehow, though it does feel more like audio is missing/overwritten when a pop occurs.
Giving a really large block size like 1000ms of audio make the pop occasionally not occur.

My understanding is that the dmic driver continuously reads data as soon as the start flag is given and will choose a free memory block from the slab to write to. As long as I process a returned block quickly enough and free it then the dmic should not run out of memory or drop samples (if that is even a possible behaviour)?
I can't see an off by one error or similar in the way I grab the data either. It's a bit puzzling.
The interface is not throwing me any errors with debug log enabled.

Attached a sample recording and the project code. The python script can be used to translate the ASCII HEX string to a binary.

Using NCS 2.5.0

3527.dmic.zip


5684.silence_with_clicks.zip

  • Hi Timon

    I ended up with this case also. Unfortunately we are severely understaffed during the Christmas period, and I will have to investigate further next week. I apologize for the inconvenience. 

    Best regards
    Torbjørn

  • Hi   totally understand!

  • Hi Timon

    For some reason the dmic.zip attachment is not able to load (the other attachment works). Would you be able to attach this file one more time? 

    Best regards
    Torbjørn

  • Oh weird, I edited the post with a new upload. Can you try again?

  • Hi Timon

    Thanks, now I could download all the files Slight smile

    My main concern looking at your code is the fact that you are printing all the data to the console using printk(), this might introduce quite a lot of delay in the main loop. Could you try to comment this out and see if the pops go away? 

    Best regards
    Torbjørn

1 2 3