[MPlayer-dev-eng] /dev/dsp and xscreensaver fix

D Richard Felker III dalias at aerifal.cx
Fri Mar 7 16:46:50 CET 2003


On Fri, Mar 07, 2003 at 10:37:45AM +0100, Jindrich Makovicka wrote:
> Tobias Geiger wrote:
> 
> >
> >Hi,
> >
> >me and a friend managed to fix the problem with xscreensaver having
> >/dev/dsp after mplayer is finished.
> >
> >mplayer fails to close fds before executing the "xscreensaver" command,
> >therefore /dev/dsp stays open.
> 
> This looks like a pretty dirty hack to me. In ao_oss.c, audio file 
> descriptor is set to close on exec, so it shouldn't be inherited in any 
> way. Just to be sure, I verified it using fuser and it's ok.


Unfortunately this is not possible with ALSA because it uses a brain
damaged library-based api rather than open and ioctl's, and hides the
opening of the device inside the library. I suppose there could be a
similar problem with network-based ao's keeping sockets open and such
too... The best solution, IMO, is not to kill and restart the
screensaver at all, but rather send it SIGSTOP and SIGCONT. But, this
close-all-fd's approach is ok too, IF you reopen three copies of
/dev/null for stdin/out/err before running the screensaver...

Rich



More information about the MPlayer-dev-eng mailing list