Ubuntu 18.04 RK image

Moderators: odroid, mdrjr

Ubuntu 18.04 RK image

Unread postby mad_ady » Tue Aug 14, 2018 3:28 am

Hello everyone. I've migrated to ubuntu 18.04 on my N1 by using a arm64 rootfs. It's fine for server use, but I'd like to ask for advice on one topic - for a desktop image would it be worth to grab an ubuntu for a different Rockchip platform - on the hope that mali userspace and vpu would work out of the box? If yes, can anyone suggest such a distro?
Thanks!
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Tue Aug 14, 2018 4:16 am

Mali GPU is a binary blob.. the packages for Debian will work on Ubuntu as well, as they are the same.
VPU is opensource and can be build directly from rockchip repository.
There's nothing that should stop you from using Ubuntu 18.04 as an OS as all drivers are available :)
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Tue Aug 14, 2018 5:23 am

Thanks!
Is there some repo I should add to the system to benefit from potential mali updates, or should I do a one-time install only?
What about vpu? Should I look into mainline ffmpeg an Oversun's kodi build?
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby OverSun » Tue Aug 14, 2018 6:03 am

mainline ffmpeg, mainline kodi as well. I didn't modify vanilla kodi v18 since it all moves to support everything out of the box heavily.
you just need correct compile options. look for everything related to rockchip when you compile ffmpeg and kodi
User avatar
OverSun
 
Posts: 1399
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

Re: Ubuntu 18.04 RK image

Unread postby rooted » Thu Aug 16, 2018 2:25 am

Indeed, I'm a bit disappointed by Hardkernel going to a different SoC for the N2 but I still hold out hope.

The rockchip is so well supported.
User avatar
rooted
 
Posts: 5911
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Ubuntu 18.04 RK image

Unread postby DarkBahamut » Thu Aug 16, 2018 6:57 am

I feel like this thread has read my mind. ;)

I was thinking about deploying my N1 in place of my XU4 now as I'm starting to use nextcloud so the onboard SATA is quite an interesting use case for that. I've always preferred Ubuntu but I figured the GPU drivers would be an issue. Hadn't considered they'd just be the same! Might be time to move over :)
DarkBahamut
 
Posts: 321
Joined: Tue Jan 19, 2016 10:19 am
languages_spoken: english
ODROIDs: XU4, N1

Re: Ubuntu 18.04 RK image

Unread postby memeka » Thu Aug 16, 2018 7:14 am

in case you haven't found thsi yet... https://github.com/rockchip-linux/libmali
User avatar
memeka
 
Posts: 4067
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 18.04 RK image

Unread postby hominoid » Fri Aug 17, 2018 11:44 am

Wow, this is all great news. I'm going to have to find some time to get it running on mine.
hominoid
 
Posts: 188
Joined: Tue Feb 28, 2017 3:55 am
Location: Lake Superior Basin, USA
languages_spoken: english
ODROIDs: C2, XU4, MC1, N1

Re: Ubuntu 18.04 RK image

Unread postby phaseshifter » Tue Oct 09, 2018 8:36 pm

