All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Mark Brown <broonie@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
	alsa-devel@alsa-project.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: Mon, 5 Aug 2013 21:32:02 +0100	[thread overview]
Message-ID: <20130805203202.GX23006@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130805145644.GV23006@n2100.arm.linux.org.uk>

On Mon, Aug 05, 2013 at 03:56:44PM +0100, Russell King - ARM Linux wrote:
> On Mon, Aug 05, 2013 at 03:40:54PM +0100, Mark Brown wrote:
> > On Mon, Aug 05, 2013 at 12:33:10PM +0100, Russell King - ARM Linux wrote:
> > > On Mon, Aug 05, 2013 at 12:27:33PM +0100, Mark Brown wrote:
> > 
> > > > This doesn't look good - this is adding DAPM routes which should
> > > > correspond to the DAI link that's already been configured.
> > 
> > > No, you're wrong there:
> > 
> > > CPU DAI:				Codec DAI
> > > dma-playback	--->	i2sdo	--->	Playback
> > > 		`-->	spdifdo -> not connected
> > > dma-capture	<---	i2sdi	<---	Capture

Well, having followed your suggestions and re-analysed Liam's driver, it
basically does not work, because none of the widgets get powered up.

Liam's DAPM driver does this:

==== Frontend ====
DAI drivers:    DAI stream names
System Pin      System Playback
Offload0 Pin    Offload0 Playback
Offload1 Pin    Offload1 Playback
Loopback Pin    Loopback Capture
Capture Pin     Analog Capture

Routing:
[s]System Playback   --------v           .----> [aif]SSP0 CODEC OUT
[s]Offload0 Playback ---> [w]Playback VMixer
[s]Offload1 Playback --------^           `----> [s]Loopback Capture

[aif]SSP0 CODEC IN ---> [s]Analog Capture

==== Platform ====
Routing:
[aif]SSP0 CODEC OUT ---> [s]AIF1 Playback
...

==== Codec ====
DAI drivers:    DAI stream names
rt5640-aif1     AIF1 Playback --> AIF1RX --> DAI1 RX Mux --> IF1 DAC -->...
                AIF1 Capture ...


And what I have already in kirkwood-i2s is:

