Personal tools

Recording airchecks with gpi from microphone switch

From Rivendell Wiki

Jump to: navigation, search

RDCatch Method

Description

This setup is designed to record airchecks of air talent for the purpose of talent revue by program directors or consultants. Long form air check recordings can simply use rdcatch however all we want to do is record when the announcer is live on the air. ie: When the microphone is turned on. Problem is we need to be able to archive many cuts until they are needed. Here is my Rivendell solution for this task.

This could be done over a network between a couple of workstations by embedding rml commands into a script with rmlsend, but for our purposes here this is all done on a single Rivendell workstation.

Requirements

First we must have a gpi source, any of the Rivendell supported hardware can be used as long as it supports both on and off transitions. We are going to take a ttl or contact closure from the on air console mic channel switch available on most all broadcast consoles connect it to our gpi device and with the help of a few simple rml commands and a short script get the job done.

Record Start Macro

Create a macro cart in RDLibrary and insert the following rml command in it.

RS 1 999999 001 300000!

This macro will RS (record start) 1 (deck 1) 999999 (cart number) 001 (cut number) for 300000 ms

This command will start a recording on record deck 1 and record for 300000 ms or five minutes or until we give it a stop command. For our stations format a five minute window is more than enough to capture the disk jockey's break, your mileage may vary. So, adjust this to fit your needs.

We assign this cart to the on transition gpi closure in rdadmin so that when the mic channel is turned on we begin recording. You can do this in RDAdmin>Manage Hosts> select the host >Edit>Switchers GPIO> select your gpio switcher >Edit>Configure GPIs> select your gpi >Edit>ON Transition-Cart Number

Record Stop Macro

Next step is what to do when the microphone is turned off. Create a second macro cart in RDLibrary and insert the following commands on three lines.

RR 1!                         (stop recording on deck 1)
SP 1000!                      (sleep for one second - this is to give time for the wav file to be closed)
RN /home/rduser/convert.sh!   (run our script to convert and move the file)

Note: This tutorial assumes your linux user is rduser. Change as needed.

Assign to this cart to the off transition for the gpi in rdadmin. You can do this in RDAdmin>Manage Hosts> select the host >Edit>Switchers GPIO> select your gpio switcher >Edit>Configure GPIs> select your gpi >Edit>OFF Transition-Cart Number

The Script

Now - what goes in the script convert.sh

#!/bin /bash

dt=$(date +"%b%d%H%M")     # this is to set a variable dt to our time stamp pattern monthdayhourminute.
lame -V 8 /var/snd/999999_001.wav /home/rduser/airchecks/$dt.mp3

Save this as /home/rduser/convert.sh and make it executable.

The lame command uses a variable bit rate (-V) with 1-9 being the relative quality you want to convert our recording to a mp3 file with the file name set by the variable $dt to something like Sept220750.mp3 and saves it in a aircheck directory.

You now will end up with a mp3 recording of whatever you feed deck one (we assume program signal) for every time someone turns on the control room mic.

Summary

On transition of gpi starts macro cart one to begin recording Off transition of gpi runs macro cart to stop recording and run a script to convert and save file.


Optional

Last step is to have a apache web server with autoconf enabled. We then simply create a symbolic link of our "airchecks directory" and place it in /srv/www/htdocs opening this web server with http://yourserver/airchecks will give you a index of all the cuts and they can either be played directly or downloaded.


That's it another task accomplished with Rivendell. I hope this will help others not only solve this particular task but open eyes to just how creative you can get with the combination of Rivendell and Linux. RML's can set you free!


JACK Method

When trying the above method my rcatchd process loved to segfault without much reason, so I whipped up a method using jack_capture. This only works if you use JACK.

You just have your GPI On and GPI Off carts run a script - mics_on.sh, mics_off.sh in our case. To allow us to cleanly background and end the jack_capture process we have to use screen.

In mics_on.sh we have this:

#!/bin/bash
dt=$(date +"%Y-%m-%d-%H-%M")
# Start recording, binding to the system's capture inputs, which we assume have programme content on them.
screen -dmS $dt jack_capture --format ogg --disable-console --port system:capture* /home/insanity/airchecks/$dt.ogg
screen -list | grep $dt | cut -f1 -d'.' | sed 's/\W//g' > /home/insanity/rdscripts/capture.pid # Get the PID and put it in a file
/home/insanity/rdscripts/redisset.py mics_on 1 # This sets a flag in our station statekeeping DB
ssh insanity@hendrix md_puts "MICROPHONES\ LIVE" # This displays a message in the studio on the clock via another computer

The mics_off.sh script is simple:

#!/bin/bash
kill `cat /home/insanity/rdscripts/capture.pid` # Kill the recording
/home/insanity/rdscripts/redisset.py mics_on 0 # Update the flag in statekeeping DB

You can also tell jack_capture to record to .mp3 if you want, or .wav so you can transcode into whatever format you desire.

Timemachine/Loquacious variant

Another variant uses the Timemachine program for JACK which lets you capture audio before you start actually recording. This script, loquaciousd.py, can automatically start and control Timemachine's command line interface to manage recording of airchecks, and publishes new recordings to a Redis list for further processing.

LAB Method

Q: Currently I'm using rdcatch to record jocks shows and then scoping them down. Does anyone know of a linux based recorder that I could use with a gpi from the mic switch to record air checks?

A: Doesn't LAB do this? It does indeed. LAB is referring to the Linux Audio Backstop, an application I wrote back in the late nineties that does pretty much precisely what you are looking for. OSS based, but still works fine under ALSA with OSS emulation. Current source can be found at:

http://www.rivendellaudio.org/ftpdocs/lab/lab-2.1.6.tar.gz

Frederick F. Gleason, Jr.

Chief Developer

Paravel Systems