Skip to contentSkip to conversation

snd_pcm_ops

DISCUSSION John Kacur 2 participants 2 messages Nov 14, 2008

lore
Share & tools
lore

John Kacur

author
#0 lore raw

As a newcomer to alsa, I have a few more probably simple questions. I noticed in the SOC drivers, that when the struct snd_pcm_ops is filled in, .copy is omitted, for example in file s3c24xx-pcm.c, you see the following initialization.

static struct snd_pcm_ops s3c24xx_pcm_ops = {
	.open		= s3c24xx_pcm_open,
	.close		= s3c24xx_pcm_close,
	.ioctl		= snd_pcm_lib_ioctl,
	.hw_params	= s3c24xx_pcm_hw_params,
	.hw_free	= s3c24xx_pcm_hw_free,
	.prepare	= s3c24xx_pcm_prepare,
	.trigger	= s3c24xx_pcm_trigger,
	.pointer	= s3c24xx_pcm_pointer,
	.mmap		= s3c24xx_pcm_mmap,
};

How is this supposed to work if somewhere down the line substream->ops->copy is called?

Thanks in advance for any pointers.

#1 lore raw
Quoted 2 lines · John Kacur

How is this supposed to work if somewhere down the line substream->ops->copy is called?

copy() is an optional operation - if it is not provided then the ALSA core provides$ a default implementation (see snd_pcm_lib_write_transfer() for example).