Skip to content

dai: add started field - #1891

Closed
tlauda wants to merge 5 commits into
thesofproject:masterfrom
tlauda:topic/dai-start-check
Closed

tlauda wants to merge 5 commits into
thesofproject:masterfrom
tlauda:topic/dai-start-check

Conversation

@tlauda

@tlauda tlauda commented Oct 1, 2019

Copy link
Copy Markdown
Contributor

Adds new started field based on which we assess if the pipeline
has been just started/released or maybe we should throw an xrun.
It should fix rare cases of xruns on release with timer scheduled
pipelines.

Signed-off-by: Tomasz Lauda tomasz.lauda@linux.intel.com

Comment thread src/audio/dai.c Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the comment above still necessary with this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@paulstelian97 I thought about it, but in the same time this comment is still valid.

Comment thread src/audio/dai.c 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.

Didn't we want to remove xrun recovery at all from fw?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think the comment is wrong and it's only used to notify the DAI we are in xrun, but I haven't verified the logic behind it.

Comment thread src/audio/dai.c Outdated

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.

What is the definition of started ? This looks like we are duplicating state information ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@lgirdwood Component is started, but it hasn't yet copied any data. It's really just used to avoid reporting an unecessary xrun. Couldn't come up with any another name and adding additional comp state was too much.

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.

This just seems like a shortcut by adding a new state indirectly and cheaply and will ultimately lead to confusion for integrators. I suggest we have STARTED and RUNNING states for components and pipeline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right now this is something internal for DAI, so I don't see integrators looking into it, since it's generic component. Adding additional state will add even more confusion, because it will be used only in this one place and I will need to set it pretty much in every component's copy.

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.

@tlauda pipeline and component states should all be in the one place period (especially since this is a generic state that should be useful for others too), we have one user of this new state today but that does not mean there wont be other users in the future.

@tlauda

tlauda commented Oct 2, 2019

Copy link
Copy Markdown
Contributor Author

SOFCI TEST

1 similar comment
@tlauda

tlauda commented Oct 2, 2019

Copy link
Copy Markdown
Contributor Author

SOFCI TEST

tlauda added 2 commits October 9, 2019 13:40
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Adds new component state named COMP_STATE_STARTED.
This new state indicates that the component has been
started, but hasn't copied any data yet.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
@tlauda
tlauda force-pushed the topic/dai-start-check branch from 2b01be9 to 2666277 Compare October 9, 2019 11:41
@tlauda
tlauda force-pushed the topic/dai-start-check branch from 2666277 to 46d352e Compare October 9, 2019 11:49
@tlauda

tlauda commented Oct 9, 2019 •

Copy link
Copy Markdown
Contributor Author

@lgirdwood Patch updated. Please check if it's what you've expected.

tlauda added 3 commits October 9, 2019 15:47
Uses new COMP_STATE_STARTED and sets it on START and RELEASE.
After that component can use their own logic to perform its
internal operations based on current state. API automatically
sets component's state to COMP_STATE_ACTIVE, if copy function
returned success.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Fixes rare cases of xruns reported on release with
timer scheduled pipelines. With timer scheduling
the timer tick can happen so quickly after the release,
that the DMA hasn't yet copied any data. Since position
is not zero, we will report an xrun.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Uses comp_is_started in pipeline_comp_params instead
of manually checking the state.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
@tlauda
tlauda force-pushed the topic/dai-start-check branch from 46d352e to a54a820 Compare October 9, 2019 13:54
@tlauda

tlauda commented Oct 15, 2019

Copy link
Copy Markdown
Contributor Author

@lgirdwood Closing this, because I've implemented different version in #1945. After giving it a little thought adding new comp state is not the right way to go in this particular case.

@tlauda tlauda closed this Oct 15, 2019
@tlauda
tlauda deleted the topic/dai-start-check branch November 22, 2019 11:22
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.

4 participants