linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
       [not found] ` <1428653649-38200-2-git-send-email-koro.chen@mediatek.com>
@ 2015-04-18 17:34   ` Mark Brown
  2015-04-20  4:37     ` Sascha Hauer
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2015-04-18 17:34 UTC (permalink / raw)
  To: Koro Chen
  Cc: robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, s.hauer, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote:

> +Each external interface (called "IO" in this driver) is presented as a
> +DAI to ASoC. An IO must be connected via the interconnect to a memif.
> +The connection paths are configured through the device tree.

Why are these connection paths configured via device tree?  I would
expect that either there would be runtime configurability of these
things (particularly if loopback configurations within the hardware are
possible) or we'd just allocate memory interfaces to DAIs automatically
as DAIs come into use.

> +- mem-interface-playback:
> +  mem-interface-capture: property of memif, format is: <memif irq use_sram>;
> +	                 memif: which memif to be used
> +			        (defined in include/dt-bindings/sound/mtk-afe.h)
> +		         irq: which irq to be used
> +			      (defined in include/dt-bindings/sound/mtk-afe.h)
> +		         use_sram: 1 is yes, 0 is no

Again, this looks like stuff we should be able to figure out at runtime
- the use of SRAM in particular looks like something we might want to
change depending on use case.  Assuming it adds buffering then for a
VoIP application we might not want to use SRAM to minimize latency but
during music playback we might want to enable SRAM to minimize power
consumption.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 2/3] ASoC: mediatek: Add AFE connection control
       [not found] ` <1428653649-38200-3-git-send-email-koro.chen@mediatek.com>
@ 2015-04-18 17:37   ` Mark Brown
  2015-04-20  4:50     ` Sascha Hauer
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2015-04-18 17:37 UTC (permalink / raw)
  To: Koro Chen
  Cc: robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, s.hauer, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 925 bytes --]

On Fri, Apr 10, 2015 at 04:14:08PM +0800, Koro Chen wrote:

