All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bram Bos <bos3@upcmail.nl>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Asynchronous ALSA - callback and latency questions
Date: Mon, 8 Sep 2014 18:03:13 +0200 (CEST)	[thread overview]
Message-ID: <1135001813.415555.1410192193064.open-xchange@upcmail.upc.nl> (raw)

Hello all,

I’m using ALSA for building a performance musical instrument, so I’m after
 low-latency audio output.
I have some questions (since I'm fairly new to ALSA and to Linux they may  be a
big n00by, so please bear with me)…

1. I’m using asynchronous audio output (i.e. using a callback). Sometimes the
system simply stops calling the callback function without giving an error. In
case of an xrun I would expect there to be an underrun message (which I
sometimes also get) so I can handle it properly. So I guess something else is
causing the issue? Any pointers?

2. What does “File descriptor is in a bad state” mean, when it is returned by
snd_pcm_writei? I notice that I can often avoid getting it by increasing the
size of my buffer but the message doesn't make sense to me.

3. Occasionally my application grinds to a halt with a “I/O is possible” message
– presumably this is triggered by the ALSA callback mechanism?

4. My last question is a bit more conceptual: what determines the playback
latency of my audio stream? The period size? The total ring buffer size? I
assume it should be the difference between the hardware playback pointer and the
software write pointer, but I can’t figure out how they are determined.

Thanks for any help.



System info: Raspberry Pi B+ (non-overclocked), Raspbian Wheezy, USB PnP CM108
audio device
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2014-09-08 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 16:03 Bram Bos [this message]
2014-09-09  8:24 ` Asynchronous ALSA - callback and latency questions Clemens Ladisch
2014-09-09  8:44   ` Bram Bos
2014-09-09  8:53     ` Takashi Iwai
2014-09-09 10:50       ` Bram Bos
2014-09-09 11:23         ` 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=1135001813.415555.1410192193064.open-xchange@upcmail.upc.nl \
    --to=bos3@upcmail.nl \
    --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 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.