Skip to content

Conversation

@singalsu
Copy link
Collaborator

The sof-ctl change for same .txt and .bin format as used with UCM v2 is the key change. It is done to avoid confusion with slightly different blob format chosen for UCM v2. Other changes are for organizing the blobs and updating the example blobs to have the updated header.

Sof-ctl is a developer tool, so the compatibility break with previous blob format is not an issue.

@singalsu
Copy link
Collaborator Author

Note: The first five patches are the same as in #9749 .

@singalsu singalsu force-pushed the sofctl_align_with_ucm branch from 82d5f6c to 3f9476e Compare December 31, 2024 15:48
tools/ctl/ctl.c Outdated
* to get similar blob as in set command. Helps to compare the received
* blob to sent blobs. The comp_id is not useful.
*/
ctl_data->buffer[BUFFER_TAG_OFFSET] = SOF_CTRL_CMD_BINARY;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ujfalusi What do you think of this kernel originated value rewrite?

Copy link
Contributor

Choose a reason for hiding this comment

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

In IPC3 the header.numid was used to store the command (or type) for the control (VOLUME, SWITCH, BINARY, ENUM), this is not relevant for IPC4, it is largely ignored, but when you get the control data, the kernel sets it to 'something' close enough to numid: header.numid = scontrol->comp_id.
I guess we could change the kernel to set this to SOF_CTRL_CMD_BINARY for IPC4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, I think it would be good, then the blob get responses for same blobs but from different component instances would be the same.

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.

LGTM, is there any external dependency on kernel or alsa ?

@singalsu
Copy link
Collaborator Author

singalsu commented Jan 16, 2025

LGTM, is there any external dependency on kernel or alsa ?

No, there's not except that #9749 should be merged first.

Edit, not mandatory, but without this Peter's kernel patch: thesofproject/linux#5281 the blob get has different numid that blose set had. We don't currently use blob get at all. In CI tests there's only test for sof-ctl return value success, no actual get result checking.

@singalsu singalsu force-pushed the sofctl_align_with_ucm branch from 3e2617e to 206822e Compare January 16, 2025 17:04
@lgirdwood
Copy link
Member

No, there's not except that #9749 should be merged first.

Now merged.

@singalsu singalsu force-pushed the sofctl_align_with_ucm branch from 206822e to e9ee3e8 Compare January 27, 2025 13:21
@singalsu singalsu marked this pull request as ready for review January 27, 2025 13:22
This change aligns the blob formats of UCM2 and sof-ctl.
The binary blobs for UCM2 have an additional 8 byte header that
earlier was generated internally in sof-ctl.

sof-ctl now expects the header to be in .txt and .bin format
the data file. The sof-ctl can use the same .bin files as UCM.

The Octave scripts to export blobs for topology, sof-ctl, and
UCM2 are updated to match the change. The topology embedded blobs
remain as before without the header.

The TLV header add code is removed from sof_ucm_blob_write.m
since the retrieved header from sof-ctl contains it. In topology
blob export functions the header is dropped.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
It is a common mistake (including myself) to attempt to set bytes
control without option "-s" but with provided blob file name. In
such case the previous version silently ignores the blob file name
and dumps existing bytes control values.

This change adds check of optind value from getopt(). If there
were non-parsed arguments, the sof-ctl returns with error.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch organizes the blobs by move of IIR and FIR blobs to
own sub-directories. This makes the directory structure similar
as in blobs in UCM2.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds the similar TLV header to text format blobs for
sof-ctl as present in current .bin format blobs for UCM2. The
header data consists of uint32_t value 3 for SOF_CTRL_CMD_BINARY
and uint32_t value for size of the blob.

The other change is increase of SOF ABI version number in the 6th
value in the new blob.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The comma from line end and blob end is removed. With this change
the blobs exported are identical to retrieved blobs with sof-ctl
tool and e.g. can be compared directly.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The sof-ctl is used to create the bytes control SOF ABI
header for the binary blob files.

These changes ensure that the sof-ctl is built from tools and
that the correct version of sof-ctl exists in user's path.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
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.

@ujfalusi good for kernel ?

@ujfalusi
Copy link
Contributor

The kernel PR is open for some time: thesofproject/linux#5281

@singalsu
Copy link
Collaborator Author

@iuliana-prodan OK for you too? I noticed you just updated the demo-gui.

@kv2019i kv2019i merged commit ad5f637 into thesofproject:main Feb 13, 2025
46 of 49 checks passed
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.

5 participants