From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Jaroslav Kysela <perex@perex.cz>,
Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: Shengjiu Wang <shengjiu.wang@nxp.com>,
vkoul@kernel.org, tiwai@suse.com, alsa-devel@alsa-project.org,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com,
lgirdwood@gmail.com, broonie@kernel.org,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH 1/6] ALSA: compress: add Sample Rate Converter codec support
Date: Mon, 12 Aug 2024 15:43:05 +0200 [thread overview]
Message-ID: <7dc039db-ecce-4650-8eb7-96d0cfde09a2@linux.intel.com> (raw)
In-Reply-To: <2be4303e-58e1-4ad7-92cf-f06fa6fa0f08@perex.cz>
On 8/12/24 15:31, Jaroslav Kysela wrote:
> On 12. 08. 24 12:24, Shengjiu Wang wrote:
>> On Fri, Aug 9, 2024 at 10:01 PM Jaroslav Kysela <perex@perex.cz> wrote:
>>>
>>> On 09. 08. 24 14:52, Pierre-Louis Bossart wrote:
>>>
>>>>> And metadata
>>>>> ioctl can be called many times which can meet the ratio modifier
>>>>> requirement (ratio may be drift on the fly)
>>>>
>>>> Interesting, that's yet another way of handling the drift with
>>>> userspace
>>>> modifying the ratio dynamically. That's different to what I've seen
>>>> before.
>>>
>>> Note that the "timing" is managed by the user space with this scheme.
>>>
>>>>> And compress API uses codec as the unit for capability query and
>>>>> parameter setting, So I think need to define "SND_AUDIOCODEC_SRC'
>>>>> and 'struct snd_dec_src', for the 'snd_dec_src' just defined output
>>>>> format and output rate, channels definition just reuse the
>>>>> snd_codec.ch_in.
>>>>
>>>> The capability query is an interesting point as well, it's not clear
>>>> how
>>>> to expose to userspace what this specific implementation can do, while
>>>> at the same time *requiring* userpace to update the ratio dynamically.
>>>> For something like this to work, userspace needs to have pre-existing
>>>> information on how the SRC works.
>>>
>>> Yes, it's about abstraction. The user space wants to push data, read
>>> data back
>>> converted to the target rate and eventually modify the drift using a
>>> control
>>> managing clocks using own way. We can eventually assume, that if this
>>> control
>>> does not exist, the drift cannot be controlled. Also, nice thing is
>>> that the
>>> control has min and max values (range), so driver can specify the
>>> drift range,
>>> too.
>>>
>>> And again, look to "PCM Rate Shift 100000" control implementation in
>>> sound/drivers/aloop.c. It would be nice to have the base offset for the
>>> shift/drift/pitch value standardized.
>>
>> Thanks.
>>
>> But the ASRC driver I implemented is different, I just register one sound
>> card, one device/subdevice. but the ASRC hardware support 4 instances
>> together, so user can open the card device 4 times to create 4 instances
>> then the controls can only bind with compress streams.
>
> It's just a reason to add the subdevice code for the compress offload
> layer like we have in other APIs for overall consistency. I'll try to
> work on this.
I thought this was supported already? I remember there was a request to
enable more than one compressed stream for enhanced cross-fade support
with different formats? That isn't supported with the single-device +
PARTIAL_DRAIN method.
Vinod?
>> I think I can remove the 'SNDRV_COMPRESS_SRC_RATIO_MOD',
>
> Yes.
>
>> Only define a private type for driver, which means only the ASRC driver
>> and its user application know the type.
>
> The control API should be used for this IMHO.
Agree, this would be a 'clean' split where the compress API is used for
the data parts and the control parts used otherwise to alter the ratio
or whatever else is needed.
>> For the change in 'include/uapi/sound/compress_params.h", should I
>> keep them, is there any other suggestion for them?
You can add the SRC type but if you use a control for the parameters you
don't need to add anything for the encoder options, do you?
next prev parent reply other threads:[~2024-08-12 22:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 10:26 [RFC PATCH 0/6] ASoC: fsl: add memory to memory function for ASRC Shengjiu Wang
2024-08-06 10:26 ` [RFC PATCH 1/6] ALSA: compress: add Sample Rate Converter codec support Shengjiu Wang
2024-08-06 11:16 ` Pierre-Louis Bossart
2024-08-06 11:39 ` Jeff Brower
2024-08-08 9:17 ` Shengjiu Wang
2024-08-08 11:27 ` Pierre-Louis Bossart
2024-08-08 12:02 ` Jaroslav Kysela
2024-08-08 12:19 ` Pierre-Louis Bossart
2024-08-08 15:51 ` Jaroslav Kysela
2024-08-09 7:19 ` Pierre-Louis Bossart
2024-08-09 10:14 ` Shengjiu Wang
2024-08-09 12:52 ` Pierre-Louis Bossart
2024-08-09 14:00 ` Jaroslav Kysela
2024-08-09 19:20 ` Pierre-Louis Bossart
2024-08-12 10:24 ` Shengjiu Wang
2024-08-12 13:31 ` Jaroslav Kysela
2024-08-12 13:43 ` Pierre-Louis Bossart [this message]
2024-08-14 2:22 ` Shengjiu Wang
2024-08-14 9:40 ` Pierre-Louis Bossart
2024-08-14 11:12 ` Shengjiu Wang
2024-08-14 11:58 ` Pierre-Louis Bossart
2024-08-14 14:48 ` Jaroslav Kysela
2024-08-09 13:51 ` Jaroslav Kysela
2024-08-06 10:26 ` [RFC PATCH 2/6] ASoC: fsl_asrc: define functions for memory to memory usage Shengjiu Wang
2024-08-06 10:26 ` [RFC PATCH 3/6] ASoC: fsl_easrc: " Shengjiu Wang
2024-08-06 10:26 ` [RFC PATCH 4/6] ASoC: fsl_asrc_m2m: Add memory to memory function Shengjiu Wang
2024-08-06 10:26 ` [RFC PATCH 5/6] ASoC: fsl_asrc: register m2m platform device Shengjiu Wang
2024-08-06 10:26 ` [RFC PATCH 6/6] ASoC: fsl_easrc: " Shengjiu Wang
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=7dc039db-ecce-4650-8eb7-96d0cfde09a2@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=Xiubo.Lee@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=shengjiu.wang@gmail.com \
--cc=shengjiu.wang@nxp.com \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
/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).