Skip to content

stefmat10/radiocomsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RadioComSync

Enigma2 plugin that overlays live radio commentary on TV video. Built for syncing sports radio with satellite or IPTV broadcasts on Zgemma/Enigma2 boxes.

Why?

  • Watching sport on a foreign-language satellite feed (e.g., darts on 19.2E in German) — overlay talkSPORT or BBC 5 Live for English commentary
  • Prefer radio commentary over TV pundits for Premier League, darts, cricket, rugby, etc.
  • Any broadcast where the TV audio is in the wrong language or you just want a different commentator

Features

  • Radio over TV audio — mutes DVB audio decoder, plays radio through GStreamer/ALSA
  • Online + Satellite sources — toggle between internet streams and satellite radio feeds. BBC and talkSPORT online streams can be geo-blocked outside the UK during live sport due to rights restrictions (BBC 5 Sports Extra is always blocked outside UK). The FTA satellite feeds on 28.2E are unaffected by these restrictions
  • Now Playing metadata — live show info from BBC, talkSPORT, RTÉ, and WLR FM APIs
  • Channel change detection — radio automatically stops when you change TV channel
  • Survives screen close — close the GUI and radio keeps playing (Blue button)
  • Station management — add/edit/delete/reorder stations via settings screen

Experimental: Audio Delay Sync

The plugin includes an experimental feature to automatically detect the delay between TV and radio audio using cross-correlation, then provide a countdown timer for syncing via timeshift. This has not been fully tested and may not work reliably. The core radio overlay functionality works independently of this feature.

Supported Stations

Station Online Satellite (28.2E) Now Playing API
talkSPORT MP3 stream Yes talkSPORT API
talkSPORT 2 MP3 stream - talkSPORT API
BBC 5 Live HLS (Akamai) Yes BBC Nitro API
BBC 5 Sports Extra HLS (geo-blocked outside UK) Yes BBC Nitro API
BBC Radio Ulster HLS (Akamai) - BBC Nitro API
BBC Radio 4 (TMS) HLS (Akamai) - BBC Nitro API
BBC Sportsound Scotland HLS (Akamai) - BBC Nitro API
BBC World Service HLS (Akamai) - BBC Nitro API
RTÉ Radio 1 MP3 (Icecast) Yes RTÉ Schedule API
RTÉ 2FM MP3 (Icecast) Yes RTÉ Schedule API
WLR FM MP3 (StreamTheWorld) - WLR REST API

Stations can be added/removed via the Settings screen (Menu button).

Audio Pipelines

Two pipeline types based on stream format:

MP3 streams (talkSPORT, RTÉ, WLR):

wget → mpg123 → gst-launch-1.0 fdsrc ! decodebin ! queue2 ! alsasink

HLS streams (BBC via Akamai):

ffmpeg -i HLS_URL -vn -c:a copy -f adts pipe:1 | gst-launch-1.0 fdsrc ! aacparse ! faad ! queue2 ! alsasink

The audio approach is modelled on the Budweiser plugin's proven method:

  1. audioStop() — ioctl AUDIO_STOP (0x6f01) releases the ALSA device from Enigma2's DVB audio decoder
  2. audioProcess()os.fork() + os.execv() runs the GStreamer pipeline in an independent process
  3. audioStart() — ioctl AUDIO_START (0x6f02) restores TV audio when radio stops

Controls

Button Action
OK Play selected station
Red Stop radio, restore TV audio
Green Toggle Online / Satellite view
Yellow Analyse delay & sync
Blue Close screen (radio keeps playing)
Exit Stop radio and close screen
Menu Station settings (add/edit/delete)
Left/Right Fine-tune sync +/-1 second (during playback)

Installation

Option 1: IPK package (recommended)

Download the .ipk from the releases or from the repo, then install:

# Copy to box
scp enigma2-plugin-extensions-radiocomsync_1.0.0_all.ipk root@BOX_IP:/tmp/

# Install on box
ssh root@BOX_IP "opkg install /tmp/enigma2-plugin-extensions-radiocomsync_1.0.0_all.ipk"

Or FTP the .ipk to /tmp on the box and install via Menu > Addons > Manual Install.

Option 2: Manual copy

scp -r RadioComSync/ root@BOX_IP:/usr/lib/enigma2/python/Plugins/Extensions/RadioComSync/

Restart Enigma2. The plugin appears in the Plugin Menu and Extensions Menu.

Dependencies

Standard Enigma2 packages (should already be installed):

  • gst-launch-1.0 — GStreamer pipeline runner
  • mpg123 — MP3 decoder
  • wget — HTTP stream fetcher
  • ffmpeg — HLS stream extraction (for BBC stations)

Configuration

Station presets are stored in /etc/enigma2/radiocomsync_stations.json. On first run, the plugin creates this file with the default station list. Edit via the Settings screen or modify the JSON directly.

Each station entry:

{
  "name": "RTÉ Radio 1",
  "url_online": "https://icecast.rte.ie/radio1",
  "url_sat": "http://127.0.0.1:8001/1:0:2:148D:7E7:2:11A0000:0:0:0:",
  "preferred": "sat",
  "type": "MP3",
  "last_delay_online": null,
  "last_delay_sat": null,
  "fine_tune": 0,
  "last_measured": null
}

Now Playing APIs

The plugin fetches live show metadata from multiple sources:

  • BBC Nitro APIrms.api.bbc.co.uk/v2/experience/inline/schedules/{service_id}
  • talkSPORT APItalksport.com/play/api/onAirNow/{station}
  • RTÉ Schedule APIrte.ie/radio/{slug}/schedule/{YYYYMMDD}/ (JSON via Accept header)
  • WLR FM APIwlrfm.com/wp-json/wlr/v1/schedule

Results are cached for 2 minutes to avoid excessive API calls.

File Structure

RadioComSync/
├── __init__.py          # Package init
├── plugin.py            # Entry points, channel-change monitor
├── config.py            # Station presets, delay storage
├── metadata.py          # Now-playing APIs (BBC, talkSPORT, RTÉ, WLR, ICY)
├── player.py            # Audio playback (DVB ioctl + GStreamer fork)
├── analyser.py          # Audio capture and cross-correlation
└── ui/
    ├── __init__.py
    ├── station_list.py  # Main station selector screen
    ├── analyser_screen.py # Delay analysis and sync countdown
    └── settings.py      # Station add/edit/delete

Logs

Debug output goes to /var/log/radiocomsync.log.

About

Enigma2 plugin — overlay live radio commentary on TV video for sports

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages