lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d17a2a2-3033-e740-a466-e6cf7919adb2@linux.intel.com>
Date:   Fri, 1 Nov 2019 11:39:38 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        robh@...nel.org, vkoul@...nel.org
Cc:     devicetree@...r.kernel.org, alsa-devel@...a-project.org,
        bgoswami@...eaurora.org, linux-kernel@...r.kernel.org,
        spapothi@...eaurora.org, lgirdwood@...il.com, broonie@...nel.org
Subject: Re: [alsa-devel] [PATCH v4 2/2] soundwire: qcom: add support for
 SoundWire controller


>>> +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?

> 
>>
>> It's also my understanding that .prepare will be called multiples times, 
> 
> I agree, need to add some extra checks in the prepare to deal with this!
> 
>> including for underflows and resume if you don't support INFO_RESUME.
> 
>>
>> the sdw_disable_stream() is in .hw_free, which is not necessarily 
>> called by the core, so you may have a risk of not being able to recover?
> 
> Hmm, I thought hw_free is always called to release resources allocated 
> in hw_params.
> 
> In what cases does the core not call this?

yes, but prepare can be called without hw_free called first. that's why 
we updated the state machine to allow for DISABLED|DEPREPARED -> 
PREPARED transitions.

>>> +static const struct dev_pm_ops qcom_swrm_dev_pm_ops = {
>>> +    SET_RUNTIME_PM_OPS(qcom_swrm_runtime_suspend,
>>> +               qcom_swrm_runtime_resume,
>>> +               NULL
>>> +    )
>>> +};
>>
>> Maybe define pm_runtime at a later time then? We've had a lot of race 
>> conditions to deal with, and it's odd that you don't support plain 
>> vanilla suspend first?
>>
> Trying to keep things simple for the first patchset! added this dummies 
> to keep the soundwire core happy!

If you are referring to the errors when pm_runtime is not enabled, we 
fixed this is the series that's been out for review for 10 days now...

see '[PATCH 03/18] soundwire: bus: add PM/no-PM versions of read/write 
functions', that should remove the need for dummy functions.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