snd_emu10kx sound lag workaround

Yuriy Tsibizov Yuriy.Tsibizov at gfk.ru
Thu Jul 27 07:49:23 UTC 2006


snd_emu10kx has a problem playing small sound files (it is silent) and
has some sound lag (on large files) with it's default buffer size of
EMUPAGESIZE*4 (=16K).
Workaround is to use smaller DMA buffer size (with buffer size =
EMUPAGESIZE (=4K)) as it was in snd_emu10k1 driver. Hardware can use a
buffer up to EMUPAGESIZE*8192 (=32M), if you use only one stereo
channel.

Default DMA buffer size is defined in sys/dev/sound/pci/emu10kx.h:
#define EMU_DEFAULT_BUFSZ	EMUPAGESIZE*4

It seems that driver plays data ahead of sound buffer updates,
 - with small files hardware never returns to start of buffer, with no
sound at all.
 - with large files it has a lag (length depends on sample rate) and
content of last update of hardware buffer is not played all.

I'll try to fix it or ask to commit a workaround next week.

Yuriy.



More information about the freebsd-multimedia mailing list