All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Shengjiu Wang <shengjiu.wang@nxp.com>,
	vkoul@kernel.org, perex@perex.cz, tiwai@suse.com,
	alsa-devel@alsa-project.org, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com,
	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: Tue, 6 Aug 2024 13:16:38 +0200	[thread overview]
Message-ID: <e89a56bf-c377-43d8-bba8-6a09e571ed64@linux.intel.com> (raw)
In-Reply-To: <1722940003-20126-2-git-send-email-shengjiu.wang@nxp.com>



On 8/6/24 12:26, Shengjiu Wang wrote:
> Add Sample Rate Converter(SRC) codec support, define the output
> format and rate for SRC.
> 
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
>  include/uapi/sound/compress_offload.h | 2 ++
>  include/uapi/sound/compress_params.h  | 9 ++++++++-
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h
> index 98772b0cbcb7..8b2b72f94e26 100644
> --- a/include/uapi/sound/compress_offload.h
> +++ b/include/uapi/sound/compress_offload.h
> @@ -112,10 +112,12 @@ struct snd_compr_codec_caps {
>   * end of the track
>   * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the
>   * beginning of the track
> + * @SNDRV_COMPRESS_SRC_RATIO_MOD: Resampling Ratio Modifier for sample rate converter
>   */
>  enum sndrv_compress_encoder {
>  	SNDRV_COMPRESS_ENCODER_PADDING = 1,
>  	SNDRV_COMPRESS_ENCODER_DELAY = 2,
> +	SNDRV_COMPRESS_SRC_RATIO_MOD = 3,
>  };

this sounds wrong to me. The sample rate converter is not an "encoder",
and the properties for padding/delay are totally specific to an encoder
function.

The other point is that I am not sure how standard this ratio_mod
parameter is. This could be totally specific to a specific
implementation, and another ASRC might have different parameters.

>  
>  /**
> diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
> index ddc77322d571..0843773ea6b4 100644
> --- a/include/uapi/sound/compress_params.h
> +++ b/include/uapi/sound/compress_params.h
> @@ -43,7 +43,8 @@
>  #define SND_AUDIOCODEC_BESPOKE               ((__u32) 0x0000000E)
>  #define SND_AUDIOCODEC_ALAC                  ((__u32) 0x0000000F)
>  #define SND_AUDIOCODEC_APE                   ((__u32) 0x00000010)
> -#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_APE
> +#define SND_AUDIOCODEC_SRC                   ((__u32) 0x00000011)
> +#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_SRC

I am not sure this is wise to change such definitions?
>  
>  /*
>   * Profile and modes are listed with bit masks. This allows for a
> @@ -324,6 +325,11 @@ struct snd_dec_ape {
>  	__u32 seek_table_present;
>  } __attribute__((packed, aligned(4)));
>  
> +struct snd_dec_src {
> +	__u32 format_out;
> +	__u32 rate_out;
> +} __attribute__((packed, aligned(4)));

Again I am not sure how standard those parameters are, and even if they
were if their representation is reusable.

And the compressed API has a good split between encoders and decoders, I
am not sure how an SRC can be classified as either.

>  union snd_codec_options {
>  	struct snd_enc_wma wma;
>  	struct snd_enc_vorbis vorbis;
> @@ -334,6 +340,7 @@ union snd_codec_options {
>  	struct snd_dec_wma wma_d;
>  	struct snd_dec_alac alac_d;
>  	struct snd_dec_ape ape_d;
> +	struct snd_dec_src src;
>  } __attribute__((packed, aligned(4)));
>  
>  /** struct snd_codec_desc - description of codec capabilities


  reply	other threads:[~2024-08-06 11:31 UTC|newest]

Thread overview: 40+ 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 [this message]
2024-08-06 11:39     ` Jeff Brower
2024-08-06 11:39       ` Jeff Brower
2024-08-08  9:17     ` Shengjiu Wang
2024-08-08  9:17       ` Shengjiu Wang
2024-08-08 11:27       ` Pierre-Louis Bossart
2024-08-08 11:27         ` Pierre-Louis Bossart
2024-08-08 12:02         ` Jaroslav Kysela
2024-08-08 12:02           ` Jaroslav Kysela
2024-08-08 12:19           ` Pierre-Louis Bossart
2024-08-08 12:19             ` Pierre-Louis Bossart
2024-08-08 15:51             ` Jaroslav Kysela
2024-08-08 15:51               ` Jaroslav Kysela
2024-08-09  7:19               ` Pierre-Louis Bossart
2024-08-09  7:19                 ` Pierre-Louis Bossart
2024-08-09 10:14                 ` Shengjiu Wang
2024-08-09 10:14                   ` Shengjiu Wang
2024-08-09 12:52                   ` Pierre-Louis Bossart
2024-08-09 12:52                     ` Pierre-Louis Bossart
2024-08-09 14:00                     ` Jaroslav Kysela
2024-08-09 14:00                       ` Jaroslav Kysela
2024-08-09 19:20                       ` Pierre-Louis Bossart
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
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-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=e89a56bf-c377-43d8-bba8-6a09e571ed64@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 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.