[How-To] Odroid C2 Kodi on the Framebuffer.

Guides written by the community, for the community, and only guides!

[How-To] Odroid C2 Kodi on the Framebuffer.

Postby apokalypz » Fri May 27, 2016 5:56 am

Hardkernel finally released the AML_LIBS for the C2 that allow hardware decoding! So I made a PKGBUILD for it (well actually I just tweaked my C1 PKGBUILD to use the C2 libs and build flags.) Enjoy.


Step 1 (Prep and Download):
•Make sure you have 'base-devel' and 'git' packages.
•Create a directory to hold the repository directory.
•cd into that directory and type $this->bbcode_second_pass_code('', 'git clone https://aur.archlinux.org/kodi-c2-fb.git')
•cd to the new directory.


Step 2 (Build):
•To build the package will take a couple hours, so I recommend you do this in a 'screen' window. If you don't know what that is, google it, it's a Godsend for long tasks in ssh.
•Type $this->bbcode_second_pass_code('', 'makepkg -s') to start the package build process.
•The build text will not show onscreen, it will be sent to a log instead. If you want to check the status of the actual configure/build, cd into the src/xbmc-****** directory and cat the build.log file.


Step 3 (Install):
•When it is done making the package, just install the kodi-c2-fb and the kodi-c2-eventclients-fb with "pacman -U"
•Install any other packages for optional functionality. Eg. Pulseaudio, polkit, etc.


Note: It does work, however it seems pretty buggy. While testing it so far, I ran into numerous issues. EDIT: See bottom of post for updated info.

First, the refresh rate change to match the video doesn't work, it kicks me to an unsupported mode permanently until restart.

Second, moving between menu items is kinda jittery, this is new and wasn't existent in my test builds a few weeks ago.

Third, DTS seems passthrough cuts out every couple seconds, though could be because my DTS tracks are 1,536Kbps and that might be too much for it? Also there is only support for stereo, multichannel is only available via passthrough.

Finally, there is an issue with it kodi reporting skipped frames, I don't notice any choppiness so I don't think it really is, the C1 had the same problem.

EDIT: Update on the bugginess:
1. The choppy menu movement is on mdrjr's list of things to fix in the Mali fb driver. He suspects the vsync implementation. Hopefully will be fixed soon.

2. The method I use to block the console from appearing over the kodi GUI is insufficient, I hope update the PKGBUILD with a new, and much better, implementation in the coming days.

3. The random audio drops on DTS and transcoded AC3 passtgrough seems to be related to the audio driver and the sysfs file in /sys/class/audiodsp/digital_codec" I guess it must be updated with the correct codec ("3" for DTS and "2" for AC3), however doing so while kodi is running doesn't change anything. The only way to get it to work is to update the file's value prior to opening kodi, but that causes PCM to distort and doesn't work 100% of the time. It looks like HK knows of this issue and may be working on a fix (though I only saw it talked about for android...)

4. The black screen problem after having Kodi automatically match the refresh rate seems to be fixed by disabling HDMI hotplugging in the boot.ini file as "setenv hpd true". Note: If you add anything to the "setenv bootargs, it may become too long and the whole line may not be parsed, a fix is to split the line into two lines with different variable names (eg. setenv bootargs0 "..." and setenv bootargs1 "...") and combine them in a third line (setenv bootargs " ${bootargs0} ${bootargs1}").

5. Going over a few patches, I learned that the "skipped" frames statistic is incorrect. There are, infact, no skipped frames. There are patches to disable the skipped frame counter, though it I see that as unnecessary.
Last edited by apokalypz on Tue Jun 14, 2016 1:22 pm, edited 2 times in total.
apokalypz
 
Posts: 41
Joined: Sun Apr 06, 2014 6:13 pm

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby ryazor » Fri May 27, 2016 3:24 pm

Note: This is more or less a duplicate of my reply on the Odroid forums.

Thank you Apokalypz, I've been waiting for a working PKGBUILD.

Build was successful. Kodi was able to run the two Kodi H.265 1080p samples with little to none frame skips. Unfortunately after starting the second HEVC stream the Kodi GUI seemed to disappear and Kodi eventually crashes after the playback. High bandwidth HEVC MKVs also seem to cause frame dropping (I tested 25, 55 and 100 mbps, only 25 played flawlessly).

At first I couldn't install a video plugin (Twitch). However, I was able to install it after a Kodi restart. Twitch and YouTube work right now (both up to 720p).

