Boblight on android (shield)
#1
Sad 
Hello,
I've been putting together a ambilight clone system based on boblightd on a raspberry and Ardunio uno. I have got it all working on windows kodi, client -> daemon, lights work when i play in windows kodi.
However this system was supposed to go in the livingroom tv set that uses a nVidia Shield console. I install the the addon and it ask for a binary addon and if i want to download it, (this doesnt work, neitehr did it on windows)
On windows i had to put the libboblight-win32.0.dll file in the C:\Users\<user>\AppData\Roaming\Kodi\addons\script.xbmc.boblight\resources\lib path.

From reading around i understand that for android it expects the file libboblight.so file placed in data/org.xbmc.kodi/files path, however this does not work. I've tried putting the file in other logical places, like inside the the plugin directory, inside the lib directory for the plugin. Nothing seems to work, so i'm hoping someone here has solved this problem. Also there is 3 libboblight.so files available. In desperation i have tried all 3 of them to no avail;
http://mirrors.kodi.tv/build-deps/addon-...bboblight/

androidarm64
android
androidx86


I've spent a lot of time getting the system to work and soldering led strips and all that, was a fun learning experience. Now i feel this one file is all thats between med and the fruits of my labor Sad
Turning to the forums for help and/or solutions, any experiences are welcome.
if you got it working please tell me exactly what file and path you had to use.

(kodi 16.1)
Here is a kodi.log from starting up with the kodi-boblight addon
http://pastebin.com/wNyh18df
I find around line 1075 its something fishy

Ps:
Tested to install boblight service addon on a friends shield console with same result so i dont think its a unique problem with mine.
Reply
#2
You need the android file (not arm64 and not x86) - android is a bitch when it comes to pathes were it allows to load libraries from and where not. The location i have choosen for the addon should be generic for android - no clue why it doesn't work on the shield. Are you using Kodi or SPMC?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
Hello Memphiz and thanks for your reply.

I'm using the stock kodi from google play. Pretty much virgin part from some shared database\folder redirection. To the best of my knowledge folder redirection shold not interfere with the addons like this. It stores the settings files on a smb share only. I've also removed the advancedsettings.xml and disabled all this with no result. Any idea on the line in the log file? Line 1075 or 1076 i think it was.

Edit: some #$@% autocorrect errors Smile
Reply
#4
Is there any way to investigate further is going wrong here? I'm sure there are more people than me with a shield console that would like to add boblight to it. Maybe the plugin needs a litte tuning to work on the shield. I am far from any programmer or android wiz. Its not really providing any useful information in the logs, not much to work with there.

It seems to me the download will fail no matter what, but it should accept the file when manaully put at the correct location. I have not gotten 100% confirmation that the path data/org.xbmc.kodi/files is correct. It would be more logicial for the library to reside within the plugin directory. This is how it behaves on windows.
Reply
#5
Any news on this? I've also the same problem and can't make the Addon working. I've tried different paths but with no luck.
Reply
#6
The path for the library is correct. On android anything is restricted - we can't load a library from the addon directory (like on windows) - it simply is denied by the android operating system. Might be that on the shield even loading from the files directory is forbidden.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#7
Is there any other path that might be accessible? Anything I could check?
Or an solution to make this path accessible? Maybe as root?

Gesendet von meinem ONEPLUS A3003 mit Tapatalk
Reply
#8
I have no clue tbh. Android is not my platform of knowledge
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#9
(2017-02-18, 13:52)Gizmoh Wrote: Is there any other path that might be accessible? Anything I could check?
Or an solution to make this path accessible? Maybe as root?

Gesendet von meinem ONEPLUS A3003 mit Tapatalk

Only way I got this working was by Rooting by shield.... then you get access to the file location.

I found that a little fiddly... have you taken a look at Hyperion as a alternative?
Reply
#10
In case anyone is still struggling with this, I found there are two issues with this plugin on Nvidia Shield TV at the moment.

1. Contrary to what is said above, I found that I needed the androidarm64 version of the library, not the android version. It is possible that Shield TV moved to aarch64 with the upgrade to Marshmallow. I've submitted a patch to the github repository to fix the download script.

