[alsa-devel] Question regarding snd_pcm_control_ioctl

Jaroslav Kysela perex at perex.cz
Fri Oct 22 10:56:34 CEST 2010

On Fri, 22 Oct 2010, Bensaid, Selma wrote:

> Hi,
> I have question concerning ALSA Core snd_pcm_control_ioctl function.
> I have noticed that the IOCTL fails if it's called for a device with 
> substream_count = 0, since I'm implementing a PCM device that supports 
> Record and does not support Playback, the IOCTL fails when called for 
> the Playback stream. I would propose, in such case, to return that the 
> stream has 0 playback substreams instead of failing.

You mean probably that the SNDRV_CTL_IOCTL_PCM_INFO ioctl returns -ENOENT 
when an invalid direction is accessed. It looks correct to me. If 
a direction does not exist, it makes no sense to gather info for it. And 
-ENOENT response clearly shows that this direction is not available, so 
the user space tools can distict if it's an unexpected error or this one.


Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

More information about the Alsa-devel mailing list