From: Clemens Ladisch <clemens@ladisch.de>
To: "Rafał Cieślak" <rafalcieslak256@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Why does snd_seq_drain_output() need lots of time to execute?
Date: Thu, 26 Jan 2012 23:04:42 +0100 [thread overview]
Message-ID: <4F21CDFA.3070608@ladisch.de> (raw)
In-Reply-To: <CABscqj76Lb9fgD-FY1otzETWwjJO9vwCG=Rt83jU8ti0bE6KpA@mail.gmail.com>
Rafał Cieślak wrote:
> The main problem is that although the documentation states that
> snd_seq_drain_output() returns immediately,
| "The function returns immediately after the events are sent to the
| queues ..."
> it turns out that it occasionally needs lots of time (even a second or
> two), and blocks my application, as I call it.
You could enable non-blocking mode to get an error instead of waiting.
Or you could to increase the size of the output buffer.
> And before you ask, I've set the output buffer to some huge amount,
A sequencer client has _two_ output buffers, one in alsa-lib, and one in
the kernel. Events that are scheduled for later stay in the kernel
buffer until they are actually delivered; when this buffer would
overflow, functions that drain the userspace buffer to the kernel buffer
wait instead.
To increase the kernel buffer's size, use the snd_seq_client_pool* and
snd_seq_get/set_client_pool functions. ("pool" is the buffer size, in
events; "room" is the number of free events that causes a blocked
function to wake up.)
Regards,
Clemens
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2012-01-26 22:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 17:19 Why does snd_seq_drain_output() need lots of time to execute? Rafał Cieślak
2012-01-26 22:04 ` Clemens Ladisch [this message]
2012-01-27 0:20 ` Rafał Cieślak
2012-01-27 12:03 ` Fons Adriaensen
2012-01-27 13:28 ` Rafał Cieślak
2012-01-27 13:56 ` Fons Adriaensen
2012-01-27 18:04 ` 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=4F21CDFA.3070608@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=rafalcieslak256@gmail.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.