[RDD] Slightly OT: Headless JACK and Upstart Scripts

Wayne Merricks WayneMerricks at TheVoiceAsia.Com
Thu Sep 13 21:42:51 EDT 2012


Hi,

I'm going to cc this back to the mailing list just in case anyone else finds it useful.

My scripts are a definite work in progress at the moment.  I can't for the life of me figure out how to define say a USER=radio variable and then use it later when you make upstart run as that user (with the setuid/gid commands).

An initial scout around google seems to suggest its not possible which is kind of stupid.  You can set shell variables and use those in script blocks but not within the general non-script areas of upstart init scripts.

Anyway heres what I'm currently doing:
* jackd fires up when the systems ready (via jackd.conf)
* liquidsoap fires up when jackd is ready by calling liquidsoap /path/to/soap.liq_script (via liquidsoap.conf)
* jackconnect fires up when liquidsoap is ready, waits for 5 seconds and connects my liquid soap output to the system speakers (I couldn't do this with liquidsoap on_start as the ports not ready when on_start hits for jack.output)

It was kind of a trial by fire as I had some scripts in my home directory that didn't work until I ssh'ed in which confused the hell out of me.  I fixed it by moving any scripts upstart needs to /usr/local and finally everything is happy.  I vaguely recall reading something about /home/user not being mounted or available in some sort of odd way until you log in and thankfully my blind guess worked.

If you try all of this the upstart scripts sit inside /etc/init/blah.conf (blah = the upstart service name)

Upstart logs to /var/log/upstart/blah

If you can't find that file the script failed and you should instead go to /var/log/syslog and grep for the upstart service name.

I've put all the files on pastebin (hopefully I've got these urls correct):

/etc/init/jackd.conf : http://pastebin.com/vZZnaQEX
/etc/init/liquidsoap.conf : http://pastebin.com/6wCfPe47
/etc/init/jackConnect.conf : http://pastebin.com/S1wYgnmE
/usr/local/jackConnect.sh : http://pastebin.com/6pfQxG7t
/usr/local/liveradio.liq : http://pastebin.com/ziNEKF03

This is still a work in progress, I'm still working out the kinks in the liquid soap config for compression, limiting and silence monitoring.

I'm pretty sure Jack can't be started using upstart or even the old init.d scripts if you want it to run in real time mode.  There might be some random pam changes you can make but its beyond my understanding at the moment.

The main thing is if you have a headless Ubuntu 12 server, all this stuff will work.  Just remember to install alsa and add your user to the audio group.

Hopefully I'll figure out the left overs soon, maybe put the steps onto the Riv wiki or something (I have to make documentation for work anyway so copy/paste won't take long)

Regards,

Wayne


-----Original Message-----
From: Daniel Roviriego [mailto:danifernando at gmail.com]
Sent: Thu 13/09/2012 17:48
To: Wayne Merricks
Subject: Re: [RDD] Slightly OT: Headless JACK and Upstart Scripts
 
Hi Wayne

Just wondering what setup/script are you using for liquidsoap. Would be
good to have this published somewhere, if you plan to do it so.

Thanks in advance.
Cheers




2012/9/13 Wayne Merricks <waynemerricks at thevoiceasia.com>

> Hi all,
>
> I've used darkice for over a year now and it kind of works but its not
> as solid as I'd like (plus it seems to be dying more frequently lately
> probably by my own fault.  I also notice it hasn't been updated for
> nearly 2 years despite obvious problems).
>
> So I decided to spin up ubuntu server and get to work on Jack, Liquid
> soap and icecast from the command line (not easy to trouble shoot or
> learn but I got there in the end).
>
> I need some advice with getting Jackd to run as a non-root in an upstart
> script in realtime mode (non-realtime works fine).  I noticed an old
> 2010 conversation on this list that was going through the same pains,
> did anyone around back then make any progress on this?
>
> --
> Wayne Merricks
> The Voice Asia
>
>
> #######################
> Scanned by MailMarshal
> #######################
>
> ############
>
> Attention:
>
> The information contained in this message is confidential and intended
> for the addressee(s) only. If you have received this message in error
> or there are any problems, please notify the originator immediately.
> The unauthorised use, disclosure, copying or alteration of this message
> is strictly forbidden. Christian Vision or any of its subsidiaries will
> not be liable for direct, special, indirect or consequential damages
> arising from alteration of the contents of this message by a third party
> or as a result of any virus being passed on. Please note that we reserve
> the right to monitor and read any e-mails sent or received by the
> company under the Telecommunications (Lawful Business Practice)
> (Interception of Communications) Regulation 2000. Christian Vision is
> registered in England as a limited company 2842414 and as a charity
> 1031031
>
> ############
> _______________________________________________
> Rivendell-dev mailing list
> Rivendell-dev at lists.rivendellaudio.org
> http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
>



-- 
Daniel Roviriego


#######################
Scanned by MailMarshal
#######################

############

Attention: 

The information contained in this message is confidential and intended 
for the addressee(s) only. If you have received this message in error 
or there are any problems, please notify the originator immediately.
The unauthorised use, disclosure, copying or alteration of this message
is strictly forbidden. Christian Vision or any of its subsidiaries will
not be liable for direct, special, indirect or consequential damages 
arising from alteration of the contents of this message by a third party
or as a result of any virus being passed on. Please note that we reserve
the right to monitor and read any e-mails sent or received by the 
company under the Telecommunications (Lawful Business Practice) 
(Interception of Communications) Regulation 2000. Christian Vision is 
registered in England as a limited company 2842414 and as a charity 
1031031  

############
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rivendellaudio.org/pipermail/rivendell-dev/attachments/20120914/272b1232/attachment-0001.htm 


More information about the Rivendell-dev mailing list