Need to do a mic to speaker audio passthrough in raspberry pi zero

I need to do a microphone to speaker audio passthrough in raspberry pi zero. I use a USB sound card attached to a USB hub with a raspberry pi zero board.

Surprisingly I can't find good working sample codes for something I had thought somebody must have done already, and nothing I have tried so far has worked, so here in hopes of getting some expert opinions

I tried using ALSA's C API to make my own program, but it's too complicated and seems to have a very steep learning curve. I tried PulseAudio and it gives distorted output. I tried libsoundio and it gives broken output. I finally managed to do what I needed to do using RtAudio (which conveniently also has an audio passthrough sample code: The RtAudio Home Page) but it turns out if I keep the audio passthrough program running long enough the output starts getting distorted for no apparent reason. I have tried playing around with audio frame buffer size, sampling frequency, channel count, and nothing works. I can't tell if it's something wrong with my program or the library itself has a problem. I tried using Audio classes from QT but a very basic passthrough program I came up with using this gives a distorted output. For something that's so popular I don't understand why QT themselves don't provide an example of how to do this.

I have done something like this before for a Windows 10 program. I thought it would just be a matter of finding the corresponding audio functions for doing this in Linux, and I should be able to make something usable for raspberry pi. Apparently not the case.

Sorry for the long'ish rant. I hope someone can answer the following questions for me:

1. Can anyone provide a working audio passthrough sample code in Linux/raspberry pi OS using C++? I would prefer if it uses callbacks and not blocking function calls. Something similar to the RtAudio sample code I linked above. Or if anybody knows how to fix my problem with RtAudio it will be a great help.

2. Isn't ALSA the lowest level software between the OS and the sound hardware? If my OS has ALSA shouldn't that be enough to do what I explained above? Where does Pulseaudio come into the picture here? Is it a replacement for ALSA or does it work on top of ALSA, like RtAudio is supposed to work on top of ALSA?

3. I am looking at the JACK audio library (Home | JACK Audio Connection Kit), now that the other things I tried did not end up working. Should I understand this as something similar to RtAudio? RtAudio's website says (The RtAudio Home Page) it can use JACK as an "Audio API". What does being an Audio API mean here? I'm guessing this means if a computer has RtAudio but doesn't have ALSA/JACK then RtAudio will not work. But isn't it true that if a computer doesn't have ALSA audio will not work on it at all? Is JACK something that works as a replacement for ALSA or something that works on top of ALSA and provides us an interface to ALSA? the wikipedia page for JACK says "JACK can be used with ALSA, PortAudio, CoreAudio, FFADO and OSS as hardware back-ends." So does that imply JACk will not work without ALSA? Where does it fall into the hierarchy?

Again, sorry for the long post, and thank you if you've read this far. Any hints that will help me go in the right direction will be greatly appreciated.