Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rimage: add ipc4 extended module config introduction #451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RanderWang
Copy link

This is a introduction of ipc4 extended module config and how to add these information in config file xxx.toml for ipc4.

@RanderWang
Copy link
Author

@cujomalainey this is the document for thesofproject/rimage#125

| **uuid**: uuid of the module
| **affinity_mask**: usable dsp core mask, bit N is for core N, 0x3 means core 0 and 1 can be used
| **instance_count**: max module instance count can be active in fw
| **domain_types**: two schedule domains: domain ll (0), and dp (1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd assume these are indexes of bits in the mask since you may define a module that works in both domains? But you provided value of "0" in the example above which suggests these are mutually exclusive modes?

Copy link
Author

Choose a reason for hiding this comment

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

I find "domain_types LL DP" in real case.
Let's use index of bit. Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

should give a bit more guidance here about which to choose for developers who may just building a standalone module are not SOF developers. LL and DP mean nothing to outsiders. To be honest I only know edf and ll, I have no clue what dp is.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cujomalainey Some of this is referring to ongoing work, which understandably makes this hard to follow. For DP, the PR to add this concept to SOF was just submitted for review thesofproject/sof#7089

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
@RanderWang
Copy link
Author

updated comments for domain type

esensing,
emax,
einvalid = emax
};
Copy link
Contributor

Choose a reason for hiding this comment

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

@mwasko @mmaka1 Can we add something about the semantics here? What should people adding new modules know about setting the "module_type"?

Copy link
Contributor

Choose a reason for hiding this comment

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

@kv2019i module_type enum was defined for the Host SW driver purpose. The idea was to have option to identify components of specific functionality like for e.g. wov, mux or any other listed above. That capability allow for more topology flexibility at Host SW level. For example, instead of hardcoding in topology that you need Module_1 with specific GUID you can point that you need Module_1 with specific functionality type. That allow to swap components of the same functionality without need to change the topology itself / modifying GUIDs.

The bottom line is that new modules module_type should be matched with one of the available on list or if necessary the new custom type should be added. I would also recommend to change the enum name to something like module_fuctionality_type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack @mwasko . I think the "bottom line" part should be added directly in the docs to help module developers choose correctly.

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.

@mwasko good for you ?

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

good start but lots of questions raised @RanderWang

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/index.rst Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
***********************
| **name**: name of the module
| **uuid**: uuid of the module
| **affinity_mask**: usable dsp core mask, bit N is for core N, 0x3 means core 0 and 1 can be used
Copy link
Member

Choose a reason for hiding this comment

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

what does 'usable' mean? is this restricting on which core a module can run, with the actual determination done on a per-instance basis?

Copy link
Author

Choose a reason for hiding this comment

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

sure

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
enum type {
pcm = 0,
mp3,
aac,
Copy link
Member

Choose a reason for hiding this comment

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

no. this should not be added, @mmaka1 mentioned this is not used by firmware.

Copy link
Author

Choose a reason for hiding this comment

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

@plbossart extended module config are used by driver, not by firmware. type is included in conf and I need to comments it

Copy link
Member

Choose a reason for hiding this comment

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

I am not going to question @mmaka1 's answer " The driver never used this one. And it was always hardcoded to ePcm. "

don't document things that are not useful or even used.

Copy link
Member

Choose a reason for hiding this comment

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

ack - lets remove

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
@lgirdwood
Copy link
Member

@plbossart updates good for you ?

| **uuid**: uuid of the module
| **affinity_mask**: usable dsp core mask, bit N is for core N, 0x3 means core 0 and 1 can be used
| **instance_count**: max module instance count can be active in fw
| **domain_types**: two schedule domains: domain ll (0), and dp (1)
Copy link
Member

Choose a reason for hiding this comment

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

should give a bit more guidance here about which to choose for developers who may just building a standalone module are not SOF developers. LL and DP mean nothing to outsiders. To be honest I only know edf and ll, I have no clue what dp is.

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
.. code-block:: bash

pin = [dir, type, sample rates, sample size, sample container size, channel config]
For example, gain module pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff], it supports input pcm
Copy link
Member

Choose a reason for hiding this comment

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

is there no better way to document/configure this? This seems like a heavy load on the user to (de)compile and humans are great sources of error

Copy link
Author

@RanderWang RanderWang Feb 16, 2023

Choose a reason for hiding this comment

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

it needs to develop a new tool to make it easy, something like a ui tool to chose feature by clicking mouse.

Copy link
Member

Choose a reason for hiding this comment

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

I mean, just simply using enums, and discrete fields would be better than manual bitpacking

Copy link
Author

Choose a reason for hiding this comment

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

@cujomalainey sure. Let's add this feature to rimage tool.

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
@RanderWang
Copy link
Author

updated, thanks!

@RanderWang
Copy link
Author

@cujomalainey updated to use string instead of hex number for pin setting. If it is confirmed, I will start to add support in rimage tools

@RanderWang
Copy link
Author

Copy link
Member

@cujomalainey cujomalainey left a comment

Choose a reason for hiding this comment

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

looking much better, thank you, almost there

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
Module config
-------------
**Usage:**
``mod_cfg PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS``
Copy link
Member

Choose a reason for hiding this comment

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

this is a bit long, 11 args is a bit hard to read

Copy link
Author

Choose a reason for hiding this comment

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

what's your suggestion ? It defines array of config data.

Copy link
Member

Choose a reason for hiding this comment

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

The indicies are named no? Can they not be broken out?

Copy link
Author

Choose a reason for hiding this comment

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

sorry, I don't get your idea. Can you give an example ? Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Based on the description even though it is a byte array, the bytes themselves are all mapped directly to a value. Just curious why we cannot treat this as a packed struct and give everything a name and/or possible sub structs to make access and identification easier.

Copy link
Author

Choose a reason for hiding this comment

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

In my opinion, we can define struct in C language code, but this is a config file and these data blob are generated by FW tools, so like topology setting, we just include byte array.

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.

@RanderWang this is a starting point which can be built upon. Just one issue to close.

enum type {
pcm = 0,
mp3,
aac,
Copy link
Member

Choose a reason for hiding this comment

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

ack - lets remove

@RanderWang
Copy link
Author

removed AAC and change init_config to init_config_has_extenstion

lgirdwood
lgirdwood previously approved these changes Jul 6, 2023
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.

Lets use this as the starting point.

@lgirdwood
Copy link
Member

@cujomalainey @plbossart can we unblock this as the starting point as today we have zero documentation and this is better than zero. This then allows others to add more context like @btian1 (who has CPC formula's) and @mwasko (who has other manifest data). Thanks !

@cujomalainey
Copy link
Member

@cujomalainey @plbossart can we unblock this as the starting point as today we have zero documentation and this is better than zero. This then allows others to add more context like @btian1 (who has CPC formula's) and @mwasko (who has other manifest data). Thanks !

Ack but can we get issues tracking the cleanup requests?

Copy link
Collaborator

@deb-intel deb-intel left a comment

Choose a reason for hiding this comment

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

Numerous edits are included to ensure grammatical and style consistency throughout this doc and the rest of SOF documentation.

developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
developer_guides/rimage/ipc4_extended_module_config.rst Outdated Show resolved Hide resolved
This is a introduction of ipc4 extended module config and
how to add this information in the xxx.toml for template.

Signed-off-by: Rander Wang <rander.wang@intel.com>
@RanderWang
Copy link
Author

refined style according to comments, thanks!

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.

9 participants