Also I often notice the console output overlaying the Kodi FB image when selecting menu items.

I'm going to try to build the HTSP DVR plugin and test DVB-T2 HEVC streams.

Thank you very much so far, your work is a great leap from my point of view.
ryazor
 
Posts: 2
Joined: Sun Nov 14, 2010 5:19 pm

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby apokalypz » Tue Jun 14, 2016 1:40 pm

The h.265 high bitrate video frame dropping might be due to a performance hit on extra memcopies for each demuxed frame. It seems wrxtasy has a patch for it. I don't have any high bitrate h.265 vids, can you apply wrxtasy's patch and see if it helps?: https://github.com/wrxtasy/LibreELEC.tv ... cket.patch
apokalypz
 
Posts: 41
Joined: Sun Apr 06, 2014 6:13 pm

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby it9exm » Sat Aug 06, 2016 1:41 pm

Hi,
Kodi for Odroid C2 is not getting compiled because of this:

http://forum.kodi.tv/showthread.php?tid=283382

Please update curl to 7.50.1 in the official repository, it should fix the build as stated here:

http://forum.kodi.tv/showthread.php?tid=283382&pid=2388535#pid2388535
it9exm
 
Posts: 12
Joined: Sat Aug 06, 2016 1:35 pm

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby it9exm » Mon Aug 08, 2016 8:19 am

Curl has been updated, now i'm getting this:

