[alsa-devel] Underrun

Irfan Shaikh irfan.shaikh at sasken.com
Tue Mar 1 06:59:48 CET 2011

Hello All,

A)     I am getting many under-run in my audio capture and playback application.

         1) My CAPTURE buffer is of 1024 * 8 (Period size * no of periods), PLAYBACK buffer is of (512 * 16)
         2) I try to read 8 K frames each time and write returned frames to playback device.
         3) Stereo audio, sample size 2 bytes, frame size 4 bytes, 48000 Hz

I have done following to reduce under run :
         1) Increased the number of periods on playback device (to increase playback latency).
         2) optimized my code

Please sugest me some more way so that i can avoid underrun of my playback device

B) Can i use snd_pcm_prepare() twice in two consecutive lines

For eg :

        I just want to know if this is OK for playback device state.


SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email.
Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html

More information about the Alsa-devel mailing list