[alsa-devel] PCM usage / seg fault in pcm_params.c

Borg Onion borg.onion at gmail.com
Thu Nov 24 21:29:14 CET 2011

> > Program terminated with signal 11, Segmentation fault.
> >
> > Sound card is opened, PCM device is opened,
> Is it?
> ...
> Found PCM device #1
> Playback=no, Capture=yes, Full Duplex=no
> Playback capabilities:
> Segmentation fault

You're right, my bad.  Fixed now.  Still, an assert() in the lib wouldn't
hurt.  They seem to be thoroughly applied for everything else.  That same
function in the lib asserts already, so here's my proposal to modify the
assert call:

int snd_pcm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
        int res;
        snd_output_t *log;
        snd_output_stdio_attach(&log, stderr, 0);
        assert(pcm && pcm->ops && params);
        snd_output_printf(log, "REFINE called:\n");
        snd_pcm_hw_params_dump(params, log);
        res = pcm->ops->hw_refine(pcm->op_arg, params);
        snd_output_printf(log, "refine done - result = %i\n", res);
        snd_pcm_hw_params_dump(params, log);
        return res;


More information about the Alsa-devel mailing list