[RDD] RDairplay Stops

Patrick Schmalstig / WRRJ Radio xanaftp at gmail.com
Sat Dec 8 14:30:14 EST 2012


Here's the code:

<?php
$processid = shell_exec('pgrep rdairplay'); //check to see if rdairplay is
running
if ($processid == '') {
sleep(5);
$processid = shell_exec('pgrep rdairplay'); //failsafe to make sure
rdairplay really isn't running
if ($processid == '') {
shell_exec("export DISPLAY=:0.0 && rdairplay >>
/media/Personal/rdairplay.log 2>&1 &"); //if it isn't running, load it up
on display 0.0 and send the process to a log file.
while (shell_exec("pgrep rdairplay") == '') { //wait until rdairplay loads
sleep(3);
}
sleep(10); //sleep another 10 seconds so that rdairplay is fully loaded
before making the next move
shell_exec("/usr/bin/rmlsend LL\ 1\ recoverlog\!"); //load the recovery log
sleep(5); //give it 5 seconds to load
shell_exec("/usr/bin/rmlsend PN\ 1\!"); //play the log
sleep(5); //sleep 5 more seconds
$christmas = shell_exec("export DISPLAY=:0.0 && zenity --info
--text='Rdairplay crashed (and darkice was reset) and was brought back
online at " . date('Y-m-d') . " " . time() . "'"); //use ZENITY to make a
message box on display 0.0 saying rdairplay crashed and was brought back
online. Unfortunately time outputs as a timestamp so you may need to
convert that.
}
}
?>

If you have any problems, please let me know. Again, paste into gedit or
something, save as a php file, install the php client on Ubuntu if not
installed already, create a cron job executing "php
path/to/this/phpfile.php" every minute, and you should be okay.

Please test this once by closing out rdairplay after the cron job was
created. See if it loads after a couple minutes. If not please let me know.
:)

-Patrick

On Sat, Dec 8, 2012 at 12:00 PM, Steve Atkins <lubun at comcast.net> wrote:

>
> ------------------------------
> *From: *"Patrick Schmalstig / WRRJ Radio" <xanaftp at gmail.com>
> *To: *"User discussion about the Rivendell Radio Automation System" <
> rivendell-dev at lists.rivendellaudio.org>
> *Sent: *Friday, December 7, 2012 3:39:45 PM
> *Subject: *Re: [RDD] RDairplay Stops
>
>
>  I created a PHP file that executes every minute via. Cron Job that does a
> pgrep of rdairplay... and if rdairplay isn't running, the PHP will open up
> rdairplay (then waits until it loads and it gets a process ID when
> pgrepping) and then uses rmlsend to trigger a recovery log to make
> rdairplay playing again.
>
> This may not work for you.  If you are interested in the PHP RDAirplay
> auto-recovery code, I can send it to you in this mailing list.
>
> Thanks for all the helpful responses to my problem.  Yes Patrick, I'd be
> happy to keep that script on hand as a back up.  I am, however, beginning
> to question the reliability of this older motherboard.  After re-booting,
> the system has been running smoothly since the original post.  So, we'll
> see.
>
> Thanks again for the assist!
>
> Steve
>
> _______________________________________________
> Rivendell-dev mailing list
> Rivendell-dev at lists.rivendellaudio.org
> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
>
> _______________________________________________
> Rivendell-dev mailing list
> Rivendell-dev at lists.rivendellaudio.org
> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
>
>


-- 
Signed,
Patrick Schmalstig
Founder/Administrator of WRRJ Radio
https://www.wrrj.org

please remember: some of my emails are delayed 24 hours before I send them
out in order to give me time to check the content of my emails. Please call
me at 937-490-9775 if you need a faster reply.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rivendellaudio.org/pipermail/rivendell-dev/attachments/20121208/539f954e/attachment.htm 


More information about the Rivendell-dev mailing list