<?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; Projects</title>
	<atom:link href="http://www.talkunafraid.co.uk/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.talkunafraid.co.uk</link>
	<description>The (occasionally coherent) ramblings of a geek</description>
	<lastBuildDate>Thu, 09 Feb 2012 02:27:36 +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>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>Audio tools for Linux commandline geeks</title>
		<link>http://www.talkunafraid.co.uk/2011/01/audio-tools-for-linux-commandline-geeks/</link>
		<comments>http://www.talkunafraid.co.uk/2011/01/audio-tools-for-linux-commandline-geeks/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 12:10:13 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[Awesome Stuff]]></category>
		<category><![CDATA[Code Snippets and Examples]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Radio]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[insanity]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=1224</guid>
		<description><![CDATA[At Insanity I&#8217;ve been doing a lot of things with audio. Clearly me being me, I wasn&#8217;t doing this using Windows &#8211; we&#8217;ve now finally made it to 50% Linux, 50% Windows at Insanity and I plan to keep nudging things in the Linux direction for ease of maintenance and use, and because it&#8217;s just [...]]]></description>
			<content:encoded><![CDATA[<p>At Insanity I&#8217;ve been doing a lot of things with audio. Clearly me being me, I wasn&#8217;t doing this using Windows &#8211; we&#8217;ve now finally made it to 50% Linux, 50% Windows at Insanity and I plan to keep nudging things in the Linux direction for ease of maintenance and use, and because it&#8217;s just _better_ for doing audio things with. What do I mean by that, though?</p>
<p>Well, here&#8217;s one thing- there&#8217;s so many fantastic audio editing, production and routing tools for Linux. And even better, there&#8217;s loads that can be run on a command line, without needing a desktop computer- so we can do audio processing on our server hardware, of which we&#8217;ve got plenty. But they&#8217;re a bit hard to find so I figured I&#8217;d just do a quick summary of the top few tools we&#8217;re using that you might&#8217;ve heard of, and a few you probably haven&#8217;t. So, in no particular order&#8230;</p>
<h3><span id="more-1224"></span>sox</h3>
<p>sox is an awesome little tool which bills itself as the swiss-army knife of audio tools. It&#8217;s not far off, either. While it&#8217;s not so great on the format support side of things, this little thing can do pretty much any common operation you want it to do (and a few not-so-common ones). We&#8217;re using it to automatically split up hour long MP3 files into half-hour chunks, as well as using it for trimming silence off audio and performing companding on audio before things get imported to our playout system. We use ffmpeg to get things into WAV for it, though.</p>
<h3>ffmpeg/ffprobe</h3>
<p>ffmpeg is one of those legendary tools. This thing will read anything and lets you seamlessly turn it into anything else. I&#8217;ve thrown the nastiest, strangest and most obscure files at this thing and had it spit out completely usable WAVs time after time. Learn to love this puppy. Oh, and it&#8217;s fast, too. ffprobe is it&#8217;s companion tool, able to quickly give you the rundown on any file and return metadata.</p>
<h3>exiftool</h3>
<p>If ffmpeg is the king of reading audio data, exiftool is the queen of metadata. While it&#8217;s aimed mostly at image files, it&#8217;s also incredibly good at pulling useful metadata out of various formats stored in audio files- MP3 ID3 tags, AAC metadata, you name it. We use this to get metadata out of pretty much anything and normalize it into MP3 ID3 tags for our playout system, which can&#8217;t recognize much unless you spoon-feed it in the right format.</p>
<h3>mp3info</h3>
<p>A blissfully simple little tool for querying and writing MP3 ID3 tags. Very handy, fast, and simple. What&#8217;s not to like?</p>
<h3>JACK</h3>
<p>JACK, the Jack Audio Connection Kit is yet another one of the more well-known tools. Capable of routing audio signals inside a virtual patchbay it&#8217;s very powerful, and we use it extensively all over the place. NetJACK is an interesting development that is really starting to take shape now, and is one to watch in the coming years. JACK is supported by tons of stuff, including a lot of the software aimed at the broadcast and professional audio crowd.</p>
<h3>jack_meter</h3>
<p>jack_meter is a really nice little script that can do command-line monitoring of levels on a given set of JACK ports. It&#8217;ll draw you a nice little meter, or spit out numerical information. We&#8217;ve actually now got this hooked up to a Nagios script to check to ensure our self-operated studio is in the right ballpark levels-wise and isn&#8217;t driving the net TX system overly hard- works a treat!</p>
<h3>rotter</h3>
<p>Not so handy for _everyone_, but certainly has its place. Rotter is a recording of transmission tool, intended for radio stations and other people who want to make a continuous recording of an audio source (using JACK again) and store it in files split up based on a fairly flexible partitioning system. We&#8217;re required to do regulatory logging and such, and this is used for both that and for presenters who want to make podcasts of their shows &#8211; and this is a darn sight cheaper (and better!) than the £1500+ commercial products to do this.</p>
<h3>audacity</h3>
<p>Okay, not a command-line tool, but it&#8217;s by far one of the best audio editors out there right now, in my opinion matched only by Pro Tools for just doing quick and simple composition and editing of assets. And since it&#8217;s crossplatform and free, the presenters can take it home with them and work there instead of having to use our production room to do simple edits!</p>
<p>I&#8217;m sure I&#8217;ll remember a few after I post this but that&#8217;s certainly a good start. Do you have any tools you couldn&#8217;t live without for audio processing?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2011/01/audio-tools-for-linux-commandline-geeks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring radio, and the joys of realtime feedback</title>
		<link>http://www.talkunafraid.co.uk/2010/12/monitoring-radio-and-the-joys-of-realtime-feedback/</link>
		<comments>http://www.talkunafraid.co.uk/2010/12/monitoring-radio-and-the-joys-of-realtime-feedback/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 00:56:40 +0000</pubDate>
		<dc:creator>James Harrison</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Odds and Ends]]></category>
		<category><![CDATA[Radio]]></category>
		<category><![CDATA[Servers and Software]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[gpio]]></category>
		<category><![CDATA[insanity]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nsca]]></category>
		<category><![CDATA[radio]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://www.talkunafraid.co.uk/?p=1197</guid>
		<description><![CDATA[Monitoring and logging of broadcast systems is often overlooked in smaller setups like university radio stations. Which is a shame. If we&#8217;d had monitoring in place last year at Insanity, we&#8217;d have known exactly how much dead air went out. Now, we&#8217;ve got a much better setup. It&#8217;s cheap(ish), a little bit homebrew, but there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Monitoring and logging of broadcast systems is often overlooked in smaller setups like university radio stations. Which is a shame. If we&#8217;d had monitoring in place last year at Insanity, we&#8217;d have known exactly how much dead air went out. Now, we&#8217;ve got a much better setup. It&#8217;s cheap(ish), a little bit homebrew, but there&#8217;s nothing fundamentally wrong about that. It works, and I know we&#8217;ve had 53m 34s of dead air in the last year &#8211; and it&#8217;s all accounted for. We also know when we were running on backup audio &#8211; showing that we&#8217;d have been on dead air for a goodly 1 day, 17 hours, if it weren&#8217;t for our silence detector and backup playout unit.</p>
<p>So, what&#8217;s the best way to approach all this? With a new set of equipment to monitor, and a lot of old equipment still unmonitored (our desk&#8217;s GPIO and the AM transmission gear, for instance), hardware GPIO lines are order of the day. Mostly, this can be done with relays, pull-up resistors, optoisolators and a steady hand with a soldering iron (bolted onto an Arduino &#8211; see my last post). This is all well and good &#8211; but now you need to get that into a sensible format, record it, log it, and take action depending on the state (emails, indicators in the studio, etc). Which is where Nagios comes in.</p>
<p>Nagios is scarily flexible. It&#8217;s also extremely lightweight for small setups, and very easy to configure, with excellent documentation. And since it&#8217;s widely used in larger IT outfits, there&#8217;s an infinitude of addons, plugins, and so on to expand it. It&#8217;s at heart a monitoring program, with support for active checks (where Nagios polls the host or service), and passive checks (where the host/service reports in to Nagios itself). Once you&#8217;ve gotten things inside Nagios you can use a flexible set of rules for notifications, and use some of the many addons (we use check_mk&#8217;s livestatus) to get data out into other programs. We use CoffeeSaint on dashboards to provide single heads-up displays (with camera displays combined), and we&#8217;ll soon have Nagios integrated into the Insanity website&#8217;s admin backend so that staff can see a general overview of the system alongside all the other vital information like listening figures and cameras from wherever they are in the world.</p>
<p>At the moment because we&#8217;re poor, we don&#8217;t have ethernet shields for our Arduinos, so we have an Arduino Mega and an Arduino doing two things- driving a matrix LED display, and monitoring our silence detector. The latter is done by the Mega, which will later be expanded with ethernet and various boards to break out the DB25/DB15/DB9 connectors from the mixing desk into Arduino-compatible levels. For now though it&#8217;s just hooked up on USB. The Mega also drives a set of Bliptronics LED RGB modules- these are currently spread along the top of the mixing desk in the studio where presenters can see it.</p>
<p>The Mega is set up to simply watch the two inputs of the silence detector and their alarm states, and to display one of four messages describing that state to serial over USB, where it&#8217;s picked up by a small Ruby script, which then sends a NSCA (Nagios Status Check Acceptor) packet to the NSCA daemon on the monitoring box. This packet contains the information about the silence detector in a format that maps to the host and services described in Nagios. This means we get very rapid updates on the silence detector compared to active monitoring. Even more rapid is the LED strip, which is controlled wholly in C. If the station&#8217;s output gets switched to the backup source because the silence detector thinks the studio is too quiet, then the strip goes red (normally green) &#8211; and if a presenter is in there, he/she now knows that there&#8217;s a problem, they&#8217;re no longer going out on air, and they can either work out the problem by themselves (previously the staff wouldn&#8217;t know that this had even happened without going out and listening to the radio) or call for support.</p>
<p>It&#8217;s one thing to have standards, and another thing entirely to monitor your performance and hold yourself to them; and when there&#8217;s a problem with your metrics, then you can fix it. We&#8217;ve dramatically improved the actual quality of broadcast radio that Insanity puts out in the last year; partly it&#8217;s a human change, we&#8217;ve had some great presenters join us this year and a very determined board, but there&#8217;s an element of technical change and a lot of instant feedback for presenters to help them; and this has really helped people spot problems where previously they wouldn&#8217;t even have known they were there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.talkunafraid.co.uk/2010/12/monitoring-radio-and-the-joys-of-realtime-feedback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

