Repository navigation
Conversation
|
Can one of the admins verify this patch?
|
|
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 :
Happy to change commit these changes. |
There was a problem hiding this comment.
🟡 Changes recommended
Uninitialized work cancellation and concurrent opens can trigger kernel panics or free an active DMA buffer, while incorrect buffer and restart accounting can expose stale or corrupted audio data.
5 open issues
Reject concurrent opens that share the singleton stream · New Initialize work item before cleanup can cancel it · New Keep DSP consumption and ALSA produced-byte counts separate · New Prevent overwriting unread data in the compress buffer · New Reset ALSA byte accounting when restarting after STOP · New
What changed in this PR
Adds an IPC3 probe-extraction client for i.MX8, connecting the platform to the existing SOF probes infrastructure.
Changes:
- Enables the probes client through Kconfig and build integration.
- Adds a coherent DMA ring buffer with 10 ms polling to deliver DSP data to the compress buffer.
- Registers the i.MX probes auxiliary device and its lifecycle callbacks.
| File | Description |
|---|---|
sound/soc/sof/sof-client-probes.c |
Adds the i.MX auxiliary-device match. |
sound/soc/sof/imx/Makefile |
Includes the probes implementation in the i.MX8 build. |
sound/soc/sof/imx/Kconfig |
Selects probes support for i.MX8 when debugfs is enabled. |
sound/soc/sof/imx/imx8.c |
Hooks probes registration and unregistration into platform operations. |
sound/soc/sof/imx/imx-probes.c |
Implements DMA allocation, polling, and compress-stream callbacks. |
sound/soc/sof/imx/imx-common.h |
Declares the probes registration helpers. |
Review effort: Balanced
|
Do we want to have SND_SOC_SOF_IMX_PROBES enabled all the time for IMX? I wonder how Intel is doing? |
| // address to the firmware in PROBE_INIT (as stream_tag) and the firmware | ||
| // writes the extracted packets into the ring and publishes a byte counter in | ||
| // the first word of the header page. A delayed work copies new data into the | ||
| // compress buffer and wakes up the reader. |
There was a problem hiding this comment.
Here only the SPDX and copyright should use // comments style. The rest should use C classic comments style /* ... */.
Mostly the same, In the Intel side of things, at Here, SND_SOC_SOF_IMX_PROBES is hidden. SND_SOC_SOF_IMX8 selects it if DEBUG_FS. |
At second thought, we can enable the SND_SOC_SOF_IMX_PROBES without any condition, to be aligned with Intel. Will push changes soon. |
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 <stefan.ghetu@nxp.com>
Reject a second open instead of freeing the buffer the DSP is writing to, and keep the active extractor tag when that happens. Initialize the work item at registration so cleanup can always cancel it. Track the DSP read cursor separately from the byte count reported to the compress core. Extend the 32-bit DSP counter across wraps, copy only into free space of the compress buffer, and reset the reported count on start and stop. Signed-off-by: Stefan Ghetu <stefan.ghetu@nxp.com>
b0433af to
50dcd0f
Compare


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.