@ mad_ady how are you going with the ubuntu image..it would be great if we all had a copy to flash..thank`s ..phase...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 3001
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Tue Oct 09, 2018 8:47 pm

In fact, I'm thinking of returning to the stock Debian. Mostly because the current ubuntu/custom kernel I'm running has problems rebooting. I played with a custom kernel because I wanted to run docker/lxc on top of it (had an idea about running an openwrt router image inside a container, but I no longer need it). I may want to run a custom kernel still if I can get a bit of time to add IR blaster support to it.
Also, the N1's role will change for me. It used to be a NAS, but now it will become a NAS, media player and home assistant.

Before returning to Debian, I might play with it a little longer, and if I'm happy with the results I'll share an image.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby phaseshifter » Wed Oct 10, 2018 1:08 am

that would be great if you could...thank you for the support any way.
just knowing that it can be done is great in the fact that h-k might but i doubt put out an image themselves ....
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 3001
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Thu Nov 29, 2018 7:38 pm

Ok, I'm reviving this thread since I want to finish a ubuntu desktop image for the n1. So far I have a custom kernel running, I'm trying to add petitboot support, will look into adding ir blaster support as well (since I need it) and for the sake of others mostly, I'd like to add full desktop support (mali, ffmpeg, kodi).
So far I have installed the mali/vpu drivers provided by hardkernel from their debian image and they installed mostly fine. However, I'm not getting egl support yet. When running glmark2-es2 I get:
Code: Select all
ERROR: The DDK is not compatible with any of the Mali GPUs on the system.
The DDK was built for 0x860 r2p0 status range [0..15], but none of the GPUs matched:
Error: eglInitialize() failed with error: 0x3001
ERROR: The DDK is not compatible with any of the Mali GPUs on the system.
The DDK was built for 0x860 r2p0 status range [0..15], but none of the GPUs matched:
Error: eglInitialize() failed with error: 0x3001
Error: main: Could not initialize canvas


The Xorg server seems to be loading fbdev as video driver (output here: http://paste.ubuntu.com/p/BX5WyVrFFj/), while glxinfo reports it's using MESA (which I suppose it's bad): http://paste.ubuntu.com/p/9RPDCqRmdG/.
So far I have installed the following debs from Ubuntu's Debian repo:
Code: Select all
libmali-rk-dev_1.6-1_arm64.deb
libmali-rk-midgard-t86x-r14p0_1.6-1_arm64.deb
librockchip-mpp-dev_1.4.0-2_arm64.deb
librockchip-mpp-static_1.4.0-2_arm64.deb
librockchip-mpp1-dbgsym_1.4.0-2_arm64.deb
librockchip-mpp1_1.4.0-2_arm64.deb
librockchip-vpu0-dbgsym_1.4.0-2_arm64.deb
librockchip-vpu0_1.4.0-2_arm64.deb


I could use a push in the right direction. What should I do to enable gles support? Can somebody share /var/log/Xorg.0.log and the output of glxinfo from the debian image? I'm too lazy/busy right now to install it :)
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Fri Nov 30, 2018 12:19 am

mad_ady wrote:The Xorg server seems to be loading fbdev as video driver (output here: http://paste.ubuntu.com/p/BX5WyVrFFj/)

It's using "modset" which is fine and correct, you should find it under /etc/X11/ either under xorg.conf or under xorg.d or something.
the N1 support 2 drivers, armsoc and modset as framebuffer drivers (DDX).
The glamor error is odd though, as it normally uses a special xorg-core driver that is patched to use "GLES" for glamor and allow glamor to be "loaded" correctly.
(although not very helptful but helps a bit).
You should check if you have to patched xorg version from rockchip installed.

mad_ady wrote:while glxinfo reports it's using MESA (which I suppose it's bad): http://paste.ubuntu.com/p/9RPDCqRmdG/.

glxinfo is for OpenGL, the N1 does not support OpenGL as you should know.. es2_info is the correct one to use.
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Fri Nov 30, 2018 12:26 am

Thanks @meveric. That explains why hardkernel's debian repo had packages for xorg. I'll try to mark hold current packages and overwrite them with the ones from debian (if version is close enough).

Thanks also for the correct glinfo command.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby crashoverride » Fri Nov 30, 2018 4:10 pm

mad_ady wrote:I could use a push in the right direction.

Make sure you have correct permissions set for /dev/mali0. This usually requires a rule setup for it. You can test with "sudo chmod a+rw /dev/mali0".
crashoverride
 
Posts: 4143
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Mon Dec 03, 2018 7:20 pm

/dev/mali0 has the correct permissions (now).
I've tried to install the xorg packages from the debian repository, but it fails due to missing packages.
So now I'm trying to build xorg-server from rockchip: https://github.com/rockchip-linux/xserver.git. I've cloned it, installed dependencies with sudo apt-get build-dep xorg-server and tried to run debuild:
Code: Select all
debuild -i -us -uc -b

But it fails at some point:
Code: Select all
configure:27386: gcc -c -g -O2 -fdebug-prefix-map=/root/xserver=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -Wdate-time -D_FORTIFY_SOURCE=2 -DPRE_RELEASE=0  conftest.c >&5           
In file included from /usr/local/include/uapi/linux/capability.h:16:0,                                                                                                                                         
                 from /usr/local/include/linux/capability.h:15,
                 from /usr/local/include/linux/netlink.h:5,                                                                                                                                                   
                 from /usr/include/libaudit.h:34,                                                                                                                                                             
                 from conftest.c:157:                                                                                                                                               
/usr/local/include/linux/types.h:14:26: error: conflicting types for 'fd_set'                                                                                                                                 
 typedef __kernel_fd_set  fd_set;                                             
                          ^~~~~~               
In file included from /usr/include/aarch64-linux-gnu/sys/types.h:197:0,
                 from conftest.c:126:                         
/usr/include/aarch64-linux-gnu/sys/select.h:70:5: note: previous declaration of 'fd_set' was here
   } fd_set;                                         
     ^~~~~~                                                           
In file included from /usr/local/include/uapi/linux/capability.h:16:0,           
                 from /usr/local/include/linux/capability.h:15, 
                 from /usr/local/include/linux/netlink.h:5,
                 from /usr/include/libaudit.h:34,               
                 from conftest.c:157:                                                               
/usr/local/include/linux/types.h:15:25: error: conflicting types for 'dev_t'
 typedef __kernel_dev_t  dev_t;                                                                                                                                                                               
                         ^~~~~                                                                                                                                                                                 
In file included from conftest.c:126:0:                                                                                                                         
/usr/include/aarch64-linux-gnu/sys/types.h:60:17: note: previous declaration of 'dev_t' was here
 typedef __dev_t dev_t;                         
                 ^~~~~                               
In file included from /usr/local/include/uapi/linux/capability.h:16:0,         
                 from /usr/local/include/linux/capability.h:15,                                                                                                                                               
                 from /usr/local/include/linux/netlink.h:5,                       
                 from /usr/include/libaudit.h:34,                     
                 from conftest.c:157:             
/usr/local/include/linux/types.h:25:26: error: conflicting types for 'timer_t'                                             
 typedef __kernel_timer_t timer_t;                                                                                                                                                                             
                          ^~~~~~~                                                                                                                                                                              In file included from /usr/include/aarch64-linux-gnu/sys/types.h:131:0,                                                                                                                                                         from conftest.c:126:                                                                                                                                                                         
/usr/include/aarch64-linux-gnu/bits/types/timer_t.h:7:19: note: previous declaration of 'timer_t' was here                                                                                                      typedef __timer_t timer_t;                                                                                                                                                                                                       ^~~~~~~                                                                                                                                                                                     In file included from /usr/local/include/uapi/linux/capability.h:16:0,                                                                                                                                                          from /usr/local/include/linux/capability.h:15,                                                                                                                                                                 from /usr/local/include/linux/netlink.h:5,                                                                                                                                                                     from /usr/include/libaudit.h:34,                                                                                                                                                             
                 from conftest.c:157:                 

Most likely I messed something up with the kernel headers. I've found a thread somewhere (https://www.linuxquestions.org/question ... 175534278/) saying that I can specify --with-kernel-dir and could try to bypass the problem, but I don't know how to pass that to debuild.
Any suggestions?
Thanks
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Mon Dec 03, 2018 9:39 pm

you have a lot of headers under /usr/local/include, normally there shouldn't be any headers of the type we can see here.
You can see that some of the hearders under /usr/local/include conflict with the headers under /usr/include/ or /usr/include/aarch64-linux-gnu.

My guess you have copied/installed a lot of the headers from the Kernel build folder to /usr/local/include and this messed up your entire system.
It's probably rather dangerous to have these headers there as they may conflict with other projects you want to build as well.
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby crashoverride » Mon Dec 03, 2018 10:17 pm

mad_ady wrote:So now I'm trying to build xorg-server from rockchip:

I would suggest using RK's armsoc instead:
https://github.com/rockchip-linux/xf86-video-armsoc
crashoverride
 
Posts: 4143
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Mon Dec 10, 2018 9:12 pm

Ok, I cleaned-up my mess with the kernel headers that was causing xserver to issue build errors.
Now, it builds, but I'm having issues when packaging it as deb package:
Code: Select all
root@n1-pre:~/xserver# debuild -i -us -uc -b
...
make[1]: Entering directory '/root/xserver'
dh_fixperms
chown root:root /root/xserver/debian/xserver-xorg-legacy/usr/lib/xorg/Xorg.wrap
chmod ug+s /root/xserver/debian/xserver-xorg-legacy/usr/lib/xorg/Xorg.wrap
make[1]: Leaving directory '/root/xserver'
   dh_fixperms -O--parallel -Nxserver-xorg-core -Nxserver-xorg-dev -Nxdmx -Nxdmx-tools -Nxnest -Nxvfb -Nxserver-xephyr -Nxserver-xorg-legacy
   dh_missing -O--parallel
   debian/rules override_dh_strip
make[1]: Entering directory '/root/xserver'
dh_strip -pxserver-xorg-core --dbgsym-migration="xserver-xorg-core-dbg (<< 2:1.19.0-3~)"
dh_strip -s -Nxserver-xorg-core -Nxserver-xorg-core-dbg
dh_strip: -s/--same-arch is deprecated; please use -a/--arch instead
dh_strip: This feature will be removed in compat 12.
dh_strip: Requested unknown package xserver-xorg-core-dbg via -N/--no-package, expected one of: xserver-xorg-core xserver-xorg-dev xdmx xdmx-tools xnest xvfb xserver-xephyr xserver-common xorg-server-source xserver-xorg-legacy
dh_strip: unknown option or error during option parsing; aborting
debian/rules:266: recipe for target 'override_dh_strip' failed
make[1]: *** [override_dh_strip] Error 25
make[1]: Leaving directory '/root/xserver'
debian/rules:169: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1152:
dpkg-buildpackage -rfakeroot -us -uc -ui -i -b failed



I'm not sure where to start looking to see what's with the xserver-xorg-core-dbg package.

I've aslo tried @crashoverride's suggestion, but the source complains about the architecture:
Code: Select all
root@n1-pre:~/xf86-video-armsoc# debuild -i -us -uc -b
 dpkg-buildpackage -rfakeroot -us -uc -ui -i -b
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: info: source package xf86-video-armsoc
dpkg-buildpackage: info: source version 1.9.3
dpkg-buildpackage: info: source distribution testing
dpkg-buildpackage: info: source changed by Jacob Chen <jacob2.chen@rock-chips.com>
 dpkg-source -i --before-build xf86-video-armsoc
dpkg-buildpackage: info: host architecture arm64
 fakeroot debian/rules clean
dh clean --with quilt,xsf --builddirectory=build/
dh: No packages to build. Architecture mismatch: arm64, want: armel armhf
 debian/rules build
dh build --with quilt,xsf --builddirectory=build/
dh: No packages to build. Architecture mismatch: arm64, want: armel armhf
 fakeroot debian/rules binary
dh binary --with quilt,xsf --builddirectory=build/
dh: No packages to build. Architecture mismatch: arm64, want: armel armhf
 dpkg-genbuildinfo --build=binary
dpkg-genbuildinfo: error: binary build with no binary artifacts found; .buildinfo is meaningless
dpkg-buildpackage: error: dpkg-genbuildinfo --build=binary subprocess returned exit status 25
debuild: fatal error at line 1152:
dpkg-buildpackage -rfakeroot -us -uc -ui -i -b failed


I haven't tried yet to force arm64 onto it.

Something new that happens - the system apparently stops by itself after ~25 minutes. I don't know why, but it leaves no traces on serial. I'm looking into it...
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby rooted » Tue Dec 11, 2018 7:55 am

Looks like you will have to edit the makefile (or what generates it) and add arm64 as a target, not sure if that's a good idea but it's worth a try.
User avatar
rooted
 
Posts: 5911
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Ubuntu 18.04 RK image

Unread postby phaseshifter » Tue Dec 11, 2018 1:04 pm

STOP`s...could you elaborate pls ..is it going into standby ..could be something like power manager or screen saver etc..etc..systmctrl stopping
something or screen lock..maybe something you missed in all the install modding some where..etc..etc//25 mins maybe the hdd is powering down..??..along those lines..
did you miss engaging the fan control is it thermal shutdown..???
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 3001
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Tue Dec 11, 2018 1:37 pm

