All of lore.kernel.org
 help / color / mirror / Atom feed
* oss-redir/libaoss doesn't set blocked IO correctly [PATCH]
@ 2005-03-19 14:52 Matthew Hodgson
  2005-03-19 15:11 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Hodgson @ 2005-03-19 14:52 UTC (permalink / raw)
  To: alsa-devel

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

Hi,

I'm investigating switching videolan's OSS-style audio-capture (used to 
complement streaming from a v4l source) to use the alsa-oss oss-redir 
abstraction layer.  Whilst writing the patch, I came up against the 
quirk that

i_fd = oss_pcm_open(devname, O_RDONLY | O_NONBLOCK)

doesn't return a non-blocking file descriptor.  This is a bit of a 
showstopper, as vlc relies on the fd being nonblocking in order for the 
thread to yield to allow interleaved video capture to occur.

The problem appears to be a typo in alsa-oss/alsa/pcm.c:oss_dsp_open(), 
where the mode parameter rather than the oflags parameter is checked for 
the O_NONBLOCK flag.  I've included a trivial patch to fix it.

cheers;

M.

-- 
______________________________________________________________
Matthew Hodgson   matthew@mxtelecom.com   Tel: +44 845 6667778
                 Systems Analyst, MX Telecom Ltd.

[-- Attachment #2: alsa-oss-nbiofix.patch --]
[-- Type: text/plain, Size: 526 bytes --]

Index: pcm.c
===================================================================
RCS file: /cvsroot/alsa/alsa-oss/alsa/pcm.c,v
retrieving revision 1.19
diff -u -r1.19 pcm.c
--- pcm.c       27 Dec 2004 19:25:47 -0000      1.19
+++ pcm.c       19 Mar 2005 14:43:04 -0000
@@ -534,7 +534,7 @@
                errno = ENOENT;
                return -1;
        }
-       if (mode & O_NONBLOCK)
+       if (oflag & O_NONBLOCK)
                pcm_mode = SND_PCM_NONBLOCK;
        switch (oflag & O_ACCMODE) {
        case O_RDONLY:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: oss-redir/libaoss doesn't set blocked IO correctly [PATCH]
  2005-03-19 14:52 oss-redir/libaoss doesn't set blocked IO correctly [PATCH] Matthew Hodgson
@ 2005-03-19 15:11 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2005-03-19 15:11 UTC (permalink / raw)
  To: Matthew Hodgson; +Cc: alsa-devel

On Sat, 19 Mar 2005, Matthew Hodgson wrote:

> Hi,
> 
> I'm investigating switching videolan's OSS-style audio-capture (used to 
> complement streaming from a v4l source) to use the alsa-oss oss-redir 
> abstraction layer.  Whilst writing the patch, I came up against the 
> quirk that
> 
> i_fd = oss_pcm_open(devname, O_RDONLY | O_NONBLOCK)
> 
> doesn't return a non-blocking file descriptor.  This is a bit of a 
> showstopper, as vlc relies on the fd being nonblocking in order for the 
> thread to yield to allow interleaved video capture to occur.
> 
> The problem appears to be a typo in alsa-oss/alsa/pcm.c:oss_dsp_open(), 
> where the mode parameter rather than the oflags parameter is checked for 
> the O_NONBLOCK flag.  I've included a trivial patch to fix it.

Applied. Thanks.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-19 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-19 14:52 oss-redir/libaoss doesn't set blocked IO correctly [PATCH] Matthew Hodgson
2005-03-19 15:11 ` Jaroslav Kysela

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.