[alsa-devel] _mmap_playback_avail() short (was: Default device XRUNs with perriods=2)

Raymond Yau superquad.vortex2 at gmail.com
Wed Dec 14 03:52:34 CET 2011

>> Do you require the sound card give you accurate playback position ?

>No.  Just accurate playback (or capture).  But reliably, on any system,
>without hardware-specific tweaks, 'out-of-the-box'.  Ideally with the
>potential for reasonable latency if the user requests that.  And not
>necessarily only on the 'latest' Alsa versions.

at 48000Hz, the hwptr of snd-ymfpci is increase to next boundary (256
frames). so you cannot get accurate playback position. this situation
can be emulated with snd-hda-intel by masking the value return by
pointer callback with 0xffffff00

>> snd-ymfpci only update hwptr in 5.3ms intervals
>> it seem that snd-usb-audio update hwptr in 1ms
>> > It seems the options are:-
>> >
>> > 1. Use 3 periods and accept worse latency, always filling with
>> > avail_frames
>> snd-ymfpci has periods_min 3
>> and there are sound cards with periods_max = 2

>Yes, this is the sort of thing that makes it more difficult to create a good

seem only two drivers have this limitation , so you may ask the author
of those drivers whether it is feasible to change periods_max to a
higher value

drivers/dummy.c:	.periods_max = 2,
soc/samsung/idma.c:	.periods_max = 2,

More information about the Alsa-devel mailing list