I've changed my code at least 109 times trying to get a library to work as intended, but it has never worked as intended and it's never the library's fault. (Or maybe it's never my fault. )Thank you for reading my blog post.
I learned how to use alsa's mmap mode a while ago, but it seems that I'm still not using it correctly. The latency is supposed to be the period size divided by the sampling rate, but in my soyware it's the buffer size divided by the sampling rate:anhero:.