Regarding the stops - I narrowed it down. It would only stop (red light, no output on console, on light load, cool temperature) when lightdm was running, but not logged in. I turned it off for the moment and for now no more shutdowns. I'll see if it still happens after I manage to get acceleration going.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Wed Dec 12, 2018 5:20 am

mad_ady wrote:dh: No packages to build. Architecture mismatch: arm64, want: armel armhf

Check debian/control it's probably missing arm64
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Wed Dec 12, 2018 4:57 pm

Thanks meveric. It was missing arm64. I added it and it continued the build. However, it now exited with this error when running lintian:
Code: Select all
dpkg-deb: building package 'xserver-xorg-video-armsoc' in '../xserver-xorg-video-armsoc_1.9.3_arm64.deb'.
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../xf86-video-armsoc_1.9.3_arm64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source -i --after-build xf86-video-armsoc
dpkg-buildpackage: info: binary-only upload (no source included)
Now running lintian xf86-video-armsoc_1.9.3_arm64.changes ...
warning: the authors of lintian do not recommend running it with root privileges!
E: xf86-video-armsoc changes: bad-distribution-in-changes-file testing
W: xserver-xorg-video-armsoc: transitional-package-should-be-oldlibs-optional x11/optional
Finished running lintian.


But it creates the deb file, so I'll give it a try.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Wed Dec 12, 2018 5:36 pm

I spoke too soon. The deb file only contains documentation :(. It seems the lintian error was important after all :(
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Wed Dec 12, 2018 7:29 pm

With a few tweaks to the debian/rules file I removed references to the -dbg package and was able to build debs for the xserver from rockchip's git. I ran into the lintian error again, so it's something consistent:
Code: Select all
dpkg-buildpackage: info: binary-only upload (no source included)
Now running lintian xorg-server_1.19.3-1_arm64.changes ...
warning: the authors of lintian do not recommend running it with root privileges!
E: xorg-server changes: bad-distribution-in-changes-file unstable
E: xvfb: latest-changelog-entry-without-new-date
E: xvfb: empty-manual-page usr/share/man/man1/xvfb-run.1.gz
E: xserver-xorg-core: latest-changelog-entry-without-new-date
W: xserver-xorg-core: binary-without-manpage usr/bin/X
E: xserver-common: latest-changelog-entry-without-new-date
W: xserver-common: manpage-has-errors-from-man usr/share/man/man1/Xserver.1.gz 540: warning [p 8, 1.3i]: cannot adjust line
E: xdmx: latest-changelog-entry-without-new-date
E: xorg-server-source: latest-changelog-entry-without-new-date
E: xdmx-tools: latest-changelog-entry-without-new-date
W: xdmx-tools: binary-without-manpage usr/bin/dmxaddinput
W: xdmx-tools: binary-without-manpage usr/bin/dmxaddscreen
W: xdmx-tools: binary-without-manpage usr/bin/dmxinfo
W: xdmx-tools: binary-without-manpage usr/bin/dmxreconfig
W: xdmx-tools: binary-without-manpage usr/bin/dmxresize
W: xdmx-tools: binary-without-manpage usr/bin/dmxrminput
W: xdmx-tools: binary-without-manpage usr/bin/dmxrmscreen
W: xdmx-tools: binary-without-manpage usr/bin/dmxwininfo
E: xserver-xorg-legacy: latest-changelog-entry-without-new-date
W: xserver-xorg-legacy: priority-extra-is-replaced-by-priority-optional
W: xserver-xorg-legacy: setuid-gid-binary usr/lib/xorg/Xorg.wrap 6755 root/root
E: xserver-xephyr: latest-changelog-entry-without-new-date
E: xnest: latest-changelog-entry-without-new-date
E: xserver-xorg-dev: latest-changelog-entry-without-new-date
W: xserver-xorg-dev: pkg-config-unavailable-for-cross-compilation usr/lib/pkgconfig/xorg-server.pc
E: xserver-xorg-dev: pkg-config-bad-directive usr/lib/pkgconfig/xorg-server.pc -fvisibility=hidden
W: xserver-xorg-dev: binary-without-manpage usr/bin/dh_xsf_substvars
Finished running lintian.


I've installed them and yay! It works now:
http://paste.ubuntu.com/p/XzSHBq6JZj/

I will try armsoc as well if I can get it to build.

Next I'll look into ffmpeg and kodi. Any tips on where to start?
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Thu Dec 13, 2018 5:08 pm

I've looked into ffmpeg for now. The stock ubuntu ffmpeg version supports v4l2m2m out of the box:
Code: Select all
root@n1-pre:~# ffmpeg -decoders | grep v4l2m2m
ffmpeg version 3.4.2-2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.3.0-16ubuntu2)
  configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
 V..... h263_v4l2m2m         V4L2 mem2mem H.263 decoder wrapper (codec h263)
 V..... h264_v4l2m2m         V4L2 mem2mem H.264 decoder wrapper (codec h264)
 V..... mpeg1_v4l2m2m        V4L2 mem2mem MPEG1 decoder wrapper (codec mpeg1video)
 V..... mpeg2_v4l2m2m        V4L2 mem2mem MPEG2 decoder wrapper (codec mpeg2video)
 V..... mpeg4_v4l2m2m        V4L2 mem2mem MPEG4 decoder wrapper (codec mpeg4)
 V..... vc1_v4l2m2m          V4L2 mem2mem VC1 decoder wrapper (codec vc1)
 V..... vp8_v4l2m2m          V4L2 mem2mem VP8 decoder wrapper (codec vp8)
 V..... vp9_v4l2m2m          V4L2 mem2mem VP9 decoder wrapper (codec vp9)

But I can't use it, because there are no /dev/video* entries - so the kernel encoder/decoder part is not activated:
Code: Select all
root@n1-pre:~# ls -l /dev/video*
ls: cannot access '/dev/video*': No such file or directory
root@n1-pre:~# zcat /proc/config.gz | grep -i rockchip
CONFIG_ARCH_ROCKCHIP=y
CONFIG_PCIE_ROCKCHIP=y
CONFIG_ARM_ROCKCHIP_CPUFREQ=y
CONFIG_ROCKCHIP_SCR=y
CONFIG_DWMAC_ROCKCHIP=y
CONFIG_ROCKCHIP_PHY=y
CONFIG_WL_ROCKCHIP=y
CONFIG_KEYBOARD_ROCKCHIP=y
# CONFIG_ROCKCHIP_REMOTECTL is not set
CONFIG_SPI_ROCKCHIP=y
CONFIG_PINCTRL_ROCKCHIP=y
CONFIG_ROCKCHIP_IODOMAIN=y
CONFIG_ROCKCHIP_THERMAL=y
# CONFIG_VIDEO_ROCKCHIP_ISP1 is not set
CONFIG_VIDEO_ROCKCHIP_RGA=m
# CONFIG_VIDEO_ROCKCHIP_VPU is not set
CONFIG_DRM_ROCKCHIP=y
# CONFIG_ROCKCHIP_CDN_DP is not set
CONFIG_ROCKCHIP_DW_HDMI=y
CONFIG_ROCKCHIP_DW_MIPI_DSI=y
# CONFIG_ROCKCHIP_ANALOGIX_DP is not set
CONFIG_ROCKCHIP_INNO_HDMI=y
# CONFIG_ROCKCHIP_LVDS is not set
# CONFIG_ROCKCHIP_DRM_TVE is not set
# CONFIG_ROCKCHIP_RGB is not set
# CONFIG_ROCKCHIP_DRM_BACKLIGHT is not set
# CONFIG_ROCKCHIP_RK3066_HDMI is not set
# Rockchip Misc Video driver
# CONFIG_FB_ROCKCHIP is not set
# CONFIG_ROCKCHIP_RGA is not set
# CONFIG_ROCKCHIP_RGA2 is not set
# ROCKCHIP_MPP
CONFIG_ROCKCHIP_MPP_SERVICE=y
CONFIG_ROCKCHIP_MPP_DEVICE=y
CONFIG_SND_SOC_ROCKCHIP=y
CONFIG_SND_SOC_ROCKCHIP_I2S=y
# CONFIG_SND_SOC_ROCKCHIP_PDM is not set
CONFIG_SND_SOC_ROCKCHIP_SPDIF=y
# CONFIG_SND_SOC_ROCKCHIP_DA7219 is not set
# CONFIG_SND_SOC_ROCKCHIP_HDMI_ANALOG is not set
# CONFIG_SND_SOC_ROCKCHIP_HDMI_DP is not set
CONFIG_SND_SOC_ROCKCHIP_MAX98090=y
CONFIG_SND_SOC_ROCKCHIP_RT5645=y
# CONFIG_SND_SOC_ROCKCHIP_RT5651_TC358749 is not set
# CONFIG_SND_SOC_ROCKCHIP_CDNDP is not set
CONFIG_USB_DWC3_ROCKCHIP=y
CONFIG_USB_DWC3_ROCKCHIP_INNO=y
# ROCKCHIP USB Support
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_ROCKCHIP_TIMER=y
CONFIG_ROCKCHIP_IOMMU=y
CONFIG_ROCKCHIP_CPUINFO=y
# CONFIG_ROCKCHIP_DEVICEINFO is not set
# CONFIG_ROCKCHIP_PM_TEST is not set
CONFIG_ROCKCHIP_GRF=y
CONFIG_ROCKCHIP_PM_DOMAINS=y
# CONFIG_ROCKCHIP_PVTM is not set
CONFIG_ROCKCHIP_SUSPEND_MODE=y
# CONFIG_ARM_ROCKCHIP_DMC_DEVFREQ is not set
# CONFIG_DEVFREQ_EVENT_ROCKCHIP_DFI is not set
# CONFIG_DEVFREQ_EVENT_ROCKCHIP_NOCP is not set
CONFIG_ROCKCHIP_SARADC=y
CONFIG_PWM_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_USB=y
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PHY_ROCKCHIP_INNO_USB3=y
CONFIG_PHY_ROCKCHIP_EMMC=y
CONFIG_PHY_ROCKCHIP_DP=y
# CONFIG_PHY_ROCKCHIP_INNO_MIPI_DPHY is not set
CONFIG_PHY_ROCKCHIP_INNO_HDMI_PHY=y
CONFIG_PHY_ROCKCHIP_TYPEC=y
CONFIG_PHY_ROCKCHIP_PCIE=y
CONFIG_ROCKCHIP_EFUSE=y
CONFIG_ROCKCHIP_SIP=y


So - I'd like to understand the following:
1. Do I need v4l2m2m and it should work similar to xu4? (The kernel exposes several /dev/video files that are used by ffmpeg)? In this case, what am I missing?
2. Does ffmpeg need special vpu support (mpp?) This is what my current kernel knows about the vpu:
Code: Select all
root@n1-pre:~# dmesg | grep vpu
[    1.387093] iommu: Adding device ff650000.vpu_service to group 0
[    2.354974] rk-vcodec ff650000.vpu_service: Looking up vcodec-supply from device tree
[    2.354985] rk-vcodec ff650000.vpu_service: Looking up vcodec-supply property in node /vpu_service@ff650000 failed
[    2.355000] rk-vcodec ff650000.vpu_service: no regulator for vcodec
[    2.361523] rk-vcodec ff650000.vpu_service: probe device
[    2.366884] rk-vcodec ff650000.vpu_service: vpu mmu dec ffffffc0f189fc10
[    2.373764] rk-vcodec ff650000.vpu_service: allocator is drm
[    2.379480] rk-vcodec ff650000.vpu_service: checking hw id 0
[    2.385644] rk-vcodec ff650000.vpu_service: could not find power_model node
[    2.392624] rk-vcodec ff650000.vpu_service: init success
[    2.409384] rk-vcodec ff660000.rkvdec: vpu mmu dec ffffffc0f18a0410

I also have librockchip-mpp1 installed:
Code: Select all
root@n1-pre:~# apt show librockchip-mpp1
Package: librockchip-mpp1
Version: 1.4.0-2
Status: install ok installed
Priority: optional
Section: libs
Source: mpp
Maintainer: Randy Li <randy.li@rock-chips.com>
Installed-Size: 878 kB
Depends: libc6 (>= 2.17), libgcc1 (>= 1:3.0), libstdc++6 (>= 5)
Homepage: http://www.rock-chips.com
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: Media Process Platform



Edit:
I'm currently compiling ffmpeg from here: https://github.com/rockchip-linux/ffmpeg
With these options: ./configure --enable-rkmpp --enable-version3 --enable-libdrm
@meveric: The repo doesn't have a debian/rules entry. How should I make "standard" ffmpeg deb files from it? Simply transplant the debian directory from other ffmpeg branches?
Last edited by mad_ady on Thu Dec 13, 2018 5:26 pm, edited 2 times in total.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Thu Dec 13, 2018 5:14 pm

mad_ady wrote:So - I'd like to understand the following:
1. Do I need v4l2m2m and it should work similar to xu4? (The kernel exposes several /dev/video files that are used by ffmpeg)? In this case, what am I missing?

Rockchip doesn't use v4l2m2m
mad_ady wrote:2. Does ffmpeg need special vpu support (mpp?)

yep it's called "rkmpp" and is disabled by default in ffmpeg ;)
Code: Select all
ffmpeg-4.0.2# ./configure --help | grep rkmpp
  --enable-rkmpp           enable Rockchip Media Process Platform code [no]
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Thu Dec 13, 2018 6:08 pm

... And it fails to build:
Code: Select all
CC   libavcodec/realtextdec.o
CC   libavcodec/remove_extradata_bsf.o
CC   libavcodec/rkmppdec.o
CC   libavcodec/rkmppenc.o
libavcodec/rkmppenc.c: In function 'rkmpp_init_encoder':
libavcodec/rkmppenc.c:363:47: error: 'MPP_SET_INPUT_TIMEOUT' undeclared (first use in this function); did you mean 'MPP_SET_INPUT_BLOCK'?
     ret = encoder->mpi->control(encoder->ctx, MPP_SET_INPUT_TIMEOUT, &paramS64);
                                               ^~~~~~~~~~~~~~~~~~~~~
                                               MPP_SET_INPUT_BLOCK
libavcodec/rkmppenc.c:363:47: note: each undeclared identifier is reported only once for each function it appears in
libavcodec/rkmppenc.c:371:47: error: 'MPP_SET_OUTPUT_TIMEOUT' undeclared (first use in this function); did you mean 'MPP_SET_INPUT_TIMEOUT'?
     ret = encoder->mpi->control(encoder->ctx, MPP_SET_OUTPUT_TIMEOUT, &paramS64);
                                               ^~~~~~~~~~~~~~~~~~~~~~
                                               MPP_SET_INPUT_TIMEOUT
ffbuild/common.mak:60: recipe for target 'libavcodec/rkmppenc.o' failed
make: *** [libavcodec/rkmppenc.o] Error 1



I'll need to dig for a while...
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Fri Dec 14, 2018 3:28 am

either headers are missing, or wrong version of the headers, or wrong version of ffmpeg.
It might not work with the ffmpeg version of Ubuntu 18.04 without patches.
You need header files from librockchip-mpp-dev, could also be you need correct libdrm packages (which also come from rockchip repository).

Getting this stuff all sorted out took me quite some time as well... also the packages from rockchip are often broken, don't compile correctly or have incorrect debian/rules debian/controls and so on files which needed to be corrected.
Once you have them, everything is a breeze but the first time I had to deal with this was also very hard for me.<

The first couple of times I also needed to patch ffmpeg itself, as the implementation inside ffmpeg was outdated and certain files and headers no longer existed, but I could quickly find them.. but on later versions of ffmpeg they already fixed that themselves.. so I was always looking out for what patches I needed, or if at all :D
Last version I tried was 4.0.2 from Debian Buster at that point in time, this one was fully patched already.

mad_ady wrote:Edit:
I'm currently compiling ffmpeg from here: https://github.com/rockchip-linux/ffmpeg
With these options: ./configure --enable-rkmpp --enable-version3 --enable-libdrm
@meveric: The repo doesn't have a debian/rules entry. How should I make "standard" ffmpeg deb files from it? Simply transplant the debian directory from other ffmpeg branches?

No clue, I don't even know which version this is.
Last time I tried their repo for ffmpeg it was a huge mess. I'd rather use official debian packages, they already include rkmpp and should work fine.
But I needed to alter the debian/rules file to include rkmpp as it's not activated by default.

Code: Select all
-       --enable-libvo_amrwbenc
+       --enable-libvo_amrwbenc \
+       --enable-rkmpp \
+       --enable-libdrm


in the following section of the debian/rules file:
Code: Select all
# With these enabled, resulting binaries are effectively licensed as GPLv3+.
CONFIG_extra =
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Fri Dec 14, 2018 4:02 am

Thanks, I'll try mainline ffmpeg then!
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Fri Dec 14, 2018 5:49 pm

Ok, progress report time:
I compiled ffmpeg from the ubuntu source with the rpmpp bits enabled. It compiled fine and I installed it:
Code: Select all
apt-get install   -y                    libfaad-dev           faad                            libmp3lame-dev        x264                  libx264-dev           libxvidcore-dev       build-essential     checkinstall
apt-get build-dep ffmpeg
apt-get source ffmpeg
cd ffmpeg-3.4.2/
vi debian/rules
debuild -i -us -uc -b
cd ..
dpkg -i ffmpeg-doc_3.4.2-2_all.deb ffmpeg_3.4.2-2_arm64.deb libavcodec-dev_3.4.2-2_arm64.deb libavcodec-extra57_3.4.2-2_arm64.deb libavdevice-dev_3.4.2-2_arm64.deb libavdevice57_3.4.2-2_arm64.deb libavfilter-dev_3.4.2-2_arm64.deb libavfilter-extra6_3.4.2-2_arm64.deb libavformat-dev_3.4.2-2_arm64.deb libavformat57_3.4.2-2_arm64.deb libavresample-dev_3.4.2-2_arm64.deb libavresample3_3.4.2-2_arm64.deb libavutil-dev_3.4.2-2_arm64.deb libavutil55_3.4.2-2_arm64.deb libpostproc-dev_3.4.2-2_arm64.deb libpostproc54_3.4.2-2_arm64.deb libswresample-dev_3.4.2-2_arm64.deb libswresample2_3.4.2-2_arm64.deb libswscale-dev_3.4.2-2_arm64.deb libswscale4_3.4.2-2_arm64.deb
apt-mark hold ffmpeg-doc libavutil55 libpostproc54 libswresample2 libswscale4 libavcodec-extra57 libavformat57 libavresample3 libavutil-dev libpostproc-dev libswresample-dev libswscale-dev libavcodec-dev libavfilter-extra6 libavformat-dev libavresample-dev libavdevice57 libavfilter-dev ffmpeg libavdevice-dev


Now ffmpeg lists rkmpp supported decoders, but not encoders (maybe they were not implemented in this version?)
Code: Select all
root@n1-pre:~# ffmpeg -decoders 2>&1 | grep rkmpp
  avcodec     configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-rkmpp --enable-libdrm
  avfilter    configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-rkmpp --enable-libdrm
 V..... h264_rkmpp           h264 (rkmpp) (codec h264)
 V..... hevc_rkmpp           hevc (rkmpp) (codec hevc)
 V..... vp8_rkmpp            vp8 (rkmpp) (codec vp8)
 V..... vp9_rkmpp            vp9 (rkmpp) (codec vp9)
root@n1-pre:~# ffmpeg -encoders 2>&1 | grep rkmpp
  avcodec     configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-rkmpp --enable-libdrm
  avfilter    configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-rkmpp --enable-libdrm


But when i try to use the decoder, it spits errors:
Code: Select all
root@n1-pre:~# ffmpeg -vcodec h264_rkmpp -i big_buck_bunny_1080p_h264.mov -vc h264 -an -b:v 2M bbb.mp4
...
ile 'bbb.mp4' already exists. Overwrite ? [y/N] y
mpi: mpp version: c8a41a6 author: Herman Chen [h265d]: Avoid uninitialised value in Qmatrix
hal_h264d_api: hal_h264d_init mpp_buffer_group_get_internal used ion In
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> h264 (libx264))
Press [q] to stop, [?] for help
mpp: command 31000c param 0x7ffabb1b7c ret -1
[h264_rkmpp @ 0x558bc6f800] Failed to get decoder free slots (code = -1).
Error while decoding stream #0:0: Operation not permitted
Error while decoding stream #0:0: Resource temporarily unavailable
    Last message repeated 8257 times
