Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
	Stefan Binding <sbinding@opensource.cirrus.com>,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH 2/2] ALSA: hda/cs8409: Prevent pops and clicks during reboot
Date: Wed, 25 Aug 2021 19:04:05 +0100	[thread overview]
Message-ID: <e3df5f97-bf43-7eb8-e15d-4ab11dbae7ef@opensource.cirrus.com> (raw)
In-Reply-To: <s5hpmuce05m.wl-tiwai@suse.de>

On 17/08/2021 1:16 pm, Takashi Iwai wrote:
> On Tue, 17 Aug 2021 13:28:21 +0200,
> Vitaly Rodionov wrote:
>> On 14/08/2021 7:41 am, Takashi Iwai wrote:
>>> On Fri, 13 Aug 2021 08:10:47 +0200,
>>> Takashi Iwai wrote:
>>>> On Thu, 12 Aug 2021 20:34:33 +0200,
>>>> Vitaly Rodionov wrote:
>>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>>>>>
>>>>> During reboot, when the CS42L42 powers down, pops and clicks
>>>>> may occur due to the codec not being shutdown gracefully.
>>>>> This can be fixed by going through the suspend sequence,
>>>>> which shuts down the codec cleanly inside the reboot_notify
>>>>> hook, which is called on reboot.
>>>>>
>>>>> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
>>>>> Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
>>>> I hold this one for now, as there is a fix series that deprecates the
>>>> reboot_notify callback of HD-audio by forcibly doing runtime-suspend
>>>> at shutdown.  Please check the three patches in
>>>>     https://bugzilla.kernel.org/show_bug.cgi?id=214045
>>>>
>>>> I'm going to submit those soon in anyway.
>> Hi Takashi,
>>
>> Thanks for letting us know. We have tested against for-next branch and
>> we have an issue.
>>
>> Loud pops on reboot. It looks like suspend have never been called on
>> reboot or shutdown for us.
> OK, we need to track down the cause.
>
> Does the noise persist if the codec has been runtime-suspended
> beforehand?  You can check the status in sysfs.

Hi Takashi,

Sorry for the delay. We just wanted to get as much information as 
possible. Now we can see what causing pops on reboot.

Actually when codec is suspended and we do reboot from UI, then 
sometimes we see suspend() calls in kernel log and no pops, but sometimes

we still have no suspend() on reboot and we hear pops. But when we do 
reboot from command line: > sudo reboot  then we always have pops and no 
suspend() called.

Then we have added extra logging and we can see that on reboot codec 
somehow getting resume() call and we run jack detect on resume that 
causing pops.

We were thinking about possible solution for that and we would propose 
some changes in generic code hda_bind.c:

static void hda_codec_driver_shutdown(struct device *dev) { +   if 
(codec->patch_ops.suspend) +      codec->patch_ops.suspend(codec);    
snd_hda_codec_shutdown(dev_to_hda_codec(dev)); +  
hda_codec_driver_remove(dev_to_hda_codec(dev)); }

This have been tested on all our platforms without regression and it 
fixes pops issue on dolphin HW

as well for reboot from UI and > sudo reboot. We always getting 
suspend() calls

on reboot.

Thanks,

Vitaly

>
>
> thanks,
>
> Takashi


  reply	other threads:[~2021-08-25 18:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 18:34 [PATCH 1/2] ALSA: hda/cs8409: Prevent pops and clicks during suspend Vitaly Rodionov
2021-08-12 18:34 ` [PATCH 2/2] ALSA: hda/cs8409: Prevent pops and clicks during reboot Vitaly Rodionov
2021-08-13  6:10   ` Takashi Iwai
2021-08-14  6:41     ` Takashi Iwai
2021-08-17 11:28       ` Vitaly Rodionov
2021-08-17 12:16         ` Takashi Iwai
2021-08-25 18:04           ` Vitaly Rodionov [this message]
2021-08-26  6:03             ` Takashi Iwai
2021-08-26 10:49               ` Takashi Iwai
2021-08-26 10:56                 ` Vitaly Rodionov
     [not found]                 ` <9a3c2f9e-e2a5-702f-bd3f-7348097a0500@opensource.cirrus.com>
2021-08-26 12:20                   ` Takashi Iwai
2021-08-26 13:00                     ` Vitaly Rodionov
2021-08-26 15:14                       ` Vitaly Rodionov
2021-08-26 15:29                         ` Takashi Iwai
2021-08-13  6:08 ` [PATCH 1/2] ALSA: hda/cs8409: Prevent pops and clicks during suspend Takashi Iwai

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=e3df5f97-bf43-7eb8-e15d-4ab11dbae7ef@opensource.cirrus.com \
    --to=vitalyr@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=sbinding@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    /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