Hello,
Could anyone help modernize the plugin code to properly support embedded subtitles on newer Enigma2 images such as OpenATV 7.6, which now use Python 3.12+ / 3.13+?
Since Python 3.8+, several internal changes were introduced regarding threading, locks, and event loop behavior. The current implementation appears to block or freeze the Enigma2 main GUI thread when trying to load embedded subtitles while using Kodi streams without the external E2Player/ServiceApp player.
The issue seems related to the subtitle loading/parsing process, possibly inside enableSubtitle() or embedded subtitle handlers, where blocking operations are executed on the main thread.
Current symptoms:
- GUI freeze/spinner
- subtitle selection hangs
- embedded subtitles fail to load correctly
- happens mainly with embedded subtitles (MKV/IPTV/Kodi streams)
- external subtitles usually work correctly
Environment:
- OpenATV 7.6
- Python 3.12+
- Kodi integration
- Internal GStreamer player (E2Player)
Relevant log excerpt:
06:32:23.3361 [InfoBarGenerics] Key 'KEY_BLUE' (0x191 - 401) Make.
06:32:23.3364 [SubsSupport] stopVideoOnSubtitlesMenu: True
06:32:23.3366 [SubsSupport] pausing video
06:32:23.3367 [eServiceMP3] pause(ePtr<iPauseableService> &ptr)
06:32:23.3368 [eServiceMP3] pause
06:32:23.5530 [Skin] Parsing embedded skin '<embedded-in-SubsMenu>'.
06:32:23.5540 [Skin] Processing screen '<embedded-in-SubsMenu>' position=(585,240), size=(750,600) for module 'SubsMenu'.
06:32:23.5604 [Skin] Parsing embedded skin '<embedded-in-ScreenSummary>'.
06:32:23.5611 [Skin] Processing screen '<embedded-in-ScreenSummary>', from list 'SubsMenuSummary, SubsMenu_summary, ScreenSummary', position=(0,0), size=(132,64) for module 'ScreenSummary'.
06:32:23.5674 [eServiceMP3] ****STATE TRANSITION PLAYING -> PAUSED ****
06:32:23.5683 [eRCDeviceInputDev] 0 191 1
06:32:23.5687 [InfoBarGenerics] Key 'KEY_BLUE' (0x191 - 401) Break.
06:32:24.1310 [eRCDeviceInputDev] 1 160 1
06:32:24.1317 [InfoBarGenerics] Key 'KEY_OK' (0x160 - 352) Make.
06:32:24.1438 [Skin] Parsing embedded skin '<embedded-in-SubsChooser>'.
06:32:24.1447 [Skin] Processing screen '<embedded-in-SubsChooser>' position=(502,195), size=(915,690) for module 'SubsChooser'.
06:32:24.1481 [Skin] Parsing embedded skin '<embedded-in-ScreenSummary>'.
06:32:24.1489 [Skin] Processing screen '<embedded-in-ScreenSummary>', from list 'SubsChooserSummary, SubsChooser_summary, ScreenSummary', position=(0,0), size=(132,64) for module 'ScreenSummary'.
06:32:24.3634 [eRCDeviceInputDev] 0 160 1
06:32:24.3638 [InfoBarGenerics] Key 'KEY_OK' (0x160 - 352) Break.
06:32:24.6171 [eRCDeviceInputDev] 1 18e 1
06:32:24.6176 [InfoBarGenerics] Key 'KEY_RED' (0x18E - 398) Make.
06:32:24.8493 [eRCDeviceInputDev] 0 18e 1
06:32:24.8498 [InfoBarGenerics] Key 'KEY_RED' (0x18E - 398) Break.
06:32:24.8511 [Skin] Parsing embedded skin '<embedded-in-SubsEmbeddedSelection>'.
06:32:24.8519 [Skin] Processing screen '<embedded-in-SubsEmbeddedSelection>' position=(596,375), size=(727,330) for module 'SubsEmbeddedSelection'.
06:32:24.8675 (2, 0, 1, 0, 'en', 'Send Help (2026)') 1 embedded English
06:32:24.8677 (2, 1, 1, 0, 'en', 'SDH') 2 embedded English
06:32:24.8678 (2, 2, 1, 0, 'de', 'German') 3 embedded German
06:32:24.8686 [Skin] Parsing embedded skin '<embedded-in-ScreenSummary>'.
06:32:24.8692 [Skin] Processing screen '<embedded-in-ScreenSummary>', from list 'SubsEmbeddedSelectionSummary, SubsEmbeddedSelection_summary, ScreenSummary', position=(0,0), size=(132,64) for module 'ScreenSummary'.
06:32:25.9515 [eRCDeviceInputDev] 1 6c 1
06:32:25.9519 [InfoBarGenerics] Key 'KEY_DOWN' (0x6C - 108) Make.
06:32:26.1844 [eRCDeviceInputDev] 0 6c 1
06:32:26.1848 [InfoBarGenerics] Key 'KEY_DOWN' (0x6C - 108) Break.
06:32:26.2251 [eRCDeviceInputDev] 1 160 1
06:32:26.2256 [InfoBarGenerics] Key 'KEY_OK' (0x160 - 352) Make.
06:32:26.2567 [SubsSupport] loading embedded subtitles
06:32:26.2575 [SubsSupportEmbedded] enableSubtitle (2, 1, 1, 0)
06:32:30.2634 [gRC] Warning: Main thread is busy, displaying spinner!
The plugin already appears partially migrated to Python 3, but there are still several legacy threading and synchronous patterns that may no longer be safe on Python 3.12+.
Potential areas to review:
- blocking calls inside subtitle parsing/loading
- GUI updates outside main thread
- legacy threading usage
- synchronous network requests
- race conditions in subtitle handlers
- Twisted + requests mixed usage
- subtitle parser callbacks
Any help modernizing or patching the plugin for current OpenATV/OpenPLI environments would be greatly appreciated.