GitHub - yeokm1/covox-music-player: A Linux program that plays MP3 or WAV files to the Covox Speech Thing or its clones via a native parallel port. (original) (raw)

covox-music-player

A Linux program that plays MP3 or WAV files to the Covox Speech Thing or its clones via a native parallel port. MP3 files are converted to WAV using FFmpeg as an intermediate step. WAV files are processed using the libsndfile library.

You can purchase a new Covox from Serdashop.

Video and images

Video of the program in action.

Pushing data to a Tiny Tapeout ASIC doing PWM. More details: https://yeokhengmeng.com/2024/06/my-first-chip-with-tiny-tapeout-cvx/

Screen

Screenshot of my program

Screen

Terminal on the right is my program running. Terminal on the left is to obtain the IO address of the parallel port with lspci -v or cat /proc/ioports | grep parport.

Screen

As modern computers don't have parallel ports anymore, I used this Startech Expresscard to Parallel Port adapter with my laptop. If you are on a desktop, you can use a PCI-E adapter card. I have tested this serial-parallel combo from Startech to work although other models might work as well too.

USB-Parallel adapters are best avoided as they are not true parallel port hardware as they usually appear as USB printers and abstract the IO pins away. Thus you can't bitbang the pins as my program does. Besides, USB is not really suitable for realtime control due to latencies in its protocol.

Compiling the program

I tested this up to Kubuntu 24.04 LTS but it should work on other distributions as well.

sudo apt update

#Install dependencies sudo apt install gcc build-essential libsndfile-dev ffmpeg

git clone https://github.com/yeokm1/covox-music-player.git cd covox-music-player gcc covox-music-player-linux.c -o covox-music-player-linux.out -Wall -lsndfile -pthread

Running the program

sudo ./covox-music-player-linux.out 0x378 file.mp3 [-s]

Replace 0x378 with the address of your parallel port such as 0xd020 or 0x3008 which are used on my systems. The program requires root access in order to access the parallel port addresses. View the video above to see how to obtain the addresses with the commands lspci -v or cat /proc/ioports | grep parport.

-s to not show the frame skipping is optional.

Direct Write test program

This program enables writing a single value directly to the parallel port address for debug uses. The value range is up to 255.

Compiling

gcc direct-out.c -o direct-out -Wall

Writing the single value of 5 to port 0x378

/direct-out 0x378 5

Writing the single value of 128 to port 0x4000

/direct-out 0x4000 128

References

  1. Find Parallel Port address on Linux