24 Apr
2009
24 Apr
'09
2:39 p.m.
On Fri, 24 Apr 2009, Sudeept Prusti wrote:
Hi all,
As i am working on alsa for minimal PCM playback (8khz,mono,16 bit pcm file).
When i tried to allocate 1k buffer and send through snd_pcm_writei() call it doesn't play perfect and skips are there in between. If we keep on increasing in allocating the buffer for 31 kb then it could play the buffers randomly.
Sure. Your file read logic is broken. You have to check number of bytes read and do not assume that 'k' bytes were read all time. Also, using seek is not necessary for sequential reads.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.