mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Riccardo Mereu <r.mereu.kernel@arduino.cc>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Michael McAllister <me@michaelmcallister.org>,
	Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>,
	Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ASoC: qcom: q6asm: fix 24-bit PCM level via media format V4/V5
Date: Tue,  1 Dec 2026 11:52:02 +0100	[thread overview]
Message-ID: <20261201105202.143108-1-r.mereu.kernel@arduino.cc> (raw)
In-Reply-To: <20261126115738.1765949-2-srinivas.kandagatla@oss.qualcomm.com>

Hi Srinivas,

On Thu, Nov 26, 2026 at 11:57:37AM +0000, Srinivas Kandagatla wrote:
> Both the V4 and V5 multichannel PCM media formats carry the sample word size

I see Mark has already applied both patches, so just a test report for
the record.

Tested on the Arduino UNO Q (QRB2210), on next-20261127 with our DP
audio patches on top. ADSP firmware ADSP.VT.5.4.1.c4-00013-KAMORTA
(Debian firmware-qcom-dsp 0~20261019).

The ADSP reports ASM API version 2, so this board takes the V5 path for
both playback and capture, on every frontend and format (bps/word size
16/16, 24/24, 32/32), with no DSP errors. The 8-entry channel map in the
V5 structs works fine on this firmware.

DP playback (MultiMedia4 -> SEC_MI2S_RX -> ANX7625), checked on the I2S
lines with a logic analyser (32-bit slots, BCLK 3.072 MHz, WS 48 kHz):

  format     left marker   right marker  bit walk
  S16_LE     0x40010000    0x20020000    15 bits, slot 30..16
  S24_3LE    0x40000100    0x20000200    23 bits, slot 30..8
  S32_LE     0x40000001    0x20000002    31 bits, slot 30..0
  S24_3LE,   0xbfffff00    0xdffffe00    sign in bit 31
  negated

All bit-exact, and S16/S24/S32 have the same loudness on a DP monitor
(before, S24 played about 48 dB too quiet). Headphones (codec DMA) play
S16_LE, S24_3LE and S32_LE without plug conversion, at the same level.

Headset mic capture (MultiMedia3 <- TX_CODEC_DMA_TX_3): S16_LE and
S24_3LE are now within 2 dB of each other with the same speech and sound
clean; before, S24 capture crackled. The low 8 bits of S24_3LE are
always zero here, but that is expected: the codec DMA backend runs at
S16_LE, so the DSP only pads.

PipeWire, without our S16 workaround, now opens DP and headphones at
S32_LE and the headset at S24_3LE, and all sound right.

Also fine: 20 open/close cycles in a row, 44.1 kHz S24_3LE resampled to
the 48 kHz backend, and DP plus headphones running at the same time.

Tested-by: Riccardo Mereu <r.mereu@arduino.cc>

Two nits, if you touch this code again:

> + * uses V4, which the QDSP6 firmware has supported since its introduction. (The
> + * old V2 format, which lacks the word size, is no longer used for playback.)

Capture moved to V4/V5 too (__q6asm_open_read() and
q6asm_enc_cfg_blk_pcm_format_support()), so "no longer used" without
"for playback" would be more accurate.

After this patch ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 and
struct asm_multi_channel_pcm_enc_cfg_v2 have no users left in q6asm.c.

Unrelated to this series, but found while testing: since commit
55207a5b6959 ("soundwire: qcom: add multi-master support") every boot
on this board hits the WARN_ON_ONCE() in qcom_swrm_port_target(), on the
first prepare of the codec DMA path. qcom_swrm_compute_params() leaves
port_params zeroed for ports whose qcom,ports-word-length is 0xff
(agatti.dtsi has several), and qcom_swrm_port_params() then writes
0xffffffff to DPn_BLOCK_CTRL_1(offset, 0). The write itself is old, the
WARN only made it visible. I've sent a small fix that skips those
ports: "soundwire: qcom: skip DPn_BLOCK_CTRL_1 for ports without a word
length".

https://lore.kernel.org/r/20261201104714.142340-1-r.mereu.kernel@arduino.cc

Thanks,
Riccardo

-- 





Privacy and Confidentiality Notice: This email and all attachments are 
confidential and for the designated recipient(s) only. They may also be 
privileged. If you are not the intended recipient or among the intended 
recipients, you may not use, read, retransmit, disseminate, store/copy the 
information in any medium or take any action in reliance upon it. Please 
notify the sender that you have received it in error and immediately delete 
the entire communication, including any attachments.

  parent reply	other threads:[~2026-12-01 10:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 11:57 Srinivas Kandagatla
2026-11-26 15:40 ` Mark Brown
2026-12-01 10:52 ` Riccardo Mereu [this message]
2026-12-01 10:57   ` Srinivas Kandagatla

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=20261201105202.143108-1-r.mereu.kernel@arduino.cc \
    --to=r.mereu.kernel@arduino.cc \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=me@michaelmcallister.org \
    --cc=mohammad.rafi.shaik@oss.qualcomm.com \
    --cc=perex@perex.cz \
    --cc=prasad.kumpatla@oss.qualcomm.com \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --cc=tiwai@suse.com \
    /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

all inboxes | Powered by JetHome®