Error while decoding stream #0:0: Resource temporarily unavailabletrate=  -0.0kbits/s speed=N/A   
mpp: command 31000c param 0x7ffabb1ccc ret -1
    Last message repeated 1149 times
[h264_rkmpp @ 0x558bc6f800] Failed to get decoder free slots (code = -1).
Error while decoding stream #0:0: Operation not permitted
Finishing stream 0:0 without any data written to it.


So decoding doesn't work. I think I'll try to compile https://github.com/rockchip-linux/mpp and https://github.com/rockchip-linux/libdrm-rockchip - which I've previously lifted from HK's debian and installed directly.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Fri Dec 14, 2018 6:20 pm

Ok, compiled and installed libdrm-rockchip and mpp and it still fails, but now it fails in a different way, so I guess that's progress:
Code: Select all
root@n1-pre:~# ffmpeg -vcodec h264_rkmpp -i big_buck_bunny_1080p_h264.mov -vc h264 -an -b:v 2M bbb.mp4
...
File 'bbb.mp4' already exists. Overwrite ? [y/N] y
mpi: mpp version: 50d2179f author: Herman Chen [vepu]: Fix row length errror when not aligned
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpp: deprecated block control, use timeout control instead
mpp: deprecated block control, use timeout control instead
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> h264 (libx264))
Press [q] to stop, [?] for help
[h264_rkmpp @ 0x559050f800] Decoder noticed an info change (1920x1080), format=0
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
Conversion failed!
root@n1-pre:~# dmesg | tail
[    9.597878] squashfs: SQUASHFS error: Filesystem uses "xz" compression. This is not supported
[    9.662235] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[    9.671579] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[    9.680911] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[    9.692174] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[    9.702066] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[    9.711443] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[   13.096015] tty_port_close_start: tty->count = 1 port count = 2.
[   73.862784] rk_vcodec: vpu_service_ioctl:1844: error: unknow vpu service ioctl cmd 40086c01
[   74.031396] rk-vcodec ff660000.rkvdec: closed