CPU DAI:
[s]dma-playback	---> [aif]i2sdo
		`--> [aif]spdifdo
[s]dma-capture	<--- [aif]i2sdi

So that follows exactly what Liam's driver does.  So no changes are
required there.

I've changed the DAI links to this in kirkwood-spdif.c:

static struct snd_soc_dai_link kirkwood_spdif_dai1[] = {
        {
                .name = "S/PDIF1",
                .stream_name = "IEC958 Playback",
                .platform_name = "mvebu-audio.1",
                .cpu_dai_name = "mvebu-audio.1",
		.dynamic = 1,
                .codec_name = "snd-soc-dummy",
                .codec_dai_name = "snd-soc-dummy-dai",
        }, {
                .name = "Codec",
                .cpu_dai_name = "snd-soc-dummy-dai",
                .platform_name = "snd-soc-dummy",
                .no_pcm = 1,
                .codec_dai_name = "dit-hifi",
                .codec_name = "spdif-dit",
                .ops = &kirkwood_spdif_ops,
        },
};

which is similar to what's in Liam's driver.  However, There is no
.dpcm_playback member in mainline ASoC.

However, when trying to play something:

bash# grep . /sys/kernel/debug/asoc/Kirkwood\ SPDIF/*/dapm/* | \
sed 's,/sys/kernel/debug/asoc/Kirkwood SPDIF/,,'
mvebu-audio.1/dapm/bias_level:Off
mvebu-audio.1/dapm/i2sdi:i2sdi: Off  in 0 out 0
mvebu-audio.1/dapm/i2sdi: stream dma-rx inactive
mvebu-audio.1/dapm/i2sdo:i2sdo: Off  in 0 out 0
mvebu-audio.1/dapm/i2sdo: stream dma-tx inactive
mvebu-audio.1/dapm/spdifdo:spdifdo: Off  in 0 out 0
mvebu-audio.1/dapm/spdifdo: stream dma-tx inactive
mvebu-audio.1/dapm/spdifdo: out "static" "Playback"
snd-soc-dummy/dapm/Capture:Capture: Off  in 0 out 0
snd-soc-dummy/dapm/Capture: stream Capture inactive
snd-soc-dummy/dapm/Playback:Playback: Off  in 0 out 0
snd-soc-dummy/dapm/Playback: stream Playback inactive
snd-soc-dummy/dapm/Playback: in  "static" "spdifdo"
snd-soc-dummy/dapm/bias_level:Standby
spdif-dit/dapm/Playback:Playback: Off  in 0 out 1
spdif-dit/dapm/Playback: stream Playback inactive
spdif-dit/dapm/Playback: out "static" "spdif-out"
spdif-dit/dapm/bias_level:Standby
spdif-dit/dapm/spdif-out:spdif-out: Off  in 0 out 1
spdif-dit/dapm/spdif-out: in  "static" "Playback"

Nothing gets powered up.  This is hardly surprising, because of how
ASoC connects the widgets.

So, let's summarise this.  You're saying that I'm doing it all wrong in
my driver creating those widgets and paths.  Yet, the widgets and paths
are exactly what Liam creates in his driver.

Not only that, but we have even more duplicated widgets created with this
method, even with the hack from this patch set.

snd_soc_dapm_new_dai_widgets: creating playback widget Playback:Playback
  for dai d81247c0 dapm d8263f10 (playback_widget  was   (null), new c05ab080)
snd_soc_dapm_new_dai_widgets: creating playback widget Playback:Playback
  for dai d81247c0 dapm d8263c70 (playback_widget was c05ab080, new d8fe2b40)

It seems Liam's commit needs to be reverted to fix that.  Whether that's
correct or not, I've no idea.

Plus, when I try to set things up as Liam has, the result doesn't work,
because of the widget naming scheme having no disambiguation.

WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 10/13] ASoC: kirkwood-t5325: add DAPM links between codec and cpu DAI
Date: Mon, 5 Aug 2013 21:32:02 +0100	[thread overview]
Message-ID: <20130805203202.GX23006@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130805145644.GV23006@n2100.arm.linux.org.uk>

On Mon, Aug 05, 2013 at 03:56:44PM +0100, Russell King - ARM Linux wrote:
> On Mon, Aug 05, 2013 at 03:40:54PM +0100, Mark Brown wrote:
> > On Mon, Aug 05, 2013 at 12:33:10PM +0100, Russell King - ARM Linux wrote:
> > > On Mon, Aug 05, 2013 at 12:27:33PM +0100, Mark Brown wrote:
> > 
> > > > This doesn't look good - this is adding DAPM routes which should
> > > > correspond to the DAI link that's already been configured.
> > 
> > > No, you're wrong there:
> > 
> > > CPU DAI:				Codec DAI
> > > dma-playback	--->	i2sdo	--->	Playback
> > > 		`-->	spdifdo -> not connected
> > > dma-capture	<---	i2sdi	<---	Capture

Well, having followed your suggestions and re-analysed Liam's driver, it
basically does not work, because none of the widgets get powered up.

Liam's DAPM driver does this:

==== Frontend ====
DAI drivers:    DAI stream names
System Pin      System Playback
Offload0 Pin    Offload0 Playback
Offload1 Pin    Offload1 Playback
Loopback Pin    Loopback Capture
Capture Pin     Analog Capture

Routing:
[s]System Playback   --------v           .----> [aif]SSP0 CODEC OUT
[s]Offload0 Playback ---> [w]Playback VMixer
[s]Offload1 Playback --------^           `----> [s]Loopback Capture

[aif]SSP0 CODEC IN ---> [s]Analog Capture

==== Platform ====
Routing:
[aif]SSP0 CODEC OUT ---> [s]AIF1 Playback
...

==== Codec ====
DAI drivers:    DAI stream names
rt5640-aif1     AIF1 Playback --> AIF1RX --> DAI1 RX Mux --> IF1 DAC -->...
                AIF1 Capture ...


And what I have already in kirkwood-i2s is:

CPU DAI:
[s]dma-playback	---> [aif]i2sdo
		`--> [aif]spdifdo
