[Announce] [UPDATED] 20190710 XBMC / Kodi Leia 18.3 with X11/GLES rendering and Exynos MFC support for Ubuntu 16.04

Post Reply
Steevee28
Posts: 8
Joined: Tue Jan 30, 2018 4:55 pm
languages_spoken: english, german
ODROIDs: U3
Has thanked: 1 time
Been thanked: 4 times
Contact:

[Announce] [UPDATED] 20190710 XBMC / Kodi Leia 18.3 with X11/GLES rendering and Exynos MFC support for Ubuntu 16.04

Unread post by Steevee28 » Sun Jun 16, 2019 7:58 pm

Hi all,
in the last few weeks I patched the current Kodi 18.3 sources to again support GLES rendering on X11 and again support MFC-accelerated video decoding out-of-the-box.
Original MFC/FIMC code is from Owersun (THANKS!), but it needed some re-work to be compatible to Kodi Leia again.

For ODROID-U3, I also had to replace FIMC usage by neon-accelerated macroblock un-tiling in software, because passing the buffers from MFC through FIMC was very slow and I couldn't find out why.

Anyone interested in testing this?

See here:
https://github.com/stsichler/xbmc/relea ... droid-u3-5 (updated on 2019/07/10)

History:
- v18.3-odroid-u3-5 fixed sometimes hanging playback at first frame and limits frame rate of 1080p videos to 30Hz.
- v18.3-odroid-u3-4 fixed stuttering playback of some h264 videos by re-ordering MFC output frames by its pts values.
- v18.3-odroid-u3-3 fixed NEON "bus error" in un-tiling when image width%32 != 0 and was the first release of 18.3 final.

Cheers!


EDIT: For those of you being only interested in either X11/GLES support or MFC: I've created two feature branches:
- MFC-support only: https://github.com/stsichler/xbmc/tree/Leia-feature-MFC
- X11/GLES-support only: https://github.com/stsichler/xbmc/tree/ ... re-x11gles

My current default branch "Leia-odroid-u3" contains both features plus additional ARM/compilation related fixes and ODROID-U3 specific hacks.
Last edited by Steevee28 on Wed Jul 10, 2019 4:17 pm, edited 8 times in total.
These users thanked the author Steevee28 for the post (total 3):
mad_ady (Sun Jun 16, 2019 8:09 pm) • odroid (Mon Jun 17, 2019 1:21 pm) • meveric (Tue Jun 18, 2019 10:42 pm)

User avatar
odroid
Site Admin
Posts: 31297
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 44 times
Been thanked: 179 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by odroid » Mon Jun 17, 2019 1:21 pm

Glad to see again x11/GLES capable Kodi video player. :D
Thank you for sharing the source code with handy .deb packages.

User avatar
meveric
Posts: 10256
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, H2 (N4100), N2
Has thanked: 13 times
Been thanked: 99 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by meveric » Tue Jun 18, 2019 10:47 pm

Ok here's how far I got.
I can build Kodi, Kodi starts, with OpenGL ES, on Desktop, I can start videos, BUT it doesn't use MFC at the moment.
Had to change quite some headers and some of the code to get it working correctly, but that's what I use as well.

