Kodi Build Error

Moderators: mdrjr, odroid

Kodi Build Error

Unread postby rooted » Tue Jul 24, 2018 10:11 am

I don't know enough about c++ to know what this means, I need a bit of help.

Can't finish compiling Kodi due to this error.

Code: Select all
[ 75%] Building CXX object build/utils/CMakeFiles/utils.dir/EGLImage.cpp.o
cd /home/odroid/kodi-build/build/utils && /usr/bin/ccache /usr/bin/c++   -DHAS_NEON -I/home/odroid/kodi -I/home/odroid/kodi/lib -I/home/odroid/kodi/lib/gtest/include -I/home/odroid/kodi/xbmc -I/home/odroid/kodi/xbmc/platform/linux -I/home/odroid/kodi/xbmc/cores/VideoPlayer -I/home/odroid/kodi-build/build -I/usr/include/dbus-1.0 -I/usr/lib/aarch64-linux-gnu/dbus-1.0/include -I/usr/include/python2.7 -I/usr/include/libxml2 -I/home/odroid/kodi-build/build/cpluff/include -I/usr/include/aarch64-linux-gnu -I/usr/local/include -I/home/odroid/kodi-build/build/include -I/usr/include/freetype2 -I/home/odroid/kodi-build/build/libdvd/include -I/usr/include/lzo -I/usr/local/include/libdrm  -std=c++11 -DMESA_EGL_NO_X11_HEADERS -DPLATFORM_SETTINGS_FILE=gbm.xml -Wall -O3 -DNDEBUG -s   -D_LINUX -DTARGET_POSIX -DTARGET_LINUX -D_GNU_SOURCE -DHAVE_LINUX_MEMFD=1 -DHAVE_MKOSTEMP=1 -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAS_LINUX_NETWORK -DHAVE_STD__U16_STRING=1 -DHAVE_STD__U32_STRING=1 -DHAVE_CHAR16_T=1 -DHAVE_CHAR32_T=1 -DHAVE_STDINT_H=1 -DHAS_BUILTIN_SYNC_ADD_AND_FETCH=1 -DHAS_BUILTIN_SYNC_SUB_AND_FETCH=1 -DHAS_BUILTIN_SYNC_VAL_COMPARE_AND_SWAP=1 -DHAVE_INOTIFY=1 -DHAVE_POSIX_FADVISE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_INTTYPES_H=1 -DHAS_ALSA=1 -DHAS_AVAHI=1 -DHAS_ZEROCONF=1 -DHAVE_LIBBLURAY=1 -DHAVE_LIBBLURAY_BDJ=1 -DHAVE_LIBCEC=1 -DHAS_DBUS=1 -DHAS_WEB_SERVER=1 -DHAS_WEB_INTERFACE=1 -DHAS_PYTHON=1 -DHAS_SNDIO=1 -DHAVE_LIBUDEV=1 -DHAVE_LIBXSLT=1 -DHAS_FILESYSTEM_NFS=1 -DHAS_AIRPLAY=1 -DFFMPEG_VER_SHA=\"4.0\" -I/usr/include/fribidi -DHAS_GLES=3 -DHAS_EGL=1 -DHAVE_GBM=1 -DHAS_MARIADB=1 -DHAS_UPNP=1 -DBIN_INSTALL_PATH=\"/usr/local/lib/kodi\" -DINSTALL_PATH=\"/usr/local/share/kodi\" -std=c++11 -o CMakeFiles/utils.dir/EGLImage.cpp.o -c /home/odroid/kodi/xbmc/utils/EGLImage.cpp
In file included from /home/odroid/kodi/xbmc/utils/EGLImage.cpp:21:0:
/home/odroid/kodi/xbmc/utils/EGLImage.h:40:23: error: ‘DRM_FORMAT_MOD_INVALID’ was not declared in this scope
     uint64_t modifier{DRM_FORMAT_MOD_INVALID};
                       ^~~~~~~~~~~~~~~~~~~~~~
/home/odroid/kodi/xbmc/utils/EGLImage.h:40:45: error: cannot convert ‘<brace-enclosed initializer list>’ to ‘uint64_t {aka long unsigned int}’ in initialization
     uint64_t modifier{DRM_FORMAT_MOD_INVALID};
                                             ^
/home/odroid/kodi/xbmc/utils/EGLImage.cpp: In member function ‘bool CEGLImage::CreateImage(CEGLImage::EglAttrs)’:
/home/odroid/kodi/xbmc/utils/EGLImage.cpp:97:44: error: ‘DRM_FORMAT_MOD_INVALID’ was not declared in this scope
       if (imageAttrs.planes[i].modifier != DRM_FORMAT_MOD_INVALID)
                                            ^~~~~~~~~~~~~~~~~~~~~~