[s]dma-capture	<--- [aif]i2sdi

So that follows exactly what Liam's driver does.  So no changes are
required there.

I've changed the DAI links to this in kirkwood-spdif.c:

static struct snd_soc_dai_link kirkwood_spdif_dai1[] = {
        {
                .name = "S/PDIF1",
                .stream_name = "IEC958 Playback",
                .platform_name = "mvebu-audio.1",
                .cpu_dai_name = "mvebu-audio.1",
		.dynamic = 1,
                .codec_name = "snd-soc-dummy",
                .codec_dai_name = "snd-soc-dummy-dai",
        }, {
                .name = "Codec",
                .cpu_dai_name = "snd-soc-dummy-dai",
                .platform_name = "snd-soc-dummy",
                .no_pcm = 1,
                .codec_dai_name = "dit-hifi",
                .codec_name = "spdif-dit",
                .ops = &kirkwood_spdif_ops,
        },
};

which is similar to what's in Liam's driver.  However, There is no
.dpcm_playback member in mainline ASoC.

However, when trying to play something:

bash# grep . /sys/kernel/debug/asoc/Kirkwood\ SPDIF/*/dapm/* | \
sed 's,/sys/kernel/debug/asoc/Kirkwood SPDIF/,,'
mvebu-audio.1/dapm/bias_level:Off
mvebu-audio.1/dapm/i2sdi:i2sdi: Off  in 0 out 0
mvebu-audio.1/dapm/i2sdi: stream dma-rx inactive
mvebu-audio.1/dapm/i2sdo:i2sdo: Off  in 0 out 0
mvebu-audio.1/dapm/i2sdo: stream dma-tx inactive
mvebu-audio.1/dapm/spdifdo:spdifdo: Off  in 0 out 0
mvebu-audio.1/dapm/spdifdo: stream dma-tx inactive
mvebu-audio.1/dapm/spdifdo: out "static" "Playback"
snd-soc-dummy/dapm/Capture:Capture: Off  in 0 out 0
snd-soc-dummy/dapm/Capture: stream Capture inactive
snd-soc-dummy/dapm/Playback:Playback: Off  in 0 out 0
snd-soc-dummy/dapm/Playback: stream Playback inactive
snd-soc-dummy/dapm/Playback: in  "static" "spdifdo"
snd-soc-dummy/dapm/bias_level:Standby
spdif-dit/dapm/Playback:Playback: Off  in 0 out 1
spdif-dit/dapm/Playback: stream Playback inactive
spdif-dit/dapm/Playback: out "static" "spdif-out"
spdif-dit/dapm/bias_level:Standby
spdif-dit/dapm/spdif-out:spdif-out: Off  in 0 out 1
spdif-dit/dapm/spdif-out: in  "static" "Playback"

Nothing gets powered up.  This is hardly surprising, because of how
ASoC connects the widgets.

So, let's summarise this.  You're saying that I'm doing it all wrong in
my driver creating those widgets and paths.  Yet, the widgets and paths
are exactly what Liam creates in his driver.

Not only that, but we have even more duplicated widgets created with this
method, even with the hack from this patch set.

snd_soc_dapm_new_dai_widgets: creating playback widget Playback:Playback
  for dai d81247c0 dapm d8263f10 (playback_widget  was   (null), new c05ab080)
snd_soc_dapm_new_dai_widgets: creating playback widget Playback:Playback
  for dai d81247c0 dapm d8263c70 (playback_widget was c05ab080, new d8fe2b40)

It seems Liam's commit needs to be reverted to fix that.  Whether that's
correct or not, I've no idea.

Plus, when I try to set things up as Liam has, the result doesn't work,
because of the widget naming scheme having no disambiguation.

  reply	other threads:[~2013-08-05 20:32 UTC|newest]

