alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH RFC 10/13] ASoC: kirkwood-t5325: add DAPM	links between codec and cpu DAI
Date: Thu, 22 Aug 2013 21:16:58 +0100	[thread overview]
Message-ID: <20130822201658.GK6617@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1377199370.2618.99.camel@loki>

On Thu, Aug 22, 2013 at 08:22:50PM +0100, Liam Girdwood wrote:
> On Tue, 2013-08-20 at 21:18 +0100, Russell King - ARM Linux wrote:
> > On Tue, Aug 20, 2013 at 07:50:19PM +0100, Mark Brown wrote:
> > > On Tue, Aug 20, 2013 at 02:31:43PM +0100, Russell King - ARM Linux wrote:
> > > 
> > > > Let's be a little more clear about that: I don't know how to do that
> > > > because that's the approach taken by _these_ very patches which you've
> > > > rejected for "abusing the ASoC core".  That's why I'm asking Liam
> > > 
> > > The patches I can recall seeing recently have all had some workarounds
> > > in the core which would need to be resolved differently, though it's
> > > possible I missed that being done in some version in your mails as there
> > > have generally also been a lot of modifications adding debug statements
> > > in the core.
> > 
> > The "workarounds in the core" are because there's bugs in the core that
> > I have no idea how to solve.  You are allegedly the maintainer for the
> > core code, and so you should understand that code, so you are best placed
> > to say how the core code should be fixed.  I'm willing to do the patch
> > generation to fix them but *you* need to give some guidance here -
> > something that you seem incapable to do.  At the moment, the only fix I
> > can see being workable is to comment out the broken bit in the core code.
> > 
> 
> I'll fix this issue as I've replied privately, but you know it's not
> appropriate to just comment stuff out in core code (especially if you
> don't fully understand it). I'm sure you would complain loudly to me if
> I tried to do a similar HACK in the ARM core.

Hang on, tell me exactly *where* I've asked for the hack to be merged.  The
answer is: I haven't.  What I've been asking for all along is how this
should be solved, and getting nowhere - whether I ask in a reasonable and
calm manner or have to take it to extremes like I have done now.

> > If the problem is that you don't understand the issue, then you could try
> > replying with some questions about it.
> > 
> > If the problem is that you don't understand the code, well... there's not
> > much point in continuing this discussion until you've had time to study
> > and understand that code.
> > 
> > > If you've got code you think is in a good state to submit then please do
> > > send it as a normal patch series, the last one I've got here has "ASoC:
> > > HACK: avoid creating duplicated widgets" as part of it for example.
> > 
> > That patch still hasn't gone away, and is still required, because there
> > has been no guidance or comments about the problem.  Let's explain it
> > yet again...
> > 
> > You have said "there is no problem registering the platform and the CPU
> > dai from the same device structure".  Let's assume that's a fact and see
> > what happens in the core code:
> > 
> > static int soc_probe_platform(struct snd_soc_card *card,
> >                            struct snd_soc_platform *platform)
> > {
> >         /* Create DAPM widgets for each DAI stream */
> >         list_for_each_entry(dai, &dai_list, list) {
> >                 if (dai->dev != platform->dev)
> >                         continue;
> > 
> >                 snd_soc_dapm_new_dai_widgets(&platform->dapm, dai);
> >         }
> > }
> > 
> > static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
> > {
> >         if (!cpu_dai->probed &&
> >                         cpu_dai->driver->probe_order == order) {
> >                 if (!cpu_dai->codec) {
> >                         cpu_dai->dapm.card = card;
> >                         if (!try_module_get(cpu_dai->dev->driver->owner))
> >                                 return -ENODEV;
> > 
> >                         list_add(&cpu_dai->dapm.list, &card->dapm_list);
> >                         snd_soc_dapm_new_dai_widgets(&cpu_dai->dapm, cpu_dai);
> >                 }
> > 
> > Now, the CPU DAI is added to the dai_list (it has to be there to be found
> > so the DAI link can bind it, and so soc_probe_link_dais() can be called.)
> > 
> > Think about what happens with the above code if platform->dev is the same
> > as the device used for the CPU DAI (dai->dev) - which can happen when the
> > platform and CPU DAI are registered from the same platform_device, which
> > you claim is legal with ASoC.
> > 
> > Now, look at snd_soc_dapm_new_dai_widgets():
> > 
> > int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
> >                                  struct snd_soc_dai *dai)
> > {
> >         if (dai->driver->playback.stream_name) {
> > ...
> >                 dai->playback_widget = w;
> >         }
> >         if (dai->driver->capture.stream_name) {
> > ...
> >                 dai->capture_widget = w;
> >         }
> > 
> > What happens if the widgets which are bound to are the first set that
> > are created, but they're overwritten when the second set get created?
> > (And that _does_ happen.)  The second set are the ones activated when
> > the audio device is opened, not the first set.
> > 
> > Now, there's nothing new in the above, I've already explained all the
> > above to you several times.  I've had nothing of any help what so ever
> > back from you on this.  I've asked you how to solve this.  I've had
> > absolutely nothing back.  So what am I supposed to do here?  Stuff
> > doesn't work with the core code how it is, so I took the only solution
> > _you_ left me by your silence, which is to hack the core code.
> > 
> 
> It does seem that your configuration is different to the configurations
> that work well on Haswell, OMAP4 and Qualcomm and that's probably why
> you are the only person reporting this atm. I also think the tight
> coupling between the I2S and SPDIF HW made your problem far more complex
> and therefore more difficult (for me at least) to follow when the
> signal to noise ratio of this and related threads started to
> deteriorate.

Erm, you have completely the wrong end of the stick here.  This has
nothing to do with I2S and SPDIF at all.

It's about having the _same_ struct device assocated with both the
platform/DMA backend, registered by snd_soc_register_platform() and
the CPU DAI registered via snd_soc_register_component().  SPDIF or
I2S doesn't come into this bug.

  reply	other threads:[~2013-08-22 20:17 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-04 19:21 [PATCH RFC 00/13] Adding SPDIF support to kirkwood-i2s Russell King - ARM Linux
2013-08-04 19:22 ` [PATCH RFC 01/13] ASoC: kirkwood: merge struct kirkwood_dma_priv with struct kirkwood_dma_data Russell King
2013-08-05 14:49   ` Mark Brown
2013-08-04 19:23 ` [PATCH RFC 02/13] ASoC: kirkwood: use devm_clk_get() for the external clock Russell King
2013-08-05 16:16   ` Mark Brown
2013-08-04 19:24 ` [PATCH RFC 03/13] ASoC: avoid duplicated DAI routes Russell King
2013-08-05 16:18   ` Mark Brown
2013-08-04 19:25 ` [PATCH RFC 04/13] ASoC: HACK: avoid creating duplicated widgets Russell King
2013-08-04 19:26 ` [PATCH RFC 05/13] ASoC: kirkwood: provide KIRKWOOD_PLAYCTL_ENABLE_MASK Russell King
2013-08-05 17:03   ` Mark Brown
2013-08-04 19:27 ` [PATCH RFC 06/13] ASoC: kirkwood: combine kirkwood-i2s and kirkwood-dma drivers Russell King
2013-08-05 10:13   ` Jean-Francois Moine
2013-08-05 10:20     ` Russell King - ARM Linux
2013-08-05 17:04   ` Mark Brown
2013-08-04 19:28 ` [PATCH RFC 07/13] ASoC: kirkwood: move calculation of max buffer size to kirkwood.h Russell King
2013-08-05 17:07   ` Mark Brown
2013-08-04 19:29 ` [PATCH RFC 08/13] ASoC: kirkwood: add DAPM widgets for input and output routing Russell King
2013-08-04 19:30 ` [PATCH RFC 09/13] ASoC: kirkwood-openrd: add DAPM links between codec and cpu DAI Russell King
2013-08-04 19:31 ` [PATCH RFC 10/13] ASoC: kirkwood-t5325: " Russell King
2013-08-05 11:27   ` Mark Brown
2013-08-05 11:33     ` Russell King - ARM Linux
2013-08-05 14:40       ` Mark Brown
2013-08-05 14:56         ` Russell King - ARM Linux
2013-08-05 20:32           ` Russell King - ARM Linux
2013-08-05 22:06             ` Mark Brown
2013-08-05 23:30               ` Russell King - ARM Linux
2013-08-06 13:32                 ` Mark Brown
2013-08-10 16:11                   ` Russell King - ARM Linux
2013-08-10 21:13                     ` Russell King - ARM Linux
2013-08-12  7:40                       ` Liam Girdwood
2013-08-12  8:28                         ` Russell King - ARM Linux
2013-08-13 14:59                           ` Liam Girdwood
2013-08-20 10:25                             ` Russell King - ARM Linux
2013-08-20 11:44                               ` Mark Brown
2013-08-20 11:49                                 ` Russell King - ARM Linux
2013-08-20 13:31                                   ` Russell King - ARM Linux
2013-08-20 18:50                                     ` Mark Brown
2013-08-20 20:18                                       ` Russell King - ARM Linux
2013-08-22 19:22                                         ` Liam Girdwood
2013-08-22 20:16                                           ` Russell King - ARM Linux [this message]
2013-08-23 12:13                                             ` Liam Girdwood
2013-08-23 12:58                                               ` Russell King - ARM Linux
2013-08-23 16:58                                                 ` Mark Brown
2013-08-23 17:45                                                   ` Russell King - ARM Linux
2013-08-28  1:22                                                     ` Mark Brown
2013-08-29 21:12                                                     ` Liam Girdwood
2013-08-30 11:27                                                       ` Russell King - ARM Linux
2013-08-30 16:10                                                         ` Russell King - ARM Linux
2013-08-11 12:36                     ` Mark Brown
2013-08-04 19:32 ` [PATCH RFC 11/13] ASoC: spdif_transceiver: add output pin widget Russell King
2013-08-05 11:33   ` Mark Brown
2013-08-04 19:33 ` [PATCH RFC 12/13] ASoC: kirkwood: add SPDIF output support Russell King
2013-08-04 19:34 ` [PATCH RFC 13/13] ASoC: kirkwood: add IEC958 channel status support Russell King
2013-08-04 21:45 ` [PATCH RFC 00/13] Adding SPDIF support to kirkwood-i2s Sebastian Hesselbarth
2013-08-05  8:43   ` Thomas Petazzoni
2013-08-05  8:53     ` Russell King - ARM Linux
2013-08-05  9:06       ` Thomas Petazzoni
2013-08-05 11:59   ` Mark Brown
2013-08-05 13:06     ` Sebastian Hesselbarth
2013-08-05 14:07       ` Mark Brown
2013-08-05 15:04         ` Sebastian Hesselbarth
2013-08-05 16:59           ` Mark Brown
2013-08-05 18:14             ` Sebastian Hesselbarth
2013-08-05 18:59               ` Mark Brown
2013-08-05 22:47           ` Stephen Warren
2013-08-05 14:10       ` Lars-Peter Clausen
2013-08-05 15:03         ` Mark Brown
2013-08-06  0:02         ` Kuninori Morimoto
2013-08-30  7:20           ` Kuninori Morimoto
2013-08-30  8:26             ` Lars-Peter Clausen
2013-08-30  9:56               ` Mark Brown
2013-08-05 14:59       ` Russell King - ARM Linux

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=20130822201658.GK6617@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=tiwai@suse.de \
    /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).