I try to implement baresip for Android, it uses custom alsa module for control audio devices.
This module uses this code for open device handler:
err = snd_pcm_open(&st->write, device, SND_PCM_STREAM_PLAYBACK, 0);
I tried to pass 'default', 'plug:hw:0,0', 'hw:0,0', 'hw:00,0' into this function. All results return error -2, that means no such file.
I have two question. Is it any possibility to pass some string into this function for handling audio device correct? And in generally, is it real to interact with audio devices directly from jni using this function?
Thank everyone!
I dont think that ALSA is supported by Android. The ALSA api is not available for native Android code (NDK)
for Android you should use the "opensles" module, which provide an Audio-driver to the native interface.
Baresip supports multiple audio-drivers, for example "alsa" module for Linux or "opensles" for Android NDK. Please see here for details about the opensles module:
http://www.creytiv.com/doxygen/baresip-dox/html/opensles_8c.html