All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Mark Brown <broonie@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Olivier MOYSAN <olivier.moysan@st.com>,
	"kernel@stlinux.com" <kernel@stlinux.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Jonathan Cameron <jic23@kernel.org>,
	Alexandre TORGUE <alexandre.torgue@st.com>
Subject: Re: [RFC v2 4/7] ASoC: dmaengine_pcm: add copy support
Date: Wed, 15 Feb 2017 16:46:44 +0100	[thread overview]
Message-ID: <338f8db7-2077-626f-986b-b4e3df40469c@st.com> (raw)
In-Reply-To: <20170215145341.sntwx7oqyqmw6azv@sirena.org.uk>



On 02/15/2017 03:53 PM, Mark Brown wrote:
> On Wed, Feb 15, 2017 at 02:59:18PM +0100, Arnaud Pouliquen wrote:
> 
>> For DFSDM we need to re-arrange samples after DMA transfer,
>> before sending them to application. For this, a copy ops(called
>> in snd_pcm_lib_read_transfer) alreday exists in snd_pcm_ops
>> struct.
> 
> No, copy() is an alternative to doing DMA rather than something
> that works with DMA.  If you want to have some sort of post
> processing operation it shoudn't be called copy().  It's probably
> worth considering just making a new format and letting userspace
> convert things here.
> 
You mean using a plug-in alsa to do it? this seems not possible with
tiny-alsa...
Without a plug-in, driver will not be compatible with standard audio
application.

I'm newbies in alsa plugin But it seems quite tricky to do it. This
solution means that userspace has to be aware on hardware constraint.
Processing to do is a mask on 8 LSB + a left shift on bits. T shift
value depends on several parameters: the SPI frequency, the sampling
rate and the filter parameters.
That means an alsa control to get scaling, handled by the plugin.

So i would prefer to find a way to do it in driver...

I saw that blackfin driver implements this kind of mechanism
(bf5xx_pcm_copy) to support the TDM mode. if i well understood the code
they process the TDM buffer filled by DMA. Samples are extracted from
the good TDM slots and copied in buffer that will be sent to userland.

Do you think this would be reasonable if i implement something similar
in my driver, without using the soc generic DMA engine?

Regards
Arnaud

WARNING: multiple messages have this Message-ID (diff)
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Mark Brown <broonie@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"kernel@stlinux.com" <kernel@stlinux.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	Olivier MOYSAN <olivier.moysan@st.com>
Subject: Re: [RFC v2 4/7] ASoC: dmaengine_pcm: add copy support
Date: Wed, 15 Feb 2017 16:46:44 +0100	[thread overview]
Message-ID: <338f8db7-2077-626f-986b-b4e3df40469c@st.com> (raw)
In-Reply-To: <20170215145341.sntwx7oqyqmw6azv@sirena.org.uk>



On 02/15/2017 03:53 PM, Mark Brown wrote:
> On Wed, Feb 15, 2017 at 02:59:18PM +0100, Arnaud Pouliquen wrote:
> 
>> For DFSDM we need to re-arrange samples after DMA transfer,
>> before sending them to application. For this, a copy ops(called
>> in snd_pcm_lib_read_transfer) alreday exists in snd_pcm_ops
>> struct.
> 
> No, copy() is an alternative to doing DMA rather than something
> that works with DMA.  If you want to have some sort of post
> processing operation it shoudn't be called copy().  It's probably
> worth considering just making a new format and letting userspace
> convert things here.
> 
You mean using a plug-in alsa to do it? this seems not possible with
tiny-alsa...
Without a plug-in, driver will not be compatible with standard audio
application.

I'm newbies in alsa plugin But it seems quite tricky to do it. This
solution means that userspace has to be aware on hardware constraint.
Processing to do is a mask on 8 LSB + a left shift on bits. T shift
value depends on several parameters: the SPI frequency, the sampling
rate and the filter parameters.
That means an alsa control to get scaling, handled by the plugin.

So i would prefer to find a way to do it in driver...

I saw that blackfin driver implements this kind of mechanism
(bf5xx_pcm_copy) to support the TDM mode. if i well understood the code
they process the TDM buffer filled by DMA. Samples are extracted from
the good TDM slots and copied in buffer that will be sent to userland.

Do you think this would be reasonable if i implement something similar
in my driver, without using the soc generic DMA engine?

Regards
Arnaud