> +/*
> + * The MTK AFE unit has a audio interconnect with MTK_AFE_INTERCONN_NUM_INPUT
> + * inputs and MTK_AFE_INTERCONN_NUM_OUTPUT outputs. Below table holds the
> + * register/bits to set to connect an input with an output.
> + */
> +static const struct mtk_afe_connection
> +	connections[MTK_AFE_INTERCONN_NUM_INPUT][MTK_AFE_INTERCONN_NUM_OUTPUT] = {
> +	[0][0] =   { .creg = 0x020, .cshift =  0, .sreg = 0x020, .sshift = 10},
> +	[0][1] =   { .creg = 0x020, .cshift = 16, .sreg = 0x020, .sshift = 26},

What are the constraints on using this - is it one input to one output
only or can we do mixing or duplication?  The register interface
definitely does look like something asking for runtime configuration.

It'd also be nice to have less magic numbers in the table, at least for
the indexes (which I guess correspond to some of the defines in the
headers)?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver
       [not found] ` <1428653649-38200-4-git-send-email-koro.chen@mediatek.com>
@ 2015-04-18 17:51   ` Mark Brown
  2015-04-20  6:22     ` Koro Chen
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2015-04-18 17:51 UTC (permalink / raw)
  To: Koro Chen
  Cc: robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, s.hauer, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 2683 bytes --]

On Fri, Apr 10, 2015 at 04:14:09PM +0800, Koro Chen wrote:

> +	if (memif->use_sram) {
> +		struct snd_dma_buffer *dma_buf = &substream->dma_buffer;
> +		int size = params_buffer_bytes(params);
> +
> +		memif->buffer_size = size;
> +		memif->phys_buf_addr = afe->sram_phy_address;
> +
> +		dma_buf->bytes = size;
> +		dma_buf->area = (unsigned char *)afe->sram_address;
> +		dma_buf->addr = afe->sram_phy_address;
> +		dma_buf->dev.type = SNDRV_DMA_TYPE_DEV;
> +		dma_buf->dev.dev = substream->pcm->card->dev;
> +		snd_pcm_set_runtime_buffer(substream, dma_buf);
> +	} else {
> +		ret = snd_pcm_lib_malloc_pages(substream,
> +					       params_buffer_bytes(params));
> +		if (ret < 0)
> +			return ret;
> +
> +		memif->phys_buf_addr = substream->runtime->dma_addr;
> +		memif->buffer_size = substream->runtime->dma_bytes;
> +	}

Ah, so the SRAM is directly memory mappable.  Nice.  But we have a
limited amount of it so need to allocate it to a device somehow based on
some factor I guess?

> +static int mtk_afe_set_adda_dac_out(struct mtk_afe *afe, uint32_t rate)
> +{
> +	u32 audio_i2s_dac = 0;
> +	u32 con0, con1;
> +
> +	/* set dl src2 */
> +	con0 = (mtk_afe_adda_fs(rate) << 28) | (0x03 << 24) | (0x03 << 11);
> +
> +	/* 8k or 16k voice mode */
> +	if (con0 == 0 || con0 == 3)
> +		con0 |= 0x01 << 5;

This all looks a bit magic, some defines would not go amiss here.

> +	/* SA suggests to apply -0.3db to audio/speech path */
> +	con0 = con0 | (0x01 << 1);
> +	con1 = 0xf74f0000;

More magic numbers!  This also suggests that there is a volume control
lurking in here which could usefully be exposed to applications?

> +static void mtk_afe_pmic_shutdown(struct mtk_afe *afe,
> +				  struct snd_pcm_substream *substream)
> +{
> +	/* output */
> +	regmap_update_bits(afe->regmap, AFE_ADDA_DL_SRC2_CON0, 1, 0);
> +	regmap_update_bits(afe->regmap, AFE_I2S_CON1, 1, 0);
> +
> +	/* input */
> +	regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, 1, 0);
> +	/* disable ADDA */
> +	regmap_update_bits(afe->regmap, AFE_ADDA_UL_DL_CON0, 1, false);
> +}

This is looking like exposing the routing and using DAPM might save a
bunch of code?  Overall my main thought looking at the code here and
what the hardware was described as doing is that it'd all be simpler if
it were a DPCM based thing using DAPM for power.  I think I'd like to
see a strong reason for not using at least DPCM.

> +		if (rate == MTK_AFE_I2S_RATE_8K)
> +			voice_mode = 0;
> +		else if (rate == MTK_AFE_I2S_RATE_16K)
> +			voice_mode = 1;
> +		else if (rate == MTK_AFE_I2S_RATE_32K)
> +			voice_mode = 2;
> +		else if (rate == MTK_AFE_I2S_RATE_48K)
> +			voice_mode = 3;

This should be a switch statement.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-18 17:34   ` [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver Mark Brown
@ 2015-04-20  4:37     ` Sascha Hauer
  2015-04-20 20:48       ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Sascha Hauer @ 2015-04-20  4:37 UTC (permalink / raw)
  To: Mark Brown
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

On Sat, Apr 18, 2015 at 06:34:07PM +0100, Mark Brown wrote:
> On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote:
> 
> > +Each external interface (called "IO" in this driver) is presented as a
> > +DAI to ASoC. An IO must be connected via the interconnect to a memif.
> > +The connection paths are configured through the device tree.
> 
> Why are these connection paths configured via device tree?  I would
> expect that either there would be runtime configurability of these
> things (particularly if loopback configurations within the hardware are
> possible) or we'd just allocate memory interfaces to DAIs automatically
> as DAIs come into use.

There is a crossbar switch between the memory interfaces and the DAIs.
Not every connection is possible, so not every memory interface can be
used for every DAI. An algorithm choosing a suitable memory interface
must be quite clever, complicated and also SoC dependent (the same but
different hardware is used on MT8135 aswell), so I thought offering a
static configuration via device tree is a good start. Should there be
runtime configuration possible later the device tree settings could
provide a good default.

> 
> > +- mem-interface-playback:
> > +  mem-interface-capture: property of memif, format is: <memif irq use_sram>;
> > +	                 memif: which memif to be used
> > +			        (defined in include/dt-bindings/sound/mtk-afe.h)
> > +		         irq: which irq to be used
> > +			      (defined in include/dt-bindings/sound/mtk-afe.h)
> > +		         use_sram: 1 is yes, 0 is no
> 
> Again, this looks like stuff we should be able to figure out at runtime
> - the use of SRAM in particular looks like something we might want to
> change depending on use case.  Assuming it adds buffering then for a
> VoIP application we might not want to use SRAM to minimize latency but
> during music playback we might want to enable SRAM to minimize power
> consumption.

That's exactly the usecase. How could such a runtime configurability
look like? sysfs? Or something based on the buffer sizes?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [RESEND RFC PATCH 2/3] ASoC: mediatek: Add AFE connection control
  2015-04-18 17:37   ` [RESEND RFC PATCH 2/3] ASoC: mediatek: Add AFE connection control Mark Brown
@ 2015-04-20  4:50     ` Sascha Hauer
  2015-04-20 20:52       ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Sascha Hauer @ 2015-04-20  4:50 UTC (permalink / raw)
  To: Mark Brown
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

On Sat, Apr 18, 2015 at 06:37:40PM +0100, Mark Brown wrote:
> On Fri, Apr 10, 2015 at 04:14:08PM +0800, Koro Chen wrote:
> 
> > +/*
> > + * The MTK AFE unit has a audio interconnect with MTK_AFE_INTERCONN_NUM_INPUT
> > + * inputs and MTK_AFE_INTERCONN_NUM_OUTPUT outputs. Below table holds the
> > + * register/bits to set to connect an input with an output.
> > + */
> > +static const struct mtk_afe_connection
> > +	connections[MTK_AFE_INTERCONN_NUM_INPUT][MTK_AFE_INTERCONN_NUM_OUTPUT] = {
> > +	[0][0] =   { .creg = 0x020, .cshift =  0, .sreg = 0x020, .sshift = 10},
> > +	[0][1] =   { .creg = 0x020, .cshift = 16, .sreg = 0x020, .sshift = 26},
> 
> What are the constraints on using this - is it one input to one output
> only or can we do mixing or duplication?  The register interface
> definitely does look like something asking for runtime configuration.
> 
> It'd also be nice to have less magic numbers in the table, at least for
> the indexes (which I guess correspond to some of the defines in the
> headers)?

With defines the above two lines would become something like:

#define AFE_CONN0		0x20

#define CONN0_I00_O00_S		0
...
#define CONN0_I00_O00_R		10
...
#define CONN0_I00_O01_s		16
...
#define CONN0_I00_O01_S		26

[0][0] = { .creg = AFE_CONN0, .cshift = CONN0_I00_O00_S, .sreg = AFE_CONN0, .sshift = CONN0_I00_O00_R },
[0][1] = { .creg = AFE_CONN0, .cshift = CONN0_I00_O01_S, .sreg = AFE_CONN0, .sshift = CONN0_I00_O01_S },

For the registers we could use defines, but I think using defines for
the shifts doesn't add much value given they are only used once.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver
  2015-04-18 17:51   ` [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver Mark Brown
@ 2015-04-20  6:22     ` Koro Chen
  2015-04-20 20:55       ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Koro Chen @ 2015-04-20  6:22 UTC (permalink / raw)
  To: Mark Brown
  Cc: robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, s.hauer, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

On Sat, 2015-04-18 at 18:51 +0100, Mark Brown wrote:
> On Fri, Apr 10, 2015 at 04:14:09PM +0800, Koro Chen wrote:
> 
> > +	if (memif->use_sram) {
> > +		struct snd_dma_buffer *dma_buf = &substream->dma_buffer;
> > +		int size = params_buffer_bytes(params);
> > +
> > +		memif->buffer_size = size;
> > +		memif->phys_buf_addr = afe->sram_phy_address;
> > +
> > +		dma_buf->bytes = size;
> > +		dma_buf->area = (unsigned char *)afe->sram_address;
> > +		dma_buf->addr = afe->sram_phy_address;
> > +		dma_buf->dev.type = SNDRV_DMA_TYPE_DEV;
> > +		dma_buf->dev.dev = substream->pcm->card->dev;
> > +		snd_pcm_set_runtime_buffer(substream, dma_buf);
> > +	} else {
> > +		ret = snd_pcm_lib_malloc_pages(substream,
> > +					       params_buffer_bytes(params));
> > +		if (ret < 0)
> > +			return ret;
> > +
> > +		memif->phys_buf_addr = substream->runtime->dma_addr;
> > +		memif->buffer_size = substream->runtime->dma_bytes;
> > +	}
> 
> Ah, so the SRAM is directly memory mappable.  Nice.  But we have a
> limited amount of it so need to allocate it to a device somehow based on
> some factor I guess?
Yes, actually SRAM is only used for the main playback path (which is
memif "DL1") to achieve low power in real use case. Maybe you think it's
better to not describe this in the device tree, but to choose SRAM
automatically if memif "DL1" is chosen?
> 
> > +static int mtk_afe_set_adda_dac_out(struct mtk_afe *afe, uint32_t rate)
> > +{
> > +	u32 audio_i2s_dac = 0;
> > +	u32 con0, con1;
> > +
> > +	/* set dl src2 */
> > +	con0 = (mtk_afe_adda_fs(rate) << 28) | (0x03 << 24) | (0x03 << 11);
> > +
> > +	/* 8k or 16k voice mode */
> > +	if (con0 == 0 || con0 == 3)
> > +		con0 |= 0x01 << 5;
> 
> This all looks a bit magic, some defines would not go amiss here.
> 
> > +	/* SA suggests to apply -0.3db to audio/speech path */
> > +	con0 = con0 | (0x01 << 1);
> > +	con1 = 0xf74f0000;
> 
> More magic numbers!  This also suggests that there is a volume control
> lurking in here which could usefully be exposed to applications?
> 
Sorry, I will fix these magic numbers.
It is actually not a real volume control and not that suitable for
application control because it cannot be changed in runtime; its value
is fixed and was decided off-lined by experiment that can have best
audio quality when using with our proprietary codec (not for I2S)

> > +static void mtk_afe_pmic_shutdown(struct mtk_afe *afe,
> > +				  struct snd_pcm_substream *substream)
> > +{
> > +	/* output */
> > +	regmap_update_bits(afe->regmap, AFE_ADDA_DL_SRC2_CON0, 1, 0);
> > +	regmap_update_bits(afe->regmap, AFE_I2S_CON1, 1, 0);
> > +
> > +	/* input */
> > +	regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, 1, 0);
> > +	/* disable ADDA */
> > +	regmap_update_bits(afe->regmap, AFE_ADDA_UL_DL_CON0, 1, false);
> > +}
> 
> This is looking like exposing the routing and using DAPM might save a
> bunch of code?  Overall my main thought looking at the code here and
> what the hardware was described as doing is that it'd all be simpler if
> it were a DPCM based thing using DAPM for power.  I think I'd like to
> see a strong reason for not using at least DPCM.
Thank you very much for mentioning the DPCM. I didn't know much about
DPCM and I will definitely study and check if it is suitable for our HW.
> 
> > +		if (rate == MTK_AFE_I2S_RATE_8K)
> > +			voice_mode = 0;
> > +		else if (rate == MTK_AFE_I2S_RATE_16K)
> > +			voice_mode = 1;
> > +		else if (rate == MTK_AFE_I2S_RATE_32K)
> > +			voice_mode = 2;
> > +		else if (rate == MTK_AFE_I2S_RATE_48K)
> > +			voice_mode = 3;
> 
> This should be a switch statement.



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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-20  4:37     ` Sascha Hauer
@ 2015-04-20 20:48       ` Mark Brown
  2015-04-21  9:49         ` Sascha Hauer
  2015-04-22  3:17         ` Koro Chen
  0 siblings, 2 replies; 20+ messages in thread
From: Mark Brown @ 2015-04-20 20:48 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 2813 bytes --]

On Mon, Apr 20, 2015 at 06:37:47AM +0200, Sascha Hauer wrote:
> On Sat, Apr 18, 2015 at 06:34:07PM +0100, Mark Brown wrote:
> > On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote:

> > > +Each external interface (called "IO" in this driver) is presented as a
> > > +DAI to ASoC. An IO must be connected via the interconnect to a memif.
> > > +The connection paths are configured through the device tree.

> > Why are these connection paths configured via device tree?  I would
> > expect that either there would be runtime configurability of these
> > things (particularly if loopback configurations within the hardware are
> > possible) or we'd just allocate memory interfaces to DAIs automatically
> > as DAIs come into use.

> There is a crossbar switch between the memory interfaces and the DAIs.
> Not every connection is possible, so not every memory interface can be
> used for every DAI. An algorithm choosing a suitable memory interface
> must be quite clever, complicated and also SoC dependent (the same but
> different hardware is used on MT8135 aswell), so I thought offering a
> static configuration via device tree is a good start. Should there be
> runtime configuration possible later the device tree settings could
> provide a good default.

What exactly do the restrictions look like and how often do they vary in
practice (can we get away with just doing a single static setup in the
driver)?  I'd have thought it should be fairly straightforward to have a
table of valid mappings and just pick the first free memory interface?
I'd rather not get stuck with the tables in the DT.  It's partly to
avoid setting bad precendents, we really don't want everyone coming
along hard coding this stuff, and partly because the hardware you
described didn't seem that hard to handle.

> > > +- mem-interface-playback:
> > > +  mem-interface-capture: property of memif, format is: <memif irq use_sram>;
> > > +	                 memif: which memif to be used
> > > +			        (defined in include/dt-bindings/sound/mtk-afe.h)
> > > +		         irq: which irq to be used
> > > +			      (defined in include/dt-bindings/sound/mtk-afe.h)
> > > +		         use_sram: 1 is yes, 0 is no

> > Again, this looks like stuff we should be able to figure out at runtime
> > - the use of SRAM in particular looks like something we might want to
> > change depending on use case.  Assuming it adds buffering then for a
> > VoIP application we might not want to use SRAM to minimize latency but
> > during music playback we might want to enable SRAM to minimize power
> > consumption.

> That's exactly the usecase. How could such a runtime configurability
> look like? sysfs? Or something based on the buffer sizes?

Yeah, one of those :) but probably an ALSA control is going to be the
easiest for applications.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 2/3] ASoC: mediatek: Add AFE connection control
  2015-04-20  4:50     ` Sascha Hauer
@ 2015-04-20 20:52       ` Mark Brown
  2015-04-21  5:50         ` Sascha Hauer
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2015-04-20 20:52 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]

On Mon, Apr 20, 2015 at 06:50:17AM +0200, Sascha Hauer wrote:
> On Sat, Apr 18, 2015 at 06:37:40PM +0100, Mark Brown wrote:
> > On Fri, Apr 10, 2015 at 04:14:08PM +0800, Koro Chen wrote:

> > > +	[0][0] =   { .creg = 0x020, .cshift =  0, .sreg = 0x020, .sshift = 10},
> > > +	[0][1] =   { .creg = 0x020, .cshift = 16, .sreg = 0x020, .sshift = 26},

> > It'd also be nice to have less magic numbers in the table, at least for
> > the indexes (which I guess correspond to some of the defines in the
> > headers)?

> With defines the above two lines would become something like:

> [0][0] = { .creg = AFE_CONN0, .cshift = CONN0_I00_O00_S, .sreg = AFE_CONN0, .sshift = CONN0_I00_O00_R },
> [0][1] = { .creg = AFE_CONN0, .cshift = CONN0_I00_O01_S, .sreg = AFE_CONN0, .sshift = CONN0_I00_O01_S },

> For the registers we could use defines, but I think using defines for
> the shifts doesn't add much value given they are only used once.

By indexes I actually meant the [0][0] and so on - they seem the more
magic bit.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver
  2015-04-20  6:22     ` Koro Chen
@ 2015-04-20 20:55       ` Mark Brown
  2015-04-21  2:27         ` Koro Chen
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2015-04-20 20:55 UTC (permalink / raw)
  To: Koro Chen
  Cc: robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, s.hauer, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

On Mon, Apr 20, 2015 at 02:22:24PM +0800, Koro Chen wrote:
> On Sat, 2015-04-18 at 18:51 +0100, Mark Brown wrote:
> > On Fri, Apr 10, 2015 at 04:14:09PM +0800, Koro Chen wrote:

> > Ah, so the SRAM is directly memory mappable.  Nice.  But we have a
> > limited amount of it so need to allocate it to a device somehow based on
> > some factor I guess?

> Yes, actually SRAM is only used for the main playback path (which is
> memif "DL1") to achieve low power in real use case. Maybe you think it's
> better to not describe this in the device tree, but to choose SRAM
> automatically if memif "DL1" is chosen?

Since it's directly memory mappable is there actually any cost in
latency terms from using the SRAM in low latency cases (or did I misread
what the code was doing there)?  If it can only be used with one
interface and there's no downside from using it...

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver
  2015-04-20 20:55       ` Mark Brown
@ 2015-04-21  2:27         ` Koro Chen
  2015-04-21 10:05           ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Koro Chen @ 2015-04-21  2:27 UTC (permalink / raw)
  To: Mark Brown
  Cc: robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, s.hauer, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

On Mon, 2015-04-20 at 21:55 +0100, Mark Brown wrote:
> On Mon, Apr 20, 2015 at 02:22:24PM +0800, Koro Chen wrote:
> > On Sat, 2015-04-18 at 18:51 +0100, Mark Brown wrote:
> > > On Fri, Apr 10, 2015 at 04:14:09PM +0800, Koro Chen wrote:
> 
> > > Ah, so the SRAM is directly memory mappable.  Nice.  But we have a
> > > limited amount of it so need to allocate it to a device somehow based on
> > > some factor I guess?
> 
> > Yes, actually SRAM is only used for the main playback path (which is
> > memif "DL1") to achieve low power in real use case. Maybe you think it's
> > better to not describe this in the device tree, but to choose SRAM
> > automatically if memif "DL1" is chosen?
> 
> Since it's directly memory mappable is there actually any cost in
> latency terms from using the SRAM in low latency cases (or did I misread
> what the code was doing there)?  If it can only be used with one
> interface and there's no downside from using it...
The SRAM size to be used is defined by params_buffer_bytes(params), not
fixed (of course limited by the actual available SRAM size on HW), so
the latency should be the same compared to a DRAM having the same size. 

The SRAM can be used by any memif, and that's why the plan was let DT
make the decision.



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

* Re: [RESEND RFC PATCH 2/3] ASoC: mediatek: Add AFE connection control
  2015-04-20 20:52       ` Mark Brown
@ 2015-04-21  5:50         ` Sascha Hauer
  2015-04-21 10:15           ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Sascha Hauer @ 2015-04-21  5:50 UTC (permalink / raw)
  To: Mark Brown
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

On Mon, Apr 20, 2015 at 09:52:30PM +0100, Mark Brown wrote:
> On Mon, Apr 20, 2015 at 06:50:17AM +0200, Sascha Hauer wrote:
> > On Sat, Apr 18, 2015 at 06:37:40PM +0100, Mark Brown wrote:
> > > On Fri, Apr 10, 2015 at 04:14:08PM +0800, Koro Chen wrote:
> 
> > > > +	[0][0] =   { .creg = 0x020, .cshift =  0, .sreg = 0x020, .sshift = 10},
> > > > +	[0][1] =   { .creg = 0x020, .cshift = 16, .sreg = 0x020, .sshift = 26},
> 
> > > It'd also be nice to have less magic numbers in the table, at least for
> > > the indexes (which I guess correspond to some of the defines in the
> > > headers)?
> 
> > With defines the above two lines would become something like:
> 
> > [0][0] = { .creg = AFE_CONN0, .cshift = CONN0_I00_O00_S, .sreg = AFE_CONN0, .sshift = CONN0_I00_O00_R },
> > [0][1] = { .creg = AFE_CONN0, .cshift = CONN0_I00_O01_S, .sreg = AFE_CONN0, .sshift = CONN0_I00_O01_S },
> 
> > For the registers we could use defines, but I think using defines for
> > the shifts doesn't add much value given they are only used once.
> 
> By indexes I actually meant the [0][0] and so on - they seem the more
> magic bit.

Oh, that's not magic at all, the crossbar switch has inputs and outputs
numbered from 0 to MTK_AFE_INTERCONN_NUM_INPUT /
MTK_AFE_INTERCONN_NUM_OUTPUT (they have the same numbers in the
datasheet. To connect input x with output y look at index [x][y] in the
table and write the register values found at that place. If .creg is 0x0
then it's not possible to connect the given input with the given output.

Sascha



-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-20 20:48       ` Mark Brown
@ 2015-04-21  9:49         ` Sascha Hauer
  2015-04-21 10:14           ` Mark Brown
  2015-04-21 10:15           ` Koro Chen
  2015-04-22  3:17         ` Koro Chen
  1 sibling, 2 replies; 20+ messages in thread
From: Sascha Hauer @ 2015-04-21  9:49 UTC (permalink / raw)
  To: Mark Brown
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

On Mon, Apr 20, 2015 at 09:48:49PM +0100, Mark Brown wrote:
> On Mon, Apr 20, 2015 at 06:37:47AM +0200, Sascha Hauer wrote:
> > On Sat, Apr 18, 2015 at 06:34:07PM +0100, Mark Brown wrote:
> > > On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote:
> 
> > > > +Each external interface (called "IO" in this driver) is presented as a
> > > > +DAI to ASoC. An IO must be connected via the interconnect to a memif.
> > > > +The connection paths are configured through the device tree.
> 
> > > Why are these connection paths configured via device tree?  I would
> > > expect that either there would be runtime configurability of these
> > > things (particularly if loopback configurations within the hardware are
> > > possible) or we'd just allocate memory interfaces to DAIs automatically
> > > as DAIs come into use.
> 
> > There is a crossbar switch between the memory interfaces and the DAIs.
> > Not every connection is possible, so not every memory interface can be
> > used for every DAI. An algorithm choosing a suitable memory interface
> > must be quite clever, complicated and also SoC dependent (the same but
> > different hardware is used on MT8135 aswell), so I thought offering a
> > static configuration via device tree is a good start. Should there be
> > runtime configuration possible later the device tree settings could
> > provide a good default.
> 
> What exactly do the restrictions look like and how often do they vary in
> practice (can we get away with just doing a single static setup in the
> driver)? I'd have thought it should be fairly straightforward to have a
> table of valid mappings and just pick the first free memory interface?

I think this could be done. I checked the possible connections in the
crossbar switch and it seems all memory interfaces can be connected with
all relevant external interfaces. So indeed the memory interfaces could
be dynamically allocated instead of statically associated to an
external interface. There are two problems I see: Some memory interfaces
are limited in the rates they support, they can only do 8k/16k/32k (for
speech). How can we know such memory interface should be used? Also
there are two programmable hardware gain blocks which can be inserted to
the digital audio path using the crossbar switch. There must be some
mechanism to configure them into different places.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver
  2015-04-21  2:27         ` Koro Chen
@ 2015-04-21 10:05           ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2015-04-21 10:05 UTC (permalink / raw)
  To: Koro Chen
  Cc: robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, s.hauer, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

On Tue, Apr 21, 2015 at 10:27:13AM +0800, Koro Chen wrote:

> The SRAM size to be used is defined by params_buffer_bytes(params), not
> fixed (of course limited by the actual available SRAM size on HW), so
> the latency should be the same compared to a DRAM having the same size. 

Right, some systems have the SRAM as essentially a big FIFO but this
doesn't have that problem.

> The SRAM can be used by any memif, and that's why the plan was let DT
> make the decision.

OK, if it's for any interface rather than just DL1 like Sascha said then
it does need to be selectable, but DT doesn't seem the platce to do it.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-21  9:49         ` Sascha Hauer
@ 2015-04-21 10:14           ` Mark Brown
  2015-04-21 10:15           ` Koro Chen
  1 sibling, 0 replies; 20+ messages in thread
From: Mark Brown @ 2015-04-21 10:14 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

On Tue, Apr 21, 2015 at 11:49:26AM +0200, Sascha Hauer wrote:

> I think this could be done. I checked the possible connections in the
> crossbar switch and it seems all memory interfaces can be connected with
> all relevant external interfaces. So indeed the memory interfaces could
> be dynamically allocated instead of statically associated to an
> external interface. There are two problems I see: Some memory interfaces
> are limited in the rates they support, they can only do 8k/16k/32k (for
> speech). How can we know such memory interface should be used? Also
> there are two programmable hardware gain blocks which can be inserted to
> the digital audio path using the crossbar switch. There must be some
> mechanism to configure them into different places.

This (particularly the gain controls) sounds like you want to expose the
routing to userspace and use DPCM, the code also seemed to look like it
was a good fit for DPCM.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 2/3] ASoC: mediatek: Add AFE connection control
  2015-04-21  5:50         ` Sascha Hauer
@ 2015-04-21 10:15           ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2015-04-21 10:15 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Koro Chen, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

On Tue, Apr 21, 2015 at 07:50:41AM +0200, Sascha Hauer wrote:

> Oh, that's not magic at all, the crossbar switch has inputs and outputs
> numbered from 0 to MTK_AFE_INTERCONN_NUM_INPUT /
> MTK_AFE_INTERCONN_NUM_OUTPUT (they have the same numbers in the
> datasheet. To connect input x with output y look at index [x][y] in the
> table and write the register values found at that place. If .creg is 0x0
> then it's not possible to connect the given input with the given output.

A comment saying that would help then.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-21  9:49         ` Sascha Hauer
  2015-04-21 10:14           ` Mark Brown
@ 2015-04-21 10:15           ` Koro Chen
  2015-04-21 10:56             ` Mark Brown
  1 sibling, 1 reply; 20+ messages in thread
From: Koro Chen @ 2015-04-21 10:15 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Mark Brown, robh+dt, matthias.bgg, perex, tiwai, srv_heupstream,
	linux-mediatek, galak, lgirdwood, devicetree, linux-arm-kernel,
	linux-kernel, alsa-devel

On Tue, 2015-04-21 at 11:49 +0200, Sascha Hauer wrote:
> On Mon, Apr 20, 2015 at 09:48:49PM +0100, Mark Brown wrote:
> > On Mon, Apr 20, 2015 at 06:37:47AM +0200, Sascha Hauer wrote:
> > > On Sat, Apr 18, 2015 at 06:34:07PM +0100, Mark Brown wrote:
> > > > On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote:
> > 
> > > > > +Each external interface (called "IO" in this driver) is presented as a
> > > > > +DAI to ASoC. An IO must be connected via the interconnect to a memif.
> > > > > +The connection paths are configured through the device tree.
> > 
> > > > Why are these connection paths configured via device tree?  I would
> > > > expect that either there would be runtime configurability of these
> > > > things (particularly if loopback configurations within the hardware are
> > > > possible) or we'd just allocate memory interfaces to DAIs automatically
> > > > as DAIs come into use.
> > 
> > > There is a crossbar switch between the memory interfaces and the DAIs.
> > > Not every connection is possible, so not every memory interface can be
> > > used for every DAI. An algorithm choosing a suitable memory interface
> > > must be quite clever, complicated and also SoC dependent (the same but
> > > different hardware is used on MT8135 aswell), so I thought offering a
> > > static configuration via device tree is a good start. Should there be
> > > runtime configuration possible later the device tree settings could
> > > provide a good default.
> > 
> > What exactly do the restrictions look like and how often do they vary in
> > practice (can we get away with just doing a single static setup in the
> > driver)? I'd have thought it should be fairly straightforward to have a
> > table of valid mappings and just pick the first free memory interface?
> 
> I think this could be done. I checked the possible connections in the
> crossbar switch and it seems all memory interfaces can be connected with
> all relevant external interfaces. So indeed the memory interfaces could
> be dynamically allocated instead of statically associated to an
> external interface. There are two problems I see: Some memory interfaces
> are limited in the rates they support, they can only do 8k/16k/32k (for
> speech). How can we know such memory interface should be used? Also
The 2 memif are "DAI" and "MOD_DAI", designed for speech cases, and they
should be only connected to corresponding external interface "DAI/BT"
and "modem", respectively. We don't need to put them into dynamic
allocation. 
> there are two programmable hardware gain blocks which can be inserted to
> the digital audio path using the crossbar switch. There must be some
> mechanism to configure them into different places.
Maybe in DPCM, they can be "widgets", and we can define "routes" and
corresponding controls for them. 
> 
> Sascha
> 



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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-21 10:15           ` Koro Chen
@ 2015-04-21 10:56             ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2015-04-21 10:56 UTC (permalink / raw)
  To: Koro Chen
  Cc: Sascha Hauer, robh+dt, matthias.bgg, perex, tiwai,
	srv_heupstream, linux-mediatek, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

On Tue, Apr 21, 2015 at 06:15:06PM +0800, Koro Chen wrote:
> On Tue, 2015-04-21 at 11:49 +0200, Sascha Hauer wrote:

> > there are two programmable hardware gain blocks which can be inserted to
> > the digital audio path using the crossbar switch. There must be some
> > mechanism to configure them into different places.

> Maybe in DPCM, they can be "widgets", and we can define "routes" and
> corresponding controls for them. 

Yes, exactly - it's basically just like a CODEC.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-20 20:48       ` Mark Brown
  2015-04-21  9:49         ` Sascha Hauer
@ 2015-04-22  3:17         ` Koro Chen
  2015-04-30 20:12           ` Mark Brown
  1 sibling, 1 reply; 20+ messages in thread
From: Koro Chen @ 2015-04-22  3:17 UTC (permalink / raw)
  To: Mark Brown
  Cc: Sascha Hauer, robh+dt, matthias.bgg, perex, tiwai,
	srv_heupstream, linux-mediatek, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

On Mon, 2015-04-20 at 21:48 +0100, Mark Brown wrote:
> On Mon, Apr 20, 2015 at 06:37:47AM +0200, Sascha Hauer wrote:
> > On Sat, Apr 18, 2015 at 06:34:07PM +0100, Mark Brown wrote:
> > > On Fri, Apr 10, 2015 at 04:14:07PM +0800, Koro Chen wrote:
> 
> > > > +Each external interface (called "IO" in this driver) is presented as a
> > > > +DAI to ASoC. An IO must be connected via the interconnect to a memif.
> > > > +The connection paths are configured through the device tree.
> 
> > > Why are these connection paths configured via device tree?  I would
> > > expect that either there would be runtime configurability of these
> > > things (particularly if loopback configurations within the hardware are
> > > possible) or we'd just allocate memory interfaces to DAIs automatically
> > > as DAIs come into use.
> 
> > There is a crossbar switch between the memory interfaces and the DAIs.
> > Not every connection is possible, so not every memory interface can be
> > used for every DAI. An algorithm choosing a suitable memory interface
> > must be quite clever, complicated and also SoC dependent (the same but
> > different hardware is used on MT8135 aswell), so I thought offering a
> > static configuration via device tree is a good start. Should there be
> > runtime configuration possible later the device tree settings could
> > provide a good default.
> 
> What exactly do the restrictions look like and how often do they vary in
> practice (can we get away with just doing a single static setup in the
> driver)?  I'd have thought it should be fairly straightforward to have a
> table of valid mappings and just pick the first free memory interface?
> I'd rather not get stuck with the tables in the DT.  It's partly to
> avoid setting bad precendents, we really don't want everyone coming
> along hard coding this stuff, and partly because the hardware you
> described didn't seem that hard to handle.
> 
If using DPCM, it seems the most suitable FE DAIs will be memif, and
external interface like I2S should be BE DAIs. Do you think it is
suitable for our memif to be FE DAIs? Then which memif to used can be
described in a machine driver's FE DAIs. But I think this has a problem
that our memif is one-direction, playback or capture. So the binded pcm
device cannot have playback and capture capability together. May it
cause trouble for user space apps that assumes there will be pcmC0D0p,
pcmC0D0c?

> > > > +- mem-interface-playback:
> > > > +  mem-interface-capture: property of memif, format is: <memif irq use_sram>;
> > > > +	                 memif: which memif to be used
> > > > +			        (defined in include/dt-bindings/sound/mtk-afe.h)
> > > > +		         irq: which irq to be used
> > > > +			      (defined in include/dt-bindings/sound/mtk-afe.h)
> > > > +		         use_sram: 1 is yes, 0 is no
> 
> > > Again, this looks like stuff we should be able to figure out at runtime
> > > - the use of SRAM in particular looks like something we might want to
> > > change depending on use case.  Assuming it adds buffering then for a
> > > VoIP application we might not want to use SRAM to minimize latency but
> > > during music playback we might want to enable SRAM to minimize power
> > > consumption.
> 
> > That's exactly the usecase. How could such a runtime configurability
> > look like? sysfs? Or something based on the buffer sizes?
> 
> Yeah, one of those :) but probably an ALSA control is going to be the
> easiest for applications.



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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-22  3:17         ` Koro Chen
@ 2015-04-30 20:12           ` Mark Brown
  2015-05-04  1:57             ` Koro Chen
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2015-04-30 20:12 UTC (permalink / raw)
  To: Koro Chen
  Cc: Sascha Hauer, robh+dt, matthias.bgg, perex, tiwai,
	srv_heupstream, linux-mediatek, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

[-- Attachment #1: Type: text/plain, Size: 902 bytes --]

On Wed, Apr 22, 2015 at 11:17:20AM +0800, Koro Chen wrote:

> If using DPCM, it seems the most suitable FE DAIs will be memif, and
> external interface like I2S should be BE DAIs. Do you think it is
> suitable for our memif to be FE DAIs? Then which memif to used can be
> described in a machine driver's FE DAIs. But I think this has a problem
> that our memif is one-direction, playback or capture. So the binded pcm
> device cannot have playback and capture capability together. May it
> cause trouble for user space apps that assumes there will be pcmC0D0p,
> pcmC0D0c?

I think the only userspace application you really have to worry about
here is PulseAudio which (at least with UCM) should be able to cope
since it needs to handle things like USB microphones.  I think
everything else I can think of can either cope or has to handle the same
use cases as PulseAudio does so should have support.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver
  2015-04-30 20:12           ` Mark Brown
@ 2015-05-04  1:57             ` Koro Chen
  0 siblings, 0 replies; 20+ messages in thread
From: Koro Chen @ 2015-05-04  1:57 UTC (permalink / raw)
  To: Mark Brown
  Cc: Sascha Hauer, robh+dt, matthias.bgg, perex, tiwai,
	srv_heupstream, linux-mediatek, galak, lgirdwood, devicetree,
	linux-arm-kernel, linux-kernel, alsa-devel

On Thu, 2015-04-30 at 21:12 +0100, Mark Brown wrote:
> On Wed, Apr 22, 2015 at 11:17:20AM +0800, Koro Chen wrote:
> 
> > If using DPCM, it seems the most suitable FE DAIs will be memif, and
> > external interface like I2S should be BE DAIs. Do you think it is
> > suitable for our memif to be FE DAIs? Then which memif to used can be
> > described in a machine driver's FE DAIs. But I think this has a problem
> > that our memif is one-direction, playback or capture. So the binded pcm
> > device cannot have playback and capture capability together. May it
> > cause trouble for user space apps that assumes there will be pcmC0D0p,
> > pcmC0D0c?
> 
> I think the only userspace application you really have to worry about
> here is PulseAudio which (at least with UCM) should be able to cope
> since it needs to handle things like USB microphones.  I think
> everything else I can think of can either cope or has to handle the same
> use cases as PulseAudio does so should have support.
Thank you very much for the feedback, I will try DPCM.
  



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

end of thread, other threads:[~2015-05-04  1:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1428653649-38200-1-git-send-email-koro.chen@mediatek.com>
     [not found] ` <1428653649-38200-2-git-send-email-koro.chen@mediatek.com>
2015-04-18 17:34   ` [RESEND RFC PATCH 1/3] ASoC: mediatek: Add binding support for AFE driver Mark Brown
2015-04-20  4:37     ` Sascha Hauer
2015-04-20 20:48       ` Mark Brown
2015-04-21  9:49         ` Sascha Hauer
2015-04-21 10:14           ` Mark Brown
2015-04-21 10:15           ` Koro Chen
2015-04-21 10:56             ` Mark Brown
2015-04-22  3:17         ` Koro Chen
2015-04-30 20:12           ` Mark Brown
2015-05-04  1:57             ` Koro Chen
     [not found] ` <1428653649-38200-3-git-send-email-koro.chen@mediatek.com>
2015-04-18 17:37   ` [RESEND RFC PATCH 2/3] ASoC: mediatek: Add AFE connection control Mark Brown
2015-04-20  4:50     ` Sascha Hauer
2015-04-20 20:52       ` Mark Brown
2015-04-21  5:50         ` Sascha Hauer
2015-04-21 10:15           ` Mark Brown
     [not found] ` <1428653649-38200-4-git-send-email-koro.chen@mediatek.com>
2015-04-18 17:51   ` [RESEND RFC PATCH 3/3] ASoC: mediatek: Add AFE platform driver Mark Brown
2015-04-20  6:22     ` Koro Chen
2015-04-20 20:55       ` Mark Brown
2015-04-21  2:27         ` Koro Chen
2015-04-21 10:05           ` 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).