From: Clemens Ladisch <clemens@ladisch.de>
To: Rong-Jhe <r93922118@ntu.edu.tw>
Cc: alsa-devel@alsa-project.org
Subject: Re: XRUN happens too often.
Date: Thu, 10 Apr 2008 08:41:40 +0200 [thread overview]
Message-ID: <47FDB6A4.7010704@ladisch.de> (raw)
In-Reply-To: <loom.20080408T090019-595@post.gmane.org>
Rong-Jhe wrote:
> buffer size = 9408 frames
>
> A sample in 16-bit, two channels is 4 bytes.
> I allocate a audio data of 9408x4=37632 bytes.
>
> audio_data=malloc(buffer_size*4);
>
> This audio_data buffer will receive audio data from the network.
> If this buffer is full, I use snd_pcm_writei( ) to put the buffer into the pcm.
When this buffer is full, the device buffer is completely empty,
and even the slightest delay will result in an underrun.
Write data to the device buffer immediately when you receive it.
HTH
Clemens
prev parent reply other threads:[~2008-04-10 6:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-08 10:15 XRUN happens too often Rong-Jhe
2008-04-08 11:40 ` Rong-Jhe
2008-04-08 15:20 ` stan
2008-04-09 12:06 ` Rong-Jhe
2008-04-09 22:28 ` stan
2008-04-10 1:01 ` Lee Revell
2008-04-10 3:29 ` Rong-Jhe
2008-04-10 4:54 ` Lee Revell
2008-04-10 7:59 ` Rong-Jhe
2008-04-10 8:20 ` Jaroslav Kysela
2008-04-10 12:19 ` Rong-Jhe
2008-04-10 8:24 ` Rong-Jhe
2008-04-10 6:41 ` Clemens Ladisch [this message]
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=47FDB6A4.7010704@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=r93922118@ntu.edu.tw \
/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.