All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Rob Duncan <rduncan@teslamotors.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: Available frames > buffer size
Date: Thu, 10 Dec 2015 20:24:50 +0100	[thread overview]
Message-ID: <5669D182.8040707@ladisch.de> (raw)
In-Reply-To: <94A33372-433A-454F-841E-BBD32EE87864@teslamotors.com>

Rob Duncan wrote:
> Is it ever correct for snd_pcm_avail() to return a value that’s greater
> than that returned by snd_pcm_hw_params_get_buffer_size()?

Yes, but only if have disabled stop-on-underrun (by setting the
stop_threshold to the boundary value).

> the writei() call returns 2080.  I immediately ask how many frames are
> available now (I usually get a small number in response ~ 20-30) but
> this time I get an XRUN.

The XRUN state can indicate either an underrun or some other error that
makes the stream stop.  What exactly that some other error could be
depends on the driver.

> I call snd_pcm_recover() and then snd_pcm_avail() again and now I get
> 4126 frames.
>
> As you can see the time between these two logs is less than
> 1 millisecond, so I don’t understand how the PCM can go from
> 2080 frames available to >4096 frames available so quickly.

This sounds like a bug. Which version of alsa-lib are you using?


Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2015-12-10 19:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 14:48 Available frames > buffer size Rob Duncan
2015-12-10 19:24 ` Clemens Ladisch [this message]
2015-12-10 21:24   ` Rob Duncan
2015-12-11 18:47   ` Rob Duncan

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=5669D182.8040707@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=rduncan@teslamotors.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.