Skip to content

include: user: move selector and kpb structures - #1351

Merged
lgirdwood merged 2 commits into
thesofproject:masterfrom
wwittbrx:master
Jun 11, 2019
Merged

lgirdwood merged 2 commits into
thesofproject:masterfrom
wwittbrx:master

Conversation

@wwittbrx

Copy link
Copy Markdown
Contributor

Move selector and kpb configuration structures to /sof/src/include/uapi/user to match eq and detect dummy structures configuration;

Signed-off-by: Wojciech Wittbrodt wojciechx.wittbrodt@linux.intel.com

@wwittbrx
wwittbrx requested review from a team, lbetlej, lgirdwood, mmaka1 and plbossart as code owners April 30, 2019 12:55
@wwittbrx

Copy link
Copy Markdown
Contributor Author

As discussed in PR #1304

@jajanusz jajanusz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you split it into 2 commits: 1 for selector 1 for kpb, please?

@wwittbrx
wwittbrx force-pushed the master branch 4 times, most recently from 9c1acd6 to 27ed66d Compare April 30, 2019 13:54

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there an equivalent PR for kernel ?

@slawblauciak

Copy link
Copy Markdown
Collaborator

@lgirdwood is a kernel change really necessary here?

@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak @wwittbrx yes, any PR that touches UAPI must be reflected in both kernel and FW. The same applies the other way around too.

@lgirdwood lgirdwood added the ABI ABI change involved label May 2, 2019
@plbossart

Copy link
Copy Markdown
Member

@lgirdwood is a kernel change really necessary here?

The question is rather: does the kernel need to know all this since we don't have corresponding tokens or IPC to set those files? If no, then this change does not belong in the UAPI files.

@plbossart

Copy link
Copy Markdown
Member

@lgirdwood is a kernel change really necessary here?

The question is rather: does the kernel need to know all this since we don't have corresponding tokens or IPC to set those fields? If no, then this change does not belong in the UAPI files.

@jajanusz

jajanusz commented May 6, 2019

Copy link
Copy Markdown
Contributor

@lgirdwood Why is this ABI change? ABI is the same, just struct defs are moved.

@lgirdwood

Copy link
Copy Markdown
Member

@jajanusz this has been moved from internal header to external header so is an ABI addition.
@plbossart I'm also including userspace here and not just the kernel, so to me anything that makes changes to kernel or userspace would be an ABI change.

@jajanusz

jajanusz commented May 6, 2019 •

Copy link
Copy Markdown
Contributor

@lgirdwood Yea you are right, I incorrectly assumed that if they are not using it already there is no problem, but it's backward-compatible addition so it's minor change probly

@jajanusz

jajanusz commented May 6, 2019 •

Copy link
Copy Markdown
Contributor

@lgirdwood Please classify it in https://github.com/orgs/thesofproject/projects/2 so PRs author will know which number to bump up

@lgirdwood

Copy link
Copy Markdown
Member

@wwittbrx MINOR 9, also need PR for kernel too linked to this PR.

@lgirdwood

Copy link
Copy Markdown
Member

@jajanusz done, Minors 7 & 8 are unmerged and in progress too, but are closer to merging atm.

@plbossart

Copy link
Copy Markdown
Member

@jajanusz this has been moved from internal header to external header so is an ABI addition.
@plbossart I'm also including userspace here and not just the kernel, so to me anything that makes changes to kernel or userspace would be an ABI change.

That doesn't tell me who uses these structures? the kernel doesn't, userspace doesn't, so why is this needed? External files should only be used for exchange of information. NAK on this one until I get an explanation.

@wwittbrx

wwittbrx commented May 7, 2019

Copy link
Copy Markdown
Contributor Author

@keyonjie Please chime in here. I don't know where in kernel is this data set.

From slim driver tests perspective this data is needed to either create the components with the provided config or to set the config after they are created. If we don't set this data then we are using default parameters for the components.

Take detect dummy component for example.

struct sof_detect_test_config {
	uint32_t size;

	/** synthetic system load settings */
	uint32_t load_mips;
	uint32_t load_memory_size;

	/** length of the keyphrase in milliseconds */
	uint32_t keyphrase_length;

	/** activation right shift, determines the speed of activation */
	uint16_t activation_shift;

	/** activation threshold */
	int16_t activation_threshold;

	/** reserved for future use */
	uint32_t reserved[3];
} __attribute__((packed));

You can create the component without any config, but you may wish to have different activation threshold or keyphrase length. You would need to take this structure and append it to sof_ipc_comp_process IPC. Alternatively you can send this data as a binary blob with sof_ipc_ctrl_data IPC. Either way you need to know how the configuration structure looks, which makes it a part of uapi.

@jajanusz jajanusz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, but needs PR in kernel and other ABI changing PRs to be merged with that, so keeping as 'Request changes' for now.

@wwittbrx
wwittbrx requested a review from keyonjie May 8, 2019 08:27
@wwittbrx

wwittbrx commented May 9, 2019

Copy link
Copy Markdown
Contributor Author

@plbossart
Any more comments on this?

@keyonjie
Could you explain how configuration structures are used by kernel?

@juimonen

Copy link
Copy Markdown

@jajanusz binary blobs in topology are not parsed in any way by the kernel, they are sent as such to FW. so the struct definition is not needed by kernel in any way. As I see it kernel headers should be only used for stuff that is used by the kernel somehow, so kernel needs to link to this struct somehow. This is of course debatable, but to me kernel seems like really wrong place to have these...

