I'm working on custom board running Android 4.2.1. I have almost all things working except of proper audio routing.
I have an audio codec there (WM8960 connected in I2S bus) and it works well servicing speakers, built-in microphone, headphones and headphones-mic. The HAL is implemented through tinyAlsa in audio_hw.c
like usual and works perfectly in whole system.
There is also second audio device (actually a USB sound card) with GSM modem audio connected. It is detected by ALSA without problems and I can use it on kernel level using aplay/arecord.
Now I need to set proper routing when an audio call is established -- that means that I have to play the sound from microphone to second audio device and vice versa. Can please someone give me an advice or example how to handle this using tinyAlsa API?
regards Jan
splice()
or something similar to at least avoid all the context switching. Some hardware (IMX) has an audmux module and via hardware you can route the signals directly without CPU intervention. Then you just need to make a widget that toggles the routes appropriately. Good luck with feedback; software cann't fix that easily, so your mic/speaker physics better be good. – artless noise