Open
Conversation
added 6 commits
March 31, 2026 23:39
Add sofprobeclient, a SOF probe client for compressed audio capture based on crecord. Built from its own source file with the same libtinycompress linkage as cplay and crecord. At this phase the sofprobeclient.c is almost exact copy of crecord.c. Only the reference to the command name have been updated from "crecord" to "sofprobeclient". This is a staring point for SOF probe debugging tool that uses compressed audio capture device for routing logs and audio form defined probe points out of the DSP subsystem.
Change default parameters to match typical SOF probe usage: card 3, device 0, buffer 8192, 4 fragments, S32_LE format, 48000 Hz sample rate, and 4 channels. All parameters remain overridable via command line options.
Integrate the sof-probes demux engine directly into sofprobeclient so captured compressed data is parsed in real time instead of being written to a raw file. Log output from non-audio probe points is printed to stdout (equivalent to sof-probes -l). Audio probe data is extracted into buffer_<id>.wav files in the current directory. The file output parameter is removed; sofprobeclient no longer acts as a generic recorder. New files copied from SOF v2.9 sources tools/probes/ with include paths adjusted for standalone tinycompress build: probes_demux.c / probes_demux.h - probe stream parser probes_wave.h - WAV header definitions probe_dma_frame.h - DMA frame packet format
The compress device may return more data than the parser's internal buffer (DATA_READ_LIMIT, 4096 bytes) can accept in one call. Feed captured data in a loop, copying only as much as parser_fetch_free_buffer() reports available per iteration. This fixes truncated probe packets that caused checksum errors and missing log lines.
Move the "We read N, DSP sent M" diagnostic behind a new -D (parser debug) flag so it does not clutter normal output.
Audio capture files (buffer_<id>.wav) are now automatically closed after 200 ms of inactivity, so completed recordings can be accessed while sofprobeclient is still running. If the same probe point becomes active again, a new file is created with an incrementing index (buffer_<id>-1.wav, buffer_<id>-2.wav, ...) rather than overwriting the previous capture. The index is chosen by probing the filesystem, so existing files from earlier runs are never clobbered either. Buffer IDs in file names and log messages are printed in hexadecimal (e.g. buffer_0x1a.wav) to match firmware conventions.
Author
|
@lgirdwood , @kv2019i , do you have anything to add before I turn this PR ready for review? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was hoping this SOF [1] debug tool could be accepted as part of tinycompress package. The current method of usage [2] is not very convenient and a single binary doing everything would simplify things nicely. And since this method of debugging uses alsa compressed support, I think the most natural place for the tool would be as part of tinycompress repository.
Best regards,
Jyri
[1] https://github.com/thesofproject
[2] https://thesofproject.github.io/latest/developer_guides/debugability/probes/index.html