Skip to content

ASoC: Add q6voice ready for FP5 (on v7.1-kernel) - #32

Open
wrenix wants to merge 28 commits into
sc7280-mainline:sc7280-7.1.yfrom
wrenix:sc7280-7.1.y-voice
Open

ASoC: Add q6voice ready for FP5 (on v7.1-kernel)#32
wrenix wants to merge 28 commits into
sc7280-mainline:sc7280-7.1.yfrom
wrenix:sc7280-7.1.y-voice

Conversation

@wrenix

@wrenix wrenix commented Jul 2, 2026

Copy link
Copy Markdown

adapt #27 for kernel v7.1(.2)

@wrenix
wrenix force-pushed the sc7280-7.1.y-voice branch from aa6ddc1 to a11733e Compare July 3, 2026 22:49
@zstas

zstas commented Jul 10, 2026

Copy link
Copy Markdown

@z3ntu some people confirm that with those patches calls work too on spacewar (nothing phone 1).
do you think we can merge them? it also would be nice to have calls on taoyao

WrenIX and others added 10 commits July 22, 2026 22:36
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
(cherry picked from commit a7f55b1)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
v2: strlcpy -> strscpy

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Nikita Travkin <nikita@trvn.ru>
(cherry picked from commit eb82ba2)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
(cherry picked from commit d04fd7b)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
This is just a stub for now. Later this would be used for features
like call recording.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
(cherry picked from commit ba9cd1d)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
q6voice combines the 3 q6voice-related services (q6mvm, q6cvp, q6cvs)
and allows to start/end voice calls at the moment.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
(cherry picked from commit e49b671)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
The Q6 Voice DAI driver exposes the Q6 Voice subsystem to ASoC.
At the moment it provides a single CS-Voice DAI with a hostless FE.
Eventually usage should be simplified using a codec2codec link.

v2: Set AIFs SND_SOC_NOPM
v2.1: Fix __DT_BINDINGS_Q6_VOCIE_H__ typo

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
(cherry picked from commit fe78414)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Add function to get and set RX/TX ports and use those
to un-hardcode the ports set in q6cvp_session_create() call.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
[use bool capture instead of enum similar to q6voice_start(),
 add path parameter]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
(cherry picked from commit 6599fc6)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Add ALSA controls for voice RX and TX ports.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
[use mc->shift to mark TX mixers for now to simplify code]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
(cherry picked from commit 0f30053)
Link: https://github.com/msm8916-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
VoiceMMode1 is used instead of CS-Voice on newer firmwares.

Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
(cherry picked from commit a3e2be3)
Link: https://github.com/msm8953-mainline/linux
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
@wrenix
wrenix force-pushed the sc7280-7.1.y-voice branch from 2e83363 to 4e13745 Compare July 22, 2026 20:45
flamingradian and others added 16 commits July 23, 2026 16:31
The codec may expect to delay data by 0, 1 or 2 bit clock cycles.
Keeping the TDM ctrl_sync_data_delay value zero-initialized could result
in corruption of data being read at the AFE. Add a configuration value
for the data delay and send it when preparing the TDM port.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
The codec may expect to delay data by 0, 1 or 2 bit clock cycles.
Keeping the TDM data delay zero-initialized by ignoring the device tree
value could result in corruption of data being read at the AFE.
Configure the data delay according to the value already supplied in
device tree.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
To use a topology ID, the DSP must first have the topology registered.
Add support for registering topologies from an
ACDB (Audio Calibration DataBase).

No-submit: topologies are useless upstream, unless support is added to q6afe; missing dt-bindings
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
The CVD 2.3 revision expects a different initialization sequence.
Implement the commands to make this possible.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Some platforms such as SDM670 have CVD version 2.3. This version
requires different commands to run on creation. Add the initialization
sequence for this version, using a device tree property to determine
which sequence to run.

No-submit: detect the params (channels, bit width, sample rate)
Signed-off-by: Richard Acayan <mailingradian@gmail.com>
For some VoLTE calls between new phones, the topology IDs must be set to
a value in the ACDB. Add RX and TX topology ID parameters to the
functions that send the CREATE_FULL_CONTROL_SESSION command, so the
correct topology IDs can be sent.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
The topology ID is now expected by q6cvp. Add the topology ID properties
to the paths with accessors, and pass them to the DSP.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
The topology IDs are different between sound card models (smartphones in
the context of the Pixel 3a), and even codecs. As a result, the topology
IDs are not defined by the device tree, but rather by the ALSA
configuration. Add controls to ALSA for the topology ID so they can be
configured per codec.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
The client callback for q6voice should not modify the response, as noted
for the other clients in commit 86af3c2 ("ASoC: qcom: Constify APR
callback response data") upstream. Mark the response data as const in
q6voice to be compatible with the API change.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
…kcontrol_to_dapm()

The name of the function changed upstream in commit 2532041 ("ASoC:
soc-dapm: rename snd_soc_dapm_kcontrol_dapm() to
snd_soc_dapm_kcontrol_to_dapm()").

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Signed-off-by: Bhushan Shah <bhushan.shah@machinesoul.in>
Signed-off-by: Val Packett <val@packett.cool>
On kodiak + wcd9375, only this topology seems to work so far for the mic.

Signed-off-by: Val Packett <val@packett.cool>
Signed-off-by: Bhushan Shah <bhushan.shah@machinesoul.in>
Signed-off-by: Bhushan Shah <bhushan.shah@machinesoul.in>
@wrenix
wrenix force-pushed the sc7280-7.1.y-voice branch from 4e13745 to 0c96d8a Compare July 23, 2026 16:08
@f-izzo

f-izzo commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Remember that this PR requires to enable SND_SOC_QDSP6_Q6VOICE on the kernel configuration.

@chrisduerr

chrisduerr commented Aug 11, 2026

Copy link
Copy Markdown

The following patch fixes muting of the bottom speaker:
chrisduerr@fb656da

It appears that the following commit, submitted by @valpackett on the mailing list, was changed at some point during development to remove this section (the commit is applied on Luca's kernel):
wrenix@e8ec954

Looking at the mailing list, it seems that Mark Brown commented on removing it initially:
https://lkml.org/lkml/2026/5/19/1926

Then @valpackett said "that doesn't seem required" (not sure if this is in reference to the changes, or the comment from Mark Brown):
https://lkml.org/lkml/2026/5/19/2380

Luca also mentioned that this is causing a warning, but I think he quoted too much text and it doesn't affect this patch (I honestly forget already if I saw any warnings when compiling this):
https://lkml.org/lkml/2026/5/22/1193

I'm curious what Val has to say about this, but to me it seems like it was removed in haste under the assumption that it wasn't necessary to get call audio working. I still can't say whether this specific change is the correct way to get call audio working, but it certainly fixes the issue of the bottom speaker not getting muted for me.

@wrenix

wrenix commented Aug 11, 2026

Copy link
Copy Markdown
Author

oh damit, i miss this discussion (and switch to android - lost interesset to fix/work without maintainer Feedback)

@chrisduerr

Copy link
Copy Markdown

lost interesset to fix/work without maintainer Feedback

That's unfortunate to hear, but understandable.

I'm not actually sure why there has been zero feedback at all on either of your set of patches.

@account1009

Copy link
Copy Markdown

I'm also very interested about this part!
Let me know if I can do anything to help finalizing :)

@z3ntu

z3ntu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Hi @wrenix , it wasn't my intention to make it look like I'm not interested or something.
At least when this voice call work started, there were still plenty of issues that needed to be ironed out and it's still looking like it's moving and not completely ready for integration.
Unfortunately for q6voiced I can't just point you upstream to get feedback since it's a downstream driver (though I'm hoping you're aware of the paid project with postmarketOS that aims to get this functionality finally upstream), but I personally know essentially nothing about the whole subject without first diving into it.
And kernel maintenance on its own for sm6350, sc7280 and milos trees plus any upstreaming and prep work for getting speaker and microphone upstream is still ongoing.
That being said, I really wanted to take a look at this last Friday but got hung up on other topics, but I promise to take a proper look soon and take it for a ride.
Thanks for working on this and sticking with it!

@valpackett

Copy link
Copy Markdown

I'll try to get back to fiddling with aw88261 "soon" but feel free to submit your own patches (to lkml)!

All the code brought in from downstream awinic drivers (everything related to the "firmware" and its profiles) is bad. The convoluted start code path that has this mute thing is related to profile switching. The entire pattern of opaque register-value lists from loaded binaries absolutely stinks and never should've been accepted upstream, when we have datasheets that clearly describe the entire regmap of the hardware… Ideally we'd just expose all the remaining registers (like the whole amplification bypass for earpiece mode) as their own ALSA controls and eliminate all the struct aw_device crap.

BTW the easy hot fix would be to not touch the profile in UCM at all :p

chrisduerr and others added 2 commits August 13, 2026 18:18
This removes the code responsible for keeping the aw88261 audio muted
until power-on, since it appears to be unnecessary and prevents the
bottom speaker from muting during calls on the Fairphone 5.
@wrenix

wrenix commented Aug 21, 2026

Copy link
Copy Markdown
Author

@z3ntu

z3ntu commented Aug 28, 2026

Copy link
Copy Markdown
Member

@wrenix I have seen that, but what's the purpose of all those other options? It was working for me with just CONFIG_SND_SOC_QDSP6_Q6VOICE_DAI & CONFIG_SND_SOC_QDSP6_Q6VOICE and for the other options I'm pretty sure they're not used.

@valpackett

Copy link
Copy Markdown

More specifically, all of those options are 100% for chromebooks (google,sc7280-herobrine… none of those ever publicly shipped, they were cancelled). We use the SM8250 soundcard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.