[alsa-devel] HDAudio period/buffer sizes

Takashi Iwai tiwai at suse.de
Tue Jul 26 07:47:58 CEST 2011

At Mon, 25 Jul 2011 18:47:38 -0500,
pl bossart wrote:
> When I look at the HDAudio spec, I see that the BDL entries need to be
> aligned on a 128-byte boundary, but the buffer length can be any value.
> When I look at the HDAudio driver (azx_pcm_open in hda_codec.c), I see
> that we enforce a 128-byte granularity on the period/buffer sizes, but
> this was added in a patch that fixed alignment issues (5f1545bc)
> Any technical reason why the driver is more demanding than the spec? Or
> is this a confusion between alignment and buffer size? I can understand
> that rounding to multiple of 128 bytes would be more efficient in terms
> of data access, but it also prevents applications from getting an
> interrupt when they want (eg it's impossible to use 20ms periods with a
> 44.1kHz sampling rate, you'll get 19.59 or 20.31ms).

Note that the buffer itself was already aligned to 128 bytes from the
very beginning as it's allocated via dma_alloc_coherent().
The fact that the commit fixes the real problem means that the buffer
size must be aligned, too, at least for some hardware.


More information about the Alsa-devel mailing list