Playback attempts look like this:
http://paste.ubuntu.com/p/F7wNGYMzCy/

I feel like I'm missing something else.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Fri Dec 14, 2018 6:29 pm

I thought I'd rebuild ffmpeg since I updated mpp and libdrm and installed their development packages as well, but now, the compilation of ffmpeg cries with:
Code: Select all
License: GPL version 2 or later
Creating configuration files ...
 *** extra ***
ERROR: Rockchip MPP is outdated, please get a more recent one.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
cat: config.log: No such file or directory
debian/rules:197: recipe for target 'override_dh_auto_configure' failed
make[1]: *** [override_dh_auto_configure] Error 1
make[1]: Leaving directory '/root/ffmpeg-ubuntu/ffmpeg-3.4.2'
debian/rules:193: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1152:
dpkg-buildpackage -rfakeroot -us -uc -ui -i -b failed



But I did get the latest git version from rockchip.... And ffmpeg isn't so bleeding edge. There is no ffbuild/config.log to investigate further...

Man, if rockchip which is praised for their support creates so many problems (admittedly, for a noob like me), I wouldn't want to try this on less supported hardware :D
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Sat Dec 15, 2018 2:07 am

version 3.4 is most likely too old, it will require the patch that I was talking about.
use the packages from Ubuntu 18.10 version 4.0.3 (just recompile them on 18.04 "should work fine")
http://ports.ubuntu.com/pool/universe/f/ffmpeg/

