2020-09-24, 23:22
Still failing to replicate LE 9.2.4, OMX acceleration looks broken - both audio and video stuttering after 2-3 seconds of normal playback - debug log (same as before, no need to upload a new one) https://pastebin.com/cmbErrAa
Now I did build Kodi 18.8 for the rbpi target with:
Outputs of both cmake and ldd from the resulting kodi bin to be found at:
https://pastebin.com/aaG6GThk
Issues:
- resolved - I had to temporarily make /usr/include/GLES3/ unavailable during the build (it's my old system mesa), because /xbmc-18.8-Leia/cmake/modules/FindOpenGLES.cmake found it, enabled the -DHAS_GLES=3 flag and the compilation crashed with: usr/include/GLES3/gl3.h:899:2: error: 'GLsync' does not name a type
- unresolved: Failed to connect to ftp.halifax.rwth-aachen.de port 443: Connection timed out - please try to remove those guys from your mirrors. I'm always having issues with their servers in the last years (other repos unrelated to Kodi) - they're unreliable - playing around with the firewalls? rate limiting? ...
- unresolved - apparently I have no "PLL Adjustment to maintain audio/video sync" option in Kodi Audio Settings Menu (Expert Mode) and this line was also not available in my other build attempts. Don't know why & what enables it. I also fear that this could be one of the causes of my playback issues - is it enabled by default?
- unresolved - OMX acceleration plays 2-3 seconds fine and then starts to stutter - both audio and video, even for big buck bunny h264 at 640x480 !!! played locally. I also noticed a weird warning flashing a few times in the upper right corner on the screen - something like: "the source is too slow for playback!", while playing a mpeg4 H264 1080p (very lossy - high compression) file from a local ftp repository. That was weird, apparently a 50-60Mbps FTP stream is not enough to feed a 1-2Mbps video stream to the omxplayer and this is just confirming my suspicion - some buffering issues: bottleneck/excess in Kodi - e.g. Kodi "trying to kill" the poor omxplayer, feeding it with excessive data.
The VideoPlayer (WawWawPlayer) with MMAL acceleration plays ok all sources, except that the audio waw waw makes it useless.
I did all the tests on the Pi2B build system running armv6 code (armv6 Linux distro), only the kernel was armv7 (needed for booting) and I never saw the CPU exceeding 25-30% usage (load spread at 4-6% on all 4 cores). The same is actually true for the PiZero, CPU is not loaded more than 30-40% for local playback, the only higher load for the PiZero (Kodi 17 and LE 9.2.4) is when playing DVB streams at 1080p with OMX and that doesn't exceed 75-80%.
- unresolved - my PowerManager.cpp is still not working, the PM code in Kodi 17 was simpler... but this should be maybe a topic for another thread
This is how I build FFmpeg externally - shared:
- source https://github.com/xbmc/FFmpeg/archive/4...8.4.tar.gz
- applying only this patch: https://github.com/LibreELEC/LibreELEC.t...ions.patch
- with: patch -p1 < patches/ffmpeg-001-pfcd_hevc_optimisations.patch
(also tried to add these other patches - useless in my case - and they didn't help:
https://raw.githubusercontent.com/LibreE...-ren.patch
https://raw.githubusercontent.com/LibreE...-one.patch
https://raw.githubusercontent.com/LibreE...ches.patch
)
- configuring & building:
Finally, I removed the local system mesa package and checked the links with ldd /usr/local/lib/kodi/kodi-rbpi - compared with the previous output and found no changes, meaning, local mesa is not used and doesn't represent a cause for the issues reported. Launched Kodi and experienced the same playback issues.
Are there any Kodi 18.x code patches LE is applying that I'm not aware about?
Any other hints appreciated!
Now I did build Kodi 18.8 for the rbpi target with:
Code:
export PATH="$PATH:/opt/java/bin"
CFLAGS="$CFLAGS -DEGL_NO_X11"
CXXFLAGS="$CXXFLAGS -DEGL_NO_X11"
mkdir /kit/kodi-slack-build/kodi-build/ && cd /kit/kodi-slack-build/kodi-build/
cmake ../xbmc-18.8-Leia -DCMAKE_INSTALL_PREFIX=/usr/local \
-DENABLE_INTERNAL_CROSSGUID=ON \
-DENABLE_INTERNAL_FLATBUFFERS=ON \
-DENABLE_INTERNAL_FMT=ON \
-DCORE_SYSTEM_NAME=linux \
-DWITH_CPU=arm1176jzf-s \
-DCMAKE_C_FLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" \
-DCMAKE_CXX_FLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" \
-DENABLE_AVAHI=OFF \
-DENABLE_PLIST=OFF \
-DENABLE_AIRTUNES=OFF \
-DENABLE_AIRTUNES=OFF \
-DENABLE_UPNP=OFF \
-DENABLE_NEON=OFF \
-DENABLE_VDPAU=OFF \
-DENABLE_VAAPI=OFF \
-DCORE_PLATFORM_NAME=rbpi \
-DCMAKE_PREFIX_PATH=/opt/vc
Outputs of both cmake and ldd from the resulting kodi bin to be found at:
https://pastebin.com/aaG6GThk
Issues:
- resolved - I had to temporarily make /usr/include/GLES3/ unavailable during the build (it's my old system mesa), because /xbmc-18.8-Leia/cmake/modules/FindOpenGLES.cmake found it, enabled the -DHAS_GLES=3 flag and the compilation crashed with: usr/include/GLES3/gl3.h:899:2: error: 'GLsync' does not name a type
- unresolved: Failed to connect to ftp.halifax.rwth-aachen.de port 443: Connection timed out - please try to remove those guys from your mirrors. I'm always having issues with their servers in the last years (other repos unrelated to Kodi) - they're unreliable - playing around with the firewalls? rate limiting? ...
- unresolved - apparently I have no "PLL Adjustment to maintain audio/video sync" option in Kodi Audio Settings Menu (Expert Mode) and this line was also not available in my other build attempts. Don't know why & what enables it. I also fear that this could be one of the causes of my playback issues - is it enabled by default?
- unresolved - OMX acceleration plays 2-3 seconds fine and then starts to stutter - both audio and video, even for big buck bunny h264 at 640x480 !!! played locally. I also noticed a weird warning flashing a few times in the upper right corner on the screen - something like: "the source is too slow for playback!", while playing a mpeg4 H264 1080p (very lossy - high compression) file from a local ftp repository. That was weird, apparently a 50-60Mbps FTP stream is not enough to feed a 1-2Mbps video stream to the omxplayer and this is just confirming my suspicion - some buffering issues: bottleneck/excess in Kodi - e.g. Kodi "trying to kill" the poor omxplayer, feeding it with excessive data.
The VideoPlayer (WawWawPlayer) with MMAL acceleration plays ok all sources, except that the audio waw waw makes it useless.
I did all the tests on the Pi2B build system running armv6 code (armv6 Linux distro), only the kernel was armv7 (needed for booting) and I never saw the CPU exceeding 25-30% usage (load spread at 4-6% on all 4 cores). The same is actually true for the PiZero, CPU is not loaded more than 30-40% for local playback, the only higher load for the PiZero (Kodi 17 and LE 9.2.4) is when playing DVB streams at 1080p with OMX and that doesn't exceed 75-80%.
- unresolved - my PowerManager.cpp is still not working, the PM code in Kodi 17 was simpler... but this should be maybe a topic for another thread
Code:
diff PowerManager-orig.cpp PowerManager.cpp
55c55
< int defaultShutdown = m_settings->GetInt(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE);
---
> int defaultShutdown = POWERSTATE_SHUTDOWN;
62c62,63
< if (g_application.IsStandAlone())
---
> // comment this to enable shutdown menu
> // if (g_application.IsStandAlone())
84,90c85,94
< if (!CServiceBroker::GetPowerManager().CanPowerdown())
< {
< if (CServiceBroker::GetPowerManager().CanSuspend())
< defaultShutdown = POWERSTATE_SUSPEND;
< else
< defaultShutdown = CServiceBroker::GetPowerManager().CanHibernate() ? POWERSTATE_HIBERNATE : POWERSTATE_QUIT;
< }
---
> // add this to enable shutdown menu
> defaultShutdown = POWERSTATE_SHUTDOWN;
> // comment this to enable shutdown menu
> // if (!CServiceBroker::GetPowerManager().CanPowerdown())
> // {
> // if (CServiceBroker::GetPowerManager().CanSuspend())
> // defaultShutdown = POWERSTATE_SUSPEND;
> // else
> // defaultShutdown = CServiceBroker::GetPowerManager().CanHibernate() ? POWERSTATE_HIBERNATE : POWERSTATE_QUIT;
> // }
99c103,108
< if (CanPowerdown() && m_instance->Powerdown())
---
> // comment this to enable shutdown menu
> // if (CanPowerdown() && m_instance->Powerdown())
> // add :
> bool blabla = true;
> if (blabla)
> // done add
120a130
>
139c149
< return m_instance ? m_instance->CanPowerdown() : false;
---
> return m_instance ? m_instance->CanPowerdown() : true;
This is how I build FFmpeg externally - shared:
- source https://github.com/xbmc/FFmpeg/archive/4...8.4.tar.gz
- applying only this patch: https://github.com/LibreELEC/LibreELEC.t...ions.patch
- with: patch -p1 < patches/ffmpeg-001-pfcd_hevc_optimisations.patch
(also tried to add these other patches - useless in my case - and they didn't help:
https://raw.githubusercontent.com/LibreE...-ren.patch
https://raw.githubusercontent.com/LibreE...-one.patch
https://raw.githubusercontent.com/LibreE...ches.patch
)
- configuring & building:
Code:
./configure --extra-ldflags="-L /opt/vc/lib/" \
--extra-cflags="-I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" \
--extra-cxxflags="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft" \
--extra-libs="-lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm" \
--target-os="linux" \
--prefix="/usr" \
--disable-static \
--enable-shared \
--enable-gpl \
--disable-version3 \
--enable-nonfree \
--enable-logging \
--disable-doc \
--disable-debug --enable-stripping \
--enable-pic \
--enable-optimizations \
--disable-extra-warnings \
--disable-programs \
--enable-avdevice \
--enable-avcodec \
--enable-avformat \
--enable-swscale \
--enable-postproc \
--enable-avfilter \
--disable-devices \
--enable-pthreads \
--enable-network \
--disable-gnutls --enable-openssl \
--disable-gray \
--enable-swscale-alpha \
--disable-small \
--enable-dct \
--enable-fft \
--enable-mdct \
--enable-rdft \
--disable-crystalhd \
--disable-vaapi --disable-vdpau \
--enable-runtime-cpudetect \
--disable-hardcoded-tables \
--disable-encoders \
--enable-encoder=ac3 \
--enable-encoder=aac \
--enable-encoder=wmav2 \
--enable-encoder=mjpeg \
--enable-encoder=png \
--enable-hwaccels \
--disable-muxers \
--enable-muxer=spdif \
--enable-muxer=adts \
--enable-muxer=asf \
--enable-muxer=ipod \
--enable-muxer=mpegts \
--enable-demuxers \
--enable-parsers \
--enable-bsfs \
--enable-protocol=http \
--disable-indevs \
--disable-outdevs \
--enable-filters \
--disable-avisynth \
--enable-bzlib \
--disable-lzma \
--disable-alsa \
--disable-frei0r \
--disable-libopencore-amrnb \
--disable-libopencore-amrwb \
--disable-libopencv \
--disable-libdc1394 \
--disable-libfreetype \
--disable-libgsm \
--disable-libmp3lame \
--disable-libopenjpeg \
--disable-librtmp \
--disable-libtheora \
--disable-libvo-amrwbenc \
--disable-libvorbis \
--disable-libvpx \
--disable-libx264 \
--disable-libxavs \
--disable-libxvid \
--enable-zlib \
--enable-asm \
--disable-altivec \
--disable-symver \
--disable-neon \
--enable-rpi \
--enable-libass
Finally, I removed the local system mesa package and checked the links with ldd /usr/local/lib/kodi/kodi-rbpi - compared with the previous output and found no changes, meaning, local mesa is not used and doesn't represent a cause for the issues reported. Launched Kodi and experienced the same playback issues.
Are there any Kodi 18.x code patches LE is applying that I'm not aware about?
Any other hints appreciated!