[alsa-devel] Default enabling of mixer controls
Hi,
I want to by-default enable the following mixer controls for my platform:
Analog Left Capture Route AUXL Analog Right Capture Route AUXR
Right now, they both come disabled in the default configuration and I have to enable them explicitly by issuing the amixer cset command. How can I do that automatically?
Thanks and Regards, Anuj Aggarwal
On Mon, Jun 08, 2009 at 05:40:56PM +0530, Aggarwal, Anuj wrote:
Right now, they both come disabled in the default configuration and I have to enable them explicitly by issuing the amixer cset command. How can I do that automatically?
Register writes in the DAI init function will probably do the job, however the general advice is to leave this up to user space.
It is not working for me.
I wrote this small piece of code:
static int omap3evm_twl4030_init(struct snd_soc_codec *codec) { unsigned short reg;
printk (KERN_DEBUG "inside omap3evm_twl4030_init\n\n"); /* Enable Analog Left Capture Route AUXL */ reg = codec->read(codec, TWL4030_REG_ANAMICL); reg |= TWL4030_AUXL_EN; codec->write(codec, TWL4030_REG_ANAMICL, reg);
/* Enable Analog Right Capture Route AUXR */ reg = codec->read(codec, TWL4030_REG_ANAMICR); reg |= TWL4030_AUXR_EN; codec->write(codec, TWL4030_REG_ANAMICR, reg);
return 0; }
After that, if I do a get on Analog Left Capture Route AUXL (or the other), I am seeing that it has been turned ON. However, when I try to capture, It doesn't work. I have to disable it first and then re-enable it to capture properly.
Any clues?
Regards, Anuj Aggarwal
-----Original Message----- From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa- project.org] On Behalf Of Mark Brown Sent: Monday, June 08, 2009 5:45 PM To: Aggarwal, Anuj Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] Default enabling of mixer controls
On Mon, Jun 08, 2009 at 05:40:56PM +0530, Aggarwal, Anuj wrote:
Right now, they both come disabled in the default configuration and I have to enable them explicitly by issuing the amixer cset command. How can I do that automatically?
Register writes in the DAI init function will probably do the job, however the general advice is to leave this up to user space. _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On Mon, Jun 08, 2009 at 07:54:00PM +0530, Aggarwal, Anuj wrote:
/* Enable Analog Left Capture Route AUXL */ reg = codec->read(codec, TWL4030_REG_ANAMICL); reg |= TWL4030_AUXL_EN; codec->write(codec, TWL4030_REG_ANAMICL, reg);
After that, if I do a get on Analog Left Capture Route AUXL (or the other), I am seeing that it has been turned ON. However, when I try to capture, It doesn't work. I have to disable it first and then re-enable it to capture properly.
Hrm, you'll be missing some internal DAPM state updates. Currently the most direct way to do that would be to go through the actual control interface and there's not a particularly nice way of doing that that from the kernel that I'm aware of.
Is this not something you can have user space do?
-----Original Message----- From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com] Sent: Monday, June 08, 2009 8:09 PM To: Aggarwal, Anuj Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] Default enabling of mixer controls
On Mon, Jun 08, 2009 at 07:54:00PM +0530, Aggarwal, Anuj wrote:
/* Enable Analog Left Capture Route AUXL */ reg = codec->read(codec, TWL4030_REG_ANAMICL); reg |= TWL4030_AUXL_EN; codec->write(codec, TWL4030_REG_ANAMICL, reg);
After that, if I do a get on Analog Left Capture Route AUXL (or the
other),
I am seeing that it has been turned ON. However, when I try to capture, It doesn't work. I have to disable it first and then re-enable it to capture properly.
Hrm, you'll be missing some internal DAPM state updates. Currently the most direct way to do that would be to go through the actual control interface and there's not a particularly nice way of doing that that from the kernel that I'm aware of.
Is this not something you can have user space do?
[Aggarwal, Anuj] Since this was by default enabled in my earlier codec driver, I wanted to make the change transparent to the end user. However, since the same can be done from user space too, it should not be a problem for my customer.
On Tuesday 09 June 2009 06:45:24 ext Aggarwal, Anuj wrote:
Hrm, you'll be missing some internal DAPM state updates. Currently the most direct way to do that would be to go through the actual control interface and there's not a particularly nice way of doing that that from the kernel that I'm aware of.
Should the snd_soc_dapm_sync(codec); need to be called after the register updates?
Is this not something you can have user space do?
[Aggarwal, Anuj] Since this was by default enabled in my earlier codec driver, I wanted to make the change transparent to the end user. However, since the same can be done from user space too, it should not be a problem for my customer.
I think this should be done by the user space as well. I have had plans to disable all paths by default on the twl4030 codec, and let the user space to configure for the given board. At least that is what we are doing in our custom board.
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On Tue, Jun 09, 2009 at 09:57:39AM +0300, Peter Ujfalusi wrote:
On Tuesday 09 June 2009 06:45:24 ext Aggarwal, Anuj wrote:
Hrm, you'll be missing some internal DAPM state updates. Currently the most direct way to do that would be to go through the actual control interface and there's not a particularly nice way of doing that that from the kernel that I'm aware of.
Should the snd_soc_dapm_sync(codec); need to be called after the register updates?
The equivalent thing will happen when the capture starts so I'd not expect that to help.
participants (3)
-
Aggarwal, Anuj
-
Mark Brown
-
Peter Ujfalusi