All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Rob Duncan <rduncan@tesla.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: More snd_pcm_ioplug_avail_update() questions
Date: Thu, 26 Jul 2018 17:14:34 +0200	[thread overview]
Message-ID: <s5hk1piyqp1.wl-tiwai@suse.de> (raw)
In-Reply-To: <dw77emeffqca5y.fsf@tesla.com>

On Thu, 26 Jul 2018 17:02:33 +0200,
Rob Duncan wrote:
> 
> 
> At 07:37 on Thu, Jul 26 2018, Takashi wrote:
> > OK, I seem to have misunderstood about what you meant as committed in
> > the context.  Yes, if the available is partial, it might be not
> > committed.  But I don't understand the next part.
> >
> > How will it be discarded at the next snd_pcm_ioplug_avail_update()?
> > The data remains on the buffer, and applptr isn't changed.
> 
> Yes, that's the problem.  Because when snd_pcm_ioplug_avail_update() is
> subsequently called it uses snd_pcm_mmap_begin() to get the offset into
> the mmap for the destination of the capture transfer operation.  This is
> essentially appl_ptr, which means that the data that has not yet been
> commited will be overwritten by the transfer.

OK, point taken.  Yeah, if the ioplug driver expects that the transfer
happens only once, it's a problem.

> I guess that the offset could somehow be adjusted to point to after the
> uncommitted data but I don't see a straightforward way to do that.  A
> scheme along these lines would also have to adjust the size parameter
> accordingly, of course.  This would sometimes mean that we cannot
> transfer all the available data from the IO plugin.  Would that cause
> any issues?

Maybe we can track the own applptr (e.g. transfer_ptr or such) and
calculate the transfer size from it instead of snd_pcm_mmap_begin();
i.e. write some open codes of alternative snd_pcm_mmap_begin() there.

Then transfer_ptr is updated again in snd_pcm_ioplug_mmap_commit() as
well when applptr is updated.

Of course, there is a smarter way, I'd happily take another approach.


thanks,

Takashi

  reply	other threads:[~2018-07-26 15:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 21:52 More snd_pcm_ioplug_avail_update() questions Rob Duncan
2018-07-26  7:04 ` Takashi Iwai
2018-07-26 14:19   ` Rob Duncan
2018-07-26 14:37     ` Takashi Iwai
2018-07-26 15:02       ` Rob Duncan
2018-07-26 15:14         ` Takashi Iwai [this message]
2018-07-30 18:55           ` Rob Duncan
2018-07-31  8:21             ` 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=s5hk1piyqp1.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=rduncan@tesla.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.