* ASoC: SND_SOC_DAPM_LINE behavior
@ 2009-09-29 12:36 Peter Ujfalusi
2009-09-29 12:44 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Peter Ujfalusi @ 2009-09-29 12:36 UTC (permalink / raw)
To: alsa-devel@alsa-project.org; +Cc: ext Mark Brown
Hello,
as I'm writing a new codec driver I have noticed the following (using 2.6.31
kernel).
The codec itself is really simple, it is only capable of playback and it can
bypass audio from line-in to the output.
The DAPM routing is something like this in the codec driver:
|DAC|------------->| |
|Playback Mixer|->|OUTPUT|
|INPUT|->|Bypass|->| |
|SWITCH|
Now if in the machine driver I create the following DAPM widget:
SND_SOC_DAPM_LINE("Line In", NULL),
and than connect this DAPM_LINE to the codec's INPUT (LINE-IN):
{"LINE-IN", NULL, "Line In"},
Than the codec bias level would be always in ON state, regardless of the state
of the Bypass Switch (it is off by default).
I can use the snd_soc_dapm_disable_pin(codec, "Line In") in the machine driver
to disable the pin, which moves the codec to STANDBY state.
Now, if I change the SND_SOC_DAPM_LINE to
SND_SOC_DAPM_MIC("Line In", NULL),
in the machine driver, than the codec bias would be STANDBY as long as the
Bypass switches are off, if they changed to on, than the codec bias goes to ON,
as expected.
Is this expected behavior?
--
Péter
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: ASoC: SND_SOC_DAPM_LINE behavior
2009-09-29 12:36 ASoC: SND_SOC_DAPM_LINE behavior Peter Ujfalusi
@ 2009-09-29 12:44 ` Mark Brown
2009-09-29 12:59 ` Peter Ujfalusi
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2009-09-29 12:44 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel@alsa-project.org
On Tue, Sep 29, 2009 at 03:36:39PM +0300, Peter Ujfalusi wrote:
> The DAPM routing is something like this in the codec driver:
> |DAC|------------->| |
> |Playback Mixer|->|OUTPUT|
> |INPUT|->|Bypass|->| |
> |SWITCH|
> Now if in the machine driver I create the following DAPM widget:
> SND_SOC_DAPM_LINE("Line In", NULL),
> and than connect this DAPM_LINE to the codec's INPUT (LINE-IN):
> {"LINE-IN", NULL, "Line In"},
> Than the codec bias level would be always in ON state, regardless of the state
> of the Bypass Switch (it is off by default).
That shouldn't happen, turning off the bypass switch should break the
path and let the bias sit at standby. I'd need to check the code but I
expect that the fact that LINE can be either an input or an output is
confusing things and we need to split it into two widgets, one for input
and one for output.
The easiest thing for an actual system would just be to not bother with
the external widget if you're not doing anything with it. It'll only
make things work better, there's no need for the external widgets unless
you're switching them.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: ASoC: SND_SOC_DAPM_LINE behavior
2009-09-29 12:44 ` Mark Brown
@ 2009-09-29 12:59 ` Peter Ujfalusi
0 siblings, 0 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2009-09-29 12:59 UTC (permalink / raw)
To: ext Mark Brown; +Cc: alsa-devel@alsa-project.org
On Tuesday 29 September 2009 15:44:40 ext Mark Brown wrote:
> On Tue, Sep 29, 2009 at 03:36:39PM +0300, Peter Ujfalusi wrote:
> > The DAPM routing is something like this in the codec driver:
> > |DAC|------------->| |
> > |
> > |Playback Mixer|->|OUTPUT|
> > |
> > |INPUT|->|Bypass|->| |
> > |
> > |SWITCH|
> >
> > Now if in the machine driver I create the following DAPM widget:
> > SND_SOC_DAPM_LINE("Line In", NULL),
> >
> > and than connect this DAPM_LINE to the codec's INPUT (LINE-IN):
> > {"LINE-IN", NULL, "Line In"},
> >
> > Than the codec bias level would be always in ON state, regardless of the
> > state of the Bypass Switch (it is off by default).
>
> That shouldn't happen, turning off the bypass switch should break the
> path and let the bias sit at standby. I'd need to check the code but I
> expect that the fact that LINE can be either an input or an output is
> confusing things and we need to split it into two widgets, one for input
> and one for output.
It seams that the LINE itself confusing DAPM, since if I connect a LINE to the
OUTPUT that will also keep the codec bias ON all the time.
Most probably separating the LINE to LINEIN and LINEOUT in dapm would solve the
problem. This needs however change in the existing machine drivers as well, but
it should not be too big of a problem.
> The easiest thing for an actual system would just be to not bother with
> the external widget if you're not doing anything with it. It'll only
> make things work better, there's no need for the external widgets unless
> you're switching them.
Yes, that is true.
Thanks,
Péter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-29 12:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-29 12:36 ASoC: SND_SOC_DAPM_LINE behavior Peter Ujfalusi
2009-09-29 12:44 ` Mark Brown
2009-09-29 12:59 ` Peter Ujfalusi
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.