On Sun, 21 Jul 2002, Gary Scavone wrote: > Yes, I know that you can determine the number of devices via the CTL > interface ... that's what I use. But you cannot determine whether > those devices support input and/or output without actually attempting > to open them for playback or capture (please correct me if I'm wrong > about this). So, if indeed you still need to open each device to > determine its capabilities (input and/or output channels, etc...), > then the previously mentioned error message should not be > automatically written. > > Just to clarify, the device pcmC1D1c actually exists, as reported by > the CTL interface. However, it only supports output, not input.
Use snd_ctl_pcm_info(). If stream is not available, -ENOENT is returned. Don't forget to set device #, subdevice # and stream type before this call (see snd_pcm_info_set_*() functions). Jaroslav > On Sat, 20 Jul 2002, Jaroslav Kysela wrote: > > >>On Fri, 19 Jul 2002, Gary Scavone wrote: > >> > >>> > >>> ALSA lib pcm_hw.c:797:(snd_pcm_hw_open) open /dev/snd/pcmC1D1c failed: > >>> No such file or directory > >>> > >>> > >>> This message automatically gets output by the alsa library when you > >>> call snd_pcm_open with SND_PCM_STREAM_CAPTURE on a device which can > >>> only provide output (such as the second device of the ensoniq 1370). > >>> Since you cannot probe a device's capabilities without opening it, it > >>> seems to me that the library should not automatically print this > >>> message to stderr (or stdout). Rather, the user can check the return > >>> value of the call and get an error string if desired. > >>> > >>> The current behavior is very confusing. > >> > >>You can determine the number of PCM devices via the CTL interface. ----- Jaroslav Kysela <[EMAIL PROTECTED]> Linux Kernel Sound Maintainer ALSA Project http://www.alsa-project.org SuSE Linux http://www.suse.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel