All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, broonie@kernel.org
Cc: robh@kernel.org, alsa-devel@alsa-project.org,
	bgoswami@codeaurora.org, spapothi@codeaurora.org,
	lgirdwood@gmail.com, vkoul@kernel.org
Subject: Re: [alsa-devel] [PATCH v10 2/2] ASoC: codecs: add wsa881x amplifier support
Date: Fri, 20 Dec 2019 11:38:16 -0600	[thread overview]
Message-ID: <5205e403-f4ec-0850-b813-d5250d121377@linux.intel.com> (raw)
In-Reply-To: <30c40a3b-2d70-b1a2-117b-63f0ece65cef@linaro.org>


>> Enabling the stream will cause a bank switch and (zero?) data to be 
>> transmitted, is this intentional?
>>
> I guess Yes!
> Myself and Vinod spent few weeks understanding the audio glitches if we 
> enable PA before soundwire ports, and finally hw guys came in with this 
> information, that PA has to be disabled before soundwire ports are enabled.
> 
>> If this is due to the order with the PA, then where is the PA handled?
>>
> 
> PA enable/mute are handled as part of DAPM and digital mute.

adding a comment would be nice then.

We can expect additional deviations from the initial ALSA->SoundWire 
mapping, it seems that the notion of 'prepare' was interpreted in 
different ways and some devices need to combine prepare/enable and 
disable/deprepare in the .trigger callback, i.e. prepare is used to 
'prepare streaming'. Others take a lot of time and and the 'prepare' is 
really 'prepare analog/power resources', which and require the two parts 
to be split. The standard is ambiguous on this, so both interpretations 
are legit, so we'll probably have to adjust in the SoundWire core at 
some point.

>>> +static int wsa881x_hw_free(struct snd_pcm_substream *substream,
>>> +               struct snd_soc_dai *dai)
>>> +{
>>> +    struct wsa881x_priv *wsa881x = dev_get_drvdata(dai->dev);
>>> +
>>> +    sdw_disable_stream(wsa881x->sruntime);
>>> +    sdw_deprepare_stream(wsa881x->sruntime);
>>
>> This works if you do a hw_params->prepare->hw_free transition, but 
>> isn't it possible to have hw_params->hw_free as well? In that case the 
>> stream would not enabled/prepared, so shouldn't you have the same test 
>> as in prepare?
> 
> Am not 100% sure if we would just have hw_params->hw_free, If that is 
> true, then yes we need the same check here too. However soundwire core 
> should throw invalid state error in such cases too.

It's probably better if you proactively check, we've seen cases where 
when the FE hw_params failed, the BE hw_free was called without the BE 
hw_params being invoked, so you should really test that everything was 
properly allocated and not rely on another state machine/framework.

With that feel free to add my tag below for the next revision

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

      reply	other threads:[~2019-12-20 17:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 11:56 [alsa-devel] [PATCH v10 0/2] ASoC: codecs: Add WSA881x Smart Speaker amplifier support Srinivas Kandagatla
2019-12-20 11:56 ` [alsa-devel] [PATCH v10 1/2] dt-bindings: ASoC: Add WSA881x bindings Srinivas Kandagatla
2019-12-20 11:56 ` [alsa-devel] [PATCH v10 2/2] ASoC: codecs: add wsa881x amplifier support Srinivas Kandagatla
2019-12-20 15:45   ` Pierre-Louis Bossart
2019-12-20 16:31     ` Srinivas Kandagatla
2019-12-20 17:38       ` 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=5205e403-f4ec-0850-b813-d5250d121377@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=lgirdwood@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.