public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Mark Brown <broonie@kernel.org>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	atalambedu@nvidia.com, linux-kernel@vger.kernel.org,
	Sameer Pujar <spujar@nvidia.com>,
	lgirdwood@gmail.com, tiwai@suse.com, viswanathl@nvidia.com,
	sharadg@nvidia.com, robh+dt@kernel.org, thierry.reding@gmail.com,
	linux-tegra@vger.kernel.org, digetx@gmail.com,
	rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com
Subject: Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver
Date: Mon, 24 Feb 2020 11:28:57 +0000	[thread overview]
Message-ID: <47f94534-e997-d56c-5793-ae832fb2add4@nvidia.com> (raw)
In-Reply-To: <20200221165535.GG5546@sirena.org.uk>


On 21/02/2020 16:55, Mark Brown wrote:
> On Fri, Feb 21, 2020 at 02:31:05PM +0000, Jon Hunter wrote:
>> On 21/02/2020 13:00, Mark Brown wrote:
> 
>>>> +	srate = params_rate(params);
>>>> +	if (dmic->srate_override)
>>>> +		srate = dmic->srate_override;
> 
>>> How does this work for userspace?  If we just ignore the sample rate we
>>> were asked for I'd expect that the application would get upset.
> 
>> Tegra has a hardware sample rate converter (though driver not yet
>> upstream or part of this initial series) and if using the sample-rate
>> converter, then the actual rate captured by the DMIC interface could be
>> different from the resulting sample-rate.
> 
> The ideal thing in a component model would be to represent those sample
> rate convertors directly to usrspace so the routing and rewriting is
> explicit.

I assume that it would be OK for the sample rate converter itself to
expose mixer controls to configure its input and output rates so the
user could configure as needed?

>> So we want a way to indicate to the DMIC it is capturing at rate X,
>> while the resulting sample-rate is Y.
> 
>> I am not sure if there is a better way to do this? Ideally, the DMIC
>> would query the rate from the upstream MUX it is connected to, but I am
>> not sure if there is a way to do that. So right now it is a manual
>> process and the user has to configure these which are not ideal.
> 
> Is there any *need* for these to be user configurable?  What's normally
> happening at the minute is that either the external DAIs are fixed
> configuration and the DSP just converts everything or there's no format
> conversion done and things get passed through.

I can see that in most cases there are a finite set of configurations
that the end user may use. However, we would like to make the
configuration flexible as possible and this also allow us to test lots
of different configurations for verification purposes as well.

So a typical scenario would be ...

DMIC --> SRC --> DMA

Where SRC is the sample-rate converter. Now, the DMICs support upto
48kHz and although it maybe unlikely that someone would want to up
convert to say 96kHz, it is possible we can do this with the SRC.

So if the user executes arecord with '-r 96000', the DMIC hw_params
would return an error as this is not supported. So today we override
this. However, the best solution would be to allow the user the set the
input of the SRC and then if the DMIC output is routed via the SRC use
the SRC input rate instead of the actual rate seen/specified by the
user. So like you said in your other mail, if we could propagate the
rate information that would be ideal.

Jon

-- 
nvpublic

  reply	other threads:[~2020-02-24 11:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20  6:34 [PATCH v3 00/10] add ASoC components for AHUB Sameer Pujar
2020-02-20  6:34 ` [PATCH v3 01/10] dt-bindings: sound: tegra: add DT binding " Sameer Pujar
2020-02-21 12:39   ` Mark Brown
2020-02-26 16:02   ` Rob Herring
2020-02-20  6:34 ` [PATCH v3 02/10] ASoC: tegra: add support for CIF programming Sameer Pujar
2020-02-20 14:30   ` Jon Hunter
2020-02-21  5:27   ` Dmitry Osipenko
2020-02-20  6:34 ` [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver Sameer Pujar
2020-02-20 14:36   ` Jon Hunter
2020-02-21  5:53   ` Dmitry Osipenko
2020-02-21 13:00   ` Mark Brown
2020-02-21 14:31     ` Jon Hunter
2020-02-21 16:55       ` Mark Brown
2020-02-24 11:28         ` Jon Hunter [this message]
2020-02-24 11:44           ` Mark Brown
2020-02-24 12:29             ` Sameer Pujar
2020-02-24 13:18               ` Mark Brown
2020-02-28  7:30     ` Viswanath L
2020-02-20  6:34 ` [PATCH v3 04/10] ASoC: tegra: add Tegra210 based I2S driver Sameer Pujar
2020-02-20 14:45   ` Jon Hunter
2020-02-21 13:21   ` Mark Brown
2020-02-20  6:34 ` [PATCH v3 05/10] ASoC: tegra: add Tegra210 based AHUB driver Sameer Pujar
2020-02-20  6:51   ` Randy Dunlap
2020-02-20 15:08   ` Jon Hunter
2020-02-21 13:38   ` Mark Brown
2020-02-20  6:34 ` [PATCH v3 06/10] ASoC: tegra: add Tegra186 based DSPK driver Sameer Pujar
2020-02-20  6:53   ` Randy Dunlap
2020-02-20 15:10   ` Jon Hunter
2020-02-20  6:34 ` [PATCH v3 07/10] ASoC: tegra: add Tegra210 based ADMAIF driver Sameer Pujar
2020-02-20  6:55   ` Randy Dunlap
2020-02-20 15:16   ` Jon Hunter
2020-02-21  6:08   ` Dmitry Osipenko
2020-02-20  6:34 ` [PATCH v3 08/10] arm64: tegra: add AHUB components for few Tegra chips Sameer Pujar
2020-02-20 14:49   ` Jon Hunter
2020-02-20  6:34 ` [PATCH v3 09/10] arm64: tegra: enable AHUB modules " Sameer Pujar
2020-02-20 14:52   ` Jon Hunter
2020-02-20  6:34 ` [PATCH v3 10/10] arm64: defconfig: enable AHUB components for Tegra210 and later Sameer Pujar
2020-02-20 14:52   ` Jon Hunter
2020-02-21  5:44   ` Dmitry Osipenko

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=47f94534-e997-d56c-5793-ae832fb2add4@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=atalambedu@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=dramesh@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkumard@nvidia.com \
    --cc=rlokhande@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=sharadg@nvidia.com \
    --cc=spujar@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=tiwai@suse.com \
    --cc=viswanathl@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox