Skip to content

Conversation

@bardliao
Copy link
Collaborator

The PR is an update of #4288. I didn't change anything except removing ABI: bump level to 3.19.

@bardliao bardliao requested review from a team, dbaluta, lbetlej, lgirdwood and mmaka1 as code owners June 23, 2021 08:05
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

@bardliao I can see an issue with APL no codec, but I suspect this is related to mixer. Can you add a subsequent patch here that uses a passthrough volume for PCM0 on APL nocodec topology. i.e remove the mixer pipeline and the SRC pipeline.

@plbossart
Copy link
Member

@bardliao I can see an issue with APL no codec, but I suspect this is related to mixer. Can you add a subsequent patch here that uses a passthrough volume for PCM0 on APL nocodec topology. i.e remove the mixer pipeline and the SRC pipeline.

that's what I did already with PR #4378
it's not great though, the mixer adds a lot of value for validation, we should instead have mixers in all topologies...

@keyonjie
Copy link
Contributor

@plbossart @bardliao I triggered a daily test level CI validation, the extra xrun still happen with this PR applied, please check the result of test plan 4820.

@brentlu
Copy link
Contributor

brentlu commented Jun 23, 2021

XRUN also happens to ADLP_RVP_NOCODEC/multiple-pause-resume-25.sh which does not enable this feature. It seems to me the only difference in this case is the handling of SSCR1_TSRE/SSCR1_RSRE

I'm wondering if it's valid to re-configure the SSP port for starting a streaming while the other one is in PAUSE state? That's what happen in this test case.

@plbossart
Copy link
Member

@plbossart @bardliao I triggered a daily test level CI validation, the extra xrun still happen with this PR applied, please check the result of test plan 4820.

it's impossible to draw any conclusion, this platform is already broken BEFORE testing this PR. We first need to have TGLU_NOCODEC to pass all tests before we can see what this impact of this PR might be. The same firmware/topology is used for ADL_NOCODEC in #4372 so the xruns/ipc timeouts need to be fixed first. Then we can see what this PR changes.

@bardliao
Copy link
Collaborator Author

@plbossart @bardliao I triggered a daily test level CI validation, the extra xrun still happen with this PR applied, please check the result of test plan 4820.

I can see the xrun also happens in daily test 4778 multiple-pause-resume-25.sh case. Besides, simultaneous-playback-capture-25.sh and multiple-pause-resume-25.sh test are FAIL in daily test 4803, check-capture-50rounds.sh FAIL in daily test 4834. So I triggered a test (4841) with stable-v1.8 branch + this PR, but TGLU_RVP_NOCODEC even failed on the verify-kernel-boot-log.sh test.

[    3.312337] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: error: volatile control found for dynamic widget 
[    3.312447] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: error: tplg component load failed -22
[    3.312456] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load DSP topology -22
[    3.312463] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
[    3.312495] kernel: sof-nocodec sof-nocodec: ASoC: failed to instantiate card -22
[    3.312703] kernel: sof-nocodec: probe of sof-nocodec failed with error -22

Maybe we should wait until TGLU_RVP_NOCODEC becomes stable and test again?

@keyonjie
Copy link
Contributor

@plbossart @bardliao I triggered a daily test level CI validation, the extra xrun still happen with this PR applied, please check the result of test plan 4820.

I can see the xrun also happens in daily test 4778 multiple-pause-resume-25.sh case. Besides, simultaneous-playback-capture-25.sh and multiple-pause-resume-25.sh test are FAIL in daily test 4803, check-capture-50rounds.sh FAIL in daily test 4834. So I triggered a test (4841) with stable-v1.8 branch + this PR, but TGLU_RVP_NOCODEC even failed on the verify-kernel-boot-log.sh test.

[    3.312337] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: error: volatile control found for dynamic widget 

This is definitely because of someone has changed to force dynamic pipelines on your DUT.

[ 3.312447] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: error: tplg component load failed -22
[ 3.312456] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: error: failed to load DSP topology -22
[ 3.312463] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ASoC: error at snd_soc_component_probe on 0000:00:1f.3: -22
[ 3.312495] kernel: sof-nocodec sof-nocodec: ASoC: failed to instantiate card -22
[ 3.312703] kernel: sof-nocodec: probe of sof-nocodec failed with error -22


Maybe we should wait until TGLU_RVP_NOCODEC becomes stable and test again?

@plbossart
Copy link
Member

@bardliao can you rebase and add the BCLK_ES to sof-cavs_nocodec.m4, that replaces apl, cnl and tgl versions.

Also not sure why you removed the 3.19 ABI change, is this because it's already been done.

plbossart and others added 9 commits July 2, 2021 13:31
when the bclk is not based on the default source, we will thrown an
error message but return the result of the mclk configuration.

Fix by adding an explicit -EINVAL return value.

Reported-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The DAI_CONFIG IPC is currently used both for hw_params and
hw_free. For some DAIs, there are hacky ways with e.g. invalid DMA
channels to indicate a hw_free. Rather than adding a new IPC for
hw_params and hw_free, let's add a flag that indicates if the
DAI_CONFIG is really applied during a hw_params or hw_free stage.

This is tagged as a ABI 3.19 change.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add two clks_control bits. MCLK and/or BCLK will start during hw_params
and stop during hw_free if the corresponding bit is set.

This is tagged as a ABI 3.19 change.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
…e mclk/bclk

MCLK and BCLK can be set/release separately. We can set/release mclk/bclk
more flexible with these helpers.

The helpers are defined after the Linux ones, 'prepare_enable' will
first select the relevant resources then enable the clock
output. Conversely 'disable_unprepare' will stop the clock output then
release the clock resources.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Some codecs need the SSP bit clock to start before data is provided,
and conversely the bit clock to remain active until the hw_free stage.

For backwards-compatibility with older kernels, the
SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES and
SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_ES bitfields are used to set an
internal state in the ssp->clk_active field. This helps deals with the
case where a topology sets these bits but the older kernel does not
make use of the modified IPC.

While we are at it, add clearer info traces for SSP configurations.

Note that the FSYNC only starts when DMA transfers are enabled in the
.trigger stage. This is by-design, the FSYNC will only start if the
FIFO is not empty. During the prepare stages the DMA transfers are not
enabled so the FIFOs are empty.

To enable the FSYNC at an earlier stage, we would need a major surgery
in the SOF architecture, or we would need to start zero-based DMA
transfers.

Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The current code does not follow recommended programming sequences:
TSRE and RSRE should be set before SSE and conversely cleared before
SSE.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Define the SSP_CC_MCLK/BCLK_ES bit to be used in SSP_CONFIG_DATA macro
to enable mclk/bclk on hw_params and disable malk/bclk on hw_free.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Set clks_control to (SOF_DAI_INTEL_SSP_CLKCTRL_MCLK_ES |
SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_ES) to enable MCLK/BCLK early start
feature.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Enable the bclk clock control for SSP2.

Note that this impacts existing GLK-based chromebooks as well as newer
hardware.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao bardliao force-pushed the bclk-early-start branch from 10352e2 to 32d04e9 Compare July 2, 2021 05:53
@bardliao
Copy link
Collaborator Author

bardliao commented Jul 2, 2021

@bardliao can you rebase and add the BCLK_ES to sof-cavs_nocodec.m4, that replaces apl, cnl and tgl versions.

Done

Also not sure why you removed the 3.19 ABI change, is this because it's already been done.

Yes, see abi.h

@lgirdwood
Copy link
Member

@bardliao seeing what appears to be clipping issues with alsa bat on PCM0. Looks like the gain could be too high (i.e. > 0dB) ?
@fredoh9 do you know the gains we are setting here for APL nocodec PCM0
Screenshot from 2021-07-02 14-28-06
?

@bardliao
Copy link
Collaborator Author

bardliao commented Jul 5, 2021

@bardliao seeing what appears to be clipping issues with alsa bat on PCM0. Looks like the gain could be too high (i.e. > 0dB) ?

@lgirdwood I didn't change the gain setting in this PR. And the same issue appears in recent daily tests. Like
https://sof-ci.01.org/sofpr/PR4446/build9559/devicetest/
https://sof-ci.01.org/sofpr/PR4448/build9568/devicetest/

@plbossart
Copy link
Member

SOFCI TEST

@lgirdwood
Copy link
Member

@bardliao seeing what appears to be clipping issues with alsa bat on PCM0. Looks like the gain could be too high (i.e. > 0dB) ?

@lgirdwood I didn't change the gain setting in this PR. And the same issue appears in recent daily tests. Like
https://sof-ci.01.org/sofpr/PR4446/build9559/devicetest/
https://sof-ci.01.org/sofpr/PR4448/build9568/devicetest/

Thanks @bardliao I've checked today and I'm seeing this clipping on about ~50% of APL nocodec today so it's unrelated to your PR. Since this is loopback I'm suspicious the gain is possibly coming internal sampling (as levels will rise faster) of the MSB (as playback/capture with codec seems to be fine).

@plbossart any comments, seems like this is not related to this PR.

@plbossart
Copy link
Member

@bardliao seeing what appears to be clipping issues with alsa bat on PCM0. Looks like the gain could be too high (i.e. > 0dB) ?

@lgirdwood I didn't change the gain setting in this PR. And the same issue appears in recent daily tests. Like
https://sof-ci.01.org/sofpr/PR4446/build9559/devicetest/
https://sof-ci.01.org/sofpr/PR4448/build9568/devicetest/

Thanks @bardliao I've checked today and I'm seeing this clipping on about ~50% of APL nocodec today so it's unrelated to your PR. Since this is loopback I'm suspicious the gain is possibly coming internal sampling (as levels will rise faster) of the MSB (as playback/capture with codec seems to be fine).

@plbossart any comments, seems like this is not related to this PR.

I don't know what's going on here, the updated test shows no issues with alsa-bat but problems with multi-pipelines and what looks like an xrun https://sof-ci.01.org/sofpr/PR4391/build9583/devicetest/?model=APL_UP2_NOCODEC&testcase=simultaneous-playback-capture

I have this feeling that different runs are testing different configs.

@lgirdwood
Copy link
Member

I don't know what's going on here, the updated test shows no issues with alsa-bat but problems with multi-pipelines and what looks like an xrun https://sof-ci.01.org/sofpr/PR4391/build9583/devicetest/?model=APL_UP2_NOCODEC&testcase=simultaneous-playback-capture

I have this feeling that different runs are testing different configs.

Yes, I think we are seeing lower frequency issues popping up here and unrelated to the changes in this PR. Could the multistream xruns get us into a state where we clip, not sure....but cant rule it out.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

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

let's merge this so that we have a daily test with nocodec mode with all the latest changes

@lgirdwood lgirdwood merged commit ad7f0e5 into thesofproject:main Jul 6, 2021
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.

5 participants