Plugin not working as expected when running on RaspberryPi 4
I have an issue with this plugin in Kodi 20.3 installed on my Raspberry Pi 4 2GB model
user@kodi:~ $ raspinfo
System Information
Raspberry Pi 4 Model B Rev 1.1
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
Raspberry Pi reference 2023-12-11
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 2acf7afcba7d11500313a7b93bb55a2aae20b2d6, stage2
Linux kodi 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
Whenever I pick a stream to play, it will take various seconds (5 to 10) before either the stream starts playing or an error is displayed. When - and if - the stream starts playing, it's really choppy and keeps buffering which makes it impossible to watch. After enabling debug logging in Kodi and trying to play a TV channel, the following message is repeated whenever the stream glitches:
2024-01-11 07:41:42.019 T:4172 info <general>: ffmpeg[0x5587582c30]: [hls] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0') [138/1925]
2024-01-11 07:41:42.019 T:4172 info <general>: ffmpeg[0x5587582c30]: [hls] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-01-11T03:41:22.524+00:00')
2024-01-11 07:41:42.078 T:4172 info <general>: ffmpeg[0x5587582c30]: [hls] Opening 'crypto+https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/desrai1_160/exp=1705041676~acl=%2fh
ls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=258670e6442a4658ee804c61c174318a924e7a57a737cdf49ee43f8e435e14b3/g15fvema/00000158/media_300820.aac?
aka_me_session_id=AAAAAAAAAAAM36BlAAAAAFS82ZFqoPyKxEvVIIdVyMUfusEg1m58y9W5pqnlnooIpG6cDctPawdX4zzxkgaA95oD1KKtpFV6&aka_msn=300820&aka_hls_version=3&aka_media_format_type=hls' for reading
2024-01-11 07:41:42.914 T:4175 error <general>: ffmpeg[0x5586cdb550]: [aac] TYPE_FIL: Input buffer exhausted before END element found
2024-01-11 07:41:43.286 T:4175 info <general>: CVideoPlayerAudio::Process - stream stalled
2024-01-11 07:41:45.647 T:4174 debug <general>: CPtsTracker: pattern lost on diff 80000.000000, number of losses 1
2024-01-11 07:41:45.655 T:4174 debug <general>: CDVDVideoCodecDRMPRIME::GetPicture - flush buffers
2024-01-11 07:41:45.660 T:4174 debug <general>: CVideoPlayerVideo - Stillframe detected, switching to forced 25.000000 fps
2024-01-11 07:41:46.338 T:844 debug <general>: CheckIdle - Closing session to https://raiuno1-live.akamaized.net (easy=0x7f3c43f300, multi=0x7f3c753310)
2024-01-11 07:41:47.742 T:4172 debug <general>: CVideoPlayer::SetCaching - caching state 1
2024-01-11 07:41:47.742 T:4172 debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2024-01-11 07:41:47.743 T:4175 debug <general>: CDVDAudio::Pause - pausing audio stream
2024-01-11 07:41:47.747 T:4174 debug <general>: CVideoPlayerVideo - Stillframe left, switching to normal playback
2024-01-11 07:41:48.914 T:4172 debug <general>: CVideoPlayer::SetCaching - caching state 2
2024-01-11 07:41:48.914 T:4175 debug <general>: CDVDAudio::Pause - pausing audio stream
2024-01-11 07:41:48.914 T:4172 debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2024-01-11 07:41:48.914 T:4172 debug <general>: CVideoPlayer::SetCaching - caching state 3
2024-01-11 07:41:48.915 T:4175 debug <general>: CDVDAudio::Resume - resume audio stream 2024-01-11 07:41:48.915 T:4172 debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000 2024-01-11 07:41:48.916 T:4172 debug <general>: CVideoPlayer::SetCaching - caching state 0
2024-01-11 07:41:48.916 T:4172 debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2024-01-11 07:41:49.744 T:882 error <general>: ActiveAE::FlushEngine - failed to flush 2024-01-11 07:41:49.811 T:4174 debug <general>: CPtsTracker: detected pattern of length 1: 40000.00, frameduration: 40000.000000 2024-01-11 07:41:49.847 T:882 debug <general>: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2024-01-11 07:41:49.847 T:882 warning <general>: ActiveAE - large audio sync error: -5067.494736
2024-01-11 07:41:49.848 T:882 debug <general>: ActiveAE - start sync of audio stream 2024-01-11 07:41:49.849 T:882 warning <general>: ActiveAE - large audio sync error: -5067.500496 2024-01-11 07:41:49.854 T:882 warning <general>: ActiveAE - large audio sync error: -5067.498681
2024-01-11 07:41:49.855 T:882 warning <general>: ActiveAE - large audio sync error: -5067.502255
2024-01-11 07:41:49.857 T:882 warning <general>: ActiveAE - large audio sync error: -5067.494533
2024-01-11 07:41:49.912 T:882 warning <general>: ActiveAE - large audio sync error: -5117.846275
2024-01-11 07:41:49.963 T:882 warning <general>: ActiveAE - large audio sync error: -5117.415988 2024-01-11 07:41:49.963 T:882 debug <general>: ActiveAE::SyncStream - average error of -5000.000000, start adjusting 2024-01-11 07:41:49.964 T:882 warning <general>: ActiveAE - large audio sync error: -5067.403748
2024-01-11 07:41:49.964 T:882 warning <general>: ActiveAE - large audio sync error: -5017.399896
2024-01-11 07:41:50.235 T:4172 info <general>: ffmpeg[0x5587582c30]: [https] Opening 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1705041676~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=258670e6442a4658ee804c61c174318a924e7a57a737cdf49ee43f8e435e14b3/chunklist.m3u8?aka_me_session_id=AAAAAAAAAAAM36BlAAAAAFS82ZFqoPyKxEvVIIdVyMUfusEg1m58y9W5pqnlnooIpG6cDctPawdX4zzxkgaA95oD1KKtpFV6&aka_media_format_type=hls' for reading
2024-01-11 07:41:50.332 T:4172 info <general>: ffmpeg[0x5587582c30]: [hls] Skip ('#EXT-X-VERSION:3')
2024-01-11 07:41:50.332 T:4172 info <general>: ffmpeg[0x5587582c30]: [hls] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
2024-01-11 07:41:50.332 T:4172 info <general>: ffmpeg[0x5587582c30]: [hls] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-01-11T03:41:39.012+00:00')
2024-01-11 07:41:50.401 T:4172 info <general>: ffmpeg[0x5587582c30]: [hls] Opening 'crypto+https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_2400/exp=1705041676~acl=%2fhls
%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=258670e6442a4658ee804c61c174318a924e7a57a737cdf49ee43f8e435e14b3/w2mpcpcx/00000158/media_300821.ts?aka
_me_session_id=AAAAAAAAAAAM36BlAAAAAFS82ZFqoPyKxEvVIIdVyMUfusEg1m58y9W5pqnlnooIpG6cDctPawdX4zzxkgaA95oD1KKtpFV6&aka_msn=300821&aka_hls_version=3&aka_media_format_type=hls' for reading
2024-01-11 07:41:50.865 T:882 debug <general>: ActiveAE::SyncStream - average error -10.276705 below threshold of 30.000000
2024-01-11 07:41:53.262 T:4175 info <general>: ProcessDecoderOutput: Changed max allowed Out-Of-Sync value to 65 ms due self-learning
2024-01-11 07:41:53.586 T:4168 debug <general>: Thread JobWorker 544850301952 terminating (autodelete)
2024-01-11 07:41:53.586 T:4169 debug <general>: Thread JobWorker 544764965888 terminating (autodelete)
When it hangs instead, this is what logged:
2024-01-11 07:40:30.835 T:4164 info <general>: ffmpeg[0x55871e9e00]: [https] Opening 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1800/exp=1705041615~acl=%2fhls%2fli
ve%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/chunklist.m3u8?aka_me_session_id=AAAAAAAAA
ADP3qBlAAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_media_format_type=hls' for reading
2024-01-11 07:40:30.931 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Skip ('#EXT-X-VERSION:3') 2024-01-11 07:40:30.931 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
2024-01-11 07:40:30.931 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-01-11T03:40:18.933+00:00')
2024-01-11 07:40:31.002 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Opening 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1800/exp=1705041615~acl=%2fhls%2flive
%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/serve.key?aka_me_session_id=AAAAAAAAAADP3qBl
AAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_media_format_type=hls' for reading
2024-01-11 07:40:31.350 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Opening 'crypto+https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1800/exp=1705041615~acl=%2fhls
%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/w835iil0/00000158/media_300812.ts?aka
_me_session_id=AAAAAAAAAADP3qBlAAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_msn=300812&aka_hls_version=3&aka_media_format_type=hls' for reading
2024-01-11 07:40:32.029 T:4164 info <general>: ffmpeg[0x55871e9e00]: [https] Opening 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1200/exp=1705041615~acl=%2fhls%2fli
ve%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/chunklist.m3u8?aka_me_session_id=AAAAAAAAA
ADP3qBlAAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_media_format_type=hls' for reading
2024-01-11 07:40:32.132 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Skip ('#EXT-X-VERSION:3')
2024-01-11 07:40:32.132 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
2024-01-11 07:40:32.132 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-01-11T03:40:28.987+00:00')
2024-01-11 07:40:32.163 T:4143 debug <general>: Thread JobWorker 544756511744 terminating (autodelete)
2024-01-11 07:40:32.163 T:4149 debug <general>: Thread JobWorker 544781874176 terminating (autodelete)
2024-01-11 07:40:32.163 T:4148 debug <general>: Thread JobWorker 544764965888 terminating (autodelete)
2024-01-11 07:40:32.169 T:4142 debug <general>: Thread JobWorker 544850301952 terminating (autodelete)
2024-01-11 07:40:32.206 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Opening 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1200/exp=1705041615~acl=%2fhls%2flive
%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/serve.key?aka_me_session_id=AAAAAAAAAADP3qBl
AAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_media_format_type=hls' for reading
2024-01-11 07:40:32.441 T:4164 error <general>: ffmpeg[0x55871e9e00]: [hls] Unable to open key file https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1200/exp=1705041615~ac
l=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/serve.key?aka_me_session_id=A
AAAAAAAAADP3qBlAAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_media_format_type=hls
2024-01-11 07:40:32.441 T:4164 info <general>: ffmpeg[0x55871e9e00]: [hls] Opening 'crypto+https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1200/exp=1705041615~acl=%2fhls
%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/kyppp7be/00000158/media_300812.ts?aka
_me_session_id=AAAAAAAAAADP3qBlAAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_msn=300812&aka_hls_version=3&aka_media_format_type=hls' for reading
2024-01-11 07:40:32.469 T:4164 error <general>: ffmpeg[0x55871e9e00]: [crypto] Unable to open resource: https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1200/exp=170504161
5~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/kyppp7be/00000158/media_3
00812.ts?aka_me_session_id=AAAAAAAAAADP3qBlAAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_msn=300812&aka_hls_version=3&aka_media_format_type=hls
2024-01-11 07:40:32.469 T:4164 error <general>: ffmpeg[0x55871e9e00]: [hls] Error when loading first segment 'https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/rai1_1200/exp=170
5041615~acl=%2fhls%2flive%2f598308%2fraiuno1%2f*!%2fhls%2flive%2f598308-b%2fraiuno1%2f*!%2f*.key~data=hdntl~hmac=3f754940ad67c367ece172c4099a855a15c1b24b268fcfd26eaf23601163fb5a/kyppp7be/00000157/m
edia_299735.ts?aka_me_session_id=AAAAAAAAAADP3qBlAAAAAJ4buZ0gGkxUt83nWqLgLE0QmeIc%2fWK0juI8f1vVAXkeCyeIUG08AiOieeEyij4unavI%2fG7Vt51H&aka_msn=299735&aka_hls_version=3&aka_media_format_type=hls'
2024-01-11 07:40:32.516 T:4164 debug <general>: Error, could not open file (2) https://raiuno1-live.akamaized.net/hls/live/598308/raiuno1/raiuno1/playlist_ma.m3u8?hdnea=st=1704955200~exp=1704955
350~acl=/*~hmac=dbea4c858314822aaf8d3b40dfd52af6e24ec4454732efffa9ec3ecdd60de636
2024-01-11 07:40:32.517 T:4164 error <general>: OpenDemuxStream - Error creating demuxer
2024-01-11 07:40:32.517 T:4164 info <general>: CVideoPlayer::OnExit()
2024-01-11 07:40:32.518 T:4168 debug <general>: Thread JobWorker start, auto delete: true
2024-01-11 07:40:32.518 T:4164 debug <general>: Thread VideoPlayer 544833725440 terminating
I have tried to install Kodi 20.3 w/ this plugin on a different machine (Windows laptop w\ 8GB RAM) and I have no issues over there (physical network and VPN are the same for both Raspberry Pi and Windows laptop).
Am I right in thinking this is being caused by not enough memory available on my Raspberry Pi? If so what is the minimum required amount of memory needed for this plugin to handle a video stream? Would it be possible to add a setting to limit the quality of the video feed (e.g. allowing to choose between 720p/1080p/4k)?
I have no experience with Kodi on Raspberry. The plugin is designed to browse raiplay website as Chrome does and grab direct links to play. After this operations, playing relies on internal code of Kodi and I don't know how to operate and if best video quality could be set.
Since RAI Play website allows streaming live tv at different quality levels (high, medium, low) I was suggesting including this setting in the plugin settings itself. I would assume there are different links based on the resolution of the feed (one link for 1080p, a different one for 720p): do you know if this is the case and - if so - which link gets picked?