I don't want to patch ffmpeg to use hardware decoder, I'd prefer to use MFC, but currently I get:
ERROR: CDVDVideoCodecMFC::Open - No Exynos MFC Decoder/Converter found
From what I understand this is due to:
if (!OpenDevices(V4L2_PIX_FMT_NV12MT)

So I'm trying to figure out what could cause this.

Thanks you very much for all your work!

I've started to build tons of addons like pvr, screensaver and visuals, so I'll try them individually as it should work regardless of the MFC.
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
OverSun
Posts: 1467
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 6 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by OverSun » Tue Jun 18, 2019 10:52 pm

Awesome work, good to go.
I personally decided this is too much of effort while ffmpeg work, it's just over my current busy level. Nice to see someone picked it up.
These users thanked the author OverSun for the post:
Steevee28 (Wed Jun 19, 2019 2:04 am)

Steevee28
Posts: 8
Joined: Tue Jan 30, 2018 4:55 pm
languages_spoken: english, german
ODROIDs: U3
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by Steevee28 » Tue Jun 18, 2019 11:46 pm

@meveric: are you on U3???

My changes may broke other platforms (having newer MFC), because those don't use V4L2_PIX_FMT_NV12MT any longer, afaik. But in this case, the code should fall back to again use the MFC/FIMC combination as in Oversuns' original code instead of directly unswizzling from V4L2_PIX_FMT_NV12MT.

The code is only tested on U3 so far.

User avatar
meveric
Posts: 10256
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, H2 (N4100), N2
Has thanked: 13 times
Been thanked: 99 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by meveric » Wed Jun 19, 2019 12:40 am

yeah I already started investigating, and changing if (!OpenDevices(V4L2_PIX_FMT_NV12MT) to if (!OpenDevices(V4L2_PIX_FMT_NV12M) got hardware decoder to work on the ODROID XU3/XU4, but I encounter some sound issues here and there which can cause the system to completely get stuck.

Maybe OverSun can take a look at it at a later point. I really like your work and used it as a basis to try out more stuff like addons..
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.

Steevee28
Posts: 8
Joined: Tue Jan 30, 2018 4:55 pm
languages_spoken: english, german
ODROIDs: U3
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by Steevee28 » Wed Jun 19, 2019 1:19 am

Strange... I was pretty sure that the fallback would work.... :-|
But instead of using MFC/FIMC, also on XU3/XU4, it may be faster to unswizzle MFC-decoded images in software to prevent slow MMAP memory access. I guess XU3/XU4 uses 16x16 macroblock format...?


Please also note this commit of me: https://github.com/xbmc/xbmc/commit/300 ... 701dfedcfd.
It is necessary on U3 to fix a static tearing line in the upper third of the screen. I'm sure that this line of code is more harmful than useful on XU3/XU4 and should be surrounded by some "if platform == odroid-u3", but I have no idea how to find out the platform I'm on.

When you're eventually happy with your changes, please send me a pull request or patch file! :)


...Btw: On ODROID-U3, I experienced no sound problems at all.

Steevee28
Posts: 8
Joined: Tue Jan 30, 2018 4:55 pm
languages_spoken: english, german
ODROIDs: U3
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by Steevee28 » Wed Jun 19, 2019 2:08 am

OverSun wrote:
Tue Jun 18, 2019 10:52 pm
Awesome work, good to go.
You're welcome, Oversun!!
OverSun wrote:
Tue Jun 18, 2019 10:52 pm
I personally decided this is too much of effort while ffmpeg work, it's just over my current busy level. Nice to see someone picked it up.
Btw: Currently my kodi repo is a fork of yours. What do you think? Should I re-create it as a direct fork of xbmc main repo or will you find some time to update yours again at some point of time?

User avatar
meveric
Posts: 10256
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, H2 (N4100), N2
Has thanked: 13 times
Been thanked: 99 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by meveric » Wed Jun 19, 2019 4:50 am

meveric wrote:
Wed Jun 19, 2019 12:40 am
yeah I already started investigating, and changing if (!OpenDevices(V4L2_PIX_FMT_NV12MT) to if (!OpenDevices(V4L2_PIX_FMT_NV12M) got hardware decoder to work on the ODROID XU3/XU4, but I encounter some sound issues here and there which can cause the system to completely get stuck.

Maybe OverSun can take a look at it at a later point. I really like your work and used it as a basis to try out more stuff like addons..
Ok the timeshift function does not work correctly. If I go forward in a video for 10mins for example, the movie will stop start from 0 and you have a standing picture, but the time goes slowly up until you reach that 10mins and the video starts again.
In the Kodi.log you find entries like:
2019-06-18 20:53:56.392 T:2958029536 WARNING: ActiveAE - large audio sync error: 181931.613345
2019-06-18 20:53:56.455 T:2958029536 WARNING: ActiveAE - large audio sync error: 181881.614345
2019-06-18 20:53:56.519 T:2958029536 WARNING: ActiveAE - large audio sync error: 181831.601594
2019-06-18 20:53:56.519 T:1968755424 ERROR: CDVDAudio::AddPacketsRenderer - timeout adding data to renderer

which will keep going and fill up the log until the video starts playing again.
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.

Steevee28
Posts: 8
Joined: Tue Jan 30, 2018 4:55 pm
languages_spoken: english, german
ODROIDs: U3
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by Steevee28 » Wed Jun 19, 2019 6:36 am

ok, that's strange, too.
On my U3, timeshift works properly. So, I'm currently unable to help. :-|

User avatar
OverSun
Posts: 1467
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Has thanked: 0
Been thanked: 6 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by OverSun » Wed Jun 19, 2019 3:12 pm

Steevee28 wrote:
Wed Jun 19, 2019 2:08 am
Btw: Currently my kodi repo is a fork of yours. What do you think? Should I re-create it as a direct fork of xbmc main repo or will you find some time to update yours again at some point of time?
I'll update my repo.

Steevee28
Posts: 8
Joined: Tue Jan 30, 2018 4:55 pm
languages_spoken: english, german
ODROIDs: U3
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by Steevee28 » Wed Jun 19, 2019 4:10 pm

@meveric: I just had an idea what could cause the problem: You're on arm64, aren't you ?
So the problem may be the timestamp conversion in my code: see PtsReinterpreter union, which I use to convert between double and long. On gcc arm64, afair, sizeof(long) is 8, not 4. If so, this won't work.

Can you please check this?

User avatar
meveric
Posts: 10256
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, H2 (N4100), N2
Has thanked: 13 times
Been thanked: 99 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by meveric » Wed Jun 19, 2019 8:15 pm

Steevee28 wrote:
Wed Jun 19, 2019 4:10 pm
@meveric: I just had an idea what could cause the problem: You're on arm64, aren't you ?
So the problem may be the timestamp conversion in my code: see PtsReinterpreter union, which I use to convert between double and long. On gcc arm64, afair, sizeof(long) is 8, not 4. If so, this won't work.

Can you please check this?
Nope I'm on the XU3/XU4 which is armhf. :)
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.

Steevee28
Posts: 8
Joined: Tue Jan 30, 2018 4:55 pm
languages_spoken: english, german
ODROIDs: U3
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: [Announce] Kodi Leia 18.3 RC1 with MFC support for Ubuntu 16.04

Unread post by Steevee28 » Thu Jun 20, 2019 7:33 pm

NOTE: I cleaned up and re-structured my changes and re-commited them in a new branch Leia-odroid-u3: https://github.com/stsichler/xbmc/tree/Leia-odroid-u3.

It should be easier to now use this as a starting point for merging.

(for some reason github compares this against Owersun:Krypton instead of Owersun:Leia, by default. I'm a git/github novice and don't know how to change that)
These users thanked the author Steevee28 for the post:
AreaScout (Fri Jul 05, 2019 4:25 pm)

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 3 guests