All of lore.kernel.org
 help / color / mirror / Atom feed
* ASoC: how to calculate dma size in tdm mode
@ 2012-08-09  9:56 Scott Jiang
  2012-08-09 10:38 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Jiang @ 2012-08-09  9:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

Hi Mark,

If user app use 2 channels but codec need 8 channels in tdm mode, I
need to copy this data from user space to dma buffer. I wonder how to
calculate dma size, snd_pcm_hardware.buffer_bytes_max or
buffer_bytes_max * tdm_channels / channels_min?

Thanks,
Scott

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

* Re: ASoC: how to calculate dma size in tdm mode
  2012-08-09  9:56 ASoC: how to calculate dma size in tdm mode Scott Jiang
@ 2012-08-09 10:38 ` Mark Brown
  2012-08-10  2:46   ` Scott Jiang
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-08-09 10:38 UTC (permalink / raw)
  To: Scott Jiang; +Cc: alsa-devel

On Thu, Aug 09, 2012 at 05:56:57PM +0800, Scott Jiang wrote:

> If user app use 2 channels but codec need 8 channels in tdm mode, I
> need to copy this data from user space to dma buffer. I wonder how to
> calculate dma size, snd_pcm_hardware.buffer_bytes_max or
> buffer_bytes_max * tdm_channels / channels_min?

I'm not sure which data you mean here?  It sounds like your hardware
doesn't support stereo DMA, if that's the case your capabilites should
reflect it.  With most hardware you'd just do a normal stereo playback
here, the unused TDM timeslots would not be visible outside of the DAI.

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

* Re: ASoC: how to calculate dma size in tdm mode
  2012-08-09 10:38 ` Mark Brown
@ 2012-08-10  2:46   ` Scott Jiang
  0 siblings, 0 replies; 3+ messages in thread
From: Scott Jiang @ 2012-08-10  2:46 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

2012/8/9 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Thu, Aug 09, 2012 at 05:56:57PM +0800, Scott Jiang wrote:
>
>> If user app use 2 channels but codec need 8 channels in tdm mode, I
>> need to copy this data from user space to dma buffer. I wonder how to
>> calculate dma size, snd_pcm_hardware.buffer_bytes_max or
>> buffer_bytes_max * tdm_channels / channels_min?
>
> I'm not sure which data you mean here?  It sounds like your hardware
> doesn't support stereo DMA, if that's the case your capabilites should
> reflect it.  With most hardware you'd just do a normal stereo playback
> here, the unused TDM timeslots would not be visible outside of the DAI.

I'm not sure what stereo DMA mean. Our hardware supports mask that
choose which slot is active,but I can't solve the problem that app
channel order is different from that required by codec.
For example, app is 1L1R2L2R, ad1836 requires 1L2Lxx1R2Rxx.
So I choose to copy one by one.

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

end of thread, other threads:[~2012-08-10  2:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-09  9:56 ASoC: how to calculate dma size in tdm mode Scott Jiang
2012-08-09 10:38 ` Mark Brown
2012-08-10  2:46   ` Scott Jiang

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.