On Wed, 17 Mar 2010, John Graham wrote:
Thanks for the quick reply.
Application can choose between two methods:
1) enable xrun (set stop_threshold to buffer_size or less) - you are
using this method now
2) disable xrun (set stop_threshold to boundary)
If you disable xrun checking in the driver and if application does not
update the ring buffer contents in time, the old samples from the ring
buffer will be replayed (clicks). Additionaly to reduce clicks, you may
force the driver to fill the ring buffer with silence - see
silence_threshold).
Disabling xrun will have to do for now - dirty audio is better than no audio!
I had a look at silence_threshold, but the wording in the API is
slightly confusing to me, I'm not sure how that and silence_size work.
I read to/write from buffers of 256 frames. I set alsa's buffer size
to 256, and its period size to half of that. So I figure if I want
absolutely no data re-transmitted because I've not filled up the ring
buffer in time, I should set silence_threshold to 0 and silence_size
to the buffer size? Or should silence_threshold be the size of a
period and silence_size be (buffer size - period size)?
Just set silence_size to boundary. The driver will silence the played
(unused) portion of the ring buffer.
Jaroslav
-----
Jaroslav Kysela <perex@xxxxxxxx>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user