Skip to content

ASoC: sof: imx: add SOF probes extraction client (IPC3) - #6013

Open
ursus161 wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ursus161:sof-probes-imx
Open

ursus161 wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ursus161:sof-probes-imx

Conversation

@ursus161

@ursus161 ursus161 commented Nov 3, 2026

Copy link
Copy Markdown

SND_SOC_SOF_DEBUG_PROBES was not selectable for i.MX and no auxiliary probes client device was registered.

Add a hidden Kconfig symbol SND_SOC_SOF_IMX_PROBES (selected by SND_SOC_SOF_IMX8 when DEBUG_FS is on), a new imx-probes.c that registers the client, allocates a coherent DMA buffer and passes its bus address to the firmware in PROBE_INIT stream_tag. A 10 ms delayed work polls the DSP write counter, copies new data into the compress buffer and calls snd_compr_fragment_elapsed().

Known limits: polling only, single stream, 32-bit DMA address.

SND_SOC_SOF_DEBUG_PROBES was not selectable for i.MX and no
auxiliary probes client device was registered.

Add a hidden Kconfig symbol SND_SOC_SOF_IMX_PROBES (selected by
SND_SOC_SOF_IMX8 when DEBUG_FS is on), a new imx-probes.c that
registers the client, allocates a coherent DMA buffer and passes
its bus address to the firmware in PROBE_INIT stream_tag.  A 10 ms
delayed work polls the DSP write counter, copies new data into the
compress buffer and calls snd_compr_fragment_elapsed().

Known limits: polling only, single stream, 32-bit DMA address.

Signed-off-by: Stefan Ghetu <[email protected]>
@sofci

sofci commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

reply test this please to run this test once

@ursus161

ursus161 commented Nov 3, 2026

Copy link
Copy Markdown
Author

Hi all,

Tested this on a imx8mp-evk : 1kHz tone at 48 kHz stereo, captured via probes, decodes fine.

I am not so sure about these, please provide feedback :

  1. The address handoff : extractor_stream_tag = (u32)s->paddr in imx_probes_compr_set_params() . Would a dedicated field in the probe init payload be better?
  2. About static struct imx_probes_stream imx_stream; : Every callback reads and writes that same object. That works for one recording at a time. It may break if someone opens a second recording or reloads the module, because the old state isn't tied to the stream that created it. The fix is to store the state per stream, the way the HDA client does, so each recording owns its own copy and frees it on shutdown. Would it work better?
  3. 10ms polling timer schedule_delayed_work(&s->work, msecs_to_jiffies(IMX_PROBES_POLL_MS)); . Should I change this into a notification path?

Happy to change commit these changes.

@dbaluta @plbossart @plbossart @bardliao @sofci

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.

2 participants