[alsa-devel] data write in alsa
tiwai at suse.de
Fri Dec 2 08:12:30 CET 2011
At Fri, 02 Dec 2011 12:24:41 +0530,
Vinod Koul wrote:
> Hi Takashi,
> For alsa pcm we have two ways to write data, either we use write()
> system call or use ioctl SNDRV_PCM_IOCTL_WRITEI_FRAMES.
> Is there any specific reason why we have two methods and which one is
> preferred and why?
Well, I only remember vaguely. IIRC, ioctl is used since it can pass
the error code more directly without using errno. Maybe Jaroslav
knows more exact reason.
But, honestly speaking, I don't like this implementation. For a new
interface, I'd suggest to stick with the normal read/write. Otherwise
you'll get a mess of 32bit compat layer again.
More information about the Alsa-devel