>What do the callbacks do in snd_pcm_ops_t:

the best answers can be found by looking at similar drivers, or even
dissimilar drivers. i wrote two ALSA drivers that way.

>       open

someone has called snd_pcm_open() and the named device has resolved to
include this h/w device. you should take ownership of the h/w here, do
anything that needs to be done that isn't related to actually using
the h/w.

>       close

the final user of the device has called snd_pcm_close(). release all 
resources associated with the device and release the device itself.

>       ioctl

implement all (or as many as possible) of the SNDDRV_PCM_IOCTL_* commands.

>       hw_params

this is where the hardware based parameters are set. the callback must
attempt to handle these, returning EINVAL if its not possible.

>       hw_free

not sure.

>       prepare

this is called in response to snd_pcm_prepare(), which is called
before an application can actually start to use the device. this is
where you would do any late setup of the h/w, up to but not including
starting it running.

>       trigger

this is called to actually start and stop the h/w. 

>       pointer

this is called to find out where the h/w pointer is in the ring buffer
used for capture/playback. some devices do not support it, but most do.

--p

_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to