[alsa-devel] Reg: Audio recording with twl4030 codec

Peter Ujfalusi peter.ujfalusi at nokia.com
Fri Jan 22 13:41:49 CET 2010


Hello,

On Friday 22 January 2010 11:57:23 ext shariff wrote:
> Hi all,
> 
>         I am working with OMAP3 based custom board that has twl4030 codec &
>         using linux-2.6.29 kernel from opensource.

This is kind of old...

> 
>         I have some queries regarding Audio recording.
> 
>        Audio codec is connected to twl4030 as bellow
> 
>                                   TWL4030
> 
>                              |--------------------|
>                              |
>                              |                    |------ MAINMIC
> 
>       McBSP2  ------  |i2s/tdm         |
> 
>                              | ___________|
> 
>       --> One Analog MIC is connected to Main Mic and I am using Audio path
> not the Voice path.
> 
>            After selecting Main Mic through amixer control.
> 
>            and recording audio using "arecord -c 1 -r 8000 -f S16_LE -t wav
> -d 20 record-file.wav"

The hardware should have been opened in stereo mode, since it is not supporting 
the mono, you can verify it by appending -v to arecord and see how the HW has 
been opened at the end.

> 
>        --> Here record is successful but with lot of noise.
> 
>           1) Can we record Mono(1 channel) through I2S from TWL4030 codec?

The TWL codec "Audio" path is either stereo or 4 channel.
You need to record stereo/4 channel, and than extract/use the data from the 
valid channel.
In case of Main mic it is the left channel, or Channel 1 or/and 2 (depending on 
the routings) in four channel mode.

> 
>           2) To record stereo(2 channels), do we need two Mic's ? (i.e do I
> need Sub Mic also).

No you don't need. The right channel will not contain valid data (most likely it 
is going to be silent).

You need to enable the Mic bias 1 for the main mic in your machine driver, if 
you have not done that yet:

static const struct snd_soc_dapm_widget your_widgets[] = {
...
	SND_SOC_DAPM_MIC("Your Mic", NULL),
...
};

static const struct snd_soc_dapm_route your_audio_map[] = {
...
	{"MAINMIC", NULL, "Mic Bias 1"},
	{"Mic Bias 1", NULL, "Your Mic"},
...
};

I'm not sure about the state of the twl soc codec driver in 2.6.29, but my guess 
is that it should work.

Are there any capture routing option for TX1 path, which selects between Analog 
and Digimic0? If there is than that has to be set to analog as well.

> 
> Regards,
> Shariff

-- 
Péter


More information about the Alsa-devel mailing list