build/utils/CMakeFiles/utils.dir/build.make:1910: recipe for target 'build/utils/CMakeFiles/utils.dir/EGLImage.cpp.o' failed
make[2]: *** [build/utils/CMakeFiles/utils.dir/EGLImage.cpp.o] Error 1
make[2]: Leaving directory '/home/odroid/kodi-build'
CMakeFiles/Makefile2:8044: recipe for target 'build/utils/CMakeFiles/utils.dir/all' failedmake[1]: *** [build/utils/CMakeFiles/utils.dir/all] Error 2
make[1]: Leaving directory '/home/odroid/kodi-build'
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
odroid@odroid:~/kodi-build$
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby meveric » Tue Jul 24, 2018 4:48 pm

looks like the wrong headers to me sadly this can happen very fast :(
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby rooted » Tue Jul 24, 2018 10:25 pm

It's master so possible, guess I will pull tomorrow and try again.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby meveric » Wed Jul 25, 2018 1:17 am

DRM_FORMAT_MOD_INVALID is part of the Kernel source: https://github.com/torvalds/linux/blob/ ... m_fourcc.h
but only shows up in Kernel 4.14 or higher, since the N1 currently uses Kernel 4.4 that could actually turn out to be an issue.

I also found it in weston:
https://github.com/wayland-project/west ... x-dmabuf.h

Maybe this can be used as a workaround.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby rooted » Wed Jul 25, 2018 3:24 am

I successfully compiled 18 Alpha 3 but it black screens after you stop playing.

Looks like I will have to keep using Oversun's Alpha 1 build from March.

I thought you were talking about Kodi headers, if it's indeed kernel related it could be more of an issue that I thought.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby OverSun » Wed Jul 25, 2018 3:36 am

I keep compiling kodi following the master branch once a week at least.
There is a specific not so big patch for blackscreen issue specific for drm output, I have no idea why kodi doesn't include it yet in the master branch. Although I have to mutate it pretty often to follow drm changes.
User avatar
OverSun
 
Posts: 1365
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Kodi Build Error

Unread postby rooted » Wed Jul 25, 2018 4:07 am

You have a current master build deb? Link to your patch? An idea about my failed master build?

I don't want much :)
OverSun wrote:I keep compiling kodi following the master branch once a week at least.
There is a specific not so big patch for blackscreen issue specific for drm output, I have no idea why kodi doesn't include it yet in the master branch. Although I have to mutate it pretty often to follow drm changes.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby OverSun » Wed Jul 25, 2018 4:11 am

The patch is not mine, the patch is kwiboo made.
This is to the current todays master.
That will eliminate black screen on stop.

I'm not sure about missing declaration, I don't have that.
Maybe try installing headers of kernel you are running to the system? (In kernel source directory):
Code: Select all
make headers_check
make INSTALL_HDR_PATH=dest headers_install
find dest/include \( -name .install -o -name ..install.cmd \) -delete
cp -rv dest/include/* /usr/include


Code: Select all
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp
index 1fce1277b9..d644be8809 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererDRMPRIME.cpp
@@ -40,6 +40,7 @@ CRendererDRMPRIME::CRendererDRMPRIME(std::shared_ptr<CDRMUtils> drm)

 CRendererDRMPRIME::~CRendererDRMPRIME()
 {
+  m_DRM->DisableVideoLayer();
   Reset();
 }

diff --git a/xbmc/windowing/gbm/DRMAtomic.cpp b/xbmc/windowing/gbm/DRMAtomic.cpp
index bde54c2346..c5a3799dfd 100644
--- a/xbmc/windowing/gbm/DRMAtomic.cpp
+++ b/xbmc/windowing/gbm/DRMAtomic.cpp
@@ -64,7 +64,7 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
   if (rendered)
   {
     AddProperty(m_overlay_plane, "FB_ID", fb_id);
-    AddProperty(m_overlay_plane, "CRTC_ID", m_crtc->crtc->crtc_id);
+    AddProperty(m_overlay_plane, "CRTC_ID", fb_id ? m_crtc->crtc->crtc_id : 0);
     AddProperty(m_overlay_plane, "SRC_X", 0);
     AddProperty(m_overlay_plane, "SRC_Y", 0);
     AddProperty(m_overlay_plane, "SRC_W", m_width << 16);
@@ -105,6 +105,18 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
   m_req = drmModeAtomicAlloc();
 }

+void CDRMAtomic::DisableVideoLayer()
+{
+  if (m_req)
+  {
+    AddProperty(m_primary_plane, "FB_ID", 0);
+    AddProperty(m_primary_plane, "CRTC_ID", 0);
+    drmModeAtomicCommit(m_fd, m_req, 0, nullptr);
+    drmModeAtomicFree(m_req);
+  }
+  m_req = drmModeAtomicAlloc();
+}
+
 void CDRMAtomic::FlipPage(struct gbm_bo *bo, bool rendered, bool videoLayer)
 {
   uint32_t flags = 0;
diff --git a/xbmc/windowing/gbm/DRMAtomic.h b/xbmc/windowing/gbm/DRMAtomic.h
index 261063dd20..98ed910760 100644
--- a/xbmc/windowing/gbm/DRMAtomic.h
+++ b/xbmc/windowing/gbm/DRMAtomic.h
@@ -33,6 +33,7 @@ public:
   virtual bool InitDrm() override;
   virtual void DestroyDrm() override;
   virtual bool AddProperty(struct drm_object *object, const char *name, uint64_t value) override;
+  virtual void DisableVideoLayer() override;

 private:
   void DrmAtomicCommit(int fb_id, int flags, bool rendered, bool videoLayer);
diff --git a/xbmc/windowing/gbm/DRMUtils.h b/xbmc/windowing/gbm/DRMUtils.h
index ea3430f956..fad3a76c7d 100644
--- a/xbmc/windowing/gbm/DRMUtils.h
+++ b/xbmc/windowing/gbm/DRMUtils.h
@@ -81,6 +81,7 @@ public:
   virtual bool SetActive(bool active) { return false; };
   virtual bool InitDrm();
   virtual void DestroyDrm();
+  virtual void DisableVideoLayer() {};

   std::string GetModule() const { return m_module; }
   std::string GetDevicePath() const { return m_device_path; }
User avatar
OverSun
 
Posts: 1365
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Kodi Build Error

Unread postby rooted » Wed Jul 25, 2018 4:32 am

Thanks Oversun, much appreciated.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby rooted » Wed Jul 25, 2018 7:12 am

I'm still getting the same error.

@OverSun
I'm running the kernel from your git and installed the headers. What is your gcc revision? Something must be different between our development environment.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby OverSun » Wed Jul 25, 2018 3:14 pm

Code: Select all
root@n1:/usr/include# grep -R DRM_FORMAT_MOD_INVALID *
drm/drm_fourcc.h:#define DRM_FORMAT_MOD_INVALID   fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)
root@n1:/usr/include# dpkg -S /usr/include/drm/drm_fourcc.h
linux-libc-dev:arm64: /usr/include/drm/drm_fourcc.h
root@n1:/usr/include# apt show linux-libc-dev
Package: linux-libc-dev
Version: 4.15.0-29.31
Priority: optional
Build-Essential: yes
Section: devel
Source: linux
Origin: Ubuntu
Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 5003 kB
Provides: aufs-dev, linux-kernel-headers
Conflicts: linux-kernel-headers
Replaces: linux-kernel-headers
Task: lubuntu-gtk-desktop, lubuntu-desktop, lubuntu-qt-desktop
Supported: 5y
Download-Size: 964 kB
APT-Manual-Installed: no
APT-Sources: http://ports.ubuntu.com/ubuntu-ports bionic-updates/main arm64 Packages
Description: Linux Kernel Headers for development
 This package provides headers from the Linux kernel.  These headers
 are used by the installed headers for GNU glibc and other system
 libraries. They are NOT meant to be used to build third-party modules for
 your kernel. Use linux-headers-* packages for that.

N: There is 1 additional record. Please use the '-a' switch to see it
User avatar
OverSun
 
Posts: 1365
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Kodi Build Error

Unread postby meveric » Wed Jul 25, 2018 5:04 pm

That's a Kernel 4.15 package while the N1 uses Kernel 4.4 it might still work, but some headers might cause conflicts due to missing functions.
I changed the code as it's written in the wayland link that I posted earlier:

Code: Select all
diff --git a/xbmc/utils/EGLImage.h b/xbmc/utils/EGLImage.h
index 8690d916e8..197d8811bd 100644
--- a/xbmc/utils/EGLImage.h
+++ b/xbmc/utils/EGLImage.h
@@ -27,6 +27,10 @@
 
 #include <array>
 
+#ifndef DRM_FORMAT_MOD_INVALID
+#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
+#endif
+
 class CEGLImage
 {
 public:


This seemed to have worked fine, but after fixing several other issues the resulting kodi-gbm has no hardware acceleration and only used ffmpeg software decoding.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby rooted » Wed Jul 25, 2018 10:54 pm

I'm running Debian and definitely on 4.4.x, how are you running 4.15 with Kodi VPU acceleration? What version of Ubuntu are you running?

@meveric
I will try your patch, the Kodi I'm currently running and Alpha 3 both had hardware acceleration but can only be run without X.

*edit* (see second edit)
The patch didn't help, still can't build.

Code: Select all
[ 73%] Building CXX object build/utils/CMakeFiles/utils.dir/EGLImage.cpp.o
/home/odroid/kodi/xbmc/utils/EGLImage.cpp: In member function ‘bool CEGLImage::CreateImage(CEGLImage::EglAttrs)’:
/home/odroid/kodi/xbmc/utils/EGLImage.cpp:97:66: error: expected primary-expression before ‘)’ token
       if (imageAttrs.planes[i].modifier != DRM_FORMAT_MOD_INVALID)
                                                                  ^
build/utils/CMakeFiles/utils.dir/build.make:1934: recipe for target 'build/utils/CMakeFiles/utils.dir/EGLImage.cpp.o' failed
make[2]: *** [build/utils/CMakeFiles/utils.dir/EGLImage.cpp.o] Error 1
CMakeFiles/Makefile2:8044: recipe for target 'build/utils/CMakeFiles/utils.dir/all' failedmake[1]: *** [build/utils/CMakeFiles/utils.dir/all] Error 2
Makefile:138: recipe for target 'all' failed


*edit 2*
I used this in EGLInage.h

Code: Select all
#ifndef DRM_FORMAT_MOD_INVALID
#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
#endif


Tapatalk mangled the ((1ULL<<56) - 1)

And the build finished, thanks meveric... Now to test :)

*edit3*
Aaaand Kodi segfaults :(

Oh well, what can you do.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby meveric » Thu Jul 26, 2018 12:44 am

I can give you my .deb file but as I said it's without hardware video decoding. Kodi itself runs fine if you run it from VT (without X).
I also have my own 17.6 version which runs fine under X11 but also without hardware decoding.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby rooted » Thu Jul 26, 2018 1:19 am

meveric wrote: Kodi itself runs fine if you run it from VT (without X).


With hardware decoding?

By the way you said it I guess not.

*edit*
Here is a link to the Alpha 2 build deb that does have hardware acceleration (VT) if you want to try it.

https://www.dropbox.com/s/ico6mjcao94d2 ... 4.deb?dl=1
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby AreaScout » Thu Jul 26, 2018 6:24 pm

@meveric

you need FFmpeg with Rockchip mpp decoder compiled in, iirc the original image didn't have, could that be your problem ?!

@rooted

DRMPRIME works for me, no segfault or what so ever

@all

with this PR https://github.com/xbmc/xbmc/pull/14181 black screen when movie is stopped is gone, also mouse cursor isn't visible anymore if DRM wasn't opened with drmopen

RG
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby AreaScout » Thu Jul 26, 2018 7:21 pm

those two changes are needed to successfully compile

Code: Select all
diff --git a/xbmc/utils/EGLImage.h b/xbmc/utils/EGLImage.h
index 8690d916e8..197d8811bd 100644
--- a/xbmc/utils/EGLImage.h
+++ b/xbmc/utils/EGLImage.h
@@ -27,6 +27,10 @@

 #include <array>

+#ifndef DRM_FORMAT_MOD_INVALID
+#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
+#endif
+
 class CEGLImage
 {
 public:
diff --git a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
index 1291ffd77e..ab10b4c2eb 100644
--- a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
@@ -119,7 +119,7 @@ bool CWinSystemGbmGLESContext::CreateNewWindow(const std::string& name,
     return false;
   }

-  if (!m_pGLContext.CreatePlatformSurface(m_GBM->GetSurface(), m_GBM->GetSurface()))
+  if (!m_pGLContext.CreatePlatformSurface(m_GBM->GetSurface(), reinterpret_cast<EGLNativeWindowType>(m_GBM->GetSurface())))
   {
     return false;
   }

User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby rooted » Fri Jul 27, 2018 12:40 am

Thanks AreaScout, I'm anxious to try this when I get home.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 1:39 am

AreaScout wrote:@meveric

you need FFmpeg with Rockchip mpp decoder compiled in, iirc the original image didn't have, could that be your problem ?!

Kodi comes with their own version of ffmpeg, relying on system ffmpeg is not suggested.

Kodi compiles correctly for me without the second patch, but then again I use Oversuns repository not sure what patches he has included.

I also have no black screen after stopping a video, but then again, I don't have hardware acceleration either.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 2:19 am

meveric wrote:Kodi comes with their own version of ffmpeg, relying on system ffmpeg is not suggested.


I think you know that I know this, it depends all how you compile it, i was asking if that could be the problem

meveric wrote:Kodi compiles correctly for me without the second patch, but then again I use Oversuns repository not sure what patches he has included.


Could be, I am using different headers here for compatibility with other open source software, it is better to cast this to it's native type define or just don't use gbm_surface* pointers

Just because a library is able to do gbm it doesn't meant that the headers are type define gbm_surface EGLNativeWindowType, on XU4 it wont compile either

Using the fbdev libraries and it's headers and you will get the error

https://github.com/rockchip-linux/libma ... form.h#L73

Using the X11 libraries and it's headers it will not fail, but X11 open source application may fail

https://github.com/rockchip-linux/libma ... form.h#L74

On XU4 with the gbm enabled X11 library it will fail also

https://github.com/mdrjr/5422_mali/blob ... orm.h#L104

With this small patch you will have compatibility no matter what type define is used

meveric wrote:I also have no black screen after stopping a video, but then again, I don't have hardware acceleration either.


This works only since yesterday https://github.com/xbmc/xbmc/commit/7b6 ... 9c00fb5446

What can i say i bet it's FFmpeg related, double check with version of FFmpeg is used and check if rkmppdec is enabled

RG
Last edited by AreaScout on Fri Jul 27, 2018 2:23 am, edited 1 time in total.
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby OverSun » Fri Jul 27, 2018 2:22 am

My branch on master doesn't include any patches yet, it's just a mirror of kodi upstream.
@AreaScout patch does _not_ solve black screen on stop issue. This issue happens when there is no frequency switch on video stop. So if you play 25fps movie having 60Hz UI with frame rate switch - there is going to be no issue. But if you play 30fps movie with 60Hz UI with no frame rate switch on playback start, on stop it is going to blank the screen.
The patch I pasted solves this.
User avatar
OverSun
 
Posts: 1365
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 2:27 am

OverSun wrote:My branch on master doesn't include any patches yet, it's just a mirror of kodi upstream.
@AreaScout patch does _not_ solve black screen on stop issue. This issue happens when there is no frequency switch on video stop. So if you play 25fps movie having 60Hz UI with frame rate switch - there is going to be no issue. But if you play 30fps movie with 60Hz UI with no frame rate switch on playback start, on stop it is going to blank the screen.
The patch I pasted solves this.


Maybe it was another commit, but the stop and then black screen error is gone
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 2:31 am

correct ! it was not a 30fps movie, it still fails :shock:
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 4:04 am

ok, I now have a .deb file with hardware acceleration and black screen fix.
Still sucks you need to run it from VT ;)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 4:18 am

meveric wrote:ok, I now have a .deb file with hardware acceleration and black screen fix.
Still sucks you need to run it from VT ;)


to run under X11 you can use this patch:

Code: Select all
diff --git a/xbmc/windowing/gbm/DRMUtils.cpp b/xbmc/windowing/gbm/DRMUtils.cpp
index 0a4535407f..8721a79efb 100644
--- a/xbmc/windowing/gbm/DRMUtils.cpp
+++ b/xbmc/windowing/gbm/DRMUtils.cpp
@@ -445,7 +445,7 @@ bool CDRMUtils::OpenDrm(bool needConnector)

     for (auto module : modules)
     {
-      m_fd = drmOpen(module, device.c_str());
+      m_fd = open(device.c_str(), O_RDWR | O_CLOEXEC);//m_fd = drmOpen(module, device.c_str());
       if (m_fd >= 0)
       {
         if(!GetResources())



I have another problem, playing this sample http://4ksamples.com/elysium-2013-2160p ... e-footage/ with 60fps (switch to frame rate off) it stutters a little, I was using this file to prove that with (switch to frame rate on) the movie plays extremely smooth, but now the screen stays black and my TV switches to 30fps but the movie is 25fps on all other movies the switch works correctly, this is new, it was working already, can someone confirm this ?

edit: (adjust display refresh rate) it's called settings->player->videos->on start/stop

RG
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby rooted » Fri Jul 27, 2018 4:25 am

I will try to confirm, Kodi is currently building. I already run framerate switching.

*edit*
I still can't start Kodi, it segfaults. I'm building without with blackscreen fix to see if that's why. I have a feeling it's due to a library, maybe libdvd.

*edit2*
I'm hoping it was ffmpeg being outdated, pulled the git and rebuilt it, rebuilding Kodi again as I ran clean.

I thought the working deb I have been using was a build from OverSun but actually it's a March build from AreaScout. I can't understand why I can't get this to build and work.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 6:11 am

Well I have a .deb file that switches to VT1 before starting Kodi.. If you want to try it: https://oph.mdrjr.net/meveric/other/N1/ ... _arm64.deb
I'll try AreaScount's patch for X11 to see if this works without my VT hack.

Edit:
Seems to work fine.. gonna make a new .deb file (that part takes even longer than compiling)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby rooted » Fri Jul 27, 2018 6:19 am

Here is a strace, anyone see the problem?

https://pastebin.com/4Y8W9XDr

@meveric
Thanks mate, I will wait for the deb that will run on both. Be nice to have while trying to resolve my issues.

I really want to figure out why my build is crashing so I may build master for myself every week.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 6:41 am

Finally done building the .deb file... can't wait for my SSD to arrive.
Finally gonna switch out the C2 as a build-slave for a N1 with SSD :)

new .deb file is up now: https://oph.mdrjr.net/meveric/other/N1/ ... _arm64.deb
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby memeka » Fri Jul 27, 2018 7:07 am

@meveric: is your X11 build still able to use DRMPRIME? isn't X11 running drm master?
User avatar
memeka
 
Posts: 3998
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 7:27 am

not sure what you're talking about.
I use standard X11 with MATE Desktop. I compiled Kodi with gbm and the patch from AreaScout.
And yes it's running with DRMPRIME.
not sure was X11 and drm master is suppose to be though.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby memeka » Fri Jul 27, 2018 7:40 am

meveric wrote:not sure what you're talking about.
I use standard X11 with MATE Desktop. I compiled Kodi with gbm and the patch from AreaScout.
And yes it's running with DRMPRIME.
not sure was X11 and drm master is suppose to be though.


kodi with gbm and drmprime requires to be drm master.
x11 also is drm master.
this is why i can't see how you can start kodi on gbm while on X11. unless it's a script that exits x11 first, and starts kodi afterwards.
User avatar
memeka
 
Posts: 3998
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Kodi Build Error

Unread postby rooted » Fri Jul 27, 2018 8:27 am

meveric wrote:Finally done building the .deb file... can't wait for my SSD to arrive.
Finally gonna switch out the C2 as a build-slave for a N1 with SSD :)

new .deb file is up now: https://oph.mdrjr.net/meveric/other/N1/ ... _arm64.deb


Build works great except for the black screen, I also got a black screen with my old ~/.kodi directory in place. It was due to the new whitelist resolutions feature.

Should be faster as a build slave :)


AreaScout wrote:I have another problem, playing this sample http://4ksamples.com/elysium-2013-2160p ... e-footage/ with 60fps (switch to frame rate off) it stutters a little, I was using this file to prove that with (switch to frame rate on) the movie plays extremely smooth, but now the screen stays black and my TV switches to 30fps but the movie is 25fps on all other movies the switch works correctly, this is new, it was working already, can someone confirm this ?

edit: (adjust display refresh rate) it's called settings->player->videos->on start/stop

RG


I can play the video smoothly but I get blackscreen when I stop. (adjust display refresh rate) is enabled, on your March Alpha build I linked above I don't get a black screen and it plays smoothly.

I don't get a black screen on meveric build when running from VT.

In the log:

Code: Select all
H265D_PARSER: No start code is found.
H265_PARSER_REF: Could not find ref with POC -41
H265_PARSER_REF: generate_missing_ref in
H265_PARSER_REF: generate_missing_ref frame poc -41 slot_index 0
H265_PARSER_REF: Could not find ref with POC -43
H265_PARSER_REF: generate_missing_ref in
H265_PARSER_REF: generate_missing_ref frame poc -43 slot_index 1
H265_PARSER_REF: Could not find ref with POC -46
H265_PARSER_REF: generate_missing_ref in
H265_PARSER_REF: generate_missing_ref frame poc -46 slot_index 2
H265_PARSER_REF: Could not find ref with POC -48
H265_PARSER_REF: generate_missing_ref in
H265_PARSER_REF: generate_missing_ref frame poc -48 slot_index 3
H265_PARSER_REF: Could not find ref with POC -52
H265_PARSER_REF: generate_missing_ref in
H265_PARSER_REF: generate_missing_ref frame poc -52 slot_index 4
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby rooted » Fri Jul 27, 2018 8:48 am

@meveric

I can't scan my library, could you try? Seems to be an issue with curl.
User avatar
rooted
 
Posts: 5297
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 2:09 pm

rooted wrote:@meveric

I can't scan my library, could you try? Seems to be an issue with curl.

Works fine for me. I had no issues scanning my library. It was importing the videos fine and downloaded all the artwork as well.

Although activated mine never adjust display refresh rate, not even as root. It always uses 60Hz and with that I never have the black screen issue.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 4:24 pm

memeka wrote:kodi with gbm and drmprime requires to be drm master.
x11 also is drm master.
this is why i can't see how you can start kodi on gbm while on X11. unless it's a script that exits x11 first, and starts kodi afterwards.


That's only on XU4, armsoc is using DRM and set master, so kodi can't start and segfaults.

On N1 we can choose if we use armsoc or the modified xserver with glamor driver which is hardly driven by EGL/GLES2 and not pure DRM https://github.com/rockchip-linux/xserv ... .19/glamor
this driver is used and that's why we can start kodi with x11 running on different VT or with that patch directly in x11 on same VT.

@all

On XU4 even switch VT will crash kodi, some of you may already known.

rooted wrote:I can play the video smoothly but I get blackscreen when I stop. (adjust display refresh rate) is enabled, on your March Alpha build I linked above I don't get a black screen and it plays smoothly.

I don't get a black screen on meveric build when running from VT.


ah ok, thank you :) so it seems it's my external FFmpeg which made problems, i will try internal then, good it works for you and you had adjust display refresh rate set to ON ?

@all

I have to test more on this with VT and under X11
the drmopen command will fail even if glamor is using EGL/GLES2 and running on same VT like X11, strange, a few thousand lines just to open a device ... look at this comment :lol: https://github.com/rockchip-linux/libdr ... rm.c#L2707


RG
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby memeka » Fri Jul 27, 2018 4:55 pm

You need a special build of ffmpeg for drmprime; running the internal version won’t give you that
User avatar
memeka
 
Posts: 3998
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 5:04 pm

memeka wrote:You need a special build of ffmpeg for drmprime; running the internal version won’t give you that


and where to find this version ?
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby OverSun » Fri Jul 27, 2018 6:22 pm

build libmpp to the system, and then add "--enable-rkmpp --enable-libdrm" to ffmpeg options. these are default ffmpeg options (no patches needed), if to squeeze them to internal ffmpeg build as well it will work.
User avatar
OverSun
 
Posts: 1365
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 6:27 pm

OverSun wrote:build libmpp to the system, and then add "--enable-rkmpp --enable-libdrm" to ffmpeg options. these are default ffmpeg options (no patches needed), if to squeeze them to internal ffmpeg build as well it will work.

you also need --enable-version3 but yes aside from these 3 options it also worked fine for me with ffmpeg 4.0.1 from Kodi project statically linked during build process of Kodi.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 6:30 pm

OverSun wrote:build libmpp to the system, and then add "--enable-rkmpp --enable-libdrm" to ffmpeg options. these are default ffmpeg options (no patches needed), if to squeeze them to internal ffmpeg build as well it will work.


OverSun & Meveric

both of you are right, i think memeka mixed it up with v4l2m2m decoder, if yes then he was right for that decoder you need a special FFmpeg build

RG
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 6:38 pm

v4l2_m2m is standard on ffmpeg version 3.4 and above and is therefore also included in the static ffmpeg build of Kodi by now.
Not sure about drmprime though, I don't think there's a specific option for that.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 6:58 pm

meveric wrote:v4l2_m2m is standard on ffmpeg version 3.4 and above and is therefore also included in the static ffmpeg build of Kodi by now.
Not sure about drmprime though, I don't think there's a specific option for that.


no for DRMPRIME on v4l2m2m you need a special FFmpeg build, so he was right for that decoder
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 7:27 pm

To clear things up here:

I know of three routes kodi with gbm platform can take to present the decoded frame from FFmpeg which is,

DRMPRIME Frame goes FFmpeg(HwDec)->DRMConnector with zero copy ----> fastest method (supported odroid's is N1)
DRMPRIMEGLES Frame goes FFmpeg(HWDec)->EGL/DMA_BUF->DRMConnector ----> medium fast (supported odroid's is N1)
DRM Frame goes FFmpeg(HWDec)->EGL/GLES2/Shaders->DRMConnector ----> slowest (supported odroid's XU4 and N1)

RG
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby AreaScout » Fri Jul 27, 2018 8:42 pm

and just to confuse you more DRMPRIME on XU4 is highly experimental, special FFmpeg is needed, Kernel patch is needed and it doesn't work 100% until know but maybe will
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby meveric » Fri Jul 27, 2018 8:51 pm

maybe we should keep the XU4 out of the N1 forum, makes things a lot easier ;)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 8977
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: Kodi Build Error

Unread postby memeka » Fri Jul 27, 2018 8:52 pm

AreaScout wrote:To clear things up here:

I know of three routes kodi with gbm platform can take to present the decoded frame from FFmpeg which is,

DRMPRIME Frame goes FFmpeg(HwDec)->DRMConnector with zero copy ----> fastest method (supported odroid's is N1)
DRMPRIMEGLES Frame goes FFmpeg(HWDec)->EGL/DMA_BUF->DRMConnector ----> medium fast (supported odroid's is N1)
DRM Frame goes FFmpeg(HWDec)->EGL/GLES2/Shaders->DRMConnector ----> slowest (supported odroid's XU4 and N1)

RG


To have DRMPRIME you need that both the hardware decoder and DRM have the same pixel format. Also, you need to be able to do dmabuf import.
So your 3 routes are:

1. ffmpeg hwdecoder produces buffer with data in DRM accepted format -> ffmpeg AVFrame which points to the buffer -> wrap AVFrame in DRMPRIME format -> kodi render unwraps and dma imports buffer -> drm imports buffer on primary plane, while gbm renders egl kodi GUI on overlay plane
2. ffmpeg hwdecoder produces buffer with data in EGL accepted format -> ffmpeg AVFrame which points to the buffer -> wrap AVFrame in DRMPRIME format -> kodi DRMPRIME EGL render unwraps and EGL_EXT_image_dma_buf_import -> gbm renders EGL content on one plane, which is kodi GUI + imported video
3. ffmpeg hw decoder produces buffer with data in EGL accepted format -> ffmpeg AVFrame which points to the buffer -> kodi EGL render copies that data -> renders EGL content content on 1 plane, which is kodi GUI + imported video

not sure how kodi implements the drmprime render: either there's no processing done on the video (but then the decoder needs to send data in DRM accepted format, not EGL accepted format), or, like in the case of 3, there are shaders to convert/scale the data.

experimental DRMPRIME on XU4 is case 4 :) not covered by the above
User avatar
memeka
 
Posts: 3998
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Kodi Build Error

Unread postby AreaScout » Sat Jul 28, 2018 5:39 pm

Exactly memeka :)

One thing i am not clear about the future is, we had that DRM_FORMAT_MOD_INVALID not defined error and that's because the libdrm from Rockchip isn't updated anymore and is marked as out-of-date, so what does that mean ?
Are they not willing into support a user space library which is about to change or even dropped soon ? are they trying to get upstream and so they have to wait for that long taking acceptance process ?
In fact the kernel side of the driver is updated frequently and the last commit is only ten days ago https://cgit.freedesktop.org/drm/drm/co ... 46f4906d7d if you see the commits on freedesktop
it doesn't take long to see it upstream.
But the user space library is not updated, how long we can use it then ? It has startet already with that DRM_FORMAT_MOD_INVALID error that was relatively easy to fix, but maybe in a month it's a function that is missing and after
half a year it's ten functions that are missing ...

I really wanna know what's behind all that, what do you think ?
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: Kodi Build Error

Unread postby OverSun » Sat Jul 28, 2018 5:46 pm

if you look at drm portion specific for rockchip of rockchip drm you can see that those are very few wrappers.
My understanding that libdrm is obsolete because everything is compatible with a standart libdrm for a long time, and there are no specific rockchip calls that need special handling.
I used ubuntu libdrm and rockchip libdrm and didn't find any difference nor in functionality, nor in programs linking to them. it seemed for me that all the modern code doesn't use rockchip specific parts of libdrm-rockchip anymore.
User avatar
OverSun
 
Posts: 1365
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Kodi Build Error

Unread postby AreaScout » Sat Jul 28, 2018 5:52 pm

OverSun wrote:if you look at drm portion specific for rockchip of rockchip drm you can see that those are very few wrappers.
My understanding that libdrm is obsolete because everything is compatible with a standart libdrm for a long time, and there are no specific rockchip calls that need special handling.
I used ubuntu libdrm and rockchip libdrm and didn't find any difference nor in functionality, nor in programs linking to them. it seemed for me that all the modern code doesn't use rockchip specific parts of libdrm-rockchip anymore.


Hmm that could be the answer, so upstream libdrm is working for you ? i haven't tried that, i only saw that it doesn't has any Rockchip specific part in there, also the rga part isn't there upstream
User avatar
AreaScout
 
Posts: 583
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q


Return to Ubuntu/Debian

Who is online

Users browsing this forum: No registered users and 1 guest