2. As mentioned in post #6, everything in Android is restricted. I ran into a SElinux permission error that may be difficult to fix without adb and/or root access. Running '$ restorecon /data/data/org.xbmc.kodi/files/libboblight.so' fixed this for me, but I don't know if that requires root.
Reply
#11
Wanted to come here and thank fuzzms, Those last 2 steps were what I needed to get mine working properly. Also wanted to add for the OP (any anyone else) that you can also run the boblightd directly on the Nvidia shield as it has more than enough resources to play a 4k video and run the daemon. You will have to muck about with the permissions or just run it as root. Since, as near as I can tell, you have to root the shield anyway there's not much of a downside and it's one less gadget running.

To get this working you need to download the Android NDK from google and make a standalone tool chain. There's lots of tutorials online to do that, but the quick method is basically this.

Download and unpack it and run something like this to create the tool chain.
Code:
$NDK/build/tools/make-standalone-toolchain.sh \
--arch=aarch64 --install-dir=~/tmp/android-tool-chain

Next setup some variables you'll need so compiling works
Code:
export PATH=~/tmp/android-tool-chain/bin:$PATH
export CC=aarch64-linux-android-gcc
export CXX=aarch64-linux-android-g++
export CFLAGS="-g -O2 -fPIE -DHAVE_PTHREADS"
export CXXFLAGS="-g -O2 -fPIE -DHAVE_PTHREADS"

Download the boblight source and then configure and compile it
Code:
./configure --host=aarch64-unknown-linux-gnu --without-portaudio --without-libusb --without-spi --without-x11 --without-opengl
make

Now you should should have in the src folder boblightd that should be cross compiled to run on the shield. Use your favorite ssh app to put it up on to the shield along with a configuration file for it. Ensure you run it as a user that has permissions to access /dev/ttyACM0. Plugin your arduino and run boblightd and you should be good to go.
Reply
#12
(2017-08-22, 00:07)elmerfud_ Wrote: Wanted to come here and thank fuzzms, Those last 2 steps were what I needed to get mine working properly. Also wanted to add for the OP (any anyone else) that you can also run the boblightd directly on the Nvidia shield as it has more than enough resources to play a 4k video and run the daemon. You will have to muck about with the permissions or just run it as root. Since, as near as I can tell, you have to root the shield anyway there's not much of a downside and it's one less gadget running.

To get this working you need to download the Android NDK from google and make a standalone tool chain. There's lots of tutorials online to do that, but the quick method is basically this.

Download and unpack it and run something like this to create the tool chain.
Code:
$NDK/build/tools/make-standalone-toolchain.sh \
--arch=aarch64 --install-dir=~/tmp/android-tool-chain

Next setup some variables you'll need so compiling works
Code:
export PATH=~/tmp/android-tool-chain/bin:$PATH
export CC=aarch64-linux-android-gcc
export CXX=aarch64-linux-android-g++
export CFLAGS="-g -O2 -fPIE -DHAVE_PTHREADS"
export CXXFLAGS="-g -O2 -fPIE -DHAVE_PTHREADS"

Download the boblight source and then configure and compile it
Code:
./configure --host=aarch64-unknown-linux-gnu --without-portaudio --without-libusb --without-spi --without-x11 --without-opengl
make

Now you should should have in the src folder boblightd that should be cross compiled to run on the shield. Use your favorite ssh app to put it up on to the shield along with a configuration file for it. Ensure you run it as a user that has permissions to access /dev/ttyACM0. Plugin your arduino and run boblightd and you should be good to go.  
Can't you just share the source with us?
That would make my live easier Wink

/edit:
As expected it failed.

07:35:04 {master} ~/github/boblight$ ./configure --host=aarch64-unknown-linux-gnu --without-portaudio --without-libusb --without-spi --without-x11 --without-opengl
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for aarch64-unknown-linux-gnu-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for aarch64-unknown-linux-gnu-gcc... aarch64-linux-android-gcc
checking whether the C compiler works... no
configure: error: in `/home/libreelec/github/boblight':
configure: error: C compiler cannot create executables
See `config.log' for more details.
07:35:29 {master} ~/github/boblight$ 


