Piping audio from mpg321 to PiFmRds Answered
I was working on a little project that turns my Raspberry Pi 2 into a FM transmitter. The goal is to make it completely headless, having it start up immediately on boot, without any external computers or peripherals. Now, I have tried this following command:
mpg321 --random /home/pi/music/ - | sudo /home/pi/PiFmRds/src/pi_fm_rds -freq 95.5 -audio -
The first command tells it to randomize and play the music. Then the directory it is in. Then there is the pipe, followed by the command to start PiFmRds, on the frequency of 95.5 FM. And finally, to take in audio from a pipe.
But I get this:
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
Version 0.3.2-1 (2012/03/25). Written and copyrights by Joe Drew,
now maintained by Nanakos Chrysostomos and others.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Playing MPEG stream from - ...
Using mbox device /dev/vcio.
Allocating physical memory: size = 3403776 mem_ref = 5 bus_addr = fd812000 virt_addr = 0x768c8000
ppm corr is 0.0000, divider is 1096.4912 (1096 + 2012*2^-12) [nominal 1096.4912].
It's not showing any errors, but it doesn't tell me a whole lot. Additionally, the radio I have tuned to the frequency that I set does not play anything, though it is silent, suggesting that it is transmitting.
Is there some obvious error to what I am doing, or do I need to take a different approach? Or perhaps I just need to look into the documentation of mpg321 some more?