public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	robh@kernel.org, vkoul@kernel.org
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	bgoswami@codeaurora.org, linux-kernel@vger.kernel.org,
	spapothi@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org
Subject: Re: [alsa-devel] [PATCH v4 2/2] soundwire: qcom: add support for SoundWire controller
Date: Fri, 1 Nov 2019 12:52:40 -0500	[thread overview]
Message-ID: <3aa6695d-c9b6-b517-ff2f-8eb5a269f020@linux.intel.com> (raw)
In-Reply-To: <7ea278b4-ecd4-bd17-4550-3f6f9136260e@linaro.org>



On 11/1/19 12:22 PM, Srinivas Kandagatla wrote:
> 
> 
> 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.

wow, that's a very slow command bandwith, is this because of a low frame 
rate or the SLIMbus transport in the middle?

At any rate, we've got to improve the bank switch. The intent of the 
alternate banks is that software mirrors the register settings in the 
background and only updates what needs to be changed during the 
enable/disable part. when you operate with a fixed clock frequency 
usually it's only the channel enable that changes so it could be very 
fast (1 write deferred to the SSP point).

On the intel side our command bandwidth is comparable with the usual 
I2C/HDaudio codecs, but still things complicated and slower than they 
should be. I have been chasing a bug happening on bank switches in 
multi-stream configurations for 10+ days and it's quite hard to debug at 
the moment.

One possibility is to use regmap for the banked registers, and a manual 
mirroring after each bank switch. Or maybe we could even have an 
extension of regmap to do this for us.

> I will try my luck checking the docs to see if I can find something 
> which talks about this.



      reply	other threads:[~2019-11-01 17:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 15:31 [PATCH v4 0/2] soundwire: Add support to Qualcomm SoundWire master Srinivas Kandagatla
2019-10-30 15:31 ` [PATCH v4 1/2] dt-bindings: soundwire: add bindings for Qcom controller Srinivas Kandagatla
2019-11-05  1:49   ` Rob Herring
2019-10-30 15:31 ` [PATCH v4 2/2] soundwire: qcom: add support for SoundWire controller Srinivas Kandagatla
2019-10-30 16:28   ` [alsa-devel] " Pierre-Louis Bossart
2019-11-01 16:17     ` Srinivas Kandagatla
2019-11-01 16:39       ` Pierre-Louis Bossart
2019-11-01 17:22         ` Srinivas Kandagatla
2019-11-01 17:52           ` Pierre-Louis Bossart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3aa6695d-c9b6-b517-ff2f-8eb5a269f020@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=spapothi@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox