alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Fons Adriaensen <fons@linuxaudio.org>
To: alsa-devel@alsa-project.org
Subject: Re: Trying to understand alsa
Date: Thu, 12 Jan 2012 21:50:38 +0000	[thread overview]
Message-ID: <20120112215038.GC25761@linuxaudio.org> (raw)
In-Reply-To: <1326404651.22083.28.camel@jonspc>

On Thu, Jan 12, 2012 at 09:44:11PM +0000, Jonathan Andrews wrote:
 
> What I want to do is tell ALSA to hold a buffer of 3 of my packets (3 x
> 1024Bytes, thats 512 x 16 bit samples) while I feed extra packets (1K
> Byte, 512 samples per buffer) in for playback.  The packets are arriving
> at roughly the correct rate, I just need a buffer to  iron out any
> jitter in network transmit, do I have to do this myself ?

Unless data is arriving on average at *exactly* the sample
rate of the ALSA device your buffering will sooner or later
underrun or overrun. ALSA itself can't handle this use case,
it requires adaptive resampling and it's not easy.

Ciao,

-- 
FA

Vor uns liegt ein weites Tal, die Sonne scheint - ein Glitzerstrahl.

  reply	other threads:[~2012-01-12 21:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 21:44 Trying to understand alsa Jonathan Andrews
2012-01-12 21:50 ` Fons Adriaensen [this message]
2012-01-12 22:12 ` Andrew Eikum
     [not found]   ` <1326410207.23310.17.camel@jonspc>
2012-01-13 15:10     ` Andrew Eikum
  -- strict thread matches above, loose matches on Subject: below --
2012-01-12 23:36 Jonathan Andrews
2012-01-12 23:36 Jonathan Andrews
2012-01-12 23:45 Jonathan Andrews
2012-01-13  1:25 ` Jonathan Andrews

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=20120112215038.GC25761@linuxaudio.org \
    --to=fons@linuxaudio.org \
    --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;
as well as URLs for NNTP newsgroup(s).