WARNING: multiple messages have this Message-ID (diff)
From: arnaud.pouliquen@st.com (Arnaud Pouliquen)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC v2 4/7] ASoC: dmaengine_pcm: add copy support
Date: Wed, 15 Feb 2017 16:46:44 +0100	[thread overview]
Message-ID: <338f8db7-2077-626f-986b-b4e3df40469c@st.com> (raw)
In-Reply-To: <20170215145341.sntwx7oqyqmw6azv@sirena.org.uk>



On 02/15/2017 03:53 PM, Mark Brown wrote:
> On Wed, Feb 15, 2017 at 02:59:18PM +0100, Arnaud Pouliquen wrote:
> 
>> For DFSDM we need to re-arrange samples after DMA transfer,
>> before sending them to application. For this, a copy ops(called
>> in snd_pcm_lib_read_transfer) alreday exists in snd_pcm_ops
>> struct.
> 
> No, copy() is an alternative to doing DMA rather than something
> that works with DMA.  If you want to have some sort of post
> processing operation it shoudn't be called copy().  It's probably
> worth considering just making a new format and letting userspace
> convert things here.
> 
You mean using a plug-in alsa to do it? this seems not possible with
tiny-alsa...
Without a plug-in, driver will not be compatible with standard audio
application.

I'm newbies in alsa plugin But it seems quite tricky to do it. This
solution means that userspace has to be aware on hardware constraint.
Processing to do is a mask on 8 LSB + a left shift on bits. T shift
value depends on several parameters: the SPI frequency, the sampling
rate and the filter parameters.
That means an alsa control to get scaling, handled by the plugin.

So i would prefer to find a way to do it in driver...

I saw that blackfin driver implements this kind of mechanism
(bf5xx_pcm_copy) to support the TDM mode. if i well understood the code
they process the TDM buffer filled by DMA. Samples are extracted from
the good TDM slots and copied in buffer that will be sent to userland.

Do you think this would be reasonable if i implement something similar
in my driver, without using the soc generic DMA engine?

Regards
Arnaud

  reply	other threads:[~2017-02-15 15:46 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 16:38 [RFC v2 0/7] Add STM32 DFSDM support Arnaud Pouliquen
2017-02-13 16:38 ` Arnaud Pouliquen
2017-02-13 16:38 ` Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 1/7] iio: Add hardware consumer support Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
     [not found]   ` <1487003909-11710-2-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-19 14:13     ` Jonathan Cameron
2017-02-19 14:13       ` Jonathan Cameron
2017-02-19 14:13       ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 2/7] IIO: Add bindings for simple sigma delta adc Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-22 15:17   ` Rob Herring
2017-02-22 15:17     ` Rob Herring
2017-02-22 15:17     ` Rob Herring
2017-02-27 11:15     ` Arnaud Pouliquen
2017-02-27 11:15       ` Arnaud Pouliquen
2017-02-27 11:15       ` Arnaud Pouliquen
2017-03-05 11:04       ` Jonathan Cameron
2017-03-05 11:04         ` Jonathan Cameron
2017-03-05 11:04         ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 3/7] IIO: ADC: add sigma delta modulator support Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
     [not found]   ` <1487003909-11710-4-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-19 14:20     ` Jonathan Cameron
2017-02-19 14:20       ` Jonathan Cameron
2017-02-19 14:20       ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 4/7] ASoC: dmaengine_pcm: add copy support Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-14 17:16   ` Mark Brown
2017-02-14 17:16     ` Mark Brown
2017-02-14 17:16     ` Mark Brown
2017-02-15 13:59     ` Arnaud Pouliquen
2017-02-15 13:59       ` Arnaud Pouliquen
2017-02-15 13:59       ` Arnaud Pouliquen
     [not found]       ` <40633f7c-a2ac-1658-cc9d-b30eaff8a95a-qxv4g6HH51o@public.gmane.org>
2017-02-15 14:53         ` Mark Brown
2017-02-15 14:53           ` Mark Brown
2017-02-15 14:53           ` Mark Brown
2017-02-15 15:46           ` Arnaud Pouliquen [this message]
2017-02-15 15:46             ` Arnaud Pouliquen
2017-02-15 15:46             ` Arnaud Pouliquen
     [not found]             ` <338f8db7-2077-626f-986b-b4e3df40469c-qxv4g6HH51o@public.gmane.org>
