From: Daniel Mack <zonque@gmail.com>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: ALSA development <alsa-devel@alsa-project.org>
Subject: Ambiguous DAPM widget names and DPCM
Date: Tue, 23 Jul 2013 10:30:16 +0200 [thread overview]
Message-ID: <51EE3F18.3030207@gmail.com> (raw)
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.
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?
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.
Thanks,
Daniel
next reply other threads:[~2013-07-23 8:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 8:30 Daniel Mack [this message]
2013-07-23 12:30 ` Ambiguous DAPM widget names and DPCM 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
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=51EE3F18.3030207@gmail.com \
--to=zonque@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@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).