* [ASoC] Mic record is not working with wm9713 ASoC driver @ 2007-05-09 9:18 Nobin Mathew 2007-05-09 10:21 ` Andrew Morton 2007-05-09 10:25 ` Liam Girdwood 0 siblings, 2 replies; 10+ messages in thread From: Nobin Mathew @ 2007-05-09 9:18 UTC (permalink / raw) To: linux-kernel I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". My settings 'Mic A Source' -> "Mic 1" 'Mic Boost (+20dB)' [on] 'Capture' [on] 'Left Capture Source' "Mic 1" 'Right Capture Source' "Mic 1" i am issuing following command to record "arecord -M -f S16_LE sound.wav" But what i found is driver is not enabling "Mic bias" and "Mic A PGA" this dump of /sys/devices/platform/soc-audio/dapm_widget while "arecord" is running is given below Mic Bias: Off Mic B Pre Amp: Off Mic A Pre Amp: On Mic B PGA: Off Mic A PGA: Off Mono In: Off Right Line In: Off Left Line In: Off Mono Out: Off Out 4: Off Out 3: Off Right Speaker: Off Left Speaker: Off Right Headphone: Off Left Headphone: Off Right ADC: On Left ADC: On Aux DAC: Off Voice DAC: Off Capture Mixer: Off HP Mixer: Off AC97 Mixer: Off Right DAC: Off Left DAC: Off Speaker Mixer: Off Mono Mixer: Off Right HP Mixer: Off Left HP Mixer: Off PM State: D0 In idea why this is happening? what is going wrong with my settings? Nobin Mathew ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ASoC] Mic record is not working with wm9713 ASoC driver 2007-05-09 9:18 [ASoC] Mic record is not working with wm9713 ASoC driver Nobin Mathew @ 2007-05-09 10:21 ` Andrew Morton 2007-05-09 10:25 ` Liam Girdwood 1 sibling, 0 replies; 10+ messages in thread From: Andrew Morton @ 2007-05-09 10:21 UTC (permalink / raw) To: Nobin Mathew; +Cc: linux-kernel, Jaroslav Kysela, Takashi Iwai On Wed, 9 May 2007 14:48:54 +0530 "Nobin Mathew" <nobin.mathew@gmail.com> wrote: > I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". > > My settings > > 'Mic A Source' -> "Mic 1" > 'Mic Boost (+20dB)' [on] > 'Capture' [on] > 'Left Capture Source' "Mic 1" > 'Right Capture Source' "Mic 1" > > > i am issuing following command to record > "arecord -M -f S16_LE sound.wav" > > But what i found is driver is not enabling "Mic bias" and "Mic A PGA" > > this dump of /sys/devices/platform/soc-audio/dapm_widget while > "arecord" is running is given below > > > Mic Bias: Off > Mic B Pre Amp: Off > Mic A Pre Amp: On > Mic B PGA: Off > Mic A PGA: Off > Mono In: Off > Right Line In: Off > Left Line In: Off > Mono Out: Off > Out 4: Off > Out 3: Off > Right Speaker: Off > Left Speaker: Off > Right Headphone: Off > Left Headphone: Off > Right ADC: On > Left ADC: On > Aux DAC: Off > Voice DAC: Off > Capture Mixer: Off > HP Mixer: Off > AC97 Mixer: Off > Right DAC: Off > Left DAC: Off > Speaker Mixer: Off > Mono Mixer: Off > Right HP Mixer: Off > Left HP Mixer: Off > PM State: D0 > > In idea why this is happening? > what is going wrong with my settings? > (maintainers cc'ed) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ASoC] Mic record is not working with wm9713 ASoC driver 2007-05-09 9:18 [ASoC] Mic record is not working with wm9713 ASoC driver Nobin Mathew 2007-05-09 10:21 ` Andrew Morton @ 2007-05-09 10:25 ` Liam Girdwood 2007-05-09 10:44 ` Nobin Mathew 1 sibling, 1 reply; 10+ messages in thread From: Liam Girdwood @ 2007-05-09 10:25 UTC (permalink / raw) To: Nobin Mathew; +Cc: linux-kernel On Wed, 2007-05-09 at 14:48 +0530, Nobin Mathew wrote: > I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". I've replied to this duplicate post on alsa-dev. Liam ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ASoC] Mic record is not working with wm9713 ASoC driver 2007-05-09 10:25 ` Liam Girdwood @ 2007-05-09 10:44 ` Nobin Mathew [not found] ` <1178707947.3740.30.camel@a10072.wolfsonmicro.main> 0 siblings, 1 reply; 10+ messages in thread From: Nobin Mathew @ 2007-05-09 10:44 UTC (permalink / raw) To: Liam Girdwood; +Cc: linux-kernel Liam Sorry for disturbing you again, I could not find that reply on alsa devel mailing list Can u send that to me Thanks On 5/9/07, Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote: > On Wed, 2007-05-09 at 14:48 +0530, Nobin Mathew wrote: > > I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". > > I've replied to this duplicate post on alsa-dev. > > Liam > > ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <1178707947.3740.30.camel@a10072.wolfsonmicro.main>]
[parent not found: <8d6898730705090355v6966309av6aff6c1e93c5a876@mail.gmail.com>]
* Fwd: [ASoC] Mic record is not working with wm9713 ASoC driver [not found] ` <8d6898730705090355v6966309av6aff6c1e93c5a876@mail.gmail.com> @ 2007-05-09 10:58 ` Nobin Mathew 2007-05-09 12:08 ` Liam Girdwood 0 siblings, 1 reply; 10+ messages in thread From: Nobin Mathew @ 2007-05-09 10:58 UTC (permalink / raw) To: linux-kernel [-- Attachment #1: Type: text/plain, Size: 1254 bytes --] ---------- Forwarded message ---------- From: Nobin Mathew <nobin.mathew@gmail.com> Date: May 9, 2007 4:25 PM Subject: Re: [ASoC] Mic record is not working with wm9713 ASoC driver To: Liam Girdwood <lg@opensource.wolfsonmicro.com> Liam i got the mail. I am not setting any audio paths in my machine driver On 5/9/07, Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote: > The mail server is probably a little behind..... give it about 30 > mins... > > Liam > > On Wed, 2007-05-09 at 16:14 +0530, Nobin Mathew wrote: > > Liam Sorry for disturbing you again, > > > > I could not find that reply on alsa devel mailing list > > > > Can u send that to me > > > > Thanks > > > > > > On 5/9/07, Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote: > > > On Wed, 2007-05-09 at 14:48 +0530, Nobin Mathew wrote: > > > > I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". > > > > > > I've replied to this duplicate post on alsa-dev. > > > > > > Liam > > > > > > > > - > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Please read the FAQ at http://www.tux.org/lkml/ > > [-- Attachment #2: identity_wm9713.c --] [-- Type: text/x-csrc, Size: 5800 bytes --] /* * SiRF Technology, Inc. GPS Software * * Copyright (C) 2006 by SiRF Technology, Inc. All rights reserved. * * linux/sound/soc/sirf3a/identity_wm9713.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * Machine Specific codefor ASoC driver * This will setup ac97 controller with wm9713 codec support */ #include <linux/module.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/ioport.h> #include <linux/device.h> #include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/err.h> #include <linux/amba/bus.h> #include <linux/dma-mapping.h> /* DMA memory is used for the buffer even if no DMA for this architecture */ #include <linux/pm.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/sizes.h> #ifdef CONFIG_ARM_AMBA_DMA # include <asm/mach-types.h> #endif #include <sound/driver.h> #include <sound/core.h> #include <sound/initval.h> #include <sound/ac97_codec.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> #include <sound/soc-dapm.h> #include "../codecs/ac97.h" #include "platform_sound.h" #include "aaci.h" extern struct snd_soc_cpu_dai aaci_ac97_dai[]; extern struct snd_soc_codec_dai wm9713_dai[]; extern struct snd_soc_platform sirf3a_soc_platform; extern struct snd_soc_codec_device soc_codec_dev_wm9713; extern struct ac97_pcm ac97_defs[]; extern int sirf3a_ac97_probe(struct platform_device *); extern void sirf3a_ac97_remove(struct platform_device *); extern void snd_ac97_bus_proc_init(struct snd_ac97_bus *); extern void snd_ac97_bus_proc_done(struct snd_ac97_bus *); static int identity_wm9713_startup(snd_pcm_substream_t *substream) { return 0; } static struct snd_soc_ops identity_wm9713_ops = { .startup = identity_wm9713_startup, }; static int identity_wm9713_ac97_init(struct snd_soc_codec *codec) { struct platform_controller *controller = codec->ac97->bus->private_data; struct aaci *aaci = (struct aaci *)controller->bus_controller; snd_ac97_pcm_assign(codec->ac97->bus, 3, ac97_defs); aaci->ac97_bus = codec->ac97->bus; /* * * Disable AC97 PC Beep input on audio codecs. * */ if (ac97_is_audio(codec->ac97)) snd_ac97_write_cache(codec->ac97, AC97_PC_BEEP, 0x801e); return 0; } unsigned int identity_wm9713_config_sysclk(struct snd_soc_pcm_runtime *rtd, struct snd_soc_clock_info *info) { return rtd->codec_dai->config_sysclk(rtd->codec_dai, info, 12187500); } static struct snd_soc_dai_link identity_wm9713_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", .cpu_dai = &aaci_ac97_dai[0], .codec_dai = &wm9713_dai[0], .init = identity_wm9713_ac97_init, .config_sysclk = identity_wm9713_config_sysclk, }, /* { .name = "WM9713", .stream_name = "BLUETOOTH VOICE", .cpu_dai = &aaci_ac97_dai[1], .codec_dai = &wm9713_dai[2], }, */ }; int identity_wm9713_probe(struct platform_device *pdev) { int ret = 0; struct snd_soc_device *socdev; socdev = platform_get_drvdata(pdev); socdev->machine->dai_link->cpu_dai->probe = sirf3a_ac97_probe; socdev->machine->dai_link->cpu_dai->remove = sirf3a_ac97_remove; return ret; } int identity_wm9713_suspend_pre(struct platform_device *pdev, pm_message_t state) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->codec; struct snd_soc_codec_dai *dai = codec->dai; struct platform_controller *controller = dai->private_data; controller->state.event = state.event; return 0; } int identity_wm9713_resume_post(struct platform_device *pdev) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->codec; struct snd_soc_codec_dai *dai = codec->dai; struct platform_controller *controller = dai->private_data; controller->state.event = PM_EVENT_ON; return 0; } static struct snd_soc_machine identity_wm9713 = { .name = "IDENTITY", .probe = identity_wm9713_probe, .suspend_pre = identity_wm9713_suspend_pre, .resume_post = identity_wm9713_resume_post, .dai_link = identity_wm9713_dai, .num_links = ARRAY_SIZE(identity_wm9713_dai), .ops = &identity_wm9713_ops, }; static struct snd_soc_device identity_wm9713_snd_devdata = { .machine = &identity_wm9713, .platform = &sirf3a_soc_platform, .codec_dev = &soc_codec_dev_wm9713, }; extern struct platform_device identity_snd_device; struct platform_device *pidentity_wm9713_snd_device = &identity_snd_device; static int __init identity_wm9713_init(void) { int ret; device_initialize(&pidentity_wm9713_snd_device->dev); platform_set_drvdata(pidentity_wm9713_snd_device, &identity_wm9713_snd_devdata); identity_wm9713_snd_devdata.dev = &pidentity_wm9713_snd_device->dev; ret = platform_device_add(pidentity_wm9713_snd_device); if (ret) platform_device_put(pidentity_wm9713_snd_device); return ret; } static void __exit identity_wm9713_exit(void) { platform_device_unregister(pidentity_wm9713_snd_device); } module_init(identity_wm9713_init); module_exit(identity_wm9713_exit); /* Module information */ MODULE_AUTHOR("Nobin Mathew"); MODULE_DESCRIPTION("ALSA SoC SiRF3A"); MODULE_LICENSE("GPL"); ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Fwd: [ASoC] Mic record is not working with wm9713 ASoC driver 2007-05-09 10:58 ` Fwd: " Nobin Mathew @ 2007-05-09 12:08 ` Liam Girdwood 2007-05-09 12:20 ` Fwd: " Nobin Mathew 0 siblings, 1 reply; 10+ messages in thread From: Liam Girdwood @ 2007-05-09 12:08 UTC (permalink / raw) To: Nobin Mathew; +Cc: linux-kernel It's probably best to keep this thread on alsa-dev otherwise things start to get confusing when cross posting occurs. Liam ^ permalink raw reply [flat|nested] 10+ messages in thread
* Fwd: Fwd: [ASoC] Mic record is not working with wm9713 ASoC driver 2007-05-09 12:08 ` Liam Girdwood @ 2007-05-09 12:20 ` Nobin Mathew 0 siblings, 0 replies; 10+ messages in thread From: Nobin Mathew @ 2007-05-09 12:20 UTC (permalink / raw) To: alsa-devel [-- Attachment #1: Type: text/plain, Size: 8068 bytes --] Forwarded Conversation Subject: [ASoC] Mic record is not working with wm9713 ASoC driver ------------------------ From: Nobin Mathew <nobin.mathew@gmail.com> To: linux-kernel@vger.kernel.org Date: Wed, May 9, 2007 at 2:48 PM I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". My settings 'Mic A Source' -> "Mic 1" 'Mic Boost (+20dB)' [on] 'Capture' [on] 'Left Capture Source' "Mic 1" 'Right Capture Source' "Mic 1" i am issuing following command to record "arecord -M -f S16_LE sound.wav" But what i found is driver is not enabling "Mic bias" and "Mic A PGA" this dump of /sys/devices/platform/soc-audio/dapm_widget while "arecord" is running is given below Mic Bias: Off Mic B Pre Amp: Off Mic A Pre Amp: On Mic B PGA: Off Mic A PGA: Off Mono In: Off Right Line In: Off Left Line In: Off Mono Out: Off Out 4: Off Out 3: Off Right Speaker: Off Left Speaker: Off Right Headphone: Off Left Headphone: Off Right ADC: On Left ADC: On Aux DAC: Off Voice DAC: Off Capture Mixer: Off HP Mixer: Off AC97 Mixer: Off Right DAC: Off Left DAC: Off Speaker Mixer: Off Mono Mixer: Off Right HP Mixer: Off Left HP Mixer: Off PM State: D0 In idea why this is happening? what is going wrong with my settings? Nobin Mathew -------- From: Andrew Morton <akpm@linux-foundation.org> To: Nobin Mathew <nobin.mathew@gmail.com> Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de> Date: Wed, May 9, 2007 at 3:51 PM [Quoted text hidden](maintainers cc'ed) -------- From: Liam Girdwood <lg@opensource.wolfsonmicro.com> To: Nobin Mathew <nobin.mathew@gmail.com> Cc: linux-kernel@vger.kernel.org Date: Wed, May 9, 2007 at 3:55 PM On Wed, 2007-05-09 at 14:48 +0530, Nobin Mathew wrote: > I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". I've replied to this duplicate post on alsa-dev. Liam -------- From: Nobin Mathew <nobin.mathew@gmail.com> To: Liam Girdwood <lg@opensource.wolfsonmicro.com> Cc: linux-kernel@vger.kernel.org Date: Wed, May 9, 2007 at 4:14 PM Liam Sorry for disturbing you again, I could not find that reply on alsa devel mailing list Can u send that to me Thanks [Quoted text hidden] -------- From: Liam Girdwood <lg@opensource.wolfsonmicro.com> To: Nobin Mathew <nobin.mathew@gmail.com> Date: Wed, May 9, 2007 at 4:22 PM The mail server is probably a little behind..... give it about 30 mins... Liam [Quoted text hidden]> - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -------- From: Nobin Mathew <nobin.mathew@gmail.com> To: Liam Girdwood <lg@opensource.wolfsonmicro.com> Date: Wed, May 9, 2007 at 4:25 PM Attachments: identity_wm9713.c Liam i got the mail. I am not setting any audio paths in my machine driver [Quoted text hidden] -------- From: Nobin Mathew <nobin.mathew@gmail.com> To: linux-kernel@vger.kernel.org Date: Wed, May 9, 2007 at 4:28 PM Attachments: identity_wm9713.c [Quoted text hidden] -------- From: Nobin Mathew <nobin.mathew@gmail.com> To: Liam Girdwood <lg@opensource.wolfsonmicro.com> Date: Wed, May 9, 2007 at 5:00 PM Liam i have few more doubts i have only Mic1, i am not connecting to Mic2A and Mic 2B So can i remove audio path to Mic2A and Mic2B means my audio path will be like static const char* audio_map[][3] = { /* mic is connected to mic1 - with bias */ {"MIC1", NULL, "Mic Bias"}, {"Mic Bias", NULL, "Mic 1"}, #if 0 /* mic is connected to mic2A - with bias */ {"MIC2A", NULL, "Mic Bias"}, {"Mic Bias", NULL, "Mic 2"}, /* mic is connected to mic2B - with bias */ {"MIC2B", NULL, "Mic Bias"}, {"Mic Bias", NULL, "Mic 3"}, #endif {NULL, NULL, NULL}, }; instead of static const char* audio_map[][3] = { /* mic is connected to mic1 - with bias */ {"MIC1", NULL, "Mic Bias"}, {"Mic Bias", NULL, "Mic 1"}, /* mic is connected to mic2A - with bias */ {"MIC2A", NULL, "Mic Bias"}, {"Mic Bias", NULL, "Mic 2"}, /* mic is connected to mic2B - with bias */ {"MIC2B", NULL, "Mic Bias"}, {"Mic Bias", NULL, "Mic 3"}, {NULL, NULL, NULL}, }; what is the meaning of these lines, what is RXP and RXN /* set up mainstone codec pins */ // snd_soc_dapm_set_endpoint(codec, "RXP", 0); // snd_soc_dapm_set_endpoint(codec, "RXN", 0); snd_soc_dapm_set_endpoint(codec, "MIC1", 0); [Quoted text hidden] -------- From: Liam Girdwood <lg@opensource.wolfsonmicro.com> To: Nobin Mathew <nobin.mathew@gmail.com> Date: Wed, May 9, 2007 at 5:30 PM On Wed, 2007-05-09 at 17:00 +0530, Nobin Mathew wrote: > Liam i have few more doubts > > i have only Mic1, i am not connecting to Mic2A and Mic 2B > So can i remove audio path to Mic2A and Mic2B > means > my audio path will be like > static const char* audio_map[][3] = { > > /* mic is connected to mic1 - with bias */ > {"MIC1", NULL, "Mic Bias"}, > {"Mic Bias", NULL, "Mic 1"}, > #if 0 > /* mic is connected to mic2A - with bias */ > {"MIC2A", NULL, "Mic Bias"}, > {"Mic Bias", NULL, "Mic 2"}, > /* mic is connected to mic2B - with bias */ > {"MIC2B", NULL, "Mic Bias"}, > {"Mic Bias", NULL, "Mic 3"}, > #endif > > {NULL, NULL, NULL}, > }; > This is fine, it's safe to remove unused Mic's. > instead of > > static const char* audio_map[][3] = { > > /* mic is connected to mic1 - with bias */ > {"MIC1", NULL, "Mic Bias"}, > {"Mic Bias", NULL, "Mic 1"}, > /* mic is connected to mic2A - with bias */ > {"MIC2A", NULL, "Mic Bias"}, > {"Mic Bias", NULL, "Mic 2"}, > /* mic is connected to mic2B - with bias */ > {"MIC2B", NULL, "Mic Bias"}, > {"Mic Bias", NULL, "Mic 3"}, > > {NULL, NULL, NULL}, > }; > > > what is the meaning of these lines, what is RXP and RXN > > /* set up mainstone codec pins */ > // snd_soc_dapm_set_endpoint(codec, "RXP", 0); > // snd_soc_dapm_set_endpoint(codec, "RXN", 0); > snd_soc_dapm_set_endpoint(codec, "MIC1", 0); RXP and RXN are from a different codec and should be removed. Also remove the MIC1 endpoint setting to 0 as this will disconnect it. Comments from driver :- static int identity_wm9713_ac97_init(struct snd_soc_codec *codec) { struct platform_controller *controller = codec->ac97->bus->private_data; struct aaci *aaci = (struct aaci *)controller->bus_controller; snd_ac97_pcm_assign(codec->ac97->bus, 3, ac97_defs); aaci->ac97_bus = codec->ac97->bus; /* * * Disable AC97 PC Beep input on audio codecs. * */ if (ac97_is_audio(codec->ac97)) snd_ac97_write_cache(codec->ac97, AC97_PC_BEEP, 0x801e); return 0; } AC97 beep should be disabled in userspace. e.g. alsa configuration file or by changing mixers settings (alsactl can save and restore settings). unsigned int identity_wm9713_config_sysclk(struct snd_soc_pcm_runtime *rtd, struct snd_soc_clock_info *info) { return rtd->codec_dai->config_sysclk(rtd->codec_dai, info, 12187500); } This function has been removed in current ASoC versions. It's best to upgrade from kernel.org or from here :- http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=shortlog;h=dev Liam -------- From: Nobin Mathew <nobin.mathew@gmail.com> To: Liam Girdwood <lg@opensource.wolfsonmicro.com> Date: Wed, May 9, 2007 at 5:30 PM Liam Thanks of lot i got it working Cheers [Quoted text hidden] -------- From: Liam Girdwood <lg@opensource.wolfsonmicro.com> To: Nobin Mathew <nobin.mathew@gmail.com> Cc: linux-kernel@vger.kernel.org Date: Wed, May 9, 2007 at 5:38 PM It's probably best to keep this thread on alsa-dev otherwise things start to get confusing when cross posting occurs. Liam -------- [-- Attachment #2: identity_wm9713.c --] [-- Type: text/x-csrc, Size: 5800 bytes --] /* * SiRF Technology, Inc. GPS Software * * Copyright (C) 2006 by SiRF Technology, Inc. All rights reserved. * * linux/sound/soc/sirf3a/identity_wm9713.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * Machine Specific codefor ASoC driver * This will setup ac97 controller with wm9713 codec support */ #include <linux/module.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/ioport.h> #include <linux/device.h> #include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/err.h> #include <linux/amba/bus.h> #include <linux/dma-mapping.h> /* DMA memory is used for the buffer even if no DMA for this architecture */ #include <linux/pm.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/sizes.h> #ifdef CONFIG_ARM_AMBA_DMA # include <asm/mach-types.h> #endif #include <sound/driver.h> #include <sound/core.h> #include <sound/initval.h> #include <sound/ac97_codec.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> #include <sound/soc-dapm.h> #include "../codecs/ac97.h" #include "platform_sound.h" #include "aaci.h" extern struct snd_soc_cpu_dai aaci_ac97_dai[]; extern struct snd_soc_codec_dai wm9713_dai[]; extern struct snd_soc_platform sirf3a_soc_platform; extern struct snd_soc_codec_device soc_codec_dev_wm9713; extern struct ac97_pcm ac97_defs[]; extern int sirf3a_ac97_probe(struct platform_device *); extern void sirf3a_ac97_remove(struct platform_device *); extern void snd_ac97_bus_proc_init(struct snd_ac97_bus *); extern void snd_ac97_bus_proc_done(struct snd_ac97_bus *); static int identity_wm9713_startup(snd_pcm_substream_t *substream) { return 0; } static struct snd_soc_ops identity_wm9713_ops = { .startup = identity_wm9713_startup, }; static int identity_wm9713_ac97_init(struct snd_soc_codec *codec) { struct platform_controller *controller = codec->ac97->bus->private_data; struct aaci *aaci = (struct aaci *)controller->bus_controller; snd_ac97_pcm_assign(codec->ac97->bus, 3, ac97_defs); aaci->ac97_bus = codec->ac97->bus; /* * * Disable AC97 PC Beep input on audio codecs. * */ if (ac97_is_audio(codec->ac97)) snd_ac97_write_cache(codec->ac97, AC97_PC_BEEP, 0x801e); return 0; } unsigned int identity_wm9713_config_sysclk(struct snd_soc_pcm_runtime *rtd, struct snd_soc_clock_info *info) { return rtd->codec_dai->config_sysclk(rtd->codec_dai, info, 12187500); } static struct snd_soc_dai_link identity_wm9713_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", .cpu_dai = &aaci_ac97_dai[0], .codec_dai = &wm9713_dai[0], .init = identity_wm9713_ac97_init, .config_sysclk = identity_wm9713_config_sysclk, }, /* { .name = "WM9713", .stream_name = "BLUETOOTH VOICE", .cpu_dai = &aaci_ac97_dai[1], .codec_dai = &wm9713_dai[2], }, */ }; int identity_wm9713_probe(struct platform_device *pdev) { int ret = 0; struct snd_soc_device *socdev; socdev = platform_get_drvdata(pdev); socdev->machine->dai_link->cpu_dai->probe = sirf3a_ac97_probe; socdev->machine->dai_link->cpu_dai->remove = sirf3a_ac97_remove; return ret; } int identity_wm9713_suspend_pre(struct platform_device *pdev, pm_message_t state) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->codec; struct snd_soc_codec_dai *dai = codec->dai; struct platform_controller *controller = dai->private_data; controller->state.event = state.event; return 0; } int identity_wm9713_resume_post(struct platform_device *pdev) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->codec; struct snd_soc_codec_dai *dai = codec->dai; struct platform_controller *controller = dai->private_data; controller->state.event = PM_EVENT_ON; return 0; } static struct snd_soc_machine identity_wm9713 = { .name = "IDENTITY", .probe = identity_wm9713_probe, .suspend_pre = identity_wm9713_suspend_pre, .resume_post = identity_wm9713_resume_post, .dai_link = identity_wm9713_dai, .num_links = ARRAY_SIZE(identity_wm9713_dai), .ops = &identity_wm9713_ops, }; static struct snd_soc_device identity_wm9713_snd_devdata = { .machine = &identity_wm9713, .platform = &sirf3a_soc_platform, .codec_dev = &soc_codec_dev_wm9713, }; extern struct platform_device identity_snd_device; struct platform_device *pidentity_wm9713_snd_device = &identity_snd_device; static int __init identity_wm9713_init(void) { int ret; device_initialize(&pidentity_wm9713_snd_device->dev); platform_set_drvdata(pidentity_wm9713_snd_device, &identity_wm9713_snd_devdata); identity_wm9713_snd_devdata.dev = &pidentity_wm9713_snd_device->dev; ret = platform_device_add(pidentity_wm9713_snd_device); if (ret) platform_device_put(pidentity_wm9713_snd_device); return ret; } static void __exit identity_wm9713_exit(void) { platform_device_unregister(pidentity_wm9713_snd_device); } module_init(identity_wm9713_init); module_exit(identity_wm9713_exit); /* Module information */ MODULE_AUTHOR("Nobin Mathew"); MODULE_DESCRIPTION("ALSA SoC SiRF3A"); MODULE_LICENSE("GPL"); [-- Attachment #3: Type: text/plain, Size: 160 bytes --] _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel ^ permalink raw reply [flat|nested] 10+ messages in thread
* [ASoC] Mic record is not working with wm9713 ASoC driver @ 2007-05-09 9:15 Nobin Mathew 0 siblings, 0 replies; 10+ messages in thread From: Nobin Mathew @ 2007-05-09 9:15 UTC (permalink / raw) To: alsa-devel I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". My settings 'Mic A Source' -> "Mic 1" 'Mic Boost (+20dB)' [on] 'Capture' [on] 'Left Capture Source' "Mic 1" 'Right Capture Source' "Mic 1" i am issuing following command to record "arecord -M -f S16_LE sound.wav" But what i found is driver is not enabling "Mic bias" and "Mic A PGA" this dump of /sys/devices/platform/soc-audio/dapm_widget while "arecord" is running is given below Mic Bias: Off Mic B Pre Amp: Off Mic A Pre Amp: On Mic B PGA: Off Mic A PGA: Off Mono In: Off Right Line In: Off Left Line In: Off Mono Out: Off Out 4: Off Out 3: Off Right Speaker: Off Left Speaker: Off Right Headphone: Off Left Headphone: Off Right ADC: On Left ADC: On Aux DAC: Off Voice DAC: Off Capture Mixer: Off HP Mixer: Off AC97 Mixer: Off Right DAC: Off Left DAC: Off Speaker Mixer: Off Mono Mixer: Off Right HP Mixer: Off Left HP Mixer: Off PM State: D0 In idea why this is happening? what is going wrong with my settings? Nobin Mathew ^ permalink raw reply [flat|nested] 10+ messages in thread
* [ASoC] Mic record is not working with wm9713 ASoC driver @ 2007-05-09 7:32 Nobin Mathew 2007-05-09 10:42 ` Liam Girdwood 0 siblings, 1 reply; 10+ messages in thread From: Nobin Mathew @ 2007-05-09 7:32 UTC (permalink / raw) To: alsa-devel I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". My settings 'Mic A Source' -> "Mic 1" 'Mic Boost (+20dB)' [on] 'Capture' [on] 'Left Capture Source' "Mic 1" 'Right Capture Source' "Mic 1" i am issuing following command to record "arecord -M -f S16_LE sound.wav" But what i found is driver is not enabling "Mic bias" and "Mic A PGA" this dump of /sys/devices/platform/soc-audio/dapm_widget while "arecord" is running is given below Mic Bias: Off Mic B Pre Amp: Off Mic A Pre Amp: On Mic B PGA: Off Mic A PGA: Off Mono In: Off Right Line In: Off Left Line In: Off Mono Out: Off Out 4: Off Out 3: Off Right Speaker: Off Left Speaker: Off Right Headphone: Off Left Headphone: Off Right ADC: On Left ADC: On Aux DAC: Off Voice DAC: Off Capture Mixer: Off HP Mixer: Off AC97 Mixer: Off Right DAC: Off Left DAC: Off Speaker Mixer: Off Mono Mixer: Off Right HP Mixer: Off Left HP Mixer: Off PM State: D0 In idea why this is happening? what is going wrong with my settings? Nobin Mathew ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ASoC] Mic record is not working with wm9713 ASoC driver 2007-05-09 7:32 Nobin Mathew @ 2007-05-09 10:42 ` Liam Girdwood 0 siblings, 0 replies; 10+ messages in thread From: Liam Girdwood @ 2007-05-09 10:42 UTC (permalink / raw) To: Nobin Mathew; +Cc: alsa-devel On Wed, 2007-05-09 at 13:02 +0530, Nobin Mathew wrote: > I am trying to record mic with AsoC wm9713 driver. My Mic is connected "Mic 1". > > My settings > > 'Mic A Source' -> "Mic 1" > 'Mic Boost (+20dB)' [on] > 'Capture' [on] > 'Left Capture Source' "Mic 1" > 'Right Capture Source' "Mic 1" > > > i am issuing following command to record > "arecord -M -f S16_LE sound.wav" > > But what i found is driver is not enabling "Mic bias" and "Mic A PGA" > > this dump of /sys/devices/platform/soc-audio/dapm_widget while > "arecord" is running is given below > > > Mic Bias: Off > Mic B Pre Amp: Off > Mic A Pre Amp: On > Mic B PGA: Off > Mic A PGA: Off > Mono In: Off > Right Line In: Off > Left Line In: Off > Mono Out: Off > Out 4: Off > Out 3: Off > Right Speaker: Off > Left Speaker: Off > Right Headphone: Off > Left Headphone: Off > Right ADC: On > Left ADC: On > Aux DAC: Off > Voice DAC: Off > Capture Mixer: Off > HP Mixer: Off > AC97 Mixer: Off > Right DAC: Off > Left DAC: Off > Speaker Mixer: Off > Mono Mixer: Off > Right HP Mixer: Off > Left HP Mixer: Off > PM State: D0 > > In idea why this is happening? > what is going wrong with my settings? It looks like there is an incomplete audio path from Mic1 --> ADC, hence DAPM will power down all unused components. Fwiw, I have captured from WM9713 Mic1 in the past on Mainstone. Machine driver is here for reference :- http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=sound/soc/pxa/mainstone_wm9713.c;h=65c6517e60bc88478796c67fbbfe9c2243c14a88;hb=dev Can you post your machine driver. It may help with debugging. Liam ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-05-09 12:20 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-09 9:18 [ASoC] Mic record is not working with wm9713 ASoC driver Nobin Mathew
2007-05-09 10:21 ` Andrew Morton
2007-05-09 10:25 ` Liam Girdwood
2007-05-09 10:44 ` Nobin Mathew
[not found] ` <1178707947.3740.30.camel@a10072.wolfsonmicro.main>
[not found] ` <8d6898730705090355v6966309av6aff6c1e93c5a876@mail.gmail.com>
2007-05-09 10:58 ` Fwd: " Nobin Mathew
2007-05-09 12:08 ` Liam Girdwood
2007-05-09 12:20 ` Fwd: " Nobin Mathew
-- strict thread matches above, loose matches on Subject: below --
2007-05-09 9:15 Nobin Mathew
2007-05-09 7:32 Nobin Mathew
2007-05-09 10:42 ` Liam Girdwood
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.