configure:3155: checking for aarch64-unknown-linux-gnu-gcc
configure:3182: result: aarch64-linux-android-gcc
configure:3451: checking for C compiler version
configure:3460: aarch64-linux-android-gcc --version >&5
./configure: line 3462: aarch64-linux-android-gcc: command not found
configure:3471: $? = 127
configure:3460: aarch64-linux-android-gcc -v >&5
./configure: line 3462: aarch64-linux-android-gcc: command not found
configure:3471: $? = 127
configure:3460: aarch64-linux-android-gcc -V >&5
./configure: line 3462: aarch64-linux-android-gcc: command not found
configure:3471: $? = 127
configure:3460: aarch64-linux-android-gcc -qversion >&5
./configure: line 3462: aarch64-linux-android-gcc: command not found
configure:3471: $? = 127
configure:3491: checking whether the C compiler works
configure:3513: aarch64-linux-android-gcc -g -O2 -fPIE -DHAVE_PTHREADS   conftest.c  >&5
./configure: line 3515: aarch64-linux-android-gcc: command not found
configure:3517: $? = 127
configure:3555: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "boblight"
| #define PACKAGE_TARNAME "boblight"
| #define PACKAGE_VERSION "2.0"
| #define PACKAGE_STRING "boblight 2.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "boblight"
| #define VERSION "2.0"
| /* end confdefs.h.  */

| int
| main ()
| {

|   ;
|   return 0;
| }
configure:3560: error: in `/home/libreelec/github/boblight':
configure:3564: error: C compiler cannot create executables
See `config.log' for more details.


Any ideas?
Reply
#13
It looks like your NDK tool chain isn't complete or isn't in your path based on the command not found errors.
Reply
#14
Hi,
I have HTPC and a DIY led strips connected to Arduino uno, using Boblight for kodi I use this for few years...

the HTPC is getting old and I want to replace it, maybe with Nvidia Shield, I read the topic but not sure if in the bottom line it is possible to connect my leds to the shields without any problems?
I am not familiar with all the linux commands described above, but if there is a stable solution to configure my setup with the shield, I will highly consider to replace my HTPC.

can someone please explain for me the bottom line?
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
#15
Yes it's possible to have the Nvidia Shield TV to run boblightd and drive your LEDs.  It's not exactly easy, but it is stable when you get it going.  I'm not very familiar with Android development, and I don't really have the time to figure it all out.  Perhaps someone more familiar with building APK's with native binaries could make the whole process much easier.  For now the way I do it is to just build the binary using the NDK, transfer it over to the Shield and run it.  My Shield is rooted with Magisk and I also have SSHelper installed.  In order to get this to work for you successfully (at this point) I would recommend you have some Linux experience and know how to use ADB to side load apk's.  

First, the standard boblight source won't compile with the Android NDK.  My modified source here.
https://github.com/elmerfud/boblight

Next, you need to download the Android NDK.  I recommend getting version r16b.  It's the version I used, it's not the newest and I don't know if newer versions work or not so just get this version. 
https://developer.android.com/ndk/downlo...eases.html

I'll try and cover the steps to compile as detailed as I can. I'm assuming you have a Linux box with the standard suite of development tools installed. 

1. Download the Android NDK and transfer it to /opt
2. Navigate to /opt and unpack the NDK
Code:
cd /opt
unzip android-ndk-r16b-linux-x86_64.zip
3. Navigate in to the NDK
Code:
cd android-ndk-r16b
4. Make the standalone tool chain
Code:
./build/tools/make-standalone-toolchain.sh --arch=arm64 --install-dir=/opt/android-tool-chain
5. Navigate back to /opt and get the boblight code
Code:
cd /opt
git clone https://github.com/elmerfud/boblight.git
6. Navigate in to the boblight code directory
Code:
cd boblight
7. Setup required shell variables to compile with the tool chain.
Code:
export PATH=/opt/android-tool-chain/bin:$PATH
export CC=aarch64-linux-android-clang
export CXX=aarch64-linux-android-clang++
export CFLAGS="-g -O2 -fPIE -DHAVE_PTHREADS"
export CXXFLAGS="-g -O2 -fPIE -DHAVE_PTHREADS"
export LDFLAGS="-fPIE -pie"
8. Configure and build boblight
Code:
./configure --host=aarch64-unknown-linux-gnu --without-portaudio --without-libusb --without-spi --without-x11 --without-opengl
make
9. At this point you should have a boblightd binary at /opt/boblight/src/boblightd.  Transfer this to your Shield along with the config file you need to drive your lights.
10. Running this in your Shield will require you to change the permissions of the binary so it can be executed.  Additionally you'll either have to run it as root, or adjust all the required permissions to allow it to read /dev/ttyACM0 or which ever device your outputting to.
Reply

Logout Mark Read Team Forum Stats Members Help
Boblight on android (shield)0