Repository navigation
kpb: add new state - #2331
kpb: add new state#2331
Conversation
|
@lgirdwood, @dbaluta this patch doesn't fix any issue, it just adds new state so we can have more detailed info in logs. Right now we will see a proper KPB state change like PREPARE -> RUN -> BUFFER -> INIT_DRAINING -> DRAINING -> ... -> RESET
Because these are private states of KPB and generic ones don't apply here. |
@mrajwa Oh, I see. Please add this information in the commit message. |
|
@mrajwa |
I am against treating KPB_STATE_INIT_DRAINING and KPB_STATE_DRAINING as one state. This is unnatural and not true and will confuse people reading the code, logs etc. As for not switching back from KPB_STATE_INIT_DRAINING to preserved state - I think its sane to switch back as soon as init of draining is done since as I described above this state blocks all others (internal buffering being the most crucial one here) |
701dd0e to
243ce18
Compare
I have UML code for it also but the question is where should I commit it? Into sof-dosc? I see there is no parser for uml only picture source is linked. |
|
@mrajwa looks good, I'm no UML parsing expert for docs, so better ask @mmaka1. Can you convert this to ASCII from UML to insert into the header (if we cant do this then a big comment is needed stating that any state changes must also be reflected in the UML diagram). i.e. I want to make it easy for anyone who changes code to alos update diagram. |
lgirdwood
left a comment
There was a problem hiding this comment.
I think we are almost good, lets just make it easier to follow for other developers.
There was a problem hiding this comment.
Lets just state the assumption about state in a comment here.
There was a problem hiding this comment.
and we can probably have a big fat comment here that any state changes must also be reflected in ASCII header diagram or UML diagram on sof-docs (with a link to said UML diagram).
There was a problem hiding this comment.
Yes very good idea, so let me first finish UML merging and once this is done I will come back here with the update.
|
@lgirdwood, I tried to convert it to ASCII using plantuml built in feature but it doesn't look good. So I would include it in the sof dosc in the form of plantuml code and/or actual rendered picture. |
@mrajwa you could try asciiflow here: http://asciiflow.com/ |
|
@keyonjie, this tool seems to be aimed to draw ASCII diagrams and it might work however, I don't see any option to save it as a code and no option to generate a picture for sof-dosc. Especially the former concerns me since it will make our diagrams hard to maintain - each time you would like to add new state you would have to redraw it yourself or tinker with ASCII in your own...nightmare. Plantuml is based on their code, so each and every time you modify something it all boils down to changing specific line in code. Not to mention it generates a nice picture right away. |
|
@mrajwa ok, lets do it in sof-docs, as long as we have some comment that explains this with command line for using the tool to generate the output. |
|
I have added a PR into sof-docs thesofproject/sof-docs#183 and added comments you requested in the FW. Can we merge now? I would like to merge it fast as I want to open new, bigger PR for KWD aimed to make it even more secure in corner cases. |
1119860 to
d30b561
Compare
This patch add a log message indicating wrong state of KPB during buffering. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This adds new state KPB_STATE_INIT_DRAINING into KPB internal states. This way we can see failed init draining in logs. This new state is also needed to change KPBs regular behavior in a situation where we have initied draining task, therefore calculated read position but the task doesn't start before next pipeline_copy happens. In this case, having this new state we can recognize it and update read position accordingly to new data. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>

This adds new state KPB_STATE_INIT_DRAINING
into KPB.
Signed-off-by: Marcin Rajwa marcin.rajwa@linux.intel.com