Skip to content

mic_privacy: initial implementation - #9788

Merged
lgirdwood merged 4 commits into
thesofproject:mainfrom
mbukowsk:mbukowsk-mic_privacy
Mar 11, 2025
Merged

lgirdwood merged 4 commits into
thesofproject:mainfrom
mbukowsk:mbukowsk-mic_privacy

Conversation

@mbukowsk

Copy link
Copy Markdown
Contributor

Audio privacy feature allows end user to directly
control if user space applications receive actual
data from input devices (microphones). The control
is bypassing application level settings or operating
system controls (like audio endpoint volume).

Comment thread src/audio/base_fw.c Resolved
Comment thread src/include/ipc4/base_fw.h Resolved
Comment thread src/audio/base_fw.c Resolved
Comment thread src/audio/copier/copier_generic.c Resolved
Comment thread src/audio/copier/copier_hifi.c Resolved
Comment thread app/boards/intel_adsp_ace30_ptl.conf Resolved
Comment thread src/audio/copier/copier.c Resolved
Comment thread src/audio/copier/copier.c Resolved

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

~0

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mbukowsk can you confirm a high level overview of how it works when FW managed. i.e. I assume FW will send an IPC to SW when the mute is enabled/disabled ? What about Mic state at FW boot ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be in Zephyr as its HW specific.

Comment thread src/lib/dma.c Resolved
Comment thread xtos/include/sof/lib/dma.h Resolved
Comment thread src/audio/base_fw.c Resolved

@jsarha jsarha left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No bugs from me (the others already found the serious stuff), but couple of suggestions more.

Comment thread src/audio/copier/copier_dai.c Resolved
Comment thread src/lib/dma.c Resolved
Comment thread src/include/ipc4/base_fw.h Resolved
@abonislawski
abonislawski force-pushed the mbukowsk-mic_privacy branch 6 times, most recently from 70c6211 to 37336ba Compare February 8, 2025 16:32
Comment thread src/audio/copier/copier.c Resolved
@lgirdwood

Copy link
Copy Markdown
Member

@mbukowsk can you check CI, several failures. Thanks !

@ujfalusi ujfalusi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mbukowsk, the privacy_capabilities is configured to the wrong struct, that is going to case the host quite a bit of issues as it will not find it in hw_config and there will be two entries with the same ID in fw_config.

Comment thread src/audio/copier/copier_gain.c Resolved
Comment thread src/audio/copier/copier_gain.h Resolved
Comment thread src/audio/base_fw.c Resolved
Comment thread src/audio/copier/copier.c Resolved
Comment thread src/audio/copier/copier.c Resolved
Comment thread src/audio/copier/copier_gain.c Resolved
Comment thread src/audio/copier/copier_gain.h Resolved
Comment thread src/audio/copier/copier_gain.c Resolved
@lgirdwood

Copy link
Copy Markdown
Member

@mbukowsk, the privacy_capabilities is configured to the wrong struct, that is going to case the host quite a bit of issues as it will not find it in hw_config and there will be two entries with the same ID in fw_config.

@ujfalusi ok that's a blocker for kernel. Can you reply with what this should look like for kernel so @mbukowsk can copy.

@ujfalusi

ujfalusi commented Feb 11, 2025 •

Copy link
Copy Markdown
Contributor

@mbukowsk, the privacy_capabilities is configured to the wrong struct, that is going to case the host quite a bit of issues as it will not find it in hw_config and there will be two entries with the same ID in fw_config.

@ujfalusi ok that's a blocker for kernel. Can you reply with what this should look like for kernel so @mbukowsk can copy.

No, this is a blocker for this PR.

The firmware places the IPC4_PRIVACY_CAPS_HW_CFG (as is a hardware configuration tuple with ID 11) into the FW_CFG (as is firmware configuration). The ID 11 is IPC4_MAX_ASTATE_COUNT_FW_CFG in firmware config.

These are different configurations, one is queried with SOF_IPC4_FW_PARAM_FW_CONFIG (basefw param 6), the other is SOF_IPC4_FW_PARAM_HW_CONFIG_GET (basefw param 7).

The IPC4_PRIVACY_CAPS_HW_CFG must be placed to the hardware config data in basefw_hw_config() and not in basefw_config() as this PR does.

The corresponding kernel patch is thesofproject/linux@7f00cf9

@abonislawski
abonislawski force-pushed the mbukowsk-mic_privacy branch 2 times, most recently from 37f0e45 to 764f2d8 Compare February 18, 2025 08:33
@abonislawski

Copy link
Copy Markdown
Member

@ujfalusi @lyakh yeap its related. Both DMIC and mic privacy drivers enables the same IRQ so in debug build (linux CI) it can trigger assert for such check but works in normal build (internal CI).
Pushed test commit for west update to verify it.

Comment thread west.yml Resolved
@ujfalusi

Copy link
Copy Markdown
Contributor

@abonislawski, we still have the crash on dmic start..

@abonislawski
abonislawski force-pushed the mbukowsk-mic_privacy branch 2 times, most recently from 524af57 to abe0df8 Compare February 20, 2025 08:51
@ujfalusi

Copy link
Copy Markdown
Contributor

SOFCI TEST

@abonislawski

abonislawski commented Feb 24, 2025 •

Copy link
Copy Markdown
Member

@lgirdwood lgirdwood added the DNM Do Not Merge tag label Feb 24, 2025
@lgirdwood

Copy link
Copy Markdown
Member

I've made this DNM until @abonislawski is ready with Zephyr patches merged.

@abonislawski
abonislawski force-pushed the mbukowsk-mic_privacy branch 2 times, most recently from 3843767 to 52c9e0d Compare February 25, 2025 07:53
@kv2019i

kv2019i commented Mar 10, 2025

Copy link
Copy Markdown
Collaborator

@abonislawski Zephyr PRs now merged, do you want to update to this PR?

@abonislawski
abonislawski force-pushed the mbukowsk-mic_privacy branch from 52c9e0d to 6a1fefa Compare March 10, 2025 11:49
@lgirdwood lgirdwood removed the DNM Do Not Merge tag label Mar 10, 2025
Comment thread west.yml Resolved
@ujfalusi
ujfalusi self-requested a review March 11, 2025 09:55
Change type of arguments for gain params setting functions.
DAI data struct is replaced by gain_params. Components other
than DAI can also use copier gain feature (eg. microphone privacy)

Signed-off-by: Michal Bukowski <[email protected]>
Audio privacy feature allows end user to directly
control if user space applications receive actual
data from input devices (microphones). The control
is bypassing application level settings or operating
system controls (like audio endpoint volume).

Signed-off-by: Michal Bukowski <[email protected]>
Added empty implementation which always returns success

Signed-off-by: Michal Bukowski <[email protected]>
…ANGE

SW sends this IPC when microphone privacy state is changed for
HW_MANAGED mode and SNDW interface.

Signed-off-by: Michal Bukowski <[email protected]>
@abonislawski
abonislawski force-pushed the mbukowsk-mic_privacy branch from 6a1fefa to d3d665a Compare March 11, 2025 10:05
@lgirdwood
lgirdwood merged commit f6b7e77 into thesofproject:main Mar 11, 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.

7 participants