* Reg: Audio recording with twl4030 codec
@ 2010-01-22 9:57 shariff
2010-01-22 12:41 ` Peter Ujfalusi
[not found] ` <1cbe56071001220459n511c41d7ya117ca8b19c11ae5@mail.gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: shariff @ 2010-01-22 9:57 UTC (permalink / raw)
To: alsa-devel
Hi all,
I am working with OMAP3 based custom board that has twl4030 codec &
using linux-2.6.29 kernel from opensource.
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"
--> Here record is successful but with lot of noise.
1) Can we record Mono(1 channel) through I2S from TWL4030 codec?
2) To record stereo(2 channels), do we need two Mic's ? (i.e do I
need Sub Mic also).
Regards,
Shariff
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Reg: Audio recording with twl4030 codec 2010-01-22 9:57 Reg: Audio recording with twl4030 codec shariff @ 2010-01-22 12:41 ` Peter Ujfalusi [not found] ` <1cbe56071001220459n511c41d7ya117ca8b19c11ae5@mail.gmail.com> 1 sibling, 0 replies; 4+ messages in thread From: Peter Ujfalusi @ 2010-01-22 12:41 UTC (permalink / raw) To: alsa-devel; +Cc: ext shariff 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <1cbe56071001220459n511c41d7ya117ca8b19c11ae5@mail.gmail.com>]
[parent not found: <1cbe56071001242332r4fcf5a3dyd509750e39ca9377@mail.gmail.com>]
* Re: Reg: Audio recording with twl4030 codec [not found] ` <1cbe56071001242332r4fcf5a3dyd509750e39ca9377@mail.gmail.com> @ 2010-01-25 8:14 ` Peter Ujfalusi 2010-01-25 8:22 ` shariff 0 siblings, 1 reply; 4+ messages in thread From: Peter Ujfalusi @ 2010-01-25 8:14 UTC (permalink / raw) To: ext shariff; +Cc: alsa-devel Hello, Let's put alsa-devel back to the CC... On Monday 25 January 2010 09:32:45 ext shariff wrote: > Hi Peter, > > 1) As we only have one Main MIC when I am recording in stereo mode by > specifying "-c 2", one channel is silent and one channel is recorded > properly. As it should. Just as a sidenote, I'm usually using -f dat for the format, which gives 48KHz, stereo 16LE > > 2) But still the recorded channel is noisy, how can I reduce the noise of > the recorded channel? Hmm, what kind of noise? How are you configuring the dai with the snd_soc_dai_set_fmt? For stereo it should be (if OMAP is slave, TWL is master): SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM; For TDM mode (four channel): SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM; See omap3beagle.c how it is done. > > I have one more question. ( Regarding Audio path) > > ---> If I want to avoid that one channel silent, do I need to connect "SUB > MIC or AUXR"?( as these are connected right ADC). If you want audio data there, than yes you need another mic for the right channel. > ----> If I need to record 4 channel audio without any silent channel do I > need to connect digital microphones also? You can duplicate the channel 1 and 3 to channel 2 and 4, meaning that you route the ADCL and ADCR to these channels (TX1 and TX2 path are both analog). You can also hook up a stereo digital mic to the digimic1 interface, but remember, that the digimic needs 48KHz sampling rate. -- Péter > > Regards, > Shariff > > On Fri, Jan 22, 2010 at 6:29 PM, shariff > <shariffsinbox@gmail.com<mailto:shariffsinbox@gmail.com>> wrote: Hi Peter, > > Thank you very much for your suggestions. > > Regards, > Shariff > > > On Fri, Jan 22, 2010 at 6:11 PM, Peter Ujfalusi > <peter.ujfalusi@nokia.com<mailto:peter.ujfalusi@nokia.com>> wrote: 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 > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Reg: Audio recording with twl4030 codec 2010-01-25 8:14 ` Peter Ujfalusi @ 2010-01-25 8:22 ` shariff 0 siblings, 0 replies; 4+ messages in thread From: shariff @ 2010-01-25 8:22 UTC (permalink / raw) To: Peter Ujfalusi; +Cc: alsa-devel Hi Peter, Thanks for you suggestions. Regards, Shariff On Mon, Jan 25, 2010 at 1:44 PM, Peter Ujfalusi <peter.ujfalusi@nokia.com>wrote: > Hello, > > Let's put alsa-devel back to the CC... > > On Monday 25 January 2010 09:32:45 ext shariff wrote: > > Hi Peter, > > > > 1) As we only have one Main MIC when I am recording in stereo mode by > > specifying "-c 2", one channel is silent and one channel is recorded > > properly. > > As it should. Just as a sidenote, I'm usually using -f dat for the format, > which > gives 48KHz, stereo 16LE > > > > > 2) But still the recorded channel is noisy, how can I reduce the noise of > > the recorded channel? > > Hmm, what kind of noise? > How are you configuring the dai with the snd_soc_dai_set_fmt? > For stereo it should be (if OMAP is slave, TWL is master): > SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM; > > For TDM mode (four channel): > SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM; > > See omap3beagle.c how it is done. > > > > > I have one more question. ( Regarding Audio path) > > > > ---> If I want to avoid that one channel silent, do I need to connect > "SUB > > MIC or AUXR"?( as these are connected right ADC). > > If you want audio data there, than yes you need another mic for the right > channel. > > > ----> If I need to record 4 channel audio without any silent channel do I > > need to connect digital microphones also? > > You can duplicate the channel 1 and 3 to channel 2 and 4, meaning that you > route > the ADCL and ADCR to these channels (TX1 and TX2 path are both analog). > You can also hook up a stereo digital mic to the digimic1 interface, but > remember, that the digimic needs 48KHz sampling rate. > > -- > Péter > > > > > Regards, > > Shariff > > > > On Fri, Jan 22, 2010 at 6:29 PM, shariff > > <shariffsinbox@gmail.com<mailto:shariffsinbox@gmail.com>> wrote: Hi > Peter, > > > > Thank you very much for your suggestions. > > > > Regards, > > Shariff > > > > > > On Fri, Jan 22, 2010 at 6:11 PM, Peter Ujfalusi > > <peter.ujfalusi@nokia.com<mailto:peter.ujfalusi@nokia.com>> wrote: > 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 > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-25 8:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-22 9:57 Reg: Audio recording with twl4030 codec shariff
2010-01-22 12:41 ` Peter Ujfalusi
[not found] ` <1cbe56071001220459n511c41d7ya117ca8b19c11ae5@mail.gmail.com>
[not found] ` <1cbe56071001242332r4fcf5a3dyd509750e39ca9377@mail.gmail.com>
2010-01-25 8:14 ` Peter Ujfalusi
2010-01-25 8:22 ` shariff
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).