[alsa-devel] snd_pcm_hw_params_set_buffer_time_near: invalid argument

Raymond Yau superquad.vortex2 at gmail.com
Tue Mar 8 14:25:25 CET 2011


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"

Does linux kernel allow ALSA allocate 2/3 of system memory for sound buffer
on a machine iwth 1.5Gbytes memory

64Kbytes is only 371ms of S16_LE 44100Hz stereo


ACCESS = 00000000ffffffffffffffff -> 0000000000000009
FORMAT = 00000000ffffffffffffffff -> 0000000000000404
SUBFORMAT = 00000000ffffffffffffffff -> 0000000000000001
SAMPLE_BITS = [0 4294967295] -> [0 4294967295]
FRAME_BITS = [0 4294967295] -> [0 4294967295]
CHANNELS = [0 4294967295] -> [2 8]
RATE = [0 4294967295] -> [8000 192000]
PERIOD_TIME = [0 4294967295] -> [0 4294967295]
PERIOD_SIZE = [0 4294967295] -> [0 4294967295]
PERIOD_BYTES = [0 4294967295] -> [128 536870912]
PERIODS = [0 4294967295] -> [2 32]
BUFFER_TIME = [0 4294967295] -> [0 4294967295]
BUFFER_SIZE = [0 4294967295] -> [0 4294967295]
BUFFER_BYTES = [0 4294967295] -> [128 1073741824]
TICK_TIME = [0 4294967295] -> [0 4294967295]
Rule 0 [f8ae36f2]: FORMAT = 404 -> 404
Rule 1 [f8ae351b]: SAMPLE_BITS = [0 4294967295] -> [16 32]
Rule 2 [f8ae365f]: SAMPLE_BITS = [16 32] -> [16 32]
Rule 3 [f8ae361d]: FRAME_BITS = [0 4294967295] -> [32 256]
Rule 4 [f8ae35d9]: FRAME_BITS = [32 256] -> [32 256]
Rule 5 [f8ae35d9]: FRAME_BITS = [32 256] -> [32 256]
Rule 6 [f8ae365f]: CHANNELS = [2 8] -> [2 8]
Rule 7 [f8ae35d9]: RATE = [8000 192000] -> [8000 192000]
Rule 8 [f8ae35d9]: RATE = [8000 192000] -> [8000 192000]
Rule 9 [f8ae365f]: PERIODS = [2 32] -> [2 32]
Rule 10 [f8ae365f]: PERIOD_SIZE = [0 4294967295] -> [0 2147483647]
Rule 11 [f8ae35d9]: PERIOD_SIZE = [0 2147483647] -> [4 134217728]
Rule 12 [f8ae3595]: PERIOD_SIZE = [4 134217728] -> [4 134217728]
Rule 13 [f8ae361d]: BUFFER_SIZE = [0 4294967295] -> [8 4294967295]
Rule 14 [f8ae35d9]: BUFFER_SIZE = [8 4294967295] -> [8 268435456]
Rule 15 [f8ae3595]: BUFFER_SIZE = [8 268435456] -> [8 268435456]
Rule 16 [f8ae3595]: PERIOD_BYTES = [128 536870912] -> [128 536870912]
Rule 17 [f8ae3595]: BUFFER_BYTES = [128 1073741824] -> [128 1073741824]
Rule 18 [f8ae35d9]: PERIOD_TIME = [0 4294967295] -> (20 4294967295]
Rule 19 [f8ae35d9]: BUFFER_TIME = [0 4294967295] -> (41 4294967295]
Rule 20 [f8ae5fa6]: BUFFER_BYTES = [128 1073741824] -> [128 1073741824]
Rule 21 [f8ae5fa6]: PERIOD_BYTES = [128 536870912] -> [128 536870912]
Rule 22 [f8ae5fa6]: CHANNELS = [2 8] -> [2 8]
Rule 23 [f8ae34e2]: BUFFER_BYTES = [128 1073741824] -> [128 65536]
Rule 24 [f8ae34bd]: RATE = [8000 192000] -> [8000 192000]


More information about the Alsa-devel mailing list