2018-10-20, 15:41
Hi,
I'm wondering if it would be possible to incorporate RDS support to work with digital streams?
Basically, I use TVHeadend with a satellite tuner, and on some radio stations carried on the digital satellite transponders, UECP RDS data is present inside the MP2 audio packets. (This is especially common on German radio stations on 19.2°E 12266H because they are used to feed FM transmitters in cable networks in Germany, and the cable FM modulators take the UECP data from the stream to modulate the RDS data).
I think I read that the existing RDS support converts the RDS from FM radio stations to UECP for Kodi to display. The RDS data present with these satellite radio stations is already in UECP, and because it's inside the MP2 audio stream (it comes inside at the end of each MP2 audio packet), there should be access to the data even when streamed to Kodi with HTSP from TVHeadend.
The only considerations are that the UECP needs to be reassembled from the MP2 packets. It comes in chunks in reverse order at the end of each MP2 packet. I have created a Python tool which reverses and reassembles the data into UECP packets (and then decodes the RDS data from this).
I guess if Kodi has already got a UECP decoder to read this data for FM radio stations currently, then a tool would just be needed to re-assemble the UECP packets from the MP2 audio packets and pass them to Kodi.
My tool is here - https://github.com/mrwish7/uecp_tool/blo...cp_tool.py
It currently only works with 48kHz streams (all MP2 satellite streams I have encountered use this sample rate in any case), and takes a single argument, the bitrate of the stream. This could be worked out automatically which is on my to-do list!
self.decode_frame() takes the full UECP packet once read and starts to decode the data. This might be useful!
Here's an example of one of the radio stations carrying the RDS data on the 12266H transponder on 19.2°E (NDR 2) with my tool -
(This also shows the currently playing song on the Radio Text)
I'm wondering if it would be possible to incorporate RDS support to work with digital streams?
Basically, I use TVHeadend with a satellite tuner, and on some radio stations carried on the digital satellite transponders, UECP RDS data is present inside the MP2 audio packets. (This is especially common on German radio stations on 19.2°E 12266H because they are used to feed FM transmitters in cable networks in Germany, and the cable FM modulators take the UECP data from the stream to modulate the RDS data).
I think I read that the existing RDS support converts the RDS from FM radio stations to UECP for Kodi to display. The RDS data present with these satellite radio stations is already in UECP, and because it's inside the MP2 audio stream (it comes inside at the end of each MP2 audio packet), there should be access to the data even when streamed to Kodi with HTSP from TVHeadend.
The only considerations are that the UECP needs to be reassembled from the MP2 packets. It comes in chunks in reverse order at the end of each MP2 packet. I have created a Python tool which reverses and reassembles the data into UECP packets (and then decodes the RDS data from this).
I guess if Kodi has already got a UECP decoder to read this data for FM radio stations currently, then a tool would just be needed to re-assemble the UECP packets from the MP2 audio packets and pass them to Kodi.
My tool is here - https://github.com/mrwish7/uecp_tool/blo...cp_tool.py
It currently only works with 48kHz streams (all MP2 satellite streams I have encountered use this sample rate in any case), and takes a single argument, the bitrate of the stream. This could be worked out automatically which is on my to-do list!
self.decode_frame() takes the full UECP packet once read and starts to decode the data. This might be useful!
Here's an example of one of the radio stations carrying the RDS data on the 12266H transponder on 19.2°E (NDR 2) with my tool -
Code:
curl -s http://tvheadendstreamaddress?profile=audio | python3.5 uecp_tool.py 320
Set frame length: 960
PTY 10
PTY 10
TA OFF
TA OFF
RT NDR 2 - ndr.de/ndr2
RT NDR 2 - ndr.de/ndr2
PS NDR 2
PS NDR 2
TA OFF
TA OFF
PTY 10
PTY 10
TA OFF
TA OFF
RT NDR 2 - ndr.de/ndr2 RT NDR 2 - ndr.de/ndr2
(This also shows the currently playing song on the Radio Text)