Repository navigation
Closed
Labels
GLKApplies to Gemini LakeApplies to Gemini LakeP1Blocker bugs or important featuresBlocker bugs or important featuresbugSomething isn't workingSomething isn't working
Description
This issue is found on Yorp Chromebook.
How to reproduce:
- plug in headset
- run speaker-test -D hw:0,1 -c 2 or aplay -Dhw:0,1 -f dat -c 2 Music.wav
- ctrl + c to stop speaker-test or aplay
- Do not unplug headset and check DAPM status:
grep On /sys/kernel/debug/asoc/sof-glkda7219max/ -r
DAPM status after playback:
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Playback:Playback: On in 0 out 2
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/HPR:HPR: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/HPL:HPL: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Charge Pump:Charge Pump: On in 0 out 0 - R71(0x47) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Headphone Right PGA:Headphone Right PGA: On in 0 out 0 - R108(0x6c) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Headphone Left PGA:Headphone Left PGA: On in 0 out 0 - R107(0x6b) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Mixout Right PGA:Mixout Right PGA: On in 0 out 1 - R111(0x6f) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Mixout Left PGA:Mixout Left PGA: On in 0 out 1 - R110(0x6e) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/DACR:DACR: On in 0 out 1 - R106(0x6a) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/DACL:DACL: On in 0 out 1 - R105(0x69) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/ST Mixer Out FilterR:ST Mixer Out FilterR: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/ST Mixer Out FilterL:ST Mixer Out FilterL: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Mixer Out FilterR:Mixer Out FilterR: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Mixer Out FilterL:Mixer Out FilterL: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Out DACR Mux:Out DACR Mux: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Out DACL Mux:Out DACL Mux: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/DAIIN:DAIIN: On in 0 out 2
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/DAI:DAI: On in 0 out 0 - R44(0x2c) mask 0x80
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/TONE:TONE: On in 1 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/Mic Bias:Mic Bias: On (forced) in 0 out 0 - R98(0x62) mask 0x8
/sys/kernel/debug/asoc/sof-glkda7219max/i2c-DLGS7219:00/dapm/bias_level:On
/sys/kernel/debug/asoc/sof-glkda7219max/MX98357A:00/dapm/bias_level:On
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/PIPELINE.7.HDA5.OUT:PIPELINE.7.HDA5.OUT: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF7.1:BUF7.1: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF7.0:BUF7.0: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/PIPELINE.6.HDA4.OUT:PIPELINE.6.HDA4.OUT: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF6.1:BUF6.1: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF6.0:BUF6.0: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/PIPELINE.5.HDA3.OUT:PIPELINE.5.HDA3.OUT: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF5.1:BUF5.1: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF5.0:BUF5.0: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/PIPELINE.4.DMIC0.IN:PIPELINE.4.DMIC0.IN: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF4.0:BUF4.0: On in 1 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/PIPELINE.3.SSP2.IN:PIPELINE.3.SSP2.IN: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF3.1:BUF3.1: On in 2 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF3.0:BUF3.0: On in 2 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/PIPELINE.2.SSP2.OUT:PIPELINE.2.SSP2.OUT: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/SSP2.OUT:SSP2.OUT: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF2.1:BUF2.1: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF2.0:BUF2.0: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/PIPELINE.1.SSP1.OUT:PIPELINE.1.SSP1.OUT: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF1.1:BUF1.1: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/BUF1.0:BUF1.0: On in 0 out 1
/sys/kernel/debug/asoc/sof-glkda7219max/sof-audio/dapm/bias_level:On
/sys/kernel/debug/asoc/sof-glkda7219max/dapm/Platform Clock:Platform Clock: On in 0 out 0
/sys/kernel/debug/asoc/sof-glkda7219max/dapm/Headphone Jack:Headphone Jack: On in 0 out 1
Test recipe:
ChromeOS:R73-11559.0.0
SOF/TPLG-glk-006-drop-stable: ad95dba8475b9
kernel-cros-sof-v4.14-rebase: a83979d
Metadata
Metadata
Assignees
Labels
GLKApplies to Gemini LakeApplies to Gemini LakeP1Blocker bugs or important featuresBlocker bugs or important featuresbugSomething isn't workingSomething isn't working
Activity
bardliao commentedon Feb 20, 2019
soc_dapm_dai_stream_event() will be trigger when playback is stop. When soc_dapm_dai_stream_event(SSP2.OUT) is triggered before soc_dapm_dai_stream_event(Passthrough Playback 1), the SSP2.OUT widget which connect to codec's widget will be checked to on due to "Passthrough Playback 1" widget is on. Unfortunately, the order is exactly what we have now.
But we don't see this issue on Up2. Compare to chrome book project, soc_dapm_dai_stream_event(SSP2.OUT) will be triggered by close_delayed_work() after above sequence is finished on Up2 and SSP2.OUT widget will be marked to off.
We can "fix" the issue by the following patch
plbossart commentedon Feb 20, 2019
bardliao commentedon Feb 21, 2019
@plbossart Sorry, it is not clear in the above comment. Let me describe it again. The FE dai (Passthrough Playback 1) should be closed before BE dai (SSP2.OUT). Otherwise, the BE dai will not be powered down since BE dai is connected to FE dai and the FE dai is still active. The .ignore_pmdown_time flag will take effect on both FE and BE dai. In other words, if we set .ignore_pmdown_time to a BE dai and not set in the connected FE dai, DAPM will close the BE dai immediately after playback is stop, but will close the FE dai after the power down time. As a result, the BE dai will be closed before the FE dai.
Currently, there is no way to set the .ignore_pmdown_time flag to a FE dai through topology. So, the easiest to prevent this issue is to remove the .ignore_pmdown_time flag from BE dai.
Thanks @xiulipan for helping on this.
plbossart commentedon Feb 21, 2019
@bardliao Sorry, still scratching my head on this one. if you stop the playback, isn't pm_runtime going to take everything down? Do we still get this issue after suspend happens?
bardliao commentedon Feb 22, 2019
Yes, we still get the issue after runtime suspended. pm_runtime will not take dapm down. In fact, the pcm512x codec is not going to suspend if there are some dapm widget on.
plbossart commentedon Feb 22, 2019
ok, so we do have the issue with the pcm512x (earlier it was stated it was not).
I see weird things with the -nohdmi topology:
I am not too sure why the SSP5 and BUF1.1/1.0 are On even before I start playing. I do see a number of IPCs on startup but there is no .trigger or .prepare/hw_params.
What I do see is that the Pipeline seems to detached and somehow the buffers are on even though the other components they are linked to are off, so it could be an issue with the buffer widgets.

