From: Lars-Peter Clausen <lars@metafoo.de>
To: Edward Cragg <edward.cragg@codethink.co.uk>, alsa-devel@alsa-project.org
Cc: ts001-ct@extlists.codethink.co.uk
Subject: Re: ASoC TDM channel re-mapping
Date: Mon, 17 Oct 2016 18:53:52 +0200 [thread overview]
Message-ID: <d8b134c7-e871-39ed-defc-8a3c7875d56f@metafoo.de> (raw)
In-Reply-To: <20161017083634.GD13157@codethink.co.uk>
On 10/17/2016 10:36 AM, Edward Cragg wrote:
> Hi,
>
> We have an ASoC driver in which we have added support for TDM over an I2S
> interface.
>
> We would like to have the capability of re-mapping the channel ordering, for
> which i know there is a callback in place to start this process,
> set_channel_map.
>
> The only backend implementation of this is using the ALSA API and the .copy
> handler in an ALSA PCM driver to mutate data copied out of ALSA before it's
> DMA'd to hardware. This is in sound/soc/blackfin/bf5xx-i2s-pcm.c
>
> The problem we have is that the driver we're using currently uses a dmaengine
> based PCM driver, and i'm not sure whether this is compatible with using the
> .copy callback, without reimplementing the driver entirely as an ALSA PCM
> driver.
>
> Since there aren't very many examples in mainline, I was hoping to ask for
> advice for the best way of doing this.
>
> I wondered:
>
> - Would it be possible to add a functional copy callback using a dmaengine
> based PCM driver?
> - Otherwise, would there be a good way to implement channel remapping in a
> TDM frame using the dmaengine based PCM driver?
> or
> - Would the best way indeed be to reimplement the PCM driver as a normal ALSA
> PCM driver?
Does your hardware support re-mapping? Or is this something you want to do
in the same style as the blackfin driver by having the kernel shuffle all
the samples around? If it is the later I'd recommend to implement this in
userspace. The general idea for kernel drivers is to advertise the hardware
capabilities, but not go beyond them and emulate missing functionality since
this can have unexpected performance impacts. (And yes, the Blackfin driver
should have never been implemented the way it is)
next prev parent reply other threads:[~2016-10-17 16:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 8:36 ASoC TDM channel re-mapping Edward Cragg
2016-10-17 16:53 ` Lars-Peter Clausen [this message]
2016-10-19 7:21 ` Edward Cragg
2025-06-17 3:20 ` [alsa-devel] " roycarlson56
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=d8b134c7-e871-39ed-defc-8a3c7875d56f@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=edward.cragg@codethink.co.uk \
--cc=ts001-ct@extlists.codethink.co.uk \
/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).