[MPlayer-dev-eng] xscreensaver inherits mplayer's ALSA FD's

Sebastian Kapfer sebastian_kapfer at web.de
Mon Feb 10 17:27:23 CET 2003


I have configured my mplayer to start/stop the xscreensaver daemon. This
is the result:

$ lsof | grep xscreen | grep pcm
$ mplayer archiv/movies/*
[SNIPPED]
$ lsof | grep xscreen | grep pcm
xscreensa 2000   sk    9u   CHR     116,16              1017
/dev/snd/pcmC0D0p

After exiting mplayer, xss blocks my sound card, which is of course a
bit unfortunate, as xss continues to run in the background.

This can be fixed by patching alsa-lib to set the FD_CLOEXEC flag on its
FD's. Unfortunately, the ALSA guys don't accept this patch, saying that
it would be inconsistent to have ALSA FD's be FD_CLOEXEC. See
http://www.mail-archive.com/alsa-devel@lists.sourceforge.net/msg06249.html
for the whole thread...

This complicates the issue a bit. Re-starting xss can't be done via
system("xscreensaver&") any more, since system doesn't close ALSA FD's
either :)

The issue needs a global solution, as mplayer shouldn't be leaking
/any/ FD's to child processes. Maybe starting an "uncontaminated" shell
process before mplayer opens any files, and using that process to launch
xss?

-- 
Best Regards,   |   Hi! I'm a .signature virus. Copy me into
 Sebastian      |   your ~/.signature to help me spread!


More information about the MPlayer-dev-eng mailing list