2017-02-16 20:14               ` Mark Brown
2017-02-16 20:14                 ` Mark Brown
2017-02-16 20:14                 ` Mark Brown
2017-02-27  9:05                 ` Arnaud Pouliquen
2017-02-27  9:05                   ` Arnaud Pouliquen
2017-02-27  9:05                   ` Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 5/7] ASoC: stm32: add DFSDM DAI support Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
     [not found]   ` <1487003909-11710-6-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-13 18:13     ` Peter Meerwald-Stadler
2017-02-13 18:13       ` Peter Meerwald-Stadler
     [not found]       ` <alpine.DEB.2.02.1702131906350.25127-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2017-02-14 11:09         ` Arnaud Pouliquen
2017-02-14 11:09           ` Arnaud Pouliquen
     [not found]           ` <c381a9a2-5dff-af9a-eeb0-8fd1a74f448e-qxv4g6HH51o@public.gmane.org>
2017-02-14 12:57             ` Peter Meerwald-Stadler
2017-02-14 12:57               ` Peter Meerwald-Stadler
2017-02-14 17:45     ` Mark Brown
2017-02-14 17:45       ` Mark Brown
2017-02-14 17:45       ` Mark Brown
2017-02-15 16:39       ` Arnaud Pouliquen
2017-02-15 16:39         ` Arnaud Pouliquen
2017-02-15 16:39         ` Arnaud Pouliquen
     [not found]         ` <9b875a75-294a-2f59-5830-cc0f6b3b62c7-qxv4g6HH51o@public.gmane.org>
2017-02-15 16:53           ` Mark Brown
2017-02-15 16:53             ` Mark Brown
2017-02-15 16:53             ` Mark Brown
     [not found]       ` <20170214174534.35ytbpax75mxcayg-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-02-19 14:56         ` Jonathan Cameron
2017-02-19 14:56           ` Jonathan Cameron
2017-02-19 14:56           ` Jonathan Cameron
2017-02-27 10:31           ` Arnaud Pouliquen
2017-02-27 10:31             ` Arnaud Pouliquen
2017-02-27 10:31             ` Arnaud Pouliquen
     [not found]             ` <84f330ab-48a2-6e0b-ab95-6aab5b34c241-qxv4g6HH51o@public.gmane.org>
2017-03-05 10:55               ` Jonathan Cameron
2017-03-05 10:55                 ` Jonathan Cameron
2017-03-05 10:55                 ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 6/7] IIO: add bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-19 15:00   ` Jonathan Cameron
2017-02-19 15:00     ` Jonathan Cameron
2017-02-19 15:00     ` Jonathan Cameron
2017-02-27 10:47     ` Arnaud Pouliquen
2017-02-27 10:47       ` Arnaud Pouliquen
2017-02-27 10:47       ` Arnaud Pouliquen
     [not found]       ` <7fbfc694-3685-ec90-6292-5a5157a8a0d2-qxv4g6HH51o@public.gmane.org>
2017-03-05 11:00         ` Jonathan Cameron
2017-03-05 11:00           ` Jonathan Cameron
2017-03-05 11:00           ` Jonathan Cameron
     [not found]   ` <1487003909-11710-7-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-13 18:05     ` Peter Meerwald-Stadler
2017-02-13 18:05       ` Peter Meerwald-Stadler
2017-02-22 16:42     ` Rob Herring
2017-02-22 16:42       ` Rob Herring
2017-02-22 16:42       ` Rob Herring
2017-02-27 14:07       ` Arnaud Pouliquen
2017-02-27 14:07         ` Arnaud Pouliquen
2017-02-27 14:07         ` Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 7/7] IIO: ADC: add stm32 DFSDM support Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-13 16:38   ` Arnaud Pouliquen
2017-02-19 14:46   ` Jonathan Cameron
2017-02-19 14:46     ` Jonathan Cameron
2017-02-19 14:46     ` Jonathan Cameron
2017-02-27 10:09     ` Arnaud Pouliquen
2017-02-27 10:09       ` Arnaud Pouliquen
2017-02-27 10:09       ` Arnaud Pouliquen
     [not found]       ` <fe86eca5-5dca-efb3-45d2-46e193f60dc9-qxv4g6HH51o@public.gmane.org>
2017-03-05 10:55         ` Jonathan Cameron
2017-03-05 10:55           ` Jonathan Cameron
2017-03-05 10:55           ` Jonathan Cameron

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=338f8db7-2077-626f-986b-b4e3df40469c@st.com \
    --to=arnaud.pouliquen@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kernel@stlinux.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@st.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.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 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.