All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Dimitris Papavasiliou <dpapavas@gmail.com>
Cc: alsa-devel@alsa-project.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: Re: Need help fixing pop/click artifacts in an ASOC driver
Date: Thu, 20 Dec 2018 15:36:13 +0000	[thread overview]
Message-ID: <20181220153613.GC9325@sirena.org.uk> (raw)
In-Reply-To: <8c996338-19a3-996b-16dc-5535688ccea2@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2091 bytes --]

On Wed, Dec 19, 2018 at 11:44:46PM +0200, Dimitris Papavasiliou wrote:
> On 12/19/18 6:19 PM, Mark Brown wrote:
> > If you're saying you're keeping the device open while you're doing this
> > (rather than closing the stream and reconfiguring) then I'd expect
> > you're going to find other hardware which has similar issues, reclocking
> > the device isn't something I'd expect to be able to do glitch free.

> I got pops even if I opened the stream, called hw_params and closed it
> on each iteration, but, as it turns out, that was in part because I
> was being lazy, using a Python script to do the above, which sneaked
> in a hw_params call immediately after opening the stream, to "reset"
> it to default values.

Wow, that's...  interesting.

> So I've retried your suggested approach.  It looks like setting
> .ignore_pmdown_time = 1 in the snd_soc_dai_link of the machine driver
> is enough to cause immediate power ups/downs, but I get the following
> behavior: The device gets powered up immediately after the first
> hw_params call (even if nothing gets played subsequently) and it gets

Are you sure it's the hw_params() call itself?

> powered down immediately after it's closed.  This does avoid the pop
> when the device gets configured right after opening it, which, as you
> say, seems to be what usually happens (I checked with the SoX play
> utility and the MPD), but a pop is generated if there are multiple
> hw_params calls and the sample rate is changed in any but the first one
> (where the device is still powered down).

> This can conceivably happen (for instance the Python library I was
> using, forces you to make multiple hw_params calls, in order to set
> more than one parameters).  Is there some way to configure the DAPM to
> power up the card right before playback starts, and power it down
> right after it stops?  This would prevent pops even in such
> pathological cases.

This is what's supposed to happen.  DAPM is triggered in the prepare()
callback, you can call hw_params() as often as you like and it should
have no interaction with DAPM at all.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2018-12-20 15:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 16:37 Need help fixing pop/click artifacts in an ASOC driver Dimitris Papavasiliou
2018-11-08  1:42 ` Pierre-Louis Bossart
2018-11-08 15:18   ` Takashi Iwai
2018-11-10 15:46   ` Dimitris Papavasiliou
2018-11-14 22:06     ` Mark Brown
2018-11-14 22:50       ` Dimitris Papavasiliou
2018-11-14 23:02         ` Mark Brown
2018-11-14 23:55           ` Dimitris Papavasiliou
2018-11-15  0:33             ` Mark Brown
2018-11-15 11:25               ` Dimitris Papavasiliou
2018-11-15 19:04                 ` Mark Brown
2018-11-18 13:37                   ` Dimitris Papavasiliou
2018-11-24 20:17                     ` Dimitris Papavasiliou
2018-12-13 17:42                       ` Mark Brown
2018-12-17 12:17                         ` Dimitris Papavasiliou
2018-12-17 12:37                           ` Mark Brown
2018-12-17 12:58                             ` Dimitris Papavasiliou
2018-12-17 14:10                               ` Mark Brown
2018-12-17 15:03                                 ` Dimitris Papavasiliou
2018-12-17 15:40                                   ` Mark Brown
2018-12-17 16:23                                     ` Dimitris Papavasiliou
2018-12-17 16:52                                       ` Mark Brown
2018-12-18 10:39                                         ` Dimitris Papavasiliou
2018-12-19 16:19                                           ` Mark Brown
2018-12-19 21:44                                             ` Dimitris Papavasiliou
2018-12-20 15:36                                               ` Mark Brown [this message]
2018-12-20 20:41                                                 ` Dimitris Papavasiliou
2018-12-21 10:57                                                   ` Mark Brown
2018-12-21 13:05                                                     ` Dimitris Papavasiliou
2018-12-21 17:33                                                       ` Mark Brown
2018-12-23 20:11                                                         ` Dimitris Papavasiliou
2018-12-22 14:44                                                       ` Matthias Reichl
2018-12-23 20:15                                                         ` Dimitris Papavasiliou
2018-12-17 15:03                           ` Pierre-Louis Bossart
2018-12-17 17:39                             ` Mark Brown
2018-12-17 18:08                               ` Pierre-Louis Bossart
2018-12-17 19:02                                 ` Mark Brown
2018-12-17 19:14                                   ` Pierre-Louis Bossart
2019-01-05 19:01                                     ` Pierre-Louis Bossart
2018-12-18 11:32                                 ` Dimitris Papavasiliou
2018-12-18 14:12                                   ` Pierre-Louis Bossart
2018-12-18 17:10                                     ` Dimitris Papavasiliou

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=20181220153613.GC9325@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=dpapavas@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    /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.