Interfacing Rivendell with the real world on a budget

So, you’ve got this lovely, expensive broadcast console your previous engineers have left for you sitting in your studio. And you’re using all of 3 microphone inputs and a few line inputs.

And, of course, the logic facilities of the console are entirely ignored. It’s a shame, isn’t it? A microphone live light is a wonderful thing to have, and there’s so much you can do with a little bit of GPI. But the cards that provide you with general purpose inputs tend to be expensive, odd and awkward little bits of kit to work with. Let’s fix that!Go buy a cheap USB joystick. I used a Logitech Attack 3, with 11 buttons. These things are great- they’re basically big USB input multiplexers already made for you! All you need is a bit of electronics magic to make everything play nice without toasting it all, and a tiny bit of Rivendell configuration combined with some shell scripts. Get your screwdriver out and rip that thing to shreds. Carefully.

At the top of this post is a schematic. The switch on the right is the switch on the board of the joystick- just soldering onto the back of the existing switch pins or desoldering the pin, either works but one option keeps you the physical button for debugging. The optoisolator in the middle is the magic – it’s a 4N35 model from TI, and will keep your two bits of kit entirely electrically isolated. On the left we’ve got a D-sub connector, in this case from an Alice AIR2000 console, with the red light pins connected – +12V and ground, which will drive 30mA. We’ve got a 150 ohm resistor in there to keep current on the optoisolator down. The net effect of this is that the optoisolator effectively acts as a sort of relay for DC – entirely isolating the two circuits so we don’t have to deal with 12V on our USB device.

This circuit’s easy to whip up and the bits can be purchased from RS, Farnell or Maplins. Nice and easy.

Next, plug your joystick into your Linux box running Rivendell. Now, Linux will show up the joystick as a HCI device, listed in /dev/input, but we need to know which device in there is the actual joystick. Run this command

ls -lar /dev/input/by-id
Console logic connector on the left, joystick on the right.

One of the symlinks in that folder will point at a file that’s named like event4, event6, or similar. Remember that, and open RDAdmin. Add a new GPIO matrix to your host, using generic local GPIO as the type, and enter /dev/input/event4 (what you saw above) as the path. Then set it to 11 GPIs. Close down RDAdmin, and restart the Rivendell daemons with this command:

service rivendell restart

Now open a console and run

rdgpimon

Press some buttons or, if you’ve already done your wiring, go turn a microphone on – and you should see the appropriate GPI light up green. Congratulations! Now you can go tinker. For our mic on lights, we’ve got a pair of carts for on/off on that GPI. Those scripts run a shell script that sets a flag in a database that can be queried by various bits and pieces of tech around the station to show the current status of the microphones. The possibilities are endless, though – have a look at the Rivendell documentation!