$this->bbcode_second_pass_code('', '==> Starting package_kodi-c2-eventclients-fb()...
make -C tools/EventClients
make[1]: Entering directory '/home/alarm/kodi-c2-fb/src/xbmc-cdb7704d1174395f399657fd3f562fe236516b9f/tools/EventClients'
/bin/sh: python: command not found
cd Clients/WiiRemote && \
g++ -O2 -DNDEBUG=1 -march=armv8-a -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -I/home/alarm/kodi-c2-fb/src/c2_mali/fbdev/mali_headers -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DNDEBUG=1 -march=armv8-a -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -I/home/alarm/kodi-c2-fb/src/c2_mali/fbdev/mali_headers -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DNDEBUG=1 -march=armv8-a -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -I/home/alarm/kodi-c2-fb/src/c2_mali/fbdev/mali_headers -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/lib/mali-egl -L/usr/lib/aml_libs -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/lib/mali-egl -L/usr/lib/aml_libs -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/lib/mali-egl -L/usr/lib/aml_libs CWIID_WiiRemote.cpp -lcwiid -lbluetooth -DICON_PATH="\"/usr/share/pixmaps/kodi/\"" -DCWIID_OLD -o WiiRemote
In file included from CWIID_WiiRemote.h:51:0,
from CWIID_WiiRemote.cpp:27:
/usr/include/cwiid.h:344:2: error: 'bdaddr_t' does not name a type
bdaddr_t bdaddr;
^~~~~~~~
/usr/include/cwiid.h:360:29: error: 'bdaddr_t' was not declared in this scope
cwiid_wiimote_t *cwiid_open(bdaddr_t *bdaddr, int flags);
^~~~~~~~
/usr/include/cwiid.h:360:39: error: 'bdaddr' was not declared in this scope
cwiid_wiimote_t *cwiid_open(bdaddr_t *bdaddr, int flags);
^~~~~~
/usr/include/cwiid.h:360:47: error: expected primary-expression before 'int'
cwiid_wiimote_t *cwiid_open(bdaddr_t *bdaddr, int flags);
^~~
/usr/include/cwiid.h:360:56: error: expression list treated as compound expression in initializer [-fpermissive]
cwiid_wiimote_t *cwiid_open(bdaddr_t *bdaddr, int flags);
^
/usr/include/cwiid.h:361:37: error: 'bdaddr_t' was not declared in this scope
cwiid_wiimote_t *cwiid_open_timeout(bdaddr_t *bdaddr, int flags, int timeout);
^~~~~~~~
/usr/include/cwiid.h:361:47: error: 'bdaddr' was not declared in this scope
cwiid_wiimote_t *cwiid_open_timeout(bdaddr_t *bdaddr, int flags, int timeout);
^~~~~~
/usr/include/cwiid.h:361:55: error: expected primary-expression before 'int'
cwiid_wiimote_t *cwiid_open_timeout(bdaddr_t *bdaddr, int flags, int timeout);
^~~
/usr/include/cwiid.h:361:66: error: expected primary-expression before 'int'
cwiid_wiimote_t *cwiid_open_timeout(bdaddr_t *bdaddr, int flags, int timeout);
^~~
/usr/include/cwiid.h:361:77: error: expression list treated as compound expression in initializer [-fpermissive]
cwiid_wiimote_t *cwiid_open_timeout(bdaddr_t *bdaddr, int flags, int timeout);
^
/usr/include/cwiid.h:399:24: error: 'bdaddr_t' was not declared in this scope
int cwiid_find_wiimote(bdaddr_t *bdaddr, int timeout);
^~~~~~~~
/usr/include/cwiid.h:399:34: error: 'bdaddr' was not declared in this scope
int cwiid_find_wiimote(bdaddr_t *bdaddr, int timeout);
^~~~~~
/usr/include/cwiid.h:399:42: error: expected primary-expression before 'int'
int cwiid_find_wiimote(bdaddr_t *bdaddr, int timeout);
^~~
/usr/include/cwiid.h:399:53: error: expression list treated as compound expression in initializer [-fpermissive]
int cwiid_find_wiimote(bdaddr_t *bdaddr, int timeout);
^
In file included from CWIID_WiiRemote.cpp:27:0:
CWIID_WiiRemote.h:131:3: error: 'bdaddr_t' does not name a type
bdaddr_t m_btaddr;
^~~~~~~~
CWIID_WiiRemote.cpp: In member function 'void CWiiRemote::SetBluetoothAddress(const char*)':
CWIID_WiiRemote.cpp:159:16: error: 'bdaddr_t' does not name a type
static const bdaddr_t b = {{0, 0, 0, 0, 0, 0}}; /* BDADDR_ANY */
^~~~~~~~
CWIID_WiiRemote.cpp:161:21: error: 'm_btaddr' was not declared in this scope
str2ba(btaddr, &m_btaddr);
^~~~~~~~
CWIID_WiiRemote.cpp:161:29: error: 'str2ba' was not declared in this scope
str2ba(btaddr, &m_btaddr);
^
CWIID_WiiRemote.cpp:163:12: error: 'm_btaddr' was not declared in this scope
bacpy(&m_btaddr, &b);
^~~~~~~~
CWIID_WiiRemote.cpp:163:23: error: 'b' was not declared in this scope
bacpy(&m_btaddr, &b);
^
CWIID_WiiRemote.cpp:163:24: error: 'bacpy' was not declared in this scope
bacpy(&m_btaddr, &b);
^
CWIID_WiiRemote.cpp: In member function 'bool CWiiRemote::Connect()':
CWIID_WiiRemote.cpp:336:40: error: 'm_btaddr' was not declared in this scope
m_wiiremoteHandle = cwiid_connect(&m_btaddr, flags);
^~~~~~~~
CWIID_WiiRemote.cpp:336:55: error: 'cwiid_open' cannot be used as a function
m_wiiremoteHandle = cwiid_connect(&m_btaddr, flags);
^
CWIID_WiiRemote.cpp: In function 'int main(int, char**)':
CWIID_WiiRemote.cpp:736:25: error: 'hci_get_route' was not declared in this scope
if (hci_get_route(NULL) < 0)
^
make[1]: *** [Makefile:10: Clients/WiiRemote/WiiRemote] Error 1
make[1]: Leaving directory '/home/alarm/kodi-c2-fb/src/xbmc-cdb7704d1174395f399657fd3f562fe236516b9f/tools/EventClients'
make: *** [Makefile:356: eventclients] Error 2
==> ERROR: A failure occurred in package_kodi-c2-eventclients-fb().
Aborting...
')

For python i created a symlink, but the error is still there.
it9exm
 
Posts: 12
Joined: Sat Aug 06, 2016 1:35 pm

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby moonman » Mon Aug 08, 2016 8:43 am

Take this https://github.com/archlinuxarm/PKGBUIL ... 1/PKGBUILD
as an example to replace python with python2
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby it9exm » Mon Aug 08, 2016 9:13 am

Python is not the problem, i had to remove cwiid from core and replace it with with cwiid-git, not before having installed bluez-git too. And now makepkg started again building kodi because there isn't a way to build just kodi-c2-eventclients-fb. This is a real pita.
it9exm
 
Posts: 12
Joined: Sat Aug 06, 2016 1:35 pm

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby it9exm » Mon Aug 08, 2016 11:19 am

Another update:

$this->bbcode_second_pass_code('', '==> Starting package_kodi-c2-eventclients-fb()...
make -C tools/EventClients
make[1]: Entering directory '/home/alarm/kodi-c2-fb/src/xbmc-cdb7704d1174395f399657fd3f562fe236516b9f/tools/EventClients'
cd Clients/WiiRemote && \
g++ -O2 -DNDEBUG=1 -march=armv8-a -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -I/home/alarm/kodi-c2-fb/src/c2_mali/fbdev/mali_headers -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DNDEBUG=1 -march=armv8-a -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -I/home/alarm/kodi-c2-fb/src/c2_mali/fbdev/mali_headers -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DNDEBUG=1 -march=armv8-a -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -I/home/alarm/kodi-c2-fb/src/c2_mali/fbdev/mali_headers -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/lib/mali-egl -L/usr/lib/aml_libs -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/lib/mali-egl -L/usr/lib/aml_libs -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/lib/mali-egl -L/usr/lib/aml_libs CWIID_WiiRemote.cpp -lcwiid -lbluetooth -DICON_PATH="\"/usr/share/pixmaps/kodi/\"" -DCWIID_OLD -o WiiRemote
mkdir -p /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/bin
cp -a Clients/WiiRemote/WiiRemote /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/bin/kodi-wiiremote
cp -a Clients/J2ME\ Client/j2me_remote.py /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/bin/kodi-j2meremote
cp -a Clients/PS3\ BD\ Remote/ps3_remote.py /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/bin/kodi-ps3remote
cp -a Clients/PS3\ Sixaxis\ Controller/ps3d.py /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/bin/kodi-ps3d
cp -a Clients/Kodi\ Send/kodi-send.py /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/bin/kodi-send
mkdir -p /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/lib/python2.7/site-packages/kodi
echo 'ICON_PATH="/usr/share/pixmaps/kodi/"' > /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/lib/python2.7/site-packages/kodi/defs.py
cp -a lib/python/* /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/lib/python2.7/site-packages/kodi/
cp -a Clients/PS3\ BD\ Remote/ps3_remote.py /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/lib/python2.7/site-packages/kodi/
mkdir -p /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/include/kodi
cp -a lib/c++/* /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/include/kodi/
mkdir -p /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/share/pixmaps/kodi
cp -a icons/* /home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/usr/share/pixmaps/kodi/
make[1]: Leaving directory '/home/alarm/kodi-c2-fb/src/xbmc-cdb7704d1174395f399657fd3f562fe236516b9f/tools/EventClients'
mv: cannot stat '/home/alarm/kodi-c2-fb/pkg/kodi-c2-eventclients-fb/kodi/*': No such file or directory
==> ERROR: A failure occurred in package_kodi-c2-eventclients-fb().
Aborting...
')

I have no words.
it9exm
 
Posts: 12
Joined: Sat Aug 06, 2016 1:35 pm

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby moonman » Mon Aug 08, 2016 8:06 pm

https://github.com/archlinuxarm/PKGBUIL ... t/PKGBUILD

Remove everything after make DESTDIR="$pkgdir" eventclients WII_EXTRA_OPTS=-DCWIID_OLD
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: [How-To] Odroid C2 Kodi on the Framebuffer.

Postby it9exm » Tue Aug 09, 2016 12:37 pm

Thank you, this time it was ok.
I also compiled and installed kodi-addon-pvr-hts-git (and kodi-platform-git) which i need, but it fails to load when i enable it from kodi.

This is the log entry:

$this->bbcode_second_pass_code('', '14:15:30 T:547523043328 NOTICE: PVRManager - stopping
14:15:31 T:546945626352 NOTICE: PVRManager - starting up
14:15:31 T:546400366832 ERROR: ADDON: Dll Tvheadend HTSP Client - Client returned bad status (6) from Create and is not usable
14:15:31 T:546400366832 WARNING: UpdateAndInitialiseClients - failed to create add-on Tvheadend HTSP Client, status = 6
14:15:31 T:546400366832 WARNING: UpdateAndInitialiseClients - failed to load the dll for add-on Tvheadend HTSP Client, disabling it
14:15:46 T:547523043328 ERROR: GetDirectory - Error getting addons://disabled/xbmc.pvrclient
14:15:46 T:547523043328 ERROR: CGUIMediaWindow::GetDirectory(addons://disabled/xbmc.pvrclient) failed
')
it9exm
 
Posts: 12
Joined: Sat Aug 06, 2016 1:35 pm

Next

Return to Community Guides

Who is online

Users browsing this forum: No registered users and 2 guests