Re: [PATCH RFC 2/2] ASoC: qcom: qdsp6/audioreach: add support for offloading raw opus playback
From: Alexey Klimov
Date: Wed Aug 20 2025 - 13:58:29 EST
On Wed Jun 18, 2025 at 1:34 PM BST, Srinivas Kandagatla wrote:
>
>
> On 6/16/25 4:26 PM, Alexey Klimov wrote:
>> Add support for OPUS module, OPUS format ID, media format payload struct
>> and make it all recognizable by audioreach compress playback path.
>>
>> At this moment this only supports raw or plain OPUS packets not
>> encapsulated in container (for instance OGG container). For this usecase
>> each OPUS packet needs to be prepended with 4-bytes long length field
>> which is expected to be done by userspace applications. This is
>> Qualcomm DSP specific requirement.
>> > This patch is based on earlier work done by
>> Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx>
>
> Thanks for picking this up Alexey,
>
> Same, co-dev by should be good attribute for such things.
Thanks. I'll update it for the next version.
>> Cc: Annemarie Porter <annemari@xxxxxxxxxxx>
>> Cc: Srinivas Kandagatla <srini@xxxxxxxxxx>
>> Cc: Vinod Koul <vkoul@xxxxxxxxxx>
>> Signed-off-by: Alexey Klimov <alexey.klimov@xxxxxxxxxx>
>> ---
>> sound/soc/qcom/qdsp6/audioreach.c | 33 +++++++++++++++++++++++++++++++++
>> sound/soc/qcom/qdsp6/audioreach.h | 17 +++++++++++++++++
>> sound/soc/qcom/qdsp6/q6apm-dai.c | 3 ++-
>> sound/soc/qcom/qdsp6/q6apm.c | 3 +++
>> 4 files changed, 55 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c
>> index 4ebaaf736fb98a5a8a58d06416b3ace2504856e1..09e3a4da945d61b6915bf8b6f382c25ae94c5888 100644
>> --- a/sound/soc/qcom/qdsp6/audioreach.c
>> +++ b/sound/soc/qcom/qdsp6/audioreach.c
>> @@ -859,6 +859,7 @@ static int audioreach_set_compr_media_format(struct media_format *media_fmt_hdr,
>> struct payload_media_fmt_aac_t *aac_cfg;
>> struct payload_media_fmt_pcm *mp3_cfg;
>> struct payload_media_fmt_flac_t *flac_cfg;
>> + struct payload_media_fmt_opus_t *opus_cfg;
>>
>> switch (mcfg->fmt) {
>> case SND_AUDIOCODEC_MP3:
>> @@ -901,6 +902,38 @@ static int audioreach_set_compr_media_format(struct media_format *media_fmt_hdr,
>> flac_cfg->min_frame_size = mcfg->codec.options.flac_d.min_frame_size;
>> flac_cfg->max_frame_size = mcfg->codec.options.flac_d.max_frame_size;
>> break;
>> + case SND_AUDIOCODEC_OPUS_RAW:
>> + media_fmt_hdr->data_format = DATA_FORMAT_RAW_COMPRESSED;
>> + media_fmt_hdr->fmt_id = MEDIA_FMT_ID_OPUS;
>> + media_fmt_hdr->payload_size = sizeof(struct payload_media_fmt_opus_t);
>
> maybe sizeof(*opus_cfg)?
Ack.
Best regards,
Alexey