Modifying Kodi to use as launcher
#16
(2021-06-27, 17:27)ungeskriptet Wrote: Hello,
I'm trying to build Kodi for my FireTV, however I'm getting stuck at the fifth step in the build guide. I'm building inside an Ubuntu Docker container on an Arch Linux host and this is my error message:
ixemusuneh (paste)
What is wrong here? Does samba-gplv3 cause this issue?
Code:
/root/android-tools/android-ndk-r22b//toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/bits/swab.h:41:27: note: previous definition is here __BIONIC_SWAB_INLINE void swab(const void* __void_src, void* __void_dst, ssize_t __byte_count) {

It looks like you're using NDK r22b - the build guide specifies r20, revisions are not interchangeable nor necessarily backwards compatible. Try using r20b renamed to r20 and see if that helps, it may be that the swab() definition is different in r20 for which the kodi source is written.
Reply
#17
(2021-06-28, 20:35)SlartiBartFastFjord Wrote:
Code:
/root/android-tools/android-ndk-r22b//toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/bits/swab.h:41:27: note: previous definition is here __BIONIC_SWAB_INLINE void swab(const void* __void_src, void* __void_dst, ssize_t __byte_count) {

It looks like you're using NDK r22b - the build guide specifies r20, revisions are not interchangeable nor necessarily backwards compatible. Try using r20b renamed to r20 and see if that helps, it may be that the swab() definition is different in r20 for which the kodi source is written.
Thanks, that worked! Had some issues but the went away after only compiling with 2 cores. Now it works.
Here's my build for armv7 (FireTV): https://drive.google.com/file/d/1x2WCOi6oaOfDQm-7njhU2nOXlL_1LZ65/view?usp=sharing (md5: 78341a0c36e7aeb0fecc09ca011c1f5d)
Reply
#18
Can anyone share a build for shield tv?

Thx
Reply
#19
Ok, new update: Modified and built Kodi 20.0b1rc1 for 32-bit ARM (armeabi-v7a) Sony XR-55A90J on Ubuntu 22.04 LTS in a WSL on Windows. This time I also added a `ClearToHome()` function so that home button can be mapped to home screen and clear window stack.

I. Ensure there is enough memory for the WSL and gradle inside the WSL

Stop all WSL instances and the service:
Code:
C:\Users\XXX>wsl --shutdown

Create %USERPROFILE%/.wslconfig with the following content:
Code:
[wsl2]
memory=8GB # Set the memory available to WSL
processors=2 # Set the number of virtualized processors for WSL

II. Build kodi follow instructions at https://github.com/xbmc/xbmc/blob/master...Android.md with changes

I had problems with running `make`with multiple processors so I ran all `make` commands without a `-j` flag.

4. Get the source code
Change the
Code:
to
Code:
git clone -b Android-launcher https://github.com/txret/xbmc kodi
to get the modified version of the source. I am still trying out which AndroidManifest.xml options gives the snappiest feedback, feel free to play around with them yourself as the manifest is only added in the last `make apk` step (so repackaging with different options is quick). Diff of source changes.

7. Build Kodi
There seems to be an error somewhere in the makefiles resulting the latest version of `flatbuffers/flatc` being built rather than the bundled version so after having run `make -C tools/depends/target/cmakebuildsys` and `make -C tools/depends/target/cmakebuildsys BUILD_DIR=$HOME/kodi-build` correct this manually prior to building Kodi:
Code:
~/kodi$ tar xzf ~/android-tools/xbmc-tarballs/flatbuffers-2.0.0.tar.gz -C ~
~/kodi$ cd ~/flatbuffers-2.0.0
~/flatbuffers-2.0.0$ make
~/flatbuffers-2.0.0$ cp flatc ~/android-tools/xbmc-depends/x86_64-linux-gnu-native/bin/flatc
edited: worked correctly when building rc1

8. Package
Prior to `make apk`increase the gradle memory and ensure Android X support by editing `~/kodi/tools/android/packaging/gradle.properties` to look like:
Code:
android.useAndroidX=true
org.gradle.jvmargs=-XX:MaxHeapSize=1024m -Xmx2048m
edit: Probably not necessary when building rc1 and later

9. Install
To install as launcher connect to TV by ADB and run
Code:
~/kodi$ adb connect xxx.xxx.xxx.xxx:5555
~/kodi$ adb install kodiapp-armeabi-v7a-debug.apk
Then launch Kodi as a normal app from the factory launcher and go through the initial setup (storage permission etc). Once Kodi is up and running disable the factory launcher (the commands are `uninstall` but it's only disabled in reality) by adb:
Code:
~/kodi$ adb shell pm uninstall -k --user 0 com.google.android.apps.tv.launcherx
~/kodi$ adb shell pm uninstall -k --user 0 com.google.android.tungsten.setupwraith

Related notes
One suggestion is to use the open source Key Mapper (https://f-droid.org/packages/io.github.s...keymapper/ or https://github.com/keymapperorg/KeyMapper) to remap keys as needed to easily reach Android Settings, Sonys QuickLaunch app, scroll apps not made for non-touch screens, control sound system etc. Personally I have a IR programmable air mouse remote with keyboard from Amazon.
Reply

Logout Mark Read Team Forum Stats Members Help
Modifying Kodi to use as launcher0