On 2018年03月27日 23:37, Pierre-Louis Bossart wrote:
On 3/27/18 4:17 AM, Wu Zhigang wrote:
When pipeline processing the command, we have to turn off the IRQs. If not, the DMA IRQ will interrupt the pipeline state set process, when pipeline is scheduled, the states inconsistence will cause xrun.
we disable the irqs but then will walk the graph from host to DAI with component_op_downstream to pass a COMPS_OPS_CMD with in turn will call all .cmd callbacks from all components
This could take a significant amount of time and lead to interrupts unrelated to that specific pipeline not being serviced, leading to xruns.
what am I missing?
This point I also mentioned in the previous email list. I also worried about the IRQs masked duration might be too long. My suggestion is change the state set sequence, set the DAI component first, then VOL, the last HOST. Liam's comments is the mask duration is short. thanks zhigang.wu
Signed-off-by: Wu Zhigang zhigang.wu@linux.intel.com
Tested with apl-gpmrb board
kernel: https://github.com/plbossart/sound.git%C2%A0 branch: topic/sof-v4.14 95d77adbaadc44b28c8975a3714f70824d1a8529
firmware: git://git.alsa-project.org/sound-open-firmware.git branch: 1.1-stable 210989dffeea811de2370fccb7cf5d53106b1e6e
tools: branch: 1.1-stable cc91c73aa3e91eea35abdeb76d578b97f718feff
src/audio/pipeline.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 1b7f248..23be503 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -627,6 +627,7 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd, { struct op_data op_data; int ret; + uint32_t flags; trace_pipe("cmd"); @@ -635,7 +636,7 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd, op_data.cmd = cmd; op_data.cmd_data = data; - spin_lock(&p->lock); + spin_lock_irq(&p->lock, flags); if (host->params.direction == SOF_IPC_STREAM_PLAYBACK) { /* send cmd downstream from host to DAI */ @@ -651,7 +652,7 @@ int pipeline_cmd(struct pipeline *p, struct comp_dev *host, int cmd, trace_error_value(cmd); } - spin_unlock(&p->lock); + spin_unlock_irq(&p->lock, flags); return ret; }