Add raw OPUS codec support for compress offload
Get series with b4
b4 am [email protected] change-id 20250616-opus_codec_rfc_v1-b60bd308893bVersions newest first
- v3 Latest3 patches 5 repliesIn review
- v22 patches 3 repliesSuperseded
- v1 posting 2/22 patches 1 replySuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC posting 1/2 | 2 patches | 6 replies | Superseded |
Changes in v3 from the cover letter
- back to define version member as __u8 in snd_dec_opus and reading it in audioreach_set_compr_media_format() as suggested by Takashi;
- new patch, bumping compress API minor version as suggested by Vinod and Takashi;
- Link to v2: https://lore.kernel.org/r/[email protected]
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | ALSA: compress: add raw opus codec define and opus decoder structsinclude/ | +42 | 2 replies | |
| 2/3 | ALSA: compress_offload: increase SNDRV_COMPRESS_VERSION minor version by 1include/ | +1 | 1 reply | |
| 3/3 | ASoC: qcom: qdsp6/audioreach: add support for offloading raw opus playbacksound/ sound/ sound/ +1 more | +49 | 1 reply |
Reviews trailers per patch
2 of 3 patches have a Reviewed-by or Acked-by.
| Patch | Mark Brown | Vinod Koul |
|---|---|---|
| 1/3 | ||
| 2/3 | A-b | |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/3] Add raw OPUS codec support for compress offload
This series adds support in kernel to recognise raw (or plain) OPUS codec playback for compress offloading. At this point this series doesn't deal with OPUS packets packed in any kind of containers (OGG or others) and focuses on adding missing bits for pure OPUS packets.
The second patch adds its usage in Qualcomm Audio DSP code. To correctly recognise raw OPUS packets by qdsp6, each packets needs to be prepended with 4-bytes field that contains length of a raw OPUS packet. It is expected to be useful for usecases when OPUS packets are streamed over network and they are not encapsulated in a container. Userspace application that will use the compress API has to manually add such 4-bytes long field to each OPUS packet.
This is tested on sm8750-mtp. It is expected that next hardware revisions will also support raw OPUS codec offloading.
Dependencies are:
-- hardware with DSP that supports decoding OPUS packets (>= Qualcomm sm8750); -- adsp fastrpc;
-- explicitly setting format in sm8750 soundcard driver
https://lore.kernel.org/linux-sound/[email protected]/
-- running adsprpcd tool with support for Audio PD and DSP libraries loading support (or its alternative);
-- tinycompress fcplay tool that will prepare raw opus packets and do the required addition of length field;
-- mfc module in topology compress-playback path, that module is expected to parse channel mapping and do the required things to map streams/channels to physically-present output channels on backend.
The userspace tinycompress tool with support for raw OPUS compress playback is located here:
https://github.com/laklimov/tinycompress_opus
branch: opus_v3_workinprogress
The userspace tool is not expected that it is ready and still needs some work, for instance recognition that it runs on Qualcomm hardware. More like working PoC.
---
Changes in v3:
- back to define version member as __u8 in snd_dec_opus and reading it in audioreach_set_compr_media_format() as suggested by Takashi;
- new patch, bumping compress API minor version as suggested by Vinod and Takashi;
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2 (as suggested by Vinod):
- opus decoder struct: switch version memeber to be union to allow reading it
as a byte or two 4-bits fields;
- audioreach_set_compr_media_format: read version byte.
- Link to v1: https://lore.kernel.org/r/[email protected]
Changes since RFC (mostly as suggetsed by Srini):
- added struct snd_dec_opus_ch_map to struct snd_dec_opus;
- changed tags;
- reworked comments for struct snd_dec_opus;
In qcom audioreach patch:
- corrected how {stream_count,coupled_count} is ejected from mcfg->codec;
- stopped dealing with channel mapping parsing (this is internal struct for decoder on audio DSP side);
- used sizeof(*opus_cfg) for payload size;
Tinycompress/fcplay:
- small updates to match kernel structs.
- Link to RFC: https://lore.kernel.org/r/[email protected]
---
Alexey Klimov (3):
ALSA: compress: add raw opus codec define and opus decoder structs
ALSA: compress_offload: increase SNDRV_COMPRESS_VERSION minor version by 1
ASoC: qcom: qdsp6/audioreach: add support for offloading raw opus playback
include/uapi/sound/compress_offload.h | 2 +- include/uapi/sound/compress_params.h | 43 ++++++++++++++++++++++++++++++++++- sound/soc/qcom/qdsp6/audioreach.c | 27 ++++++++++++++++++++++ sound/soc/qcom/qdsp6/audioreach.h | 17 ++++++++++++++ sound/soc/qcom/qdsp6/q6apm-dai.c | 3 ++- sound/soc/qcom/qdsp6/q6apm.c | 3 +++ 6 files changed, 92 insertions(+), 3 deletions(-)
---
base-commit: 05af764719214d6568adb55c8749dec295228da8
change-id: 20250616-opus_codec_rfc_v1-b60bd308893b
Best regards,
Signature · 1 line
Alexey Klimov <[email protected]>