All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Clemens Ladisch" <cladisch@fastmail.net>
To: Gabriele Melia <gabmelia84@msn.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Broken playback
Date: Wed, 21 Nov 2007 17:09:35 +0100	[thread overview]
Message-ID: <1195661375.18942.1222573455@webmail.messagingengine.com> (raw)
In-Reply-To: <BLU107-W413B1F3D204AF054EDB272C1780@phx.gbl>

Gabriele Melia wrote:
> > Try non-blocking mode (see the snd_pcm_nonblock function). In non-
> > blocking mode, the writei call will only write as much data as can be
> > written without waiting (or returns -EAGAIN if the buffer is already
> > full at the moment).
> 
> I'm already in this case

Then the problem is not that the writei call takes too long.
An underrun can happen only when your code takes too much time between
two consecutive calls to writei.

> How to set the buffer size of the circular buffer in which i store the
> pcm that is then called by alsa?

snd_pcm_hw_params_set_buffer_size_near(), but the allowed values are
hardware dependent.  You might want to add your own circular buffer that
is bigger than ALSA's.


HTH
Clemens

  parent reply	other threads:[~2007-11-21 16:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21  8:46 Broken playback Gabriele Melia
2007-11-21 11:36 ` Clemens Ladisch
     [not found]   ` <BLU107-W5983EEB0D75DFABAC2EC60C1780@phx.gbl>
2007-11-21 15:28     ` Clemens Ladisch
     [not found]       ` <BLU107-W413B1F3D204AF054EDB272C1780@phx.gbl>
2007-11-21 16:09         ` Clemens Ladisch [this message]
     [not found]           ` <BLU107-W25C7A8D036E93269A46276C1780@phx.gbl>
2007-11-22  8:14             ` Clemens Ladisch

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=1195661375.18942.1222573455@webmail.messagingengine.com \
    --to=cladisch@fastmail.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=gabmelia84@msn.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.