All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, patches.audio@intel.com,
	lgirdwood@gmail.com,
	Jaikrishna Nemallapudi <jaikrishnax.nemallapudi@intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	broonie@kernel.org,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Subject: Re: [PATCH 2/3] ALSA: core: modify .ack callback to take arguments for updating appl ptr
Date: Mon, 22 May 2017 11:11:03 +0530	[thread overview]
Message-ID: <20170522054103.GU15061@localhost> (raw)
In-Reply-To: <s5hk25emvrg.wl-tiwai@suse.de>

On Thu, May 18, 2017 at 10:09:23AM +0200, Takashi Iwai wrote:
> On Thu, 18 May 2017 08:18:21 +0200,
> Subhransu S. Prusty wrote:
> > 
> > On Tue, May 16, 2017 at 01:06:57PM +0530, Subhransu S. Prusty wrote:
> > > On Tue, May 16, 2017 at 07:56:44AM +0200, Takashi Iwai wrote:
> > > > On Tue, 16 May 2017 03:01:57 +0200,
> > > > Subhransu S. Prusty wrote:
> > > > > 
> > > > > From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > > > > 
> > > > > When appl_ptr is updated let low-level driver know, e.g.  to let the
> > > > > low-level driver/hardware pre-fetch data opportunistically.
> > > > > 
> > > > > The existing .ack callback is extended with new attribute argument, to
> > > > > support this capability. Legacy driver subscribe to SND_PCM_ACK_LEGACY and
> > > > > doesn't process ack if it is not set. SND_PCM_ACK_APP_PTR can be used to
> > > > > process the application ptr update in the driver like in the skylake
> > > > > driver which can use this to inform position of appl pointer to host DMA
> > > > > controller. The skylake driver to process the SND_PCM_ACK_APP_PTR will be
> > > > > submitted with a separate patch set.
> > > > > 
> > > > > In the ALSA core, this capability is independent from the NO_REWIND
> > > > > hardware flag. The low-level driver may however tie both options and only
> > > > > use the updated appl_ptr when rewinds are disabled due to hardware
> > > > > limitations.
> > > > > 
> > > > > Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> > > > > Signed-off-by: Jaikrishna Nemallapudi <jaikrishnax.nemallapudi@intel.com>
> > > > > Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> > > > 
> > > > It might be me who suggested the extension of the ack ops, but now
> > > > looking at the result, I reconsider whether it'd be a better choice if
> > > > we add another ops (e.g. update_appl_ptr()) instead.  Could you try to
> > > > rewrite the patch in that way for comparison?
> > > 
> > > Here is the version using update_appl_ptr.
> > 
> > Hi Takashi,
> > 
> > Did you get a chance to look at the update_appl_ptr changes?
> > Please let us know which one will be preferable, will submit the patches
> > accordingly.
> 
> Now I have a mixed feeling.  Using ack() is basically "the right
> thing".  The update of appl_ptr in forward/rewind and sync_ptr should
> be notified to ack() in general.  It's the purpose of ack(), after
> all.  In that sense, we may call ack() without any argument from any
> places.
> 
> The only problem is that the rewind is broken on some drivers, and
> calling ack() may lead to unexpected results.

Precisely the reason we went with an arg to make it opt-in and ensure
existing drivers don't break

> That is, we should look at these existing drivers and handle the
> rewind case (negative appl_ptr diff) appropriately -- or maybe we
> should add a flag to disallow the rewind on such drivers.
> After that, ack() can be called safely from all places that update
> appl_ptr.

Testing a large set of those drivers will be an issue :(

> ... this is one way.  Another way is to allow a quick hack and doubly
> call a new callback.

Sorry but how would invoking twice help here?

> 
> I prefer the former, but obviously it'll take longer.  So it depends
> on urgency.

We have been going back and forth on this for at least couple of years now,
so I would really love this to get merged before next window :)

-- 
~Vinod

  parent reply	other threads:[~2017-05-22  5:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16  1:01 [PATCH 0/3] ALSA: Add rewind disable support Subhransu S. Prusty
2017-05-16  1:01 ` [PATCH 1/3] ALSA: core: let low-level driver or userspace disable rewinds Subhransu S. Prusty
2017-05-16  5:53   ` Takashi Iwai
2017-05-16  7:40     ` Subhransu S. Prusty
2017-05-16  1:01 ` [PATCH 2/3] ALSA: core: modify .ack callback to take arguments for updating appl ptr Subhransu S. Prusty
2017-05-16  5:56   ` Takashi Iwai
2017-05-16  7:36     ` Subhransu S. Prusty
2017-05-18  6:18       ` Subhransu S. Prusty
2017-05-18  8:09         ` Takashi Iwai
2017-05-19 13:11           ` Takashi Iwai
2017-05-22  5:41           ` Vinod Koul [this message]
2017-05-16 16:11     ` Pierre-Louis Bossart
2017-05-19  3:57   ` Takashi Sakamoto
2017-05-19  6:27     ` Takashi Iwai
2017-05-19 15:01       ` Pierre-Louis Bossart
2017-05-22  5:22         ` Vinod Koul
2017-05-22  7:16           ` Takashi Iwai
2017-05-26  7:42             ` Vinod Koul
2017-05-26  7:47               ` Takashi Iwai
2017-05-26  8:01                 ` Vinod Koul
2017-05-22  5:21       ` Vinod Koul
2017-05-16  1:01 ` [PATCH 3/3] ALSA: pcm: conditionally avoid mmap of control data Subhransu S. Prusty
2017-05-16  5:38   ` Takashi Sakamoto
2017-05-16  5:46     ` Takashi Iwai
2017-05-16  5:57       ` Takashi Sakamoto
2017-05-16  6:18         ` Takashi Iwai
2017-05-16  6:24           ` Takashi Sakamoto
2017-05-16  6:34             ` Takashi Iwai
2017-05-16  6:54               ` Takashi Sakamoto
2017-05-16  7:02                 ` Takashi Iwai
2017-05-16 10:55                   ` Takashi Sakamoto

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=20170522054103.GU15061@localhost \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jaikrishnax.nemallapudi@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=patches.audio@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=subhransu.s.prusty@intel.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 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.