I have questions about the ALSA sound library.
Let me first state that a usual reply to questions like mine is "use JACK", and that that anwer is not helpful, since I probably cannot use JACK. I am running a native linux program on an Android device (not NDK, but really native), and from what I gathered, JACK does not work on Android since some libc and posix stuff incompatabilities.
The questions:
1) can I use 2 different threads, for a) reading captured samples and b) playing back samples? All ALSA "full duplex" examples I've seen just use alternating reading from / writing to the sound card with blocking functions, which seems not to work too great, especially if your program is supposed to do a little more than that.
2) As I understood, ALSA mixes audio played by different applications, much like the windows audio mixer. Is it possible to get exclusive access to an audio device, such that my application is guaranteed to be the only one playing back audio, with no mixing & degrading of dynamic range going on?