[LAD] Opening ALSA devices (hardware and PCM)

Clemens Ladisch clemens at ladisch.de
Tue Jun 8 07:27:05 UTC 2010


Julien Claassen wrote:
>    I was wondering, is there a difference in opening a device like
> plughw:0,0
>    and
> plug:pcm.my_own_device

If my_own_device is defined as a hw device, no.

> I've looked in the code of aplay

aplay is more a debugging tool for driver than an example for application
writers.

>    The application is question is chan_alsa from asterisk. So it's quite
> limited: configured for 8kHz, 16bit (either se or le) and mono. They use a
> fixed periodsize and connected buffer.

There is no guarantee that ALSA devices support any particular period
or buffer sizes.

> I want to connect a pcm-device wired to JACK to the asterisk software, yet
> it either tells me, that the argument is invalid Plug:pcm.name or plug:name)
> or it gets read/write errors or it simply crashes.

I've looked into chan_alsa.c; it doesn't take the actual period size
into account when setting the buffer size (so it could be possible that
the buffer is too small), and it doesn't abort on errors (so the actual
device parameters could be anything).

Are there any error messages in the asterisk log?


Regards,
Clemens



More information about the Linux-audio-dev mailing list