On 01/11/2019 16:39, Pierre-Louis Bossart wrote:
+static int qcom_swrm_prepare(struct snd_pcm_substream *substream,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ struct snd_soc_dai *dai)
+{
+ÂÂÂ struct qcom_swrm_ctrl *ctrl = dev_get_drvdata(dai->dev);
+
+ÂÂÂ if (!ctrl->sruntime[dai->id])
+ÂÂÂÂÂÂÂ return -EINVAL;
+
+ÂÂÂ return sdw_enable_stream(ctrl->sruntime[dai->id]);
So in hw_params you call sdw_prepare_stream() and in _prepare you call sdw_enable_stream()?
Shouldn't this be handled in a .trigger operation as per the documentation "From ASoC DPCM framework, this stream state is linked to
.trigger() start operation."
If I move sdw_enable/disable_stream() to trigger I get a big click noise on my speakers at start and end of every playback. Tried different things but nothing helped so far!. Enabling Speaker DACs only after SoundWire ports are enabled is working for me!
There is nothing complicated on WSA881x codec side all the DACs are enabled/disabled as part of DAPM.
that looks like a work-around to me? If you do a bank switch without anything triggered, you are most likely sending a bunch of zeroes to your amplifier and enabling click/pop removals somehow.
It'd be worth looking into this, maybe there's a missing digital mute/unmute that's not done in the right order?
Digital mute does not help too, as they get unmuted before sdw_enable_stream() call in trigger, I hit same click sound.
Same in the disable path too!
Also I noticed that there are more than 20+ register read/writes in the sdw_enable_stream() path which took atleast 30 to 40 milliseconds.
I will try my luck checking the docs to see if I can find something which talks about this.