alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Problem adding support for digital mixer in codec
@ 2010-03-25  2:33 Candelaria Villarreal, Jorge
  2010-03-25  4:53 ` Raymond Yau
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Candelaria Villarreal, Jorge @ 2010-03-25  2:33 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Hi,

I am trying to add support for a digital mixer. The digital mixer is
connected like the following example:

  
Path 1 -------\
Path 2 --------\
		    MIXER ------> DAC----> ...
Path 3 --------/
Path 4 -------/



However, I think ALSA does not support this configuration, as the DAC
should be the first element in a route. I tried adding the DAC to the
route first, and connected its output to the mixer inputs, like this:

	  {"Mixer", "Multimedia Ext Switch", "HSDAC Left"},
        {"Mixer", "Multimedia Ext Switch", "HSDAC Right"},

        {"Mixer", "Voice Switch", "HSDAC Left"},
        {"Mixer", "Voice Switch", "HSDAC Right"},

        {"Mixer", "Multimedia Uplink Switch", "HSDAC Left"},
        {"Mixer", "Multimedia Uplink Switch", "HSDAC Right"},

        {"Mixer", "Multimedia Switch", "HSDAC Left"},
        {"Mixer", "Multimedia Switch", "HSDAC Right"},

But this does not seem to work. Can anyone give me some tips? Any comment
would be appreciated.

Thanks,
Jorge

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem adding support for digital mixer in codec
  2010-03-25  2:33 Problem adding support for digital mixer in codec Candelaria Villarreal, Jorge
@ 2010-03-25  4:53 ` Raymond Yau
  2010-03-25  7:17 ` Peter Ujfalusi
  2010-03-25  9:26 ` Mark Brown
  2 siblings, 0 replies; 7+ messages in thread
From: Raymond Yau @ 2010-03-25  4:53 UTC (permalink / raw)
  To: ALSA Development Mailing List

2010/3/25 Candelaria Villarreal, Jorge <jorge.candelaria@ti.com>

> Hi,
>
> I am trying to add support for a digital mixer. The digital mixer is
> connected like the following example:
>
>
> Path 1 -------\
> Path 2 --------\
>                    MIXER ------> DAC----> ...
> Path 3 --------/
> Path 4 -------/
>
>
>
> However, I think ALSA does not support this configuration, as the DAC
> should be the first element in a route. I tried adding the DAC to the
> route first, and connected its output to the mixer inputs, like this:
>
>          {"Mixer", "Multimedia Ext Switch", "HSDAC Left"},
>        {"Mixer", "Multimedia Ext Switch", "HSDAC Right"},
>
>        {"Mixer", "Voice Switch", "HSDAC Left"},
>        {"Mixer", "Voice Switch", "HSDAC Right"},
>
>        {"Mixer", "Multimedia Uplink Switch", "HSDAC Left"},
>        {"Mixer", "Multimedia Uplink Switch", "HSDAC Right"},
>
>        {"Mixer", "Multimedia Switch", "HSDAC Left"},
>        {"Mixer", "Multimedia Switch", "HSDAC Right"},
>
> But this does not seem to work. Can anyone give me some tips? Any comment
> would be appreciated.
>
> Thanks,
> Jorge
>


Does your DSP support hardware mixing ?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem adding support for digital mixer in codec
  2010-03-25  2:33 Problem adding support for digital mixer in codec Candelaria Villarreal, Jorge
  2010-03-25  4:53 ` Raymond Yau
@ 2010-03-25  7:17 ` Peter Ujfalusi
  2010-03-25  9:13   ` Liam Girdwood
  2010-03-25  9:26 ` Mark Brown
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Ujfalusi @ 2010-03-25  7:17 UTC (permalink / raw)
  To: alsa-devel; +Cc: ext Candelaria Villarreal, Jorge

Hi,

On Thursday 25 March 2010 04:33:54 ext Candelaria Villarreal, Jorge wrote:
> Hi,
> 
> I am trying to add support for a digital mixer. The digital mixer is
> connected like the following example:
> 
> 
> Path 1 -------\
> Path 2 --------\
>                    MIXER ------> DAC----> ...
> Path 3 --------/
> Path 4 -------/
> 
> 
> 
> However, I think ALSA does not support this configuration, as the DAC
> should be the first element in a route. I tried adding the DAC to the
> route first, and connected its output to the mixer inputs, like this:
> 
> 	  {"Mixer", "Multimedia Ext Switch", "HSDAC Left"},
>         {"Mixer", "Multimedia Ext Switch", "HSDAC Right"},
> 
>         {"Mixer", "Voice Switch", "HSDAC Left"},
>         {"Mixer", "Voice Switch", "HSDAC Right"},
> 
>         {"Mixer", "Multimedia Uplink Switch", "HSDAC Left"},
>         {"Mixer", "Multimedia Uplink Switch", "HSDAC Right"},
> 
>         {"Mixer", "Multimedia Switch", "HSDAC Left"},
>         {"Mixer", "Multimedia Switch", "HSDAC Right"},
> 
> But this does not seem to work. Can anyone give me some tips? Any comment
> would be appreciated.

Hmm, how these paths are connected, and where?
What I mean is I suppose you have one path, which is connected to the main CPU, 
than I suspect you have a connection to a modem (voice?), than you have 
possibility to connect some other components via digital link?

What I did with the TWL4030 codec, is that I have moved the actual DAC power 
control from the DAPM_DAC to different widget (the DAPM_DAC is kind of a fake 
one). This was needed to support the digital loopback functionality.

So if you reorder the DAPM widgets (making sure that the switch order still OK), 
than I think you can treat one of the paths as normal playback path (fake 
DAPM_DAC -> mixer (have the DAC power bit handled here) -> ...).
Than you might consider of adding the rest of the paths as DAPM_INPUT, and 
connect them to the mixer (which after the fake DAC).
So you kind of have digital loopback from those to the analog domain.

> 
> Thanks,
> Jorge

-- 
Péter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem adding support for digital mixer in codec
  2010-03-25  7:17 ` Peter Ujfalusi
@ 2010-03-25  9:13   ` Liam Girdwood
  2010-03-25  9:22     ` Peter Ujfalusi
  2010-03-25 16:56     ` Candelaria Villarreal, Jorge
  0 siblings, 2 replies; 7+ messages in thread
From: Liam Girdwood @ 2010-03-25  9:13 UTC (permalink / raw)
  To: ext Candelaria Villarreal, Jorge; +Cc: alsa-devel, Peter Ujfalusi

On Thu, 2010-03-25 at 09:17 +0200, Peter Ujfalusi wrote:
> Hi,
> 
> On Thursday 25 March 2010 04:33:54 ext Candelaria Villarreal, Jorge wrote:
> > Hi,
> > 
> > I am trying to add support for a digital mixer. The digital mixer is
> > connected like the following example:
> > 
> > 
> > Path 1 -------\
> > Path 2 --------\
> >                    MIXER ------> DAC----> ...
> > Path 3 --------/
> > Path 4 -------/
> > 
> > 
> > 
> > However, I think ALSA does not support this configuration, as the DAC
> > should be the first element in a route. I tried adding the DAC to the
> > route first, and connected its output to the mixer inputs, like this:
> > 
> > 	  {"Mixer", "Multimedia Ext Switch", "HSDAC Left"},
> >         {"Mixer", "Multimedia Ext Switch", "HSDAC Right"},
> > 
> >         {"Mixer", "Voice Switch", "HSDAC Left"},
> >         {"Mixer", "Voice Switch", "HSDAC Right"},
> > 
> >         {"Mixer", "Multimedia Uplink Switch", "HSDAC Left"},
> >         {"Mixer", "Multimedia Uplink Switch", "HSDAC Right"},
> > 
> >         {"Mixer", "Multimedia Switch", "HSDAC Left"},
> >         {"Mixer", "Multimedia Switch", "HSDAC Right"},
> > 
> > But this does not seem to work. Can anyone give me some tips? Any comment
> > would be appreciated.

The DAC is traditionally an endpoint (or source) widget within DAPM.
This means it is does not have a source widget to supply it with audio.

> 
> Hmm, how these paths are connected, and where?
> What I mean is I suppose you have one path, which is connected to the main CPU, 
> than I suspect you have a connection to a modem (voice?), than you have 
> possibility to connect some other components via digital link?
> 
> What I did with the TWL4030 codec, is that I have moved the actual DAC power 
> control from the DAPM_DAC to different widget (the DAPM_DAC is kind of a fake 
> one). This was needed to support the digital loopback functionality.
> 
> So if you reorder the DAPM widgets (making sure that the switch order still OK), 
> than I think you can treat one of the paths as normal playback path (fake 
> DAPM_DAC -> mixer (have the DAC power bit handled here) -> ...).
> Than you might consider of adding the rest of the paths as DAPM_INPUT, and 
> connect them to the mixer (which after the fake DAC).
> So you kind of have digital loopback from those to the analog domain.
> 

This approach currently works well on the twl4030. However, you may want
to consider using SND_SOC_DAPM_AIF_IN() for your input paths here. e.g.

AIF_IN -> MIXER -> DAC -> rest of codec

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem adding support for digital mixer in codec
  2010-03-25  9:13   ` Liam Girdwood
@ 2010-03-25  9:22     ` Peter Ujfalusi
  2010-03-25 16:56     ` Candelaria Villarreal, Jorge
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2010-03-25  9:22 UTC (permalink / raw)
  To: ext Liam Girdwood
  Cc: ext Candelaria Villarreal, Jorge, alsa-devel@alsa-project.org

On Thursday 25 March 2010 11:13:36 ext Liam Girdwood wrote:
> This approach currently works well on the twl4030. However, you may want
> to consider using SND_SOC_DAPM_AIF_IN() for your input paths here. e.g.
> 
> AIF_IN -> MIXER -> DAC -> rest of codec

I was also thinking to restructure the TWL4030 codec to have the AIF_IN and 
AIF_OUT widgets.
We do have digital routing selection before the DACs (and mixers), which as it 
is now not in the codec driver, but it would be nice to have them at some point.
I have them in a custom board file (as simple kcontrols), and as I recall I have 
sent a sample patch for beagle to add those in the machine driver. Or I have not 
sent, I'm not sure..

> 
> Liam

-- 
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem adding support for digital mixer in codec
  2010-03-25  2:33 Problem adding support for digital mixer in codec Candelaria Villarreal, Jorge
  2010-03-25  4:53 ` Raymond Yau
  2010-03-25  7:17 ` Peter Ujfalusi
@ 2010-03-25  9:26 ` Mark Brown
  2 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2010-03-25  9:26 UTC (permalink / raw)
  To: Candelaria Villarreal, Jorge; +Cc: alsa-devel@alsa-project.org

On Wed, Mar 24, 2010 at 09:33:54PM -0500, Candelaria Villarreal, Jorge wrote:

> However, I think ALSA does not support this configuration, as the DAC
> should be the first element in a route. I tried adding the DAC to the
> route first, and connected its output to the mixer inputs, like this:

No, this is actually supported now - to expand on what Liam said in
reply to Peter if you leave the stream NULL in your DAC widgets and
instead use a SND_SOC_DAPM_AIF_IN() to bind to the stream then you can
add any DAPM routing you need between the AIF and the DAC.  The WM8994
driver is one example of doing this, it has digital mixing and routing
support which allows audio paths that never reach a DAC.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem adding support for digital mixer in codec
  2010-03-25  9:13   ` Liam Girdwood
  2010-03-25  9:22     ` Peter Ujfalusi
@ 2010-03-25 16:56     ` Candelaria Villarreal, Jorge
  1 sibling, 0 replies; 7+ messages in thread
From: Candelaria Villarreal, Jorge @ 2010-03-25 16:56 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel@alsa-project.org, Peter, Ujfalusi

Liam Girdwood wrote:
> On Thu, 2010-03-25 at 09:17 +0200, Peter Ujfalusi wrote:
>> 
>> What I did with the TWL4030 codec, is that I have moved the actual
>> DAC power control from the DAPM_DAC to different widget (the
>> DAPM_DAC is kind of a fake one). This was needed to support the
>> digital loopback functionality. 
>> 
>> So if you reorder the DAPM widgets (making sure that the switch
>> order still OK), than I think you can treat one of the paths as
>> normal playback path (fake DAPM_DAC -> mixer (have the DAC power bit
>> handled here) -> ...). Than you might consider of adding the rest of
>> the paths as DAPM_INPUT, and connect them to the mixer (which after
>> the fake DAC). 
>> So you kind of have digital loopback from those to the analog domain.
>> 
> 
> This approach currently works well on the twl4030. However,
> you may want
> to consider using SND_SOC_DAPM_AIF_IN() for your input paths
> here. e.g.
> 
> AIF_IN -> MIXER -> DAC -> rest of codec

I see now, this is exactly what I was looking for. I will give it a try
then. Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-25 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25  2:33 Problem adding support for digital mixer in codec Candelaria Villarreal, Jorge
2010-03-25  4:53 ` Raymond Yau
2010-03-25  7:17 ` Peter Ujfalusi
2010-03-25  9:13   ` Liam Girdwood
2010-03-25  9:22     ` Peter Ujfalusi
2010-03-25 16:56     ` Candelaria Villarreal, Jorge
2010-03-25  9:26 ` Mark Brown

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).