All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Alan Horstmann <gineera@aspect135.co.uk>
Cc: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Subject: Re: _mmap_playback_avail() short
Date: Tue, 29 Nov 2011 16:21:51 +0100	[thread overview]
Message-ID: <4ED4F88F.1080504@ladisch.de> (raw)
In-Reply-To: <201111291407.50367.gineera@aspect135.co.uk>

Alan Horstmann wrote:
> On Monday 28 November 2011 21:12, Clemens Ladisch wrote:
> > As a workaround, try snd_pcm_hw_params_set_periods_integer().
>
> Integer period for the pcm is actually already being set.

Strange; there's a bug somewhere ...

> Can you also explain how the non-integer period *size* is handled?

There are no non-integer period sizes.

> In the test case, dmix is set to 48000 with period 1024.  So at 44100 the
> rate conversion means the corresponding period size is 940.8.  I am not
> sure how that gets handled.  From the params dump giving period as (940 941)
> I had anticipated that a mixture of 4 * 941 and one 940 period would occur.
> However, what I see is that at a period boundary there is always just 940
> avail_frames - is that correct?

Have a look in /proc/asound/cardX/pcm0p/sub0/hw_params.

> How does that get converted to the 1024 frames at 48000?  Will there be
> irregular timing?

The rate plugin uses the proportion of the two period sizes for rate
conversion.  In your example, 940 samples are always converted into 1024
samples; the actual sample rate is 48000/1024*940 = 44062.5.


Regards,
Clemens

  reply	other threads:[~2011-11-29 15:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 17:38 Default device XRUNs with perriods=2 Alan Horstmann
2011-11-03 10:03 ` _mmap_playback_avail() short (was: Default device XRUNs with perriods=2) Alan Horstmann
2011-11-25 15:10   ` Alan Horstmann
2011-11-27  1:40     ` Raymond Yau
2011-11-28 11:03       ` Alan Horstmann
2011-11-28 21:12     ` _mmap_playback_avail() short Clemens Ladisch
2011-11-29 14:07       ` Alan Horstmann
2011-11-29 15:21         ` Clemens Ladisch [this message]
2011-11-29 22:07           ` Alan Horstmann

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=4ED4F88F.1080504@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=gineera@aspect135.co.uk \
    --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.