Adding streaming internet radio to an old cabinet radio/phono/eight-track

Adding streaming internet radio to an old cabinet radio/phono/eight-track

So this came home with us.

giant phono cabinet
giant phono cabinet

It’s a 1970’s phonograph, AM/FM radio, and eight track tape player.  The tape player can record eight-track tapes.

Well, in theory it can.  In practice, the radio worked, the phono sounded terrible, and the tape player didn’t work at all.

A new needle fixed the phono.  Awesome.  Three out of four functions.  But the eight-track was in awful shape.  It doesn’t switch tracks, it doesn’t play.  The capstan is entirely missing the rubber friction drive that moves the tape.

So I did what any good geek would do: I operated and spliced in a Beaglebone, so it plays streaming internet radio.


 

First hurdle.  It’s cold, and my basement, where the only ethernet cable lives, is really cold.  I’m also lazy.  So I used a cat5 cable from the beaglebone to my laptop, set up port forwarding on my laptop, and then I could ssh into the beaglebone via the usb cable, and do software upgrades via apt-get through the cat5 and then across the wireless network.

On bbb:
ifconfig eth0 192.168.7.2
ifconfig add default gw 192.168.7.1
On laptop, start with an ifconfig and look at the output. There should be two eth[x] entries, one of which will include the 192.168.7.2 entry. That’s actually the usb. So you want to configure the other one, which is the hardware associated with the port where the cat5 cable lives. For this example I’m presuming it’s eth1, and your wireless connection is wlan0.
sudo ifconfig eth1 192.168.7.1
sudo iptables –table nat –append POSTROUTING –out-interface eth1 -j MASQUERADE
sudo iptables –append FORWARD –in-interface wlan0 -j ACCEPT
sudo echo 1 > /proc/sys/net/ipv4/ip_forward

If you’re using xubuntu (or apparently a few other distros) that last line won’t work because for whatever reason ‘>’ doesn’t inherit sudo permissions. So you have to punt:

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward

Now you can start work on the bbb.
apt-get update
apt-get upgrade
apt-get install alsa-base alsa-utils

Mine already had all the alsa stuff installed. A bunch of programs didn’t successfully upgrade, like apache and dbus, which I need to look into later, but I don’t actually use any of those for this project so I don’t care. [note 1]


 

Second hurdle: setting up audio.

I’m using a USB soundcard.  This requires disabling HDMI, which I’m not using at all, so the soundcard can manage the sound.

Go to /boot/uboot and edit uEnv.txt to remove the comment status from the line disabling hdmi. It’ll be optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
Then go to /etc/modprobe.d/alsa-base.conf and edit it to change the index on snd-usb-audio from -2 to 0.
Reboot the bbb with your usb soundcard plugged in.
For me, this resulted in being able to play music. I needed some music to play and a player.

apt-get install mpg321
wget http://www.noiseaddicts.com/samples/1456.mp3

(you might want to change your working directory to /home/debian before doing that, rather than sticking an mp3 in /etc/modprobe.d)
and then you can mpg321 1456.mp3 and hear some noise.
mpg321 will also accept url’s, so:
mpg321 http://ice.somafm.com/indiepop

(If you download a .pls, it’s just text and will have the correct URL embedded in it.)
I used a Syba usb soundcard. It works beautifully.

[note 1]
For some reason, on current beaglebones led_aging.sh is a screwed-up file, and prevents apt-get update from working correctly on half a dozen packages.
From here: https://groups.google.com/forum/#!topic/beagleboard/LPjCn4LEY2I
do this:
Replace the existing /etc/init.d/led_aging.sh script with:

#!/bin/sh -e
### BEGIN INIT INFO
# Provides: led_aging.sh
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start LED aging
# Description: Starts LED aging (whatever that is)
### END INIT INFO

x=$(/bin/ps -ef | /bin/grep “[l]ed_acc”)
if [ ! -n “$x” -a -x /usr/bin/led_acc ]; then
/usr/bin/led_acc &
fi


Third hurdle: getting something to run automatically every time the beaglebone boots, aka the dreaded systemd.
In /lib/systemd/system/ make a file (programname).service
So for this example, blinker.service

It should look like this:

[Unit]
Description=blinker
ConditionPathExists=|/home/debian/programming/python

[Service]
ExecStart=/home/debian/programming/python/blinker.py
SyslogIdentifier=blinker
Restart=always

[Install]
WantedBy=multi-user.target

Then go to /etc/systemd/system/multi-user.target.wants and make a symlink to that file.

ln -s /lib/systemd/system/blinker.service /etc/systemd/system/multi-user.target.wants/blinker.service

The file itself, if it’s python, must begin with #!/usr/bin/python (or wherever you have python installed) and be executable.

Then, systemctl –system daemon-reload
and systemctl start blinker.service

and your program should start immediately and also start every time you boot the beaglebone.

If your program is dependent on other services before it starts, you can add those under the [unit] group, like:
ConditionPathExists=|/home/debian/programming/python
After=network.target

That way it will wait until the network is up before running — which, in the case of what I’m building, is nice, because it’s streaming internet radio.


I set up an Asus router as a repeater, that the Beaglebone plugs into.  I chose this because I had the router, and because I’d rather have USB just handling sound, and the network port just handling internet.
This required giving the Beaglebone a fixed IP, and registering that with the router, which also has a fixed IP, and registering the router with the house router.  Normal network stuff.  By adding port forwarding on the house router, I can ssh into the beaglebone and do any software shenanigans, like restarting it if it hiccups.

Back to hardware.  The eight-track player has nine wires leading to it: two pairs of two wires bundled inside coax grounds, and three other wires.  The unit claims to be quadraphonic.  There’s a switch at the top that says ‘stereo’ and ‘quadraphonic’.  As far as I can tell, this is bogus.  It has two sets of speakers (woofer, two tweeters) and the phono is stereo.  Given the four wires from the eight-track to the main amp board, there was at least a possibility that it was, in fact, quadraphonic.  After screwing around injecting signals into the four wires using a function generator:
debugging audio
debugging audio
I have convinced myself that two of the wires are outputs through the power amp to the speakers, and the other two are inputs for recording, that come from the speakers to the eight-track.  If there’s a microphone in this cabinet they hid it very well.
Here:
detail of eight track audio
detail of eight track audio
You can see a red wire that brings 20V to the eight-track, plus the gray and blue bundles that bring the input and output from the eight-track to the main cabinet.
At some point I have to get the eight-track working.
Alan Martin, aka The Most Interesting Engineer In The World:
https://www.youtube.com/watch?v=A1WFRC_ad2k
has told me that it is a Moral Imperative that I repair the eight-track and get it working.  He has promised, or threatened, depending on how you look at it, to send me a suitcase full of brand new still in their plastic wrappers eight-track tapes when I get it working.
I promise I will, Alan.
But for right now, I cut the output from the eight-track, and spliced into the wiring with the Beaglebone’s soundcard output.

At this point, the software and electronics were complete.  The system played streaming radio when started, and I could switch stations remotely.
But what I wanted was to have the old control work.  There were five lights, one that lit up a ‘power’ indicator, and the other four telling you which track it was currently on, plus there was a button that allowed you to skip to the next track.
So I fired up KiCAD.  At work I use Altium and Cadence, and at home, in the past, I’ve used gEDA, but I am growing to like KiCAD.
kicad_board
kicad_board
It came out nicely.
So from there, it’s off to the LPKF circuit board plotter.
phono circuit
phono circuit
That came out nicely, too.
KiCAD’s default settings do something weird that I have to explore more: the board is essentially double insulated with a thin line of copper running between two adjacent isolation cuts.  It works fine.  It’s just more work for the poor LPKF plotter to cut away all that material.
So here’s the original board, with incandescent lights, and my replacement board, with LED’s.
phono control board replacement
phono control board replacement
I pretty much eyeballed the dimensions, by holding calipers up above the bulbs.  I was more careful with the screw mounting points.
The tactile switch on the board is triggered by a press-button I machined out of a bit of hex aluminum.
phono control panel and button
phono control panel and button
It works reasonably well.  It’s awfully sensitive.  I should have gotten a button with a much higher press force.  The narrower round part goes through the hole in the control panel, with the hex slightly larger in diameter so you can’t pull it out.
At this point it’s down to buttoning up.  Screw new control board in place, attach old control board to a bit of convenient metal with tape, rainbow jumper wires from the control board to the beaglebone.
phono all wired up
phono all wired up
Then the Asus and the Beaglebone go inside the cabinet, where I’ve wired in a spare outlet (seen at bottom) and the faceplate goes back on the machine.
phono closed up
phono closed up
It worked pretty well.
The program I’m using to run everything chooses a random URL from a list I compile.  As such, it lights a random track light, rather than incrementing them.  In part, that’s because incrementing stateful variables in a callback in python is trickier than I’d expected.  But as I have that working now, I’ll ssh into it and upgrade the software at some point.
Here’s an odd thing: different streams have different volumes.  I can set the gain of mpg321, but for the same gain, some streams are really loud and have a good volume match with the dynamic range of the amp, while others are so quiet that I have to crank the amp up to max to hear them well.  It’s just ones and zeros, right?  Weird.
Comments are closed.