[alsa-devel] snd_pcm_hw_params_set_buffer_time_near: invalid argument

Takashi Iwai tiwai at suse.de
Mon Apr 4 13:00:00 CEST 2011


At Tue, 8 Mar 2011 21:25:25 +0800,
Raymond Yau wrote:
> 
> 2011/3/8 Jean-Yves Avenard <jyavenard at gmail.com>
> 
> > On 7 March 2011 23:24, Raymond Yau <superquad.vortex2 at gmail.com> wrote:
> >
> > > This seem to be bug in alsa-lib as I can reproduce using
> > alsa-lib/test/pcm.c
> > > with buffer time 120000 and my hda codec support both 11025Hz and 22050Hz
> > >
> > > using buffer time 160000 is OK
> >
> > Yes.. It's hard to understand why 120ms wouldn't be okay, but 160ms would.
> >
> > Could you check is 400ms works for you ? I found this to be a value
> > that generally do not work when using 44.1kHz 6 channels audio.
> >
> > For the time being, I made my application use 500ms buffer; this is
> > what many media players are using (including mplayer) , so I'm
> > guessing it would be fine under most circumstances otherwise we would
> > have heard about it before.
> >
> > Jean-Yves
> >
> 
> It seem that hda-intel does not really has AZX_MAX_BUF_SIZE 1024x1024x1024
> on 32bits machine , buffer bytes was reduced to 64K bytes  at the beginning
> by "Rule 23"

It's because of the pre-allocation buffer size.
You can change it via proc file dynamically:
	echo 1024 > /proc/asound/card0/pcm0p/sub0/prealloc


Takashi


More information about the Alsa-devel mailing list