plbossart commentedon Feb 22, 2019
With HDMI taken out there is clearly something wrong with the topology:
The fact that there are two connections duplicated looks suspicious...
bardliao commentedon Feb 23, 2019
@plbossart
You will see this issue if you set ignore_pmdown_time = 1, to the dai link of "SSP5-Codec" in bxt_pcm512x.c
You will see more widgets are On and will not be Off after playback is stop
SSP5.OUT on will lead to the codec widgets are on, and it is the problem.
The widget id of BUF1.0 and BUF1.1 is snd_soc_dapm_buffer, and it is snd_soc_dapm_scheduler for PIPELINE.1.SSP5.OUT. The power will always on for those two widget ids
w->power_check = dapm_always_on_check_power;
It looks weird for me, too. But I think it will not effect the result since the power status of the duplicated connections will be the same.
plbossart commentedon Feb 25, 2019
@ranj063 any comments on the fact that there are duplicate connections? Could it be a topology issue?
ranj063 commentedon Feb 25, 2019
@plbossart the duplicate connection looks weird. I'm not sure it is a topology issue. Looking at the tplg graph I only see the connections as below.

plbossart commentedon Feb 25, 2019
@ranj063 can you remind me where this tplg->graph is? I'd like to run it on the PCM512x topology just to double-check the topology is correct
ranj063 commentedon Feb 25, 2019
@plbossart right now its only a binary. I'll send it to you by email and I'm going to submit a PR today to add it to the topology repo.
ranj063 commentedon Feb 25, 2019
@plbossart i figured out why there are 2 connections from Passthrough Playback 0 -> PCM0P. actually this is the case for all PCM's in our case. Turns out dapm automatically adds this route when the PCM0P widget is created. The duplicate connection comes from topology indeed. This comes from (in the case of pipe-volume-playback.m4) `dapm(N_PCMP(PCM_ID), Passthrough Playback PCM_ID)'.
If I remove this line from topology, the dapm graph shows up with 1 conenction but hw params fails because we use this route info to bind the PCM ID to the host component. But I think we can possibly remove it while creating the host comp. I'm working on the patch now. Will submit it ASAP.
ranj063 commentedon Feb 25, 2019
@plbossart as for the second issue with the buffers and pipeline widgets not turning off, I have a fix for it too. will submit it soon. These widget types are missing their default power_check definitions in soc-dapm.c.
ranj063 commentedon Feb 25, 2019
@plbossart #675 fixes both the problems with the buffers being ON and the duplicate connection.

bardliao commentedon Mar 1, 2019
Close it as it has fixed by #675