Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: alsa-devel@lists.sourceforge.net
Subject: Strange err=25 result.
Date: Wed, 14 Jan 2004 14:09:02 +0000	[thread overview]
Message-ID: <40054D7E.5010902@superbug.demon.co.uk> (raw)

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?

My aim is to let the application detect when a usb audio device is 
unplugged, so that the application can release all alsa resources.
The application will then poll the alsa-lib trying to open the device 
again, and continually get errors until the audio usb device is plugged 
in again. For my application to achieve this, I would need a specific 
errno for the "usb device unplugged" that will not get confused with 
over/underruns or other errors that might not be "usb unplugged" related.

Cheers
James


-------------------------------------------------------
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

             reply	other threads:[~2004-01-14 14:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 14:09 James Courtier-Dutton [this message]
2004-01-14 14:12 ` Strange err=25 result Jaroslav Kysela
2004-01-15  0:50   ` James Courtier-Dutton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40054D7E.5010902@superbug.demon.co.uk \
    --to=james@superbug.demon.co.uk \
    --cc=alsa-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox