alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: Daniel Mack <zonque@gmail.com>
Cc: ALSA development <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: Ambiguous DAPM widget names and DPCM
Date: Tue, 23 Jul 2013 13:48:23 +0100	[thread overview]
Message-ID: <1374583703.2475.25.camel@loki> (raw)
In-Reply-To: <51EE3F18.3030207@gmail.com>

On Tue, 2013-07-23 at 10:30 +0200, Daniel Mack wrote:
> Hi Mark,
> Hi Liam,
> 
> I spent some hours reverse-engineering the DPCM code, and I plan to
> prepare a patch to add some documentation once I've assembled a fully
> working setup. However, I have a general question regarding DAPM widget
> names.
> 
> DPCM uses DAPM widgets and routes in order to determine the FE <-> BE
> connections at runtime. The problem with this is that widget names are
> very ambiguous, as the automatically created widgets for DAIs are named
> after their stream_name properties, which contain "Playback" or
> "Capture" for all components in my case. Hence, the code which walks the
> connections (snd_soc_dapm_dai_get_connected_widgets()) will most likely
> match the wrong one (which has empty sound/sink lists), which results in
> a failure like this:
> 
> [   16.606268]  fe: ASoC: fe no valid playback route
> 
> I hacked the names of all components so they are unique, but even then,
> the problem is that snd_soc_dapm_new_dai_widgets() is called twice for
> the CPU DAI, once from soc_probe_platform(), and later from
> soc_probe_link_dais(), and both calls would create DAPM widgets with
> identical names, resulting in the same problem as described above.
> 
> I don't know how to handle this, but I believe that nobody was really
> hit by this issue yet, as DPCM doesn't seem to be used widely, at least
> not by any machine code in mainline.

You might be the first to hit this as I never hit it with OMAP4 or the
Haswell DSP code (but it's possible everything just worked for me).

Fwiw, the Haswell audio DSP code can be found here :-

https://git.kernel.org/cgit/linux/kernel/git/lrg/asoc.git/log/?h=intel/haswell-audio-dsp

Dynamic Compressed audio support is now in this branch too.

> 
> One idea would be to change the automatically generated names of DAI
> widgets in order to make them unique, or re-factor the lookup routines.
> 
> Any opinion on that? Do I miss a general consideration here?
> 

I did initially have something like that for OMAP that based the DAI
widget name on the DAI device name, but this also needed something that
would work for codecs with multiple DAI's. In the end it wasn't required
for OMAP, but it sounds like something like a unique name is required
now. 

> With more hacks in place, the setup somehow succeeds, but when the
> stream is opened, we'll hit a BUG() in sound/core/pcm_memory.c, because
> the FE device's DMA type is undefined. But that's another topic I'll
> address later.

Hmm, it looks like your FE is being treated as a regular static PCM in
this case.

Liam

  parent reply	other threads:[~2013-07-23 12:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23  8:30 Ambiguous DAPM widget names and DPCM Daniel Mack
2013-07-23 12:30 ` Mark Brown
2013-07-23 15:34   ` Daniel Mack
2013-07-23 18:30     ` Mark Brown
2013-07-25 12:24       ` Daniel Mack
2013-07-25 12:48         ` Mark Brown
2013-07-25 19:53           ` Liam Girdwood
2013-07-26  9:13     ` Peter Ujfalusi
2013-07-23 12:48 ` Liam Girdwood [this message]
2014-03-21 16:50 ` Patrick Lai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374583703.2475.25.camel@loki \
    --to=liam.r.girdwood@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=zonque@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).