All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Kai Vehmanen <kai.vehmanen@wakkanet.fi>
Cc: alsa-devel@lists.sourceforge.net, The Eye <the.eye@gmx.li>
Subject: Re: possible ALSA bug/feature (was: important recording broke. why?) (fwd)
Date: Tue, 25 Mar 2003 19:01:35 +0100	[thread overview]
Message-ID: <s5h7kanpbpc.wl@alsa2.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0303211610150.20651-100000@vaino.wakkanet.fi>

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

At Fri, 21 Mar 2003 16:16:04 +0200 (EET),
Kai Vehmanen wrote:
> 
> Hi,
> 
> first please read the mail to ecasound-list below. 
> 
> It seems that with newer ALSA versions, snd_pcm_read[in]()  sometimes
> returns -EIO even though documentation says nothing about this. After some
> testing this seems to not happen on direct hw-access, only with
> the pcm_plugin. The EIO comes from snd_pcm_wait(). 
> 
> Is this a bug or or a feature?

i also don't know whether Jaroslav added as a feature or as an
unexpected bug.  anyway, this means that the poll failed and the pcm
status is abnormal, typically xruns...

how about the attached patch?  (untested)


Takashi

[-- Attachment #2: pcm-poll-err-fix.dif --]
[-- Type: application/octet-stream, Size: 666 bytes --]

Index: alsa-lib/src/pcm/pcm.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-lib/src/pcm/pcm.c,v
retrieving revision 1.130
diff -u -r1.130 pcm.c
--- alsa-lib/src/pcm/pcm.c	20 Mar 2003 11:06:13 -0000	1.130
+++ alsa-lib/src/pcm/pcm.c	25 Mar 2003 18:00:13 -0000
@@ -6110,9 +6110,15 @@
 			}
 
 			err = snd_pcm_wait(pcm, -1);
-			if (err < 0)
-				break;
 			state = snd_pcm_state(pcm);
+			if (err < 0) {
+				/* check more precisely */
+				if (state == SND_PCM_STATE_XRUN)
+					err = -EPIPE;
+				else if (state == SND_PCM_STATE_SUSPENDED)
+					err = -ESTRPIPE;
+				break;
+			}
 			goto _again;
 			
 		}

  parent reply	other threads:[~2003-03-25 18:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-21 14:16 possible ALSA bug/feature (was: important recording broke. why?) (fwd) Kai Vehmanen
2003-03-22 21:43 ` Laurent Georget
2003-03-25 18:01 ` Takashi Iwai [this message]
     [not found]   ` <3E80CB2E.7070204@club-internet.fr>
     [not found]     ` <s5hznnio0ml.wl@alsa2.suse.de>
2003-03-26 20:53       ` Laurent Georget
2003-03-27 11:27         ` Mono to stereo ? Giuliano Pochini
2003-03-27 11:43           ` Paul Davis
2003-03-28  3:14             ` Manuel Jander
2003-03-28  2:46               ` Paul Davis
2003-03-28  9:21                 ` Giuliano Pochini
2003-03-28 10:02               ` Takashi Iwai
2003-03-28 10:14                 ` Jaroslav Kysela
2003-03-28 16:21                 ` Jeff Muizelaar
2003-03-28 16:43                   ` Takashi Iwai
2003-03-28 17:15                     ` Jeff Muizelaar
2003-03-27  0:42   ` possible ALSA bug/feature (was: important recording broke. why?) (fwd) Kai Vehmanen
2003-03-27  9:15     ` Takashi Iwai

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=s5h7kanpbpc.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=kai.vehmanen@wakkanet.fi \
    --cc=the.eye@gmx.li \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.