[alsa-devel] crash with assertion (?)

IOhannes m zmoelnig zmoelnig at iem.at
Tue Sep 7 18:05:01 CEST 2010

hi all,

(just in case: sorry for double posting, i first sent from a
non-subscribed address)

this might have been discussed already ages ago, but i didn't find much
on the web, and i'm a bit confused why it happens, so:

i'm developing/bugfixing an application using (well, obviously) alsa,
and i get crashes with assertions.

my setup:
- nvidia CK804 onboard soundcard (this soundcard seems to only be able
to run at 48kHz)
- debian squeeze/sid (libasound2 1.0.23-1)

what i'm trying to do:
i'm requesting my "plughw" device with 44100Hz
the request is done with something like:
 err = snd_pcm_hw_params_set_rate_min(handle, params, &rate, 0);
 err = snd_pcm_hw_params(handle, params);

what happens:
in the snd_pcm_hw_params(), my program exits with:
"interval_inline.h:52: snd_interval_single: Assertion
`!snd_interval_empty(i)' failed."

if i use the "hw" device, i get away with the wrong samplerate (no
crash, though the requested samplerate does not take effect)

now i understand, that my soundcard does not accept 44100Hz.
what i don't understand is, that alsa-lib crashes with an assertion error.
i expect snd_pcm_hw_params() return an error!=0 if it fails to do what
it is asked to do.
imho, a library should _never ever_ crash the application.

is this a bug?
in alsa-lib? in the debian-packages?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20100907/5a604567/attachment.p7s 

More information about the Alsa-devel mailing list