All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Hodgson <matthew@mxtelecom.com>
To: alsa-devel@lists.sourceforge.net
Subject: oss-redir/libaoss doesn't set blocked IO correctly [PATCH]
Date: Sat, 19 Mar 2005 14:52:48 +0000	[thread overview]
Message-ID: <423C3CC0.80307@mxtelecom.com> (raw)

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

             reply	other threads:[~2005-03-19 14:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-19 14:52 Matthew Hodgson [this message]
2005-03-19 15:11 ` oss-redir/libaoss doesn't set blocked IO correctly [PATCH] Jaroslav Kysela

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=423C3CC0.80307@mxtelecom.com \
    --to=matthew@mxtelecom.com \
    --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 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.