@jajanusz

jajanusz commented May 16, 2019 •

Copy link
Copy Markdown
Contributor

@jajanusz binary blobs in topology are not parsed in any way by the kernel, they are sent as such to FW

Yea, but what I meant is that you could also just compose some IPCs and send them, you just decided to send blobs. I'm noob in driver things, so feel free to tell me if I write some bullshit ;)

In regard to UAPI, we can look at it as interface to use FW, we do something that run somewhere (in this case on DSP) and you can use it via this interface. In this case our user of the FW is driver, we expose to user what we can do but he decides how to use it. I prefer to look at it in more abstract way, not that it's just FW and one kind of SW using it, so idk if it's convincing for you.

@juimonen

Copy link
Copy Markdown

@jajanusz Currently with linux driver there's no way of just composing ipc message in userspace and sending it to dsp. I think this should be very strictly forbidden for users to do :)
Or if you are directly writing it to some exposed dsp register or shared memory you are not using kernel for that (?)

We decided exactly to use binary in these special component's so that we don't have to carve to stone the tokens and live with backwards compatibility etc. So all PROCESS components are subtypes of alsa/dapm effects type and we might be in real trouble if we would define tokens for all these (as we have now quite exotic ones).

The issue here is that we could probably export in kernel sof uapi headers whatever (because we kind of own it), but people would soon start to ask what are these headers for as there is no other reference to them in kernel.

There should be user space programs to generate the blobs from these headers (blobs which are then included to topology text file), but what is the correct place to have the include headers? I would rather see FW to export these to some include dir.

I guess this is also related to the thing that we combined the sof and soft (sof tools) repositories. So as I see it, the user space program should be in soft and the headers in sof. I don't recall how it was done then.

@jajanusz

Copy link
Copy Markdown
Contributor

There should be user space programs to generate the blobs from these headers (blobs which are then included to topology text file), but what is the correct place to have the include headers? I would rather see FW to export these to some include dir.

Yea, I see we cannot run away from having another includes folder for that kind of things. We noticed that problem already in #1405

I guess this is also related to the thing that we combined the sof and soft (sof tools) repositories. So as I see it, the user space program should be in soft and the headers in sof. I don't recall how it was done then.

It was previously something like that, but it was hard to manage dependencies that these tools had on f.e. fw headers. (we had to manage deps for 3 repos instead like now for 2).

@jajanusz

Copy link
Copy Markdown
Contributor

@lgirdwood @plbossart @juimonen Ok, so what are we gonna do? Imo even if you use blobs you indirectly use this api, but ok, we can have another headers folder for 'tools api', at least we will have less definitions on kernel side. Are you ok with this idea?

@jajanusz

Copy link
Copy Markdown
Contributor

Feel free to state your points in related issue - #1471

@lgirdwood

Copy link
Copy Markdown
Member

@jajanusz blobs will only go to FW via binary kcontrols for runtime tuning/config of components. i.e. they will be constructed by userspace commands using a shared header and C structure.

@jajanusz

Copy link
Copy Markdown
Contributor

@lgirdwood So I guess you agree that it'd be good to separate uapi headers into userspace/driver headers.

@lgirdwood

Copy link
Copy Markdown
Member

@jajanusz yes.

@jajanusz

jajanusz commented Jun 3, 2019

Copy link
Copy Markdown
Contributor

@wwittbrx Please update to match new headers structure. Now your headers should go to user folder.

@wwittbrx wwittbrx changed the title Uapi: move selector and kpb structures include: user: move selector and kpb structures Jun 3, 2019
@jajanusz

jajanusz commented Jun 4, 2019

Copy link
Copy Markdown
Contributor

@xiulipan Travis issue:

$  docker pull thesofproject/sof && docker tag thesofproject/sof sof
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: malformed MIME header line: Too Many Requests (HAP429).

@jajanusz
jajanusz requested review from lgirdwood and tlauda June 4, 2019 09:21
@jajanusz

jajanusz commented Jun 4, 2019

Copy link
Copy Markdown
Contributor

@juimonen @plbossart Is new solution ok for you?

@xiulipan

xiulipan commented Jun 4, 2019

Copy link
Copy Markdown
Contributor

@jajanusz
Re-trigger the Travis. Network issue is everywhere.

Comment thread src/include/user/selector.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Space at the beginning.

Comment thread src/include/user/selector.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Space at the beginning.

Comment thread src/include/user/kpb.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Space at the beginning.

Comment thread src/include/user/kpb.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Space at the beginning.

@lgirdwood lgirdwood left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wwittbrx I've moved this to MINOR 8 as we have some backlog. No need to update ABI in this PR now.
Please also add some commit messages explaining what, why, how.

wwittbrx added 2 commits June 6, 2019 09:15
Move selector configuration structure to user header folder to expose it to users such as applications/tools.
The configuration structure is needed to create a binary blob that allows to control the component.

Signed-off-by: WojciechX Wittbrodt <wojciechx.wittbrodt@linux.intel.com>
Move kpb configuration structure to user header folder to expose it to users such as applications/tools.
The configuration structure is needed to create a binary blob that allows to control the component.

Signed-off-by: WojciechX Wittbrodt <wojciechx.wittbrodt@linux.intel.com>
@lgirdwood
lgirdwood merged commit b451b31 into thesofproject:master Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ABI ABI change involved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants