ALSA Driver question
I have this alsa driver related question (ALSA api)
trigger callback:
static int
snd_ac97_playback_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct audio_stream *stream = substream->private_data;
int err = 0;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
// dma start function
break;
case SNDRV_PCM_TRIGGER_STOP:
// dma stop function
break;
default:
err = -EINVAL;
break;
}
return err;
}
when is SNDRV_PCM_TRIGGER_STOP triggered? when device (/dev/dsp) is closed? I'm having problems with understanding how to properly disable
my DMA engine (double buffered). Driver is working just fine except that
at the end, one extra period is played. Today I've discovered a bug in a pointer callback. when fixed, could solve the problem. But my most important question would be: if trigger callback can stop dma engine before another irq would happen? Because I just don't know how to detect last period (last buffer) in my alsa driver. I think that it isn't even possible?
regards,
Bojan M.
|