On Wed, 14 Jan 2004, James Courtier-Dutton wrote:
> Some debug output from calling snd_pcm_wait() when a USB device is
> unplugged.
>
> (pcm_hw.c from /alsa-lib/src/pcm/pcm_hw.c)
> file=pcm_hw.c:406 function=snd_pcm_hw_status err=25
> pcm_hw.c: snd_pcm_hw_status() SNDRV_PCM_IOCTL_STATUS failed.
>
> According to errno.h,
> #define ENOTTY 25 /* Not a typewriter */
>
> I would think that the following would be a better err result.
> #define ENODEV 19 /* No such device */
> or even
> #define EPIPE 32 /* Broken pipe */
>
> I have looked through alsa-lib and alsa-kernel and cannot find any place
> in the code that sets errno to 25!
>
> Can anybody help?
Consult the toplevel filesystem routines. In case when the device is
disconnected, all i/o (filesystem operation) calls are redirected to empty
structure, so the Linux kernel filesystem code probably returns ENOTTY
errors when no ioctl/read/write callbacks are associated to the device.
Jaroslav
-----
Jaroslav Kysela <[EMAIL PROTECTED]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel