Building a TI-99/4A cassette deck emulator

Although many people use their PC (workstation-class) to transfer programs to their TI via playing a .wav into the cassette port, I went in a different direction.

I like small dedicated devices, and thus I built a tape recorder emulator out of a BeagleBone Black, a SparkFun display cape, a USB sound dongle, and a little bit of UNIX.

First, I installed Arch Linux on the BBB via the instructions here. Yes, I hate systemd as much as anyone else, but Arch Linux has it and it’s the least distasteful of the Linux distributions at the moment.

Second, and this is very important, I disabled HDMI. If you don’t do that, the display cape WILL NOT WORK. There seems to be a different method every kernel release (as is the norm for Linux — I really wish FreeBSD supported capes), but I guarantee this method will work on Arch Linux as of March 2015. Log into the BBB, push to root, and execute:

mv /boot/dtbs/am335x-boneblack.dtb /boot/dtbs/am335x-boneblack.dtb-old
cp /boot/am335x-boneblack-emmc-overlay.dtb /boot/dtbs/am335x-boneblack.dtb 

You need to do this because the capemgr (if present in the kernel) will not disable HDMI; u-boot has the dtb hardcoded into its environment, and on the BBBs that I have they cannot be overridden by uEnv.txt. You won’t find this documented anywhere; I found it while poking around a storage-blanked BBB via serial console.

pacman -S lynx alsa-utils

Next, install the necessary packages with pacman:

Next, turn off the BBB and attach the display shield and USB sound dongle. I like the 4D Cape 43, as it’s cheap and has movement buttons. Turn on the BBB and wait to see a login prompt on the display. If you’ve got a white screen, then HDMI is still enabled. Disable it with extreme prejudice per the instructions above.

Next, log in and create an account. You can continue using “alarmpi” if you want. Edit /etc/systemd/system/getty.target.wants/getty@tty1.service and add “–autologin ${USER}” after “/sbin/agetty” in the line that starts with ExecStart.

Now go to that user’s home directory and edit .profile to look like this:

export PATH=$HOME/bin:$PATH
TAPE_PROTO="http"
TAPE_HOST="(web server)"
TAPE_PORT="9640"
TAPE_DIR="/"

if test -z "${SSH_CONNECTION}"; then
lynx -cfg=$PWD/lynx.cfg \ "${TAPE_PROTO}://${TAPE_HOST}:${TAPE_PORT}${TAPE_DIR}"
logout
fi

… editing the TAPE_* to match your environment. You can rework it to use the local filesystem by using “file:///path/to/files” if you so desire.

Now edit .mailcap thusly:

application/x-gzip; cat %s | aplay 1>/dev/null 2>&1

… so that gzip files will be autoplayed when selected. If you’re using local files, you will need to use this .mailcap instead:

application/x-gzip; cat %s | gzip -d -c | aplay 1>/dev/null 2>&1

(why gzipped .wavs? gzip -9 losslessly compresses the output of my TI-to-sine-wave generator the best, better than even flac, thus I highly recommend doing this)

Now reboot. If all went well, you’ll see a list of tape files. Select one with the buttons on the shield and press the enter button. The .wav file should be played through the USB sound dongle. Verify that it sounds okay via whatever method you desire (powered speakers, headphones, and so forth); ssh in and adjust the output volume with alsamixer if necessary.

That’s it. Standalone cassette tape player construction complete, for roughly the price of a decent tape deck back in the 80’s.

About Chris Kobayashi

I'm a security systems engineer, specializing in UNIX, network, and physical security. I'm in Tokyo, and I'm mostly retired now. I'm well-versed in both electrical and software engineering, with a particular interest in old computers and game consoles. You can contact me here.
This entry was posted in TI-99/4A. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.