Skip to content

still copy in none-active status - #356

Closed
xiulipan wants to merge 2 commits into
thesofproject:stable-1.2from
xiulipan:pipefix
Closed

xiulipan wants to merge 2 commits into
thesofproject:stable-1.2from
xiulipan:pipefix

Conversation

@xiulipan

Copy link
Copy Markdown
Contributor

Now FW will directly stop dma and no wait for last period to finish, FW may have some unfinished job that should be done even after the status is set to stop or pause. No need to cancel the task or check the status of comp.

Now will directly stop dma and no wait for last period finish, may have
some unfinished job to done even after the status is set.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Now will directly stop dma and no wait for last period finish, may have
some unfinished job to done even after the status is set. No need to
cancel the task or check the status of comp.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
@lgirdwood
lgirdwood requested review from mmaka1 and tlauda September 11, 2018 12:50
Comment thread src/audio/pipeline.c
switch (cmd) {
case COMP_TRIGGER_PAUSE:
case COMP_TRIGGER_STOP:
pipeline_schedule_cancel(p);

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 stops this being (re)scheduled after STOP ?

Comment thread src/audio/pipeline.c

/* don't go upstream if this component is not connected */
if (!buffer->connected || buffer->source->state != COMP_STATE_ACTIVE)
if (!buffer->connected)

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 will breal pipelines with a mixer, where closing one source stream will probably stop the sink stream (even if other source streams are active )?

Comment thread src/audio/host.c

tracev_host("cpy");

if (dev->state != COMP_STATE_ACTIVE)

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.

I dont see how this improve XRUN or pause release. This commit messages give no detail.

@xiulipan

Copy link
Copy Markdown
Contributor Author

@lgirdwood
I actually got quite confused about this issues, too.
With some log, I found that we have some sequence that will cause xrun:

  1. Normal case:
    dai irq, we have some dai dma buffer consume, then schedule a pipeline copy.
  2. Risk case a:
    IPC pause happen, dai irq, we have some dai dma buffer consume, then schedule pipeline copy.
  3. Risk case b:
    dai irq, we have some dai dma buffer consume, IPC pause happen, the schedule task is canceled.

Then when we resume, then case a and case b will miss some pipeline copy and buffer is not full and cause the xrun.

So in this case, I just let all case a and case b like the normal case that we make the pipeline copy unconditionally.

@xiulipan

Copy link
Copy Markdown
Contributor Author

0x364b870 [307.464319] delta [0.000522] ipc Nms // ipc comes
0x364b880 [307.464320] delta [0.000002] pipe ad! // add IPC process
0x364b890 [307.464323] delta [0.000003] pipe sch // call schedule
0x364b8a0 [307.464325] delta [0.000002] pipe sdf //schedule_edf runs now in IRQ LV4
0x364b8b0 [307.464328] delta [0.000003] pipe sei
0x364b8c0 [307.464331] delta [0.000003] dai irq // dai irq comes in IRQ LV5
0x364b8d0 [307.464334] delta [0.000002] dai dbp // dai cb function
0x364b8e0 [307.464335] delta [0.000001] value 0x00000000000000c0
0x364b8f0 [307.464337] delta [0.000002] pipe ad! // pipeline copy task scheduled
0x364b900 [307.464339] delta [0.000003] pipe sch // call schedule, but we actually in LV4 schedule_run
0x364b910 [307.464343] delta [0.000003] pipe prt // arch_run_task
0x364b920 [307.464345] delta [0.000002] pipe prT
0x364b930 [307.464346] delta [0.000001] pipe sdF // schedule_edf finished
0x364b940 [307.464348] delta [0.000002] pipe pit // in _irq_task IRQ LV2
0x364b950 [307.464350] delta [0.000002] pipe pif
0x364b960 [307.464351] delta [0.000001] value 0x00000000be0150c8
0x364b970 [307.464353] delta [0.000001] ipc Cmd // run IPC process
0x364b980 [307.464355] delta [0.000003] ipc tri
0x364b990 [307.464357] delta [0.000002] ipc trp
0x364b9a0 [307.464359] delta [0.000001] pipe cmd
0x364b9b0 [307.464360] delta [0.000002] host trg
0x364b9c0 [307.464362] delta [0.000002] volume trg
0x364b9d0 [307.464364] delta [0.000002] dai trg
0x364b9e0 [307.464366] delta [0.000002] dai tsp
0x364b9f0 [307.464367] delta [0.000002] dma DDi
0x364ba00 [307.464369] delta [0.000002] ssp tri
0x364ba10 [307.464372] delta [0.000002] ssp Ss1
0x364ba20 [307.464373] delta [0.000002] ssp Ss2
0x364ba30 [307.464375] delta [0.000002] pipe del // pipeline copy task is canceled.
0x364ba40 [307.464378] delta [0.000003] pipe piF
0x364ba50 [307.464380] delta [0.000002] pipe piT

@xiulipan

Copy link
Copy Markdown
Contributor Author

closed via some new PR #360

@xiulipan xiulipan closed this Sep 12, 2018
@xiulipan
xiulipan deleted the pipefix branch September 12, 2018 08:44
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.

2 participants