Skip to contentSkip to conversation

: Bug in handling of NONBLOCK in core/oss/pcm_oss.c?

ALSA - driver 0000783 [email protected] 1 participant 1 message Jan 3, 2005

lore
Share & tools
lore
#0 lore raw

A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=783>
======================================================================
Reported By: jdthood
Assigned To:
======================================================================

Project:                    ALSA - driver
Issue ID:                   783
Category:                   CORE OSS - pcm
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Distribution:               
Kernel Version:             
======================================================================
Date Submitted:             01-03-2005 16:40 CET
Last Modified:              01-03-2005 16:52 CET

======================================================================
Summary: Bug in handling of NONBLOCK in core/oss/pcm_oss.c?
Description:
I just discovered that Ubuntu is applying the patch presented below. It adds three lines to snd_pcm_oss_read1().

(The patch comes from this file:
http://people.ubuntu.com/~scott/ongoing-merge/alsa-driver/alsa-driver_merged.patch
)

The patch doesn't appear in your cvs. I decided that I should forward it to you for consideration. If it's correct, it's probably obvious to you that it is; if it isn't correct, it's probably obvious to you that it isn't.

Note that the three lines added by the patch are copied verbatim out of snd_pcm_oss_write1().

--- alsa-driver_1.0.7-2/sound/core/oss/pcm_oss.c 2004-11-11
06:41:05.000000000 +0000
+++ alsa-driver_1.0.7-2ubuntu1/sound/core/oss/pcm_oss.c 2004-12-11
12:46:11.806838912 +0000
@@ -926,6 +926,9 @@ static ssize_t snd_pcm_oss_read1(snd_pcm
buf += tmp;
bytes -= tmp;
xfer += tmp;
+ if ((substream->ffile->f_flags & O_NONBLOCK) != 0 &&
+ tmp != runtime->oss.period_bytes)
+ break;
}
}
return xfer;

======================================================================

----------------------------------------------------------------------
tiwai - 01-03-05 16:52
----------------------------------------------------------------------
Any bug reports about this?

I don't think the patch is necessary. When the returned value is less than the expected, it's still OK. At the next read, it should receive -EAGAIN. So, the code will get out of loop anyway at the next read.

Issue History
Date Modified Username Field Change
======================================================================
01-03-05 16:40 jdthood New Issue
01-03-05 16:52 tiwai Note Added: 0003068
======================================================================

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt