I am currently working on an embedded system that has a multi-interface audio codec chip, WM8281. My yocto-built linux kernel has the ALSA driver suite installed and I have GStreamer installed and working successfully with the WM8281 codec chip.
I need to replace the GStreamer scripts with C++ application code that essentialy does the same audio capture/playback. I have working code that does audio capture/playback using the snd_pcm-*** ALSA API routines. Using the ALSA PCM API, I call snd_pcm_open(), configure both the hardware and software parameters, then use snd_pcm_writei() and snd_pcm_readi() to pass audio samples to/from ALSA. It is all working great, I can pass audio to the audio input interface on this embedded board and I can hear the audio on the audio output interface of this embedded board.
The WM8281 is a full featured audio codec chip with multiple input and output interfaces. I am currently enabling all of the input/output interfaces of the codec using the amixer utility. When I open the device I only give the device name to the open routine, like: snd_pcm_open(handle, "hw:0,0", ....) and this opens the codec and appears to use one of the codec chip interfaces when I can snd_pcm_writei() and snd_pcm_readi().
I do not understand how ALSA knows which of the 4 input interfaces of the WM8281 codec chip to use. ALSA is obviously using IN4L and IN4R interfaces by default, but I need to tell ALSA which chip interface to use.
So how do I programmatically tell the ALSA PCM API to use a different interface of the WM8281 codec chip?