All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Elias Kokkinis <ekokkinis@upatras.gr>
Cc: alsa-devel@alsa-project.org
Subject: Re: Read and write different buffer sizes
Date: Fri, 13 Jan 2012 16:01:28 +0100	[thread overview]
Message-ID: <4F104748.2000900@ladisch.de> (raw)
In-Reply-To: <B927995C-7CD1-46DF-9B58-A4E62574A688@upatras.gr>

Elias Kokkinis wrote:
> I would like to ask if it is possible in ALSA to define different
> buffer sizes in the input and output streams.

Yes.  (But which buffer sizes are allowed always depends on the
hardware's capabilities.)

> I am using PCM sound and I want to read 2048 samples, do some
> processing involving overlap-add and then keep 1024 of them and put
> them to the output. And so on...
>
> So I want to have the same sample rate and everything but different
> buffer sizes. Is this possible? I have tried an implementation of
> this, but I think the output for some reason still outputs 2048
> samples and the audio is choppy, like having 1024 samples of audio and
> 1024 of silence.

Regardless of the buffer size, when both devices run at the same rate,
you must output, on the average, as many samples as you have read.


Regards,
Clemens

  reply	other threads:[~2012-01-13 15:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 12:19 Read and write different buffer sizes Elias Kokkinis
2012-01-13 15:01 ` Clemens Ladisch [this message]
2012-01-13 17:42   ` Elias Kokkinis

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=4F104748.2000900@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=ekokkinis@upatras.gr \
    /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.