2019-02-18, 00:30
I'm trying to get Kodi 18.x working with the OMX acceleration and experiencing video & audio (analogue out & HDMI) stuttering on both Pi Zero and Pi 2B. MMAL is working fine, apart from the constant audio slowdown&speed-up and the horribly laggy GUI.
The video playback for all video content, locally -> even with 540p/720p H264 video files that should play fine without HW acceleration, Youtube, PVR - TV Channels, is starting fine for a few seconds (3-5), then the video&audio stutters, it recovers a little, and then it stutters again and it keeps like that, never recovering.
LibreELEC 9 seems to recover after a few seconds (10-15), but it starts again if another video/TV channel is played. The CPU doesn't seem to be loaded at all, the GUI is fast-responsive and the debug log is not really helpful.
I choose the HDMI out on both my Kodi compilation and LibreELEC 9 and experienced the same video stuttering. Was doing this on a simple monitor without speakers, just wanted to check if the analogue out is causing it, negative.
In the log there are constant warnings during the stuttering:
x being proportional with the level of stuttering
Mentioned this (hidden) in another thread - post #14 - Extra section - also attached a debug log:
https://forum.kodi.tv/showthread.php?tid...pid2817448
Debug log:
https://pastebin.com/PhrSZsxr
Followed what @asavah suggested, used only the FFmpeg configuration&compilation that @popcornmix (newclock5) / LibreELEC is doing, without any improvements.
Finally, considered to raise this as a standalone topic, as there might be some bugs/issues that need attention, maybe some explanations.
First, being unaware that FFmpeg is heavily patched for the Raspberry target in Kodi 18.x (newclock5 / LibreELEC), I just took the 4.0.3-Leia-RC5.tar.gz and optimized it for the Raspberry platforms, by making use of the default configure switches (which are different from the ones used in FFmpeg-3.1.9-Krypton-17.4):
https://www.linuxquestions.org/questions...ost5956641
Then, I tried the official FFmpeg release https://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2 , again, by using the default OMX/MMAL optimization switches.
Finally, by inspecting the patchwork that has been done in the newclock5 & LibreELEC git repos, I replicated the compilation found in LibreELEC (considered the patches updated):
https://www.linuxquestions.org/questions...ost5958276
None of these FFmpeg builds have resolved the issue with the OMX acceleration.
There are some other things I tried, some learned here in the forum, without any positive results:
- disabled de-interlacing
- loaded the latest kernel&firmware provided by Raspberry (extracted from the latest Raspbian image) and used audio_pwm_mode=0 in /boot/config.txt
- set the CPU frequency on maximum -> changed the cpu freq. scale governor on performance (I'm usually keeping it on ondemand)
- overclocked the core&GPU&RAM on the Pi Zero:
Inspiration:
https://github.com/RetroPie/RetroPie-Set...erclocking
- tried to play with the cache, inspired by this thread:
https://forum.kodi.tv/showthread.php?tid...pid2823612
I looked at the OMX Player code:
https://github.com/xbmc/xbmc/commits/mas.../omxplayer
and noticed there were some changes. Wondering if I could revert some of them - use the perfectly working OMX Player code from Kodi 17.x.
I'm under the impression that there's a bottleneck / buffering issue and I don't know where, as the debug log is not helpful. Is it the OMX Player code, Kodi code, FFmpeg code (why is a RC release used)?
Any help/hints appreciated.
The video playback for all video content, locally -> even with 540p/720p H264 video files that should play fine without HW acceleration, Youtube, PVR - TV Channels, is starting fine for a few seconds (3-5), then the video&audio stutters, it recovers a little, and then it stutters again and it keeps like that, never recovering.
LibreELEC 9 seems to recover after a few seconds (10-15), but it starts again if another video/TV channel is played. The CPU doesn't seem to be loaded at all, the GUI is fast-responsive and the debug log is not really helpful.
I choose the HDMI out on both my Kodi compilation and LibreELEC 9 and experienced the same video stuttering. Was doing this on a simple monitor without speakers, just wanted to check if the analogue out is causing it, negative.
In the log there are constant warnings during the stuttering:
Code:
WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
WARNING: Previous line repeats x times.
Mentioned this (hidden) in another thread - post #14 - Extra section - also attached a debug log:
https://forum.kodi.tv/showthread.php?tid...pid2817448
Debug log:
https://pastebin.com/PhrSZsxr
Followed what @asavah suggested, used only the FFmpeg configuration&compilation that @popcornmix (newclock5) / LibreELEC is doing, without any improvements.
Finally, considered to raise this as a standalone topic, as there might be some bugs/issues that need attention, maybe some explanations.
First, being unaware that FFmpeg is heavily patched for the Raspberry target in Kodi 18.x (newclock5 / LibreELEC), I just took the 4.0.3-Leia-RC5.tar.gz and optimized it for the Raspberry platforms, by making use of the default configure switches (which are different from the ones used in FFmpeg-3.1.9-Krypton-17.4):
Code:
# for the decoding:
--enable-omx --enable-omx-rpi --enable-decoder=h264_mmal --enable-decoder=mpeg2_mmal
# for the encoding:
--enable-encoder=h264_omx
Then, I tried the official FFmpeg release https://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2 , again, by using the default OMX/MMAL optimization switches.
Finally, by inspecting the patchwork that has been done in the newclock5 & LibreELEC git repos, I replicated the compilation found in LibreELEC (considered the patches updated):
https://www.linuxquestions.org/questions...ost5958276
None of these FFmpeg builds have resolved the issue with the OMX acceleration.
There are some other things I tried, some learned here in the forum, without any positive results:
- disabled de-interlacing
- loaded the latest kernel&firmware provided by Raspberry (extracted from the latest Raspbian image) and used audio_pwm_mode=0 in /boot/config.txt
- set the CPU frequency on maximum -> changed the cpu freq. scale governor on performance (I'm usually keeping it on ondemand)
- overclocked the core&GPU&RAM on the Pi Zero:
Inspiration:
https://github.com/RetroPie/RetroPie-Set...erclocking
Code:
arm_freq=1000
gpu_freq=500
core_freq=500
sdram_freq=500
sdram_schmoo=0x02000020
over_voltage=6
sdram_over_voltage=2
https://forum.kodi.tv/showthread.php?tid...pid2823612
I looked at the OMX Player code:
https://github.com/xbmc/xbmc/commits/mas.../omxplayer
and noticed there were some changes. Wondering if I could revert some of them - use the perfectly working OMX Player code from Kodi 17.x.
I'm under the impression that there's a bottleneck / buffering issue and I don't know where, as the debug log is not helpful. Is it the OMX Player code, Kodi code, FFmpeg code (why is a RC release used)?
Any help/hints appreciated.