From: Alexey Klimov <alexey.klimov@linaro.org>
To: Vinod Koul <vkoul@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Srinivas Kandagatla <srini@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>
Cc: Patrick Lai <plai@qti.qualcomm.com>,
Annemarie Porter <annemari@quicinc.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
kernel@oss.qualcomm.com,
Ekansh Gupta <ekansh.gupta@oss.qualcomm.com>,
Alexey Klimov <alexey.klimov@linaro.org>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Subject: [PATCH RFC 1/2] ALSA: compress: add raw opus codec define and struct snd_dec_opus
Date: Mon, 16 Jun 2025 16:26:22 +0100 [thread overview]
Message-ID: <20250616-opus_codec_rfc_v1-v1-1-1f70b0a41a70@linaro.org> (raw)
In-Reply-To: <20250616-opus_codec_rfc_v1-v1-0-1f70b0a41a70@linaro.org>
Adds a raw opus codec define and raw opus decoder struct.
This is for raw OPUS packets not packed in any type of container
(for instance OGG container). The decoder struct fields
are taken from corresponding RFC document.
This is based on earlier work done by
Annemarie Porter <annemari@quicinc.com>
Cc: Annemarie Porter <annemari@quicinc.com>
Cc: Srinivas Kandagatla <srini@kernel.org>
Cc: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
include/uapi/sound/compress_params.h | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
index bc7648a30746f4632ecf6695868e79550a431dfa..f80989f7bdd2f1bfad843b1dc30fa263e083d17a 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_OPUS_RAW ((__u32) 0x00000011)
+#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_OPUS_RAW
/*
* Profile and modes are listed with bit masks. This allows for a
@@ -324,6 +325,23 @@ struct snd_dec_ape {
__u32 seek_table_present;
} __attribute__((packed, aligned(4)));
+/*
+ * RFC with info on below OPUS decoder fields:
+ * https://www.rfc-editor.org/rfc/rfc7845#section-5
+ */
+struct snd_dec_opus {
+ __u8 version; /* must be 1 */
+ __u8 num_channels;
+ __u16 pre_skip;
+ __u32 sample_rate;
+ __u16 output_gain; /* in Q7.8 format */
+ __u8 mapping_family;
+ __u8 stream_count; /* part of channel mapping */
+ __u8 coupled_count; /* part of channel mapping */
+ __u8 channel_map;
+ __u8 reserved[7]; /* space for channel mapping */
+} __attribute__((packed, aligned(4)));
+
union snd_codec_options {
struct snd_enc_wma wma;
struct snd_enc_vorbis vorbis;
@@ -334,6 +352,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_opus opus_d;
struct {
__u32 out_sample_rate;
} src_d;
--
2.47.2
next prev parent reply other threads:[~2025-06-16 15:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 15:26 [PATCH RFC 0/2] Add raw OPUS codec support for compress offload Alexey Klimov
2025-06-16 15:26 ` Alexey Klimov [this message]
2025-06-18 12:33 ` [PATCH RFC 1/2] ALSA: compress: add raw opus codec define and struct snd_dec_opus Srinivas Kandagatla
2025-08-20 17:59 ` Alexey Klimov
2025-06-16 15:26 ` [PATCH RFC 2/2] ASoC: qcom: qdsp6/audioreach: add support for offloading raw opus playback Alexey Klimov
2025-06-18 12:34 ` Srinivas Kandagatla
2025-07-03 14:33 ` Alexey Klimov
2025-08-20 18:04 ` Alexey Klimov
2025-08-20 17:56 ` Alexey Klimov
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=20250616-opus_codec_rfc_v1-v1-1-1f70b0a41a70@linaro.org \
--to=alexey.klimov@linaro.org \
--cc=annemari@quicinc.com \
--cc=broonie@kernel.org \
--cc=ekansh.gupta@oss.qualcomm.com \
--cc=kernel@oss.qualcomm.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=plai@qti.qualcomm.com \
--cc=srini@kernel.org \
--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).