All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: alsa-devel@alsa-project.org
Cc: vlc-devel@videolan.org
Subject: How to close ALSA device nodes?
Date: Sun, 18 Oct 2009 19:02:07 +0300	[thread overview]
Message-ID: <200910181902.07506.remi@remlab.net> (raw)

	Hello,

I'm getting a bug report against VLC media player whereby ALSA sound output 
stops working when the screensaver is inhibited. It turns out that VLC is 
leaking any file descriptor open through ALSA-lib into child processes. The 
exact same issue was already raised by mplayer... 6 years ago:
http://www.mail-archive.com/alsa-devel@lists.sourceforge.net/msg06249.html

In other cases (V4L, OSS, DVB, DVD, sockets, even regular files...), VLC would 
open the device nodes with O_CLOEXEC flag (if supported by kernel and libc) 
and fallback to setting FD_CLOEXEC via fcntl(). Then the descriptor is 
automatically, and in the earlier case, thread-safely, closed whenever VLC -
forks and- execs. With ALSA-lib, I cannot figure any way to achieve that...

From the earlier thread, I reckon that ALSA developers consider that this is 
an upper-layer issue. Maybe so, but then how is the upper-layer supposed to 
find which file descriptors ALSA-lib has opened - if any? Conversely, if ALSA-
lib won't tell while file descriptors it is using, what could possibly be the 
use case for not closing those on exec?

Best regards,

-- 
Rémi Denis-Courmont
http://www.remlab.net/
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel

             reply	other threads:[~2009-10-18 16:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-18 16:02 Rémi Denis-Courmont [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-10-18 16:06 How to close ALSA device nodes? Rémi Denis-Courmont
2009-10-18 17:13 ` Robert Hancock
2009-10-18 17:38 Rémi Denis-Courmont
2009-10-22 22:55 ` Daniel Yek
2009-10-23  9:49   ` Rémi Denis-Courmont

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=200910181902.07506.remi@remlab.net \
    --to=remi@remlab.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=vlc-devel@videolan.org \
    /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.