<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Talk Unafraid &#187; software</title>
	<atom:link href="http://www.talkunafraid.co.uk/tag/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.talkunafraid.co.uk</link>
	<description>The (occasionally coherent) ramblings of a geek</description>
	<lastBuildDate>Sat, 07 Jan 2012 22:24:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Perceptual image and audio deduplication</title>
		<link>http://www.talkunafraid.co.uk/2012/01/perceptual-image-and-audio-deduplication/</link>
		<comments>http://www.talkunafraid.co.uk/2012/01/perceptual-image-and-audio-deduplication/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 18:03:11 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[Code Snippets and Examples]]></category>
		<category><![CDATA[Odds and Ends]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[dragonfly]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=1375</guid>
		<description><![CDATA[Okay, two months without a post, won&#8217;t happen again&#8230; So, lately I&#8217;ve been moving out from the broadcast area and getting back into webapp development, but some of the things I&#8217;ve been working on touch quite heavily on deduplication, of images and music. This is quite an interesting topic, so let&#8217;s have a look at [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, two months without a post, won&#8217;t happen again&#8230;</p>
<p>So, lately I&#8217;ve been moving out from the broadcast area and getting back into webapp development, but some of the things I&#8217;ve been working on touch quite heavily on deduplication, of images and music. This is quite an interesting topic, so let&#8217;s have a look at what we can do now.</p>
<p>Doing exact deduplication &#8211; stopping someone uploading the same file twice to a website &#8211; is pretty easy. You just hash the uploaded file (or de-encapsulate the data and hash that if you want to be a little more resilient) with something like SHA256 or SHA512. It&#8217;s fast, effective and easy. Lookups are as fast as your RDBMS is. This works with images, audio, videos, you name it.</p>
<p>What&#8217;s much harder is doing perceptual deduplication, or content deduplication. If I upload two files which are the same except one&#8217;s a PNG and one&#8217;s a JPEG, I want to be able to say &#8220;Hang on, you&#8217;ve already uploaded that!&#8221; when you upload the second file. Similarly, what if we resize an image? We want something resistant to that sort of attack.<span id="more-1375"></span></p>
<p>There are already perceptual hashing libraries like pHash out there which work by generating hashes which look very similar to your average md5sum, but are actually generated perceptually &#8211; the Hamming distance between two hashes is a measure of the similarity of the images represented by those two hashes. This is a great thing, but it&#8217;s pretty useless on large datasets without some specialist software to manage databases of hashes and querying based on Hamming distance. The pHash guys will of course <em>sell </em>you this solution, but there&#8217;s the problem &#8211; there&#8217;s quite a bit of money to be made with this sort of product, and useful open source implementations seem to be quite rare if not non-existent.</p>
<p>pHash is also a bit of an odd thing in that it works on multiple media types &#8211; audio, video and images. More specifically for audio are techniques for audio fingerprinting, like <a href="http://acoustid.org/">AcoustID</a> which aim to generate a specific fingerprint for each recording of a song. Distance between songs isn&#8217;t something we&#8217;re very interested in, because audio releases are typically few in number, and rarely are we looking for a song which sort of sounds like X &#8211; if it sounds different, it&#8217;s a different recording of the song, or has been mastered.</p>
<p>Images are very different because people often make small changes, or change the formatting or file type of an image, and these circulate and get thrown around all over the place. We want to be able to accept things that are legitimately changed, but flag up things that are almost perfectly identical to something we already have in a database.</p>
<p>So, what can we do? Well, we can use simpler techniques to reduce the number of images to compare down to a small number &#8211; say, 50 &#8211; and then compare the Hamming distance on full pHashes using that technique. But do we actually need this? Certainly for some databases, merely using those simpler techniques may well be sufficient.</p>
<p>I&#8217;ve been building an image board, lately, which I&#8217;m using Dragonfly for, an awesome on-the-fly image serving system. We&#8217;re storing everything in MongoDB, with GridFS for file storage. Here&#8217;s what we&#8217;re doing.</p>
<p>First, we need some analysis of the image contents. I&#8217;m using a roughly perceptually weighted average intensity metric. Here&#8217;s a tiny little Python script using Python-OpenCV&#8217;s SWIG bindings to perform that analysis rapidly.</p>
<p><script type="text/javascript" src="https://gist.github.com/1575463.js?file=simple_analyser.py"></script>Now we need to get Dragonfly in on this, and register a function we&#8217;ll use to handle GIFs. This goes in our Dragonfly initializer.<script type="text/javascript" src="https://gist.github.com/1575463.js?file=dragonfly.rb"></script></p>
<p>And finally we need to store all this and actually do the find-duplicates step. Note the aspect ratio stuff &#8211; with the ImageMagick analyser, Dragonfly will handle storing this for you, which makes life easier.</p>
<p><script src="https://gist.github.com/1575463.js?file=image.rb"></script></p>
<p>In our find_duplicates function we just look for images that have both a similar intensity and a similar aspect ratio. If both of these things are very close we&#8217;ve got ourselves a potential duplicate. We&#8217;re not doing <em>exact</em> matching on intensity/aspect ratio, more fuzzy matching, because compression changes and resizes can often affect both slightly.</p>
<p>Of course, the proof is in the pudding- this site only has a hundred images in it now, and we may need to adjust the distance variable, but so far it&#8217;s working very well and isn&#8217;t bringing up any false positives while correctly identifying duplicates. The way we&#8217;re doing this from a workflow perspective is important, too &#8211; when we do find duplicates, we ask the uploader of the image to check and make sure they&#8217;re not uploading anything we already have by presenting the duplicate images to them. They can then mark the duplicate (which deletes the image they just uploaded and leaves a redirect to the image their upload duplicates) or confirm it&#8217;s not a duplicate. The statistics from those actions will be interesting to see over time as a metric of success for this approach!</p>
<p>So, that&#8217;s how I&#8217;ve done image dedupe in a Rails app &#8211; what approach are you using?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2012/01/perceptual-image-and-audio-deduplication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IRIS &#8211; The Interchangeable Radio Ingest System</title>
		<link>http://www.talkunafraid.co.uk/2011/10/iris-the-interchangeable-radio-ingest-system/</link>
		<comments>http://www.talkunafraid.co.uk/2011/10/iris-the-interchangeable-radio-ingest-system/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 10:48:14 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Radio]]></category>
		<category><![CDATA[Rivendell]]></category>
		<category><![CDATA[Servers and Software]]></category>
		<category><![CDATA[EBU R128]]></category>
		<category><![CDATA[iris]]></category>
		<category><![CDATA[myriad]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rivendell]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=1367</guid>
		<description><![CDATA[Well, wow. After nearly forgetting to actually submit it and only writing the entry a few hours before the deadline, it turns out that the system I made while at Insanity Radio 1287AM has been nominated for the Best Technical Achievement award at the Student Radio Awards. So, I figured it would be worth actually [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://assets.talkunafraid.co.uk/2011/10/IRIS-ConceptualDrawing.png" rel="lightbox[1367]"><img class="alignright size-medium wp-image-1369" title="Conceptual Overview" src="http://assets.talkunafraid.co.uk/2011/10/IRIS-ConceptualDrawing-300x225.png" alt="" width="300" height="225" /></a>Well, wow. After nearly forgetting to actually submit it and only writing the entry a few hours before the deadline, it turns out that the system I made while at Insanity Radio 1287AM has been nominated for the Best Technical Achievement award at the Student Radio Awards. So, I figured it would be worth actually writing up a little bit about what it is and what it does. And why you can use it, too, if you&#8217;re involved with a student radio station.</p>
<p>IRIS was written to replace MACIS, a system I bodged up out of necessity. At Insanity, we had a computer failure weeks before we went on air at the start of the first term, and lost all the data- including the entire playout system. Lessons have been learned (I made sure we replaced that machine with a box that had RAID, for starters) since, but we had the unenviable challenge of repopulating a student radio playout system from scratch with little to no staff. Enter MACIS!</p>
<p><span id="more-1367"></span></p>
<p>MACIS was <em>dumb</em>. It talked to our playout system (PSquared&#8217;s Myriad 3.5) via the not-very-documented TCP/IP interface, had a web interface and drop box, and some background processing magic. It was implemented as a Ruby on Rails web application, since we already used Rails and Ruby for various tasks around the station (the website is all Rails, and Ruby was chosen for most scripting tasks because of its user friendliness to people not too familiar with programming. You passed it files, it converted them (the main purpose- Myriad doesn&#8217;t support AAC, MP4 or many other formats we were using for ingest), did a basic stab at normalization, and then imported the files. Myriad is slow at importing files- 1-2 minutes per file on average, so we let MACIS distribute workload across all four of our Myriad machines, speeding things up massively.</p>
<p>This was good and got us running, but then term started. We&#8217;re a student station and have specialist music shows, who upload their own content to the playout system every week, and new content for new music and chart shows came in regularly. MACIS was used for this, as it did the conversion automatically, saving our presenters loads of time. It also did batch imports quickly and efficiently, which sped things up. However, after a while, we stopped using it, and just provided a simple Ruby dropbox on a shared file server for conversion. MACIS was useful, but too buggy and inflexible. In addition, while it did a better job of getting metadata into Myriad than Myriad managed on its own, it had issues with some formats and material.</p>
<p>What was needed was a system that would let presenters upload content in any format, would sort out the metadata, handle conversion, and fire it off to the playout system for usage.</p>
<div id="attachment_1370" class="wp-caption alignright" style="width: 211px"><a href="http://assets.talkunafraid.co.uk/2011/10/IRIS-Screenshot-UploadInformation.png" rel="lightbox[1367]"><img class="size-medium wp-image-1370" title="Upload Information" src="http://assets.talkunafraid.co.uk/2011/10/IRIS-Screenshot-UploadInformation-201x300.png" alt="" width="201" height="300" /></a><p class="wp-caption-text">An example upload showing the log and graphs (huge image)</p></div>
<p>So, while presenters got back to using Myriad directly, I went back to the drawing board and scrapped MACIS. At this stage we were considering transitioning to the Rivendell open source playout system to replace Myriad, so I decided whatever I was going to make had to support both Myriad and Rivendell, and any other system you could imagine.</p>
<p>I also wanted to solve the loudness problem. Even doing normalization to every track imported, we had huge loudness level differences between some tracks, making life quite tricky for presenters and impacting our on-air sound. Especially given our lack of transmitter processing (we only have a limiter and preemphasis box on the AM system- no AGC or multiband comps), I wanted to do all I could to get everything as perceptually loud as everything else. Enter EBU Recommendation 128 for loudness measurement- with the help of some great libraries (libebur128 in particular), I implemented a simple version of the recommended processing system for loudness normalization, including LRA correction using a compressor. Thus, everything you run through IRIS comes out sounding about the same as everything else in terms of perceptual levels &#8211; as much as is possible without impacting the sound. <em>Wish You Were Here</em> is still going to have a quiet bit at the beginning- but IRIS will gently compress the track to make the difference less severe, and will then use R128&#8242;s standards to normalize to -23 LUFS.</p>
<p>Next up, user authentication. This was almost an afterthought, but added after talking to people about security. You register an account, and that account is either able to upload content only, upload and review (more on that in a sec), or administrate the system (ie modify users etc). This is done by user groups, which are pretty flexible, and easily adapted for your own usage via a simple permissions file. Uploads are linked to users- users can only see their uploads (unless they have permission to see more than that) and admins can see who owns a specific upload. You can also have emails sent on error conditions being met- so presenters know if a file they uploaded failed to make it to the playout system <em>before</em> they turn up to do their show and wonder where it is.</p>
<p>Metadata was one of the big issues I wanted to solve. Let&#8217;s say I have a track from a CD- I&#8217;ve ripped it and the ripper has embedded title/artist, maybe album metadata from Gracenote. For a playout system for radio this isn&#8217;t perfect- really we want to know the record label, copyright info, and so on. Enter MusicBrainz- a huge collaborative open database of music metadata. With some clever tools, IRIS matches up the track&#8217;s metadata to a MusicBrainz identifier and fills in the blanks. For most tracks, it can get everything- including ISRCs, year of release, and so on. This is great for music librarians and makes copyright reconciliation for PRS/PPL much simpler, since you&#8217;ve now got all this in a database.</p>
<p>Of course, if we know what the track is, we can do another useful step- especially so for student stations. Using the MusixMatch API service (commercial but free for nonprofits at present), we can get the lyrics to a track. This means we can do a quick once-over for words we don&#8217;t want on air (swearing). Of course, this assumes the track isn&#8217;t a radio edit. We do a quick check and skip the lyric pass for tracks that look like a radio edit, but if not, the track will be flagged for review.</p>
<p>Additionally, and this is intended specifically for situations where you have no control over the ingest quality that presenters are using to rip CDs or vinyl, tracks are flagged for review if they fail to meet quality restrictions. This can be specified as a function of sample rate and bit rate. This stops people trying to upload 96kbps MP3 at 32k sample rate. We don&#8217;t want that in the system. Not now, not ever. All of these parameters can be changed easily and simply by changing a single configuration file and restarting the app.</p>
<div id="attachment_1371" class="wp-caption aligncenter" style="width: 310px"><a href="http://assets.talkunafraid.co.uk/2011/10/IRIS-SystemArchitecture.png" rel="lightbox[1367]"><img class="size-medium wp-image-1371" title="System Architecture" src="http://assets.talkunafraid.co.uk/2011/10/IRIS-SystemArchitecture-300x225.png" alt="" width="300" height="225" /></a><p class="wp-caption-text">Overview of the system architecture</p></div>
<p>Once an upload is flagged for review an administrator or music librarian can review the track and either permanently reject it or approve it (in case of false positive lyric matches or odd uploads where quality restrictions aren&#8217;t able to be met).</p>
<p>Everything in IRIS is done through a web interface- uploads, management and monitoring. Every track has its own log of events, allowing administrators to debug and diagnose problems with ease, and giving clear and simple feedback to users. There are convenience functions such as automatic display of R128 loudness graphs pre/post normalization and compression, and display of all metadata available for tracks, plus lyrics if they were found.</p>
<p>The backend to IRIS is all Ruby and Rails, using a simple database server (PostgreSQL recommended) to store everything. Background processing is distributable over multiple computers with shared storage, allowing for CPU-intensive tasks to be spread across multiple machines. Given the R128 metering process includes a fourfold upsampling, this is particularly useful. You can run workers without running the whole web application, allowing you to install copies of the app onto lots of low-cost general purpose machines and have your own distributed ingest processing cluster on even a tight bugdet.</p>
<p>Of course, now you&#8217;ve got a track with lots of metadata and some normalized audio in WAV format (archived to FLAC pre-normalization, just in case you need the original audio). Now you need to get it into your playout system. Rivendell is supported, Myriad 3.6 now has dropbox support so you can just tell IRIS to export files to that dropbox in a Myriad-supported format, and you can also just do an export in any format you choose to an arbitrary folder. Export formats supported include FLAC, MP3, WAV, BWF (Broadcast WAVE Format) and AAC. Most of these flavours come with embedded metadata.</p>
<p>IRIS isn&#8217;t a perfect system, and it&#8217;s not an instant drop-in system; I don&#8217;t have the time to maintain it as such. What it is, though, is a flexible and powerful system that any average Linux user can install and have running in hours, and which can be used by any station looking to improve their import process.  The entire project is open source, and can be obtained <a href="https://github.com/JamesHarrison/iris">here</a>- there&#8217;s also a bugtracker and wiki with some documentation (unfinished) on it. If you&#8217;d like to contribute, feel free- as I&#8217;ve stepped out from student radio to work on student television, I&#8217;ve not got a huge amount of time to work on it at the moment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2011/10/iris-the-interchangeable-radio-ingest-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rivendell 2.0.2 on Ubuntu 10.04.2 LTS</title>
		<link>http://www.talkunafraid.co.uk/2011/06/rivendell-2-0-2-on-ubuntu-10-04-2-lts/</link>
		<comments>http://www.talkunafraid.co.uk/2011/06/rivendell-2-0-2-on-ubuntu-10-04-2-lts/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 07:46:33 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[Radio]]></category>
		<category><![CDATA[Rivendell]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[rivendell]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=1328</guid>
		<description><![CDATA[Yup, it&#8217;s another guide to installing Rivendell. This time, the fancy new 2.0.2 release, complete with all sorts of fantastic goodies. Let&#8217;s get started! I&#8217;m not moving any of my Ubuntu stuff forward to 11.04 just yet; probably won&#8217;t for a while, given the situation with desktop managers and stability particularly on older hardware like [...]]]></description>
			<content:encoded><![CDATA[<p>Yup, it&#8217;s another guide to installing Rivendell. This time, the fancy new 2.0.2 release, complete with all sorts of fantastic goodies. Let&#8217;s get started!</p>
<p>I&#8217;m not moving any of my Ubuntu stuff forward to 11.04 just yet; probably won&#8217;t for a while, given the situation with desktop managers and stability particularly on older hardware like the stuff we use at Insanity. So, 10.04.02 LTS it is. It&#8217;s still supported for a while and has no realtime issues like 10.10.</p>
<p>However, there&#8217;s one snag; in my last guide we used a Rivendell package provided by the guys at Tryphon. No such package currently exists for 2.0.x, so we&#8217;ll be rolling our own from source. This is far from ideal (and I am working to get 2.0.x packages for Debian made) but it&#8217;s a good start, and will work fine- upgrades are just a bit of a pain.</p>
<p><span id="more-1328"></span>Okay. Let&#8217;s start with dependencies. I&#8217;m assuming a virgin from-source system here.</p>
<pre>sudo aptitude install libcdparanoia-dev libflac++-dev libflac-dev \ 
 libsamplerate0-dev libid3tag0-dev libid3-3.8.3-dev \
 libcurl4-gnutls-dev libsndfile1-dev libpam0g-dev \
 libsoundtouch1-dev alsa-source libtwolame-dev libmp3lame-dev \
 libmad0-dev libqt3-mt-mysql qt3-dev-tools qt3-dev-tools-compat \
 qt4-dev-tools libjack-dev libjack0.100.0-dev jackd qjackctl \
 jackeq jack-rack jack-capture libasound2-dev mysql-client \
 polymer qt3-qtconfig patchage</pre>
<p>Stick that in your terminal and wait a few minutes. There&#8217;s a lot there. At some point, jackd will ask if you want to enable realtime priority &#8211; say yes. Once that&#8217;s done, download the Rivendell tarball and extract it. Then wander into that directory.</p>
<pre>wget http://rivendellaudio.org/ftpdocs/rivendell/rivendell-2.0.2.tar.gz
tar zxf rivendell-2.0.2.tar.gz
cd rivendell-2.0.2</pre>
<p>Next, configure it- the libexec path makes sure that the paths for some new RD2 services are set up properly (specifically Apache2). Note that if you need a HPI sound card to work in this box, now would be the time to go off and install the drivers from the AudioScience website (libhpi). Do that before this.</p>
<pre>./configure --libexecdir=/usr/local/libexec</pre>
<p>Now build it, and subsequently install all the binaries and libraries.</p>
<pre>make
sudo make install</pre>
<p>This is going to take a while, even on decent modern hardware, so let me give you a taste of what&#8217;s still to come- specifically we&#8217;ve got one more hurdle ahead of us on top of the setup we needed for 1.7.2, which is the Apache web server. Rivendell 2.0.x uses a web service approach to import and export of audio data, which is a great leap forward- as well as making security improvements, it means you can delegate the import/export jobs to specific machines. Say you&#8217;ve got a pile of low-end production PCs- you don&#8217;t really want those guys to be on the front line of audio ingest. The high-end server in the rack that doesn&#8217;t do a lot, however, is completely the tool for the job. So you can tell those production PCs to use the import/export services of that server instead of their own. The flipside is we get to configure an extra thing, but it&#8217;s really a piece of cake. Don&#8217;t sweat it. And like MySQL, you don&#8217;t have to install Apache on every single machine you want to run Rivendell on, only the ones that will be using the import/export service.</p>
<p>Right. Chances are, make is probably still chugging away despite my attempt to distract you. Come back when it finishes.</p>
<p>All done? Installed? Okay, we&#8217;re about halfway there. You should now have a complete build of Rivendell with support for every format under the sun (that Rivendell supports, anyway- AAC/MP4 one day, I swear!) with support for ALSA or JACK or (if you installed libhpi before configuring) HPI sound cards. Next, let&#8217;s get the cosmetic things done- installing icons and menu items, ensuring bitmap fonts are enabled, that sort of thing.</p>
<pre>sudo cp debian/*.desktop /usr/share/applications/
sudo cp debian/*.xpm /usr/share/pixmaps/
sudo rm -rf /etc/fonts/conf.d/70-no-bitmaps.conf
sudo ln -s /etc/fonts/conf.avail/70-force-bitmaps.conf /etc/fonts/conf.d
sudo fc-cache -f -v</pre>
<p>That&#8217;s that out of the way. Next, set up a Rivendell user and group, add the current user to the audio group (for realtime permissions) and we can get on with the rest.</p>
<pre>sudo adduser --system --no-create-home --disabled-login rivendell
sudo addgroup rivendell
sudo adduser rivendell rivendell
sudo adduser `whoami` audio</pre>
<p>Okay, we&#8217;re getting somewhere. Now, rd.conf. Either copy up conf/rd.conf-sample to /etc/rd.conf, or make a new one that looks a bit like this:</p>
<pre>[Identity]
AudioOwner=rivendell
AudioGroup=rivendell
Password=letmein

[mySQL]
Hostname=localhost
Loginname=rduser
Password=letmein
Database=Rivendell
Driver=QMYSQL3

[Logs]
Facility=Syslog

[Alsa]
PeriodQuantity=4
PeriodSize=1024

[Tuning]
UseRealtime=Yes
RealtimePriority=9

[Format]
Channels=2</pre>
<p>Bam! Obviously you&#8217;ll want to use different passwords to the default and that sort of thing. We&#8217;re going with ALSA for now; using jackd is a simple (trivial, even) change to rd.conf. Check the conf/rd.conf-sample file in the source to find out how. Let&#8217;s get one other bit of housekeeping done now- we need to configure what sound cards we use for ALSA, which is set in /etc/asound.conf. But easier still, Rivendell provides a program to make this file for us. Pull up a terminal and run this to get this up and follow the instructions:</p>
<pre>sudo rdalsaconfig</pre>
<p>Once that&#8217;s done, let&#8217;s bop Apache on the head quickly. Note you only need this is if you&#8217;re running a single machine setup or if you&#8217;re installing on the machine you want to run import/export jobs on. There&#8217;s no harm in having apache/rdxport available, but it&#8217;s unneeded overhead if you&#8217;re going to delegate to other boxes anyway. Still, say we wanted to install it&#8230;</p>
<pre>sudo apt-get install apache2
sudo cp conf/rd-bin.conf /etc/apache2/conf.d/
sudo service apache2 restart</pre>
<p>Simple, right? Right. Let&#8217;s move on and get MySQL sorted out. This is for the main server only if you&#8217;re doing client-server stuff; you&#8217;ve already got the MySQL client installed if you&#8217;re building a client to connect to another existing MySQL server. Run this and when prompted, give it a nice secure password.</p>
<pre>sudo apt-get install mysql-server</pre>
<p>Let&#8217;s get the DB and sound path created and check all is well. Run this and when prompted enter your MySQL root password and the username &#8216;root&#8217; (if this is your first DB &#8211; otherwise, it should just open. Close it, ignore any errors).</p>
<pre>sudo mkdir /var/snd
sudo chown rivendell:rivendell -R /var/snd
rdadmin</pre>
<p>Okay. We&#8217;ve only got to sort one little snag out before we&#8217;re good to go- making sure Rivendell services come up cleanly on startup of the machine. There&#8217;s complications here, specifically /var/run which gets purged on startup by Ubuntu. Rivendell expects /var/run/rivendell to exist and the rivendell user/group to be able to write there- PIDs are stored for various processes here. Let&#8217;s fix that by tweaking our initscript, then set the initscript to start Rivendell on boot.</p>
<pre>sudo nano -w /etc/init.d/rivendell</pre>
<p>In that script, add the following line before the line that reads &#8216;function StartDaemons&#8217;.</p>
<pre>mkdir /var/run/rivendell 2&gt;/dev/null</pre>
<p>Okay, now run this- this will make Ubuntu start the daemons on boot.</p>
<pre>sudo update-rc.d rivendell defaults</pre>
<p>One last thing &#8211; edit /etc/pulse/client.conf and uncomment the autospawn=yes line, and set it to no. This stops pulseaudio taking over the sound card so ALSA can get at it.</p>
<pre>sudo nano -w /etc/pulse/client.conf # (then do the edit)
sudo killall pulseaudio</pre>
<p>And now we reboot and if everything went to plan, you should now have a working Rivendell installation on your system! Check for ripcd/caed/rdcatchd running, fire up rdadmin and friends, and get to configuring your perfect station.</p>
<h3>A few observations</h3>
<p>Currently there&#8217;s a segfault in Rivendell 2.0.2 with some ALSA cards. If caed doesn&#8217;t start up and /var/log/messages has a pile of caed output and then a segfault and you&#8217;ve got multiple cards available to you in rdalsaconfig, try disabling/enabling each one till you find a working one. Use &#8216;sudo service rivendell restart&#8217; to restart the daemons without rebooting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2011/06/rivendell-2-0-2-on-ubuntu-10-04-2-lts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

