Skip to content

Conversation

@Lyapsus
Copy link

@Lyapsus Lyapsus commented Nov 8, 2025

Add sof-hda-generic-aw88399.tplg, routing the HDA speaker mix into the SOF smart_amp component and out
over SSP1 to the dual AW88399 amps (with IV feedback), exposing the necessary mixer controls for Legion Pro 7 (17aa:3906)

@sofci
Copy link
Collaborator

sofci commented Nov 8, 2025

Can one of the admins verify this patch?

reply test this please to run this test once

Signed-off-by: Yakov Till <yakov.till@gmail.com>
Signed-off-by: Yakov Till <yakov.till@gmail.com>
Kernel 6.18-rc3 has SOF ABI 3.23.1, but topology was built with 3.29.1
causing version mismatch warnings. Set ABI minor version to 23 to match.

Signed-off-by: Yakov Till <yakov.till@gmail.com>
@Lyapsus Lyapsus requested a review from a team as a code owner November 9, 2025 19:21
Override DEEP_BUFFER_PIPELINE_SINK to route PCM 31 (deepbuffer) through
the AW88399 smart amp pipeline instead of directly to HDA analog codec.

Without this, audio goes: deepbuffer → mixout.2.1 → HDA codec (tweeters only)
With this fix: deepbuffer → mixout.20.1 → smart_amp.20.1 → SSP1 (full speakers)

This enables woofers driven by AW88399 amplifiers to work alongside tweeters.

Signed-off-by: Yakov Till <yakov.till@gmail.com>
Add explicit route from mixin.15.1 (deepbuffer pipeline) to mixout.20.1
(AW88399 smart amp pipeline) so PCM 31 audio flows through the smart
amplifiers instead of only through HDA analog codec.

This enables the external AW88399 amplifiers to be used for deepbuffer
playback, providing full-range audio instead of tweeter-only output.

Signed-off-by: Yakov Till <yakov.till@gmail.com>
Disable HDA config's built-in deepbuffer (which routes to HDA analog codec)
and define our own deepbuffer PCM 31 that routes to the AW88399 smart amp.

This prevents routing conflicts where mixin.15.1 would have two outputs
(one to HDA mixout.2.1 and one to smart amp mixout.20.1).

Routes:
- Regular playback (PCM 0): mixin.1.1 → mixout.20.1 → smart_amp → SSP1
- Deepbuffer (PCM 31): mixin.15.1 → mixout.20.1 → smart_amp → SSP1

Signed-off-by: Yakov Till <yakov.till@gmail.com>
@lgirdwood
Copy link
Member

test this please

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since most of the patches relate to a new file they can be squashed. Please also add commit messages, including one that describes the aw88399 hardware configuration that you are supporting. Thanks !

/** \brief SOF ABI version major, minor and patch numbers */
#define SOF_ABI_MAJOR 3
#define SOF_ABI_MINOR 29
#define SOF_ABI_MINOR 23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor ABI changes are backwards compatible so this is not needed.

@lgirdwood lgirdwood requested a review from bardliao November 11, 2025 16:16
DMIC0_PCM_CAPS 'Gain Capture 11'
AW_SMART_PIPELINE_ID 20
AW_SMART_STREAM_NAME 'SSP1-Codec'
AW_SMART_SSP_INDEX 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, we should use a generic naming. Like SSP_AMP instead of AW_SMART

# Override deepbuffer to route through AW88399 smart amp instead of HDA analog
# MUST be after HDA_CONFIG include so it overrides the HDA config's Define block
Define {
DEEP_BUFFER_PIPELINE_SINK 'mixout.20.1'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to be overwrited in tplg-targets-hda-generic.cmake


# Disable deepbuffer in HDA config - we'll define our own that routes to smart amp
Define {
DEEPBUFFER_FW_DMA_MS 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, the sof-hda-generic-aw88399.conf should be generic and the macros should be overwritten in the cmake files. And it would be better to rename sof-hda-generic-aw88399.conf to a more generic name.

Align the AW88399 smart-amp topology with the codec fixup by renaming
the SOF gain control to "Master Playback Volume". KDE/PipeWire will
now bind to the existing control name without needing extra UCM rules.

Signed-off-by: Yakov Till <yakov.till@gmail.com>
@Lyapsus Lyapsus closed this by deleting the head repository Nov 19, 2025
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.

4 participants