[alsa-devel] Problems with ALSA driver

Radivoje Jovanovic radivojejovanovic at gmail.com
Thu Sep 23 23:53:13 CEST 2010

Hi All,
I am trying to write ALSA driver for my audio card. I have initial driver
version in place.
aplay -l gives:
**** List of PLAYBACK Hardware Devices ****
card 0: default [], device 0: myMonoCard []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and aplay -L gives:

    Default Audio Device
    Discard all samples (playback) or generate zero samples (capture)

It seems to me that all looks good here but when I try:
aplay 101a.4.wav

Calling open method in the mono driver! (Output from my driver open method)
Calling hw_free method (Output from my driver hw_free method)
Calling close method in the mono driver! (Output from my driver close
aplay: main:608: audio open error: Invalid argument

All my open method does is this:
int ret;
struct snd_pcm_runtime *runtime = substream->runtime;
printk ("Calling open method in the mono driver!\n");
 /*Associate the hardware capabilities of this PCM component */
 runtime->hw = monocard_playback_mono;
return 0;

and my struct snd_pcm_hardware monocard_playback_mono = {
    .formats = SNDRV_PCM_FMTBIT_S16_LE |
           SNDRV_PCM_FMTBIT_S16_BE |
           SNDRV_PCM_FMTBIT_S8 |
    .rate_min = 8000,
    .rate_min = 48000,
    .channels_min = 1,
    .channels_max = 1,

I am not sure if alsa-lib is saying that one of these arguments is invalid
or what?
Thank you

More information about the Alsa-devel mailing list