Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Henrik Eriksson <henrik.eriksson@axis.com>
To: alsa-devel@alsa-project.org
Subject: Re: dsnoop, hwpointer and avail
Date: Mon, 13 Nov 2017 11:12:43 +0100	[thread overview]
Message-ID: <20171113101243.GC5483@lnxhenriken2.se.axis.com> (raw)
In-Reply-To: <20171110122943.GB5483@lnxhenriken2.se.axis.com>

Hello

On Fri, Nov 10, 2017 at 13:29:43 +0100, Henrik Eriksson wrote:
> Is there any documentation/rationale for how pcm_dsnoop works in
> snd_pcm_{dsnoop_}status?  I am particularly wondering about the ordering
> of the snd_pcm_dsnoop_sync_ptr and the snd_pcm_status call on the slave
> pcm.
> 
> I see occasional spikes (>1000 frames) of difference between the slave
> pcm hwpointer after the snd_pcm_status call on it and the pointers in
> the dsnoop pcm, and a correspondingly bad avail count.  I suspect the
> mismatches are due to process scheduling (the slave pcm status is
> delayed because the application process not running and the hardware
> progresses during that delay).  Does this seem plausible?  If so, could
> the code be simplified to reduce the the number of systemcalls needed?
> The status of the slave pcm seems to provide much of the information
> used to sync the pointers.  Or is there some other way to get a tighter
> coupling between the dsnoop status htstamp and avail count?

Or, rather, in snd_pcm_dnsoop_status() would it not make more sense to
use the dsnoop->update_tstamp as tstamp in the returned status, at least
when the state is SNDRV_PCM_STATE_RUNNING?  The returned status->avail
count originates from snd_pcm_dsnoop_sync_ptr() and it seems sensible to
me that the tstamp would match that.

For background, this is on a machine with not mmap'ed status and control
(in pcm_hw.c) and using slowptr in dsnoop.

Regards,
/henrik

  reply	other threads:[~2017-11-13 10:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 12:29 dsnoop, hwpointer and avail Henrik Eriksson
2017-11-13 10:12 ` Henrik Eriksson [this message]
2017-11-14 16:29   ` Henrik Eriksson

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=20171113101243.GC5483@lnxhenriken2.se.axis.com \
    --to=henrik.eriksson@axis.com \
    --cc=alsa-devel@alsa-project.org \
    /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