Thread overview: 143+ 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:21 ` 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-04 19:22   ` Russell King
2013-08-05 14:49   ` Mark Brown
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-04 19:23   ` Russell King
2013-08-05 16:16   ` Mark Brown
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-04 19:24   ` Russell King
2013-08-05 16:18   ` Mark Brown
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:25   ` Russell King
2013-08-04 19:26 ` [PATCH RFC 05/13] ASoC: kirkwood: provide KIRKWOOD_PLAYCTL_ENABLE_MASK Russell King
2013-08-04 19:26   ` Russell King
2013-08-05 17:03   ` Mark Brown
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-04 19:27   ` Russell King
2013-08-05 10:13   ` Jean-Francois Moine
2013-08-05 10:13     ` Jean-Francois Moine
2013-08-05 10:20     ` Russell King - ARM Linux
2013-08-05 10:20       ` Russell King - ARM Linux
2013-08-05 17:04   ` Mark Brown
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-04 19:28   ` Russell King
2013-08-05 17:07   ` Mark Brown
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:29   ` 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:30   ` Russell King
2013-08-04 19:31 ` [PATCH RFC 10/13] ASoC: kirkwood-t5325: " Russell King
2013-08-04 19:31   ` Russell King
2013-08-05 11:27   ` Mark Brown
2013-08-05 11:27     ` Mark Brown
2013-08-05 11:33     ` Russell King - ARM Linux
2013-08-05 11:33       ` Russell King - ARM Linux
2013-08-05 14:40       ` Mark Brown
2013-08-05 14:40         ` Mark Brown
2013-08-05 14:56         ` Russell King - ARM Linux
2013-08-05 14:56           ` Russell King - ARM Linux
2013-08-05 20:32           ` Russell King - ARM Linux [this message]
2013-08-05 20:32             ` Russell King - ARM Linux
2013-08-05 22:06             ` Mark Brown
2013-08-05 22:06               ` Mark Brown
2013-08-05 23:30               ` Russell King - ARM Linux
2013-08-05 23:30                 ` Russell King - ARM Linux
2013-08-06 13:32                 ` Mark Brown
2013-08-06 13:32                   ` Mark Brown
2013-08-10 16:11                   ` Russell King - ARM Linux
2013-08-10 16:11                     ` Russell King - ARM Linux
2013-08-10 21:13                     ` Russell King - ARM Linux
2013-08-10 21:13                       ` Russell King - ARM Linux
2013-08-12  7:40                       ` Liam Girdwood
2013-08-12  7:40                         ` [alsa-devel] " Liam Girdwood
2013-08-12  8:28                         ` Russell King - ARM Linux
2013-08-12  8:28                           ` [alsa-devel] " Russell King - ARM Linux
2013-08-13 14:59                           ` Liam Girdwood
2013-08-13 14:59                             ` [alsa-devel] " Liam Girdwood
2013-08-20 10:25                             ` Russell King - ARM Linux
2013-08-20 10:25                               ` [alsa-devel] " Russell King - ARM Linux
2013-08-20 11:44                               ` Mark Brown
2013-08-20 11:44                                 ` [alsa-devel] " Mark Brown
2013-08-20 11:49                                 ` Russell King - ARM Linux
2013-08-20 11:49                                   ` [alsa-devel] " Russell King - ARM Linux
2013-08-20 13:31                                   ` Russell King - ARM Linux
2013-08-20 13:31                                     ` [alsa-devel] " Russell King - ARM Linux
2013-08-20 18:50                                     ` Mark Brown
2013-08-20 18:50                                       ` [alsa-devel] " Mark Brown
2013-08-20 20:18                                       ` Russell King - ARM Linux
2013-08-20 20:18                                         ` [alsa-devel] " Russell King - ARM Linux
2013-08-22 19:22                                         ` Liam Girdwood
2013-08-22 19:22                                           ` [alsa-devel] " Liam Girdwood
2013-08-22 20:16                                           ` Russell King - ARM Linux
2013-08-22 20:16                                             ` [alsa-devel] " Russell King - ARM Linux
2013-08-23 12:13                                             ` Liam Girdwood
2013-08-23 12:13                                               ` [alsa-devel] " Liam Girdwood
2013-08-23 12:58                                               ` Russell King - ARM Linux
2013-08-23 12:58                                                 ` [alsa-devel] " Russell King - ARM Linux
2013-08-23 16:58                                                 ` Mark Brown
2013-08-23 16:58                                                   ` [alsa-devel] " Mark Brown
2013-08-23 17:45                                                   ` Russell King - ARM Linux
2013-08-23 17:45                                                     ` [alsa-devel] " Russell King - ARM Linux
2013-08-28  1:22                                                     ` Mark Brown
2013-08-28  1:22                                                       ` [alsa-devel] " Mark Brown
2013-08-29 21:12                                                     ` Liam Girdwood
2013-08-30 11:27                                                       ` Russell King - ARM Linux
2013-08-30 11:27                                                         ` [alsa-devel] " Russell King - ARM Linux
2013-08-30 16:10                                                         ` Russell King - ARM Linux
2013-08-30 16:10                                                           ` [alsa-devel] " Russell King - ARM Linux
2013-08-11 12:36                     ` Mark Brown
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-04 19:32   ` Russell King
2013-08-05 11:33   ` Mark Brown
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:33   ` Russell King
2013-08-04 19:34 ` [PATCH RFC 13/13] ASoC: kirkwood: add IEC958 channel status support Russell King
2013-08-04 19:34   ` Russell King
2013-08-04 21:45 ` [PATCH RFC 00/13] Adding SPDIF support to kirkwood-i2s Sebastian Hesselbarth
2013-08-04 21:45   ` Sebastian Hesselbarth
2013-08-05  8:43   ` Thomas Petazzoni
2013-08-05  8:43     ` Thomas Petazzoni
2013-08-05  8:53     ` Russell King - ARM Linux
2013-08-05  8:53       ` Russell King - ARM Linux
2013-08-05  9:06       ` Thomas Petazzoni
2013-08-05  9:06         ` Thomas Petazzoni
2013-08-05 11:59   ` Mark Brown
2013-08-05 11:59     ` Mark Brown
2013-08-05 13:06     ` Sebastian Hesselbarth
2013-08-05 13:06       ` Sebastian Hesselbarth
2013-08-05 14:07       ` Mark Brown
2013-08-05 14:07         ` Mark Brown
2013-08-05 15:04         ` Sebastian Hesselbarth
2013-08-05 15:04           ` Sebastian Hesselbarth
2013-08-05 16:59           ` Mark Brown
2013-08-05 16:59             ` Mark Brown
2013-08-05 18:14             ` Sebastian Hesselbarth
2013-08-05 18:14               ` Sebastian Hesselbarth
2013-08-05 18:59               ` Mark Brown
2013-08-05 18:59                 ` Mark Brown
2013-08-05 22:47           ` Stephen Warren
2013-08-05 22:47             ` [alsa-devel] " Stephen Warren
2013-08-05 14:10       ` Lars-Peter Clausen
2013-08-05 14:10         ` [alsa-devel] " Lars-Peter Clausen
2013-08-05 15:03         ` Mark Brown
2013-08-05 15:03           ` [alsa-devel] " Mark Brown
2013-08-06  0:02         ` Kuninori Morimoto
2013-08-06  0:02           ` [alsa-devel] " Kuninori Morimoto
2013-08-30  7:20           ` Kuninori Morimoto
2013-08-30  7:20             ` [alsa-devel] " Kuninori Morimoto
2013-08-30  8:26             ` Lars-Peter Clausen
2013-08-30  8:26               ` [alsa-devel] " Lars-Peter Clausen
2013-08-30  9:56               ` Mark Brown
2013-08-30  9:56                 ` [alsa-devel] " Mark Brown
2013-08-05 14:59       ` Russell King - ARM Linux
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=20130805203202.GX23006@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=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 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.