Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Nov 2002 18:54:28 -0500
From:      John Barlow <barlow@starkube.net>
To:        faber@ISI.EDU, randall@ucsb.edu, chip@chocobo.cx, anarcat@anarcat.ath.cx, john@utzweb.net
Cc:        freebsd-multimedia <freebsd-multimedia@FreeBSD.ORG>
Subject:   Re: running xmms from cron in FreeBSD
Message-ID:  <3DDEC3B4.50003@starkube.net>

next in thread | raw e-mail | index | archive | help
Thanks to all who replied and helped me sort this one out.  For the 
edification of poor souls who may want to run xmms (or any X app) from 
cron in the future, I'll summarize your suggestions . . .

1. Tell cron how to find X in the first place by running echo $DISPLAY 
in an xterm.  Mine reported :0.0, which is pretty typical.  I inserted 
the following line at the beginning of my crontab:

        DISPLAY=:0.0

2. Include the full path to xmms.  In my old non-working crontab I had 
the following lines:

        # wake up with KEXP 0622AM Monday - Friday
        22    6    *    *    1-5    oenomaus    xmms 
/usr/home/oenomaus/streams/kexp.pls

I added the path like so . . .

        22    6    *    *    1-5    oenomaus    /usr/X11R6/bin/xmms 
/usr/home/oenomaus/streams/kexp.pl

3. It still wasn't working.  I then tried leaving out the user 
("oenomaus" in this case), and that nailed it - I guess user only needs 
to be included when a job needs to be run as someone else.  Here's how 
the above line looked in the end:

        22    6    *    *    1-5         /usr/X11R6/bin/xmms 
/usr/home/oenomaus/streams/kexp.pl

And voila -  I'm on my way to having the streaming jukebox of my dreams. 
 I can run realplay as well, as long as I have cron do a killall before 
switching players so /dev/dsp is available.  The only other problem I've 
had is that occasionally I get loud white noise instead of my stream.  I 
think it's a sound card issue, but until I figure it out I can get 
around it by opening the stream twice in a row:
   
        22    6    *    *    1-5         /usr/X11R6/bin/xmms 
/usr/home/oenomaus/streams/kexp.pl && /usr/X11R6/bin/xmms 
/usr/home/oenomaus/streams/kexp.pl

a butt-ugly hack, but hey, it works.  Thanks again Ted, Randall, Chip, 
Anarcat, and John.

Here's a last embarrassing detail: I should have been able to figure 
this out myself.  About halfway through messing with this last night, I 
figured out that cron sends me reports about everything I ask it to do 
in my crontab.  Next time I have a problem with cron, I'll start with my 
system mail.

Best,

John Barlow


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DDEC3B4.50003>