Adam792
Specialist Contributor
- Joined
- Sep 5, 2009
- Messages
- 1,284
- Reaction score
- 1,205
- Points
- 113
- Age
- 32
- My Satellite Setup
-
Dishes: 80cm (5°W), 80cm (30°W), 60cm Zone 2 (13°E/19.2°E/28.2°E)
Receivers: HTPC w/ TBS6905 4x DVB-S2 PCIe tuner card running TVHeadend, Octagon SF8008 mini.
- My Location
- Cheltenham
Anyone who's listened to any of the German public radio stations on 12265H on 19.2°E via an Enigma2 receiver has probably noticed that radio text displays on the screen, often showing the "now playing" information.
This interested me as to how it worked, and some research a good while back found out that it's RDS (for FM radio), it's embedded into the MP2 audio stream in a format called UECP for these channels which are often used to feed the FM services available via cable providers in Germany. The cable companies have special FM modulators that take the satellite stream input and modulate the RDS data along with the audio to an FM frequency.
This project started as wanting to write a little tool to extract this information from the audio stream just out of interest to be able to view it. The data is actually embedded inside the audio stream, at the end of each MPEG Audio packet. I ended up writing a Python tool that reads in each MPEG Audio packet, checks for RDS data (the data is in reverse order at the end of the packet) and re-assembles it to display in a terminal window on the PC. For ease of decoding I'm able to use my TVHeadend setup to just stream the "raw" MP2 audio without any transport stream packaging.
The next step has then been to try out actually transmitting this data. The Raspberry Pi can generate an FM signal on its IO Pins, using a little piece of software called PiFm. There's a fork of this called PiFmRds that adds RDs transmission capability - ChristopheJacquet/PiFmRds
The PiFmRds tool lets you dynamically change the RDS PS (station name), TA Flag (Traffic Announcement) and RT (Radio Text) by sending data to a pipe. I adapted my Python tool to send the decoded RDS data from the MP2 stream to a named pipe in the correct format and hey presto! -
The process is -
Create a named pipe to share data to the PiFmRds tool
Stream MP2 stream for one of the German radio stations --> pipe into Python tool to extract the RDS and send it to the pipe
Convert the MP2 stream to WAVE with FFMPEG and pipe it into the PiFmRds tool along with the RDS data pipe as the audio and RDS data sources
Put your radio aerial near to the output pins on the Pi, and tune to the correct frequency!
This interested me as to how it worked, and some research a good while back found out that it's RDS (for FM radio), it's embedded into the MP2 audio stream in a format called UECP for these channels which are often used to feed the FM services available via cable providers in Germany. The cable companies have special FM modulators that take the satellite stream input and modulate the RDS data along with the audio to an FM frequency.
This project started as wanting to write a little tool to extract this information from the audio stream just out of interest to be able to view it. The data is actually embedded inside the audio stream, at the end of each MPEG Audio packet. I ended up writing a Python tool that reads in each MPEG Audio packet, checks for RDS data (the data is in reverse order at the end of the packet) and re-assembles it to display in a terminal window on the PC. For ease of decoding I'm able to use my TVHeadend setup to just stream the "raw" MP2 audio without any transport stream packaging.
The next step has then been to try out actually transmitting this data. The Raspberry Pi can generate an FM signal on its IO Pins, using a little piece of software called PiFm. There's a fork of this called PiFmRds that adds RDs transmission capability - ChristopheJacquet/PiFmRds
The PiFmRds tool lets you dynamically change the RDS PS (station name), TA Flag (Traffic Announcement) and RT (Radio Text) by sending data to a pipe. I adapted my Python tool to send the decoded RDS data from the MP2 stream to a named pipe in the correct format and hey presto! -
The process is -
Create a named pipe to share data to the PiFmRds tool
Stream MP2 stream for one of the German radio stations --> pipe into Python tool to extract the RDS and send it to the pipe
Convert the MP2 stream to WAVE with FFMPEG and pipe it into the PiFmRds tool along with the RDS data pipe as the audio and RDS data sources
Put your radio aerial near to the output pins on the Pi, and tune to the correct frequency!