else you need to patch your ffmpeg first.

Also please note, that you can not play videos using ffplay since rkmpp used DRM Prime which is not directly supported.
It works only as a decoder to decode the stream, but you need a tool that can convert it from DRM Prime back to something that can be displayed.

So ffmpeg in combination with specific Kodi will work, but you can not decode and watch.
For the same reason you can not decode and re-encode with software decoder, since not even ffmpeg understands the decoded frames from the rkmpp decoder :)
(Well maybe upstream can convert drm prime now, but last time I checked it could not display it)
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Sat Dec 15, 2018 2:11 am

Ok, it makes sense now, thanks.
Does this mean that mpv won't work because it uses ffplay?
I'll give it a try in the following days.
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Sat Dec 15, 2018 4:59 am

mad_ady wrote:Ok, it makes sense now, thanks.
Does this mean that mpv won't work because it uses ffplay?
I'll give it a try in the following days.

It's pretty hard to get a picture out of the rkmpp decoder.
I think the latest upstream version of mpv has DRM prime support.
Otherwise I heard this version should have it: https://github.com/LongChair/mpv

But I haven't tried it yet.
I tried once upstream mpv, but that also required upstream ffmpeg, like bleeding edge, even newer than 4.0.2 so I gave up on it.
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby memeka » Mon Dec 17, 2018 7:49 am

afaik, mpv has DRMPRIME support for a long time (6 or more months in git).
however, the output is not on DRM, but on Mali (dmabuf import).
User avatar
memeka
 
Posts: 4067
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Mon Dec 17, 2018 7:25 pm

One step at a time :)

I managed to compile ffmpeg-4.0.3 from Ubuntu 18.10 (after installing some missing dependencies):
Code: Select all
root@n1-pre:~# ffmpeg -decoders | egrep 'rkmpp'
ffmpeg version 4.0.3-1build1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=1build1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libvidstab --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=1build1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libvidstab --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-rkmpp --enable-libdrm
  avfilter    configuration: --prefix=/usr --extra-version=1build1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libvidstab --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-rkmpp --enable-libdrm
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
 V..... h264_rkmpp           h264 (rkmpp) (codec h264)
 V..... hevc_rkmpp           hevc (rkmpp) (codec hevc)
 V..... vp8_rkmpp            vp8 (rkmpp) (codec vp8)
 V..... vp9_rkmpp            vp9 (rkmpp) (codec vp9)

There are still no rkmpp encoders visible. And decoding via ffmpeg doesn't work:
Code: Select all
root@n1-pre:~# ffmpeg -vcodec h264_rkmpp -i big_buck_bunny_1080p_h264.mov -vc h264 -an -b:v 2M bbb.mp4
...
      handler_name    : Apple Alias Data Handler
File 'bbb.mp4' already exists. Overwrite ? [y/N] y
mpi: mpp version: 50d2179f author: Herman Chen [vepu]: Fix row length errror when not aligned
mpp_rt: NOT found ion allocator
mpp_rt: found drm allocator
mpp: deprecated block control, use timeout control instead
mpp: deprecated block control, use timeout control instead
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> h264 (libx264))
Press [q] to stop, [?] for help
[h264_rkmpp @ 0x55af120d10] Decoder noticed an info change (1920x1080), format=0
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
Error reinitializing filters!                                                                                                                                                                                 
Failed to inject frame into filter network: Function not implemented                                                                                                                                           
Error while processing the decoded data for stream #0:0                                                                                                                                                       
Conversion failed!                               

Maybe I need to pass extra arguments? Or set the video format to something?
Can someone with the debian version check if they can decode with ffmpeg on the n1, please?

Update: Though now stock mpv and stock kodi can play Big Buck Bunny 1080p with software decoding and it looks fine. Though I'd like to get hardware decoding (and maybe encoding as well) going...
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Tue Dec 18, 2018 3:48 am

encoder does not exist.
decoder might already work, but you use the decoder to ENCODE, and the pixelformat the decoded frames come out of ffmpeg can't be understand by ffmpeg, so to ENCODE it back to h264 it would have to know what these frames are (which it does not).
It actually even tells you this:
mad_ady wrote:
Code: Select all
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'



Only thing you can do is like a benchmark.. running it through the decoder without ANY output.

try:
Code: Select all
ffmpeg -benchmark -vcodec h264_rkmpp -i some_file.mp4 -map 0:v:0 -f null -
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Tue Dec 18, 2018 3:45 pm

encoder does not exist.

Well, that foils my world domination plans :(
I'll try the decoder then...
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Tue Dec 18, 2018 11:49 pm

Ok, benchmark works, with ~200fps:
Code: Select all
frame= 7884 fps=200 q=-0.0 size=N/A time=00:05:28.50 bitrate=N/A speed=8.33x


So - my next step would be to compile mpv and kodi with drmprime or rkmpp support as well?
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Wed Dec 19, 2018 12:18 am

I tried mpv yesterday which should be rather easy, but it didn't work for me.
Code: Select all
git clone https://github.com/mpv-player/mpv-build
cd mpv-build/
echo --enable-rkmpp >> ffmpeg_options
echo --enable-libdrm >> ffmpeg_options
echo --enable-version3 >> ffmpeg_options
echo --enable-nonfree >> ffmpeg_options
./rebuild -j4


sadly although the binary was able to compile correctly with rkmpp and drm prime support, I wasn't able to get it to work.
Using --gpu-context=drm resulted in a segfault for me.

Since I already have a working version of Kodi with drm-prime support, I guess that's the way to go, but even that will not be easy :)
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Wed Dec 19, 2018 12:23 am

Thanks for the heads up. :)
Mind sharing your kodi recipe as well?
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Ubuntu 18.04 RK image

Unread postby meveric » Wed Dec 19, 2018 2:19 am

mad_ady wrote:Thanks for the heads up. :)
Mind sharing your kodi recipe as well?


Hmm wonder if I can, as this greatly depends on the version you have.
I different commit from Kodi might already no longer work, so I'll see if I still have the version I used for the build...

Code: Select all
git clone https://github.com/Owersun/xbmc
git checkout master
git checkout 696f83ce64f495e0647dd13b432776c050415c8a


Here's the diff that I'm using:
Code: Select all
diff --git a/tools/depends/target/ffmpeg/CMakeLists.txt b/tools/depends/target/ffmpeg/CMakeLists.txt
index 4494a26128..3252a07ef0 100644
--- a/tools/depends/target/ffmpeg/CMakeLists.txt
+++ b/tools/depends/target/ffmpeg/CMakeLists.txt
@@ -53,6 +53,9 @@ if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
     else()
       list(APPEND ffmpeg_conf --disable-vdpau)
     endif()
+      list(APPEND ffmpeg_conf --enable-rkmpp)
+      list(APPEND ffmpeg_conf --enable-version3)
+      list(APPEND ffmpeg_conf --enable-libdrm)
   endif()
 elseif(CORE_SYSTEM_NAME STREQUAL android)
   if(CPU MATCHES arm64)
diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile
index 98817206bc..972a3f8ae2 100644
--- a/tools/depends/target/ffmpeg/Makefile
+++ b/tools/depends/target/ffmpeg/Makefile
@@ -21,6 +21,7 @@ ffmpg_config += --enable-encoder=ac3 --enable-encoder=aac
 ffmpg_config += --enable-encoder=wmav2 --enable-protocol=http
 ffmpg_config += --enable-gnutls
 ffmpg_config += --enable-encoder=png --enable-encoder=mjpeg
+ffmpg_config += --enable-rkmpp
 ffmpg_config += $(FFMPEG_CONFIGURE_OPTIONS)
 
 ifeq ($(CROSS_COMPILING), yes)
diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh
index dc990b8ab0..1d829a5508 100755
--- a/tools/depends/target/ffmpeg/autobuild.sh
+++ b/tools/depends/target/ffmpeg/autobuild.sh
@@ -163,6 +163,7 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \
    --enable-zlib \
    --disable-mipsdsp \
    --disable-mipsdspr2 \
+   --enable-rkmpp \
         ${FLAGS}
 
 make -j ${BUILDTHREADS}
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/network/mdns/ZeroconfBrowserMDNS.cpp b/xbmc/network/mdns/ZeroconfBrowserMDNS.cpp
index 3531df466b..739ff7f71d 100644
--- a/xbmc/network/mdns/ZeroconfBrowserMDNS.cpp
+++ b/xbmc/network/mdns/ZeroconfBrowserMDNS.cpp
@@ -34,9 +34,8 @@
 
 #if defined(TARGET_WINDOWS)
 #include "platform/win32/WIN32Util.h"
-#endif //TARGET_WINDOWS
-
 extern HWND g_hWnd;
+#endif //TARGET_WINDOWS
 
 
 CZeroconfBrowserMDNS::CZeroconfBrowserMDNS()
diff --git a/xbmc/network/mdns/ZeroconfMDNS.cpp b/xbmc/network/mdns/ZeroconfMDNS.cpp
index 71e24671f1..7434d6e3ff 100644
--- a/xbmc/network/mdns/ZeroconfMDNS.cpp
+++ b/xbmc/network/mdns/ZeroconfMDNS.cpp
@@ -29,14 +29,13 @@
 #include "guilib/LocalizeStrings.h"
 #if defined(TARGET_WINDOWS)
 #include "platform/win32/WIN32Util.h"
+extern HWND g_hWnd;
 #endif //TARGET_WINDOWS
 
 #if defined(HAS_MDNS_EMBEDDED)
 #include <mDnsEmbedded.h>
 #endif //HAS_MDNS_EMBEDDED
 
-extern HWND g_hWnd;
-
 void CZeroconfMDNS::Process()
 {
 #if defined(HAS_MDNS_EMBEDDED)
@@ -213,7 +212,7 @@ void CZeroconfMDNS::doStop()
 #if defined(TARGET_WINDOWS_STORE)
     CLog::Log(LOGERROR, "ZeroconfMDNS: WSAAsyncSelect not yet supported for TARGET_WINDOWS_STORE");
 #else
-    WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( m_service ), g_hWnd, BONJOUR_EVENT, 0 );
+//    WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( m_service ), g_hWnd, BONJOUR_EVENT, 0 );
 #endif //TARGET_WINDOWS
 
     if (m_service)
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/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.cpp b/xbmc/windowing/gbm/DRMUtils.cpp
index c119bd0778..570a3485a9 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())
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; }


I still have the separate patches that I use somewhere, but I can't guarantee they still work with most recent versions

A little more complicated are the build parameters, as I don't have the command line I used anymore, but I can try finding all the important variables that are set:
Code: Select all
CMAKE_BUILD_TYPE:STRING=Release
CORE_PLATFORM_NAME:STRING=gbm
ENABLE_EGL:BOOL=ON
ENABLE_GBM:BOOL=ON
ENABLE_INTERNAL_FFMPEG:BOOL=OFF
ENABLE_LIBDRM:BOOL=ON
ENABLE_NEON:BOOL=ON
ENABLE_OPENGL:BOOL=OFF
ENABLE_OPENGLES:BOOL=ON
ENABLE_VAAPI:STRING=OFF
ENABLE_VDPAU:BOOL=OFF
ENABLE_X:BOOL=OFF

Some of them are probably set automatically when you choose gbm as a platform.
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: 9474
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, N1, Go

Re: Ubuntu 18.04 RK image

Unread postby mad_ady » Wed Dec 19, 2018 4:56 am

Thank you!
User avatar
mad_ady
 
Posts: 4944
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1


Return to Ubuntu/Debian

Who is online

Users browsing this forum: No registered users and 1 guest