Limelight Embedded and OSMC

Hi all, first of all, sorry for my english.
I have followed @miko guide for use Limelight with OSMC and all work perfect except one thing. I cant do it work if i use the -mapping command in limelight. I use this “sudo java -jar /home/limelight/limelight.jar stream -mapping xbox.map 192.168.1.33 -1080 -60fps” When limelight is loading, a message says “Cant load controler mapping from xbox.map” It only happens if i run limelight from OSMC shortcut. If i use that same script from SSH, it works perfect.

Someone knows what could be the problem?

Thanks!

Is kodi shutting down completely before limelight is started? You can check with top while ot is running from the shortcut.

@mcobit Thanks for answer, but i dont understand you hehe. Sorry. If you mean if kodi is closed completely, i think yes. When i press the shortcut, mediacenter closes and a black screen appears with limelight loading text. Everything works fine if i do not put inside the stream.sh script the mapping option, i mean, stream starts and i can play without problems, but the mapping of the controler isnt ok. If i put the mapping option in the script, the message “Cant load controler mapping from xbox.map” appears and limelight dont load, and after a few seconds, mediacenter restarts again.

How can i know if kodi is really closed? What is ot? ^^

Where is your xbox.map file located? Can you try to use the full path to the file when loading it via script?

Wooo!! Problem solved!! I have the xbox.map file under the same folder than limelight.jar,but seems that if you use it from a shortcut only with -mapping+*.map,it doesn’t pick correctly the file unless you use the full patch. That was the problem. Thanks a lot @mcobit!!

Try

sudo apt-get update
sudo apt-get install default-jdk

S

Hi all, here i am again. I have been playing with pi and kodi a lot and the next step was control kodi and limelight with xbox360 controller with differents button mappings. I have been able to do it, but it only works if i run the initial script from SSH, if i run it from a shortcut on Kodi, the controller not work at all. These are the scripts, if someone can help. I put them in the order i think they execute.

Execute in rc.Local

#!/bin/bash
sudo /usr/bin/xboxdrv --config /home/osmc/xbmc.ini --silent --autofire RT=25 --autofire LT=25 --autofire du=200 --autofire dd=200 --autofire dl=500 --autofire dr=500 &

Shortcut Kodi / Launch SSH (limelight.sh)

#!/bin/sh

sudo openvt -c 7 -s -f clear
sudo openvt -c 7 -s -f echo “Running Limelight from KODI”
sudo su osmc -c “nohup openvt -c 7 -s -f sh /home/osmc/limelight/stream.sh >/dev/null 2>&1 &” &
sudo su osmc -c “sudo sh /home/osmc/limelight/limelight_watchdog.sh &” &
sudo openvt -c 7 -s -f clear
sleep 2
sudo su -c “systemctl stop mediacenter &” &

exit

Stream (stream.sh)

#!/bin/sh

sudo /sbin/modprobe snd-bcm2835
sudo java -jar /home/osmc/limelight/limelight.jar pair
sudo pkill xboxdrv
sudo /usr/bin/xboxdrv --config /home/osmc/padconfig.ini --trigger-as-button --silent & java -jar /home/osmc/limelight/limelight.jar stream -1080 -60fps -bitrate 30000 -mapping /home/osmc/limelight/xbox.map

Watchdog (limelight_watchdog.sh)

#!/bin/bash
sleep 30
while [ true ]; do
VAR1=“$(pgrep java)”
if [ ! “$VAR1” ]; then
sudo pkill xboxdrv
/usr/bin/xboxdrv --config /home/osmc/xbmc.ini --silent --autofire RT=25 --autofire LT=25 --autofire du=200 --autofire dd=200 --autofire dl=500 --autofire dr=500 &
sleep 1
sudo openvt -c 7 -s -f clear
sudo openvt -c 7 -s -f echo “Limelight quit… Starting KODI.”
sleep 1
sudo openvt -c 7 -f clear
sudo su -c “sudo systemctl restart mediacenter &” &
sleep 1
exit
else
sleep 2
fi
done

Padconfig Steam (padconfig.ini)

STEAM Configuration

==================

[xboxdrv]
ui-clear = true
deadzone = 4000
device-name = “Microsoft Xbox 360 Controller”

[ui-axismap]

X1 = ABS_X
Y1 = ABS_Y
X2 = ABS_RX
Y2 = ABS_RY

DPAD_X = ABS_HAT0X
DPAD_Y = ABS_HAT0Y

LT = ABS_BRAKE
RT = ABS_GAS

[ui-buttonmap]

A = BTN_A
B = BTN_B
X = BTN_X
Y = BTN_Y

start = BTN_START
back = BTN_SELECT
guide = BTN_MODE

LB = BTN_TL
RB = BTN_TR
TL = BTN_THUMBL
TR = BTN_THUMBR

EOF

Padconfig Kodi (xbmc.ini)

XBMC Configuration

==================

[xboxdrv]
extra-devices = false
extra-events = false
deadzone = 6000
device-name = “Microsoft Xbox 360 Controller”

[ui-buttonmap]
A = KEY_ENTER
B = KEY_BACKSPACE
X = KEY_X
Y = KEY_ESC

du = KEY_UP
dd = KEY_DOWN
dl = KEY_LEFT
dr = KEY_RIGHT

start = KEY_SPACE
back = KEY_L

white = KEY_C
black = KEY_I

TL = BTN_RIGHT # Left stick buttons
TR = BTN_LEFT # Right stick buttons

RT = KEY_EQUAL # Right trigger
LT = KEY_MINUS # Left trigger

[ui-axismap]
x1=REL_X:10
y1=REL_Y:10

LT^resp:127:255=ABS_Z
RT^resp:127:255=ABS_RZ

EOF

Well, as i said, everything works perfect if i run from SSH, not equal from the Shortcut with System.Exec (/home/osmc/limelight/limelight.sh) Another thing is that i have to use pkill to force xboxdrv to close because if i try to load a new pad config, i get the LIBUSB_ERROR_BUSY error, even using --detach-kernel-driver. Xpad is blacklisted so isnt the problem.

I hope someone can help =)

Thanks!!

Would be interested in an update as to where this is now. I suspect there are more than a few Pi users (Pi2 in particular) who are looking at what else their OSMC setups can do (Steam stream, RetroPie etc)…

Would be helpful if the OP was updated with where it is at…

Thanks

Sorry this might be considered necromancing, but I noticed that this topic is still the top hit and getting a few views and I never did report back with my resolution. So, I typed up the following guide as I did get it working.

First, install Java on OSMC

I used “Java SE Development Kit 8 Update 33 for ARM”. Place this anywhere, but I placed it at the following location and for purposes of making this a copy/paste tutorial, you can do the same. If you choose to place it elsewhere, make sure you update the copy/paste sections with the correct folder locations

Then, download this Limelight pack: MEGA
IMPORTANT - you need to edit the stream.sh file with your rigs static IP instead of mine, or if you want to avoid that, set your gaming rig’s static IP on your router to 192.168.1.214 and don’t bother changing any files.

Place limelight.jar in /moonlight
Place limelight-watchdog.sh limelight.py limelight.sh and stream.sh in /home/osmc

Next, for simple ease of use and laziness I have included (in the stream.sh file) a call to etherwake, you will want to edit this file and change the IP in that etherwake to your own gaming rig’s static IP (set this on your router). But, in order for etherwake to work, you’ll need to install the debian package for it. You also want to set in your computer’s power settings to not require a password on wake, otherwise you still have to go to the gaming right and log in.

sudo apt-get update
sudo apt-get install etherwake

Next, place the Java directory in the directory /opt. I used Filezilla to do this rather than using unix ssh. You can fix the permissions issue by logging in ssh as osmc/osmc and executing the following command to change the password for root and use it under Filezilla
sudo passwd root
Then, enter a new password twice. Once that’s completed, you can log in to OSMC using SFTP in Filezilla using root/whatever password you chose.

sudo update-alternatives --install “/usr/bin/java” “java” “/opt/java/bin/java” 1

This sets the OS to understand that when you execute the command Java, it uses the JDK you’ve placed into /opt, rather than having to type in the entire directory path to wherever you put it.

Next, place limelight.jar in the directory /moonlight (you can change this, I just titled it moonlight as it’s going by the project name now on github. If you change this to limelight, update the downloaded files accordingly.) I have included another version of limelight.jar I had found on a forum somewhere that fixed gurgly audio issues in the package I linked above

Now, another user above gave all the code in the zip files I attached, so thank him for those. He also gave a good indication of how to set the limelight shortcut up in the OSMC default skin. As I don’t use this skin, I have used Advanced Launcher (I use Aeon MQ5) and created an advanced launcher pointing the my limelight.py file, which is a python script that puts everything together, so there’s the option for all the others who choose to use a different skin.

After all this is said and done, when I scroll on over with the remote and select my “Games” linked (advanced launcher pointing to limelight.py) kodi shuts off & sends an etherwake signal to wake up the gaming rig, takes a few seconds to give kodi time to fully close and the rig to wake, launches limelight, opens the steam big picture stream. After I play whatever I was going to play and quit back to steam, I go to Quit on the steam menu and select “Stop Streaming” and limelight-watchdog.sh closes out the stream and reopens Kodi all seamlessly.

I’ll admit, I probably won’t be checking back here often. If these don’t quite work for you right off the bat, check the following

You’ve edited all the IP addresses within all the files to point towards your rig’s static IP - OR - changed your rigs static IP to 192.168.1.214.
You’ve placed all the files in the proper locations. You of course can change these locations, but update the files accordingly.
You’ve installed Java properly

And of course, that you have steam installed, and are using GeForce Experience with a compatible NVIDIA graphics card

Hope this helps somebody, somewhere!

dump limelight and use moonlight-embedded

https://gitlab.com/swe_toast/retrosmc_addons

added this to retrosmc there are some default configurations included for ps4 / xbox / logitech / wii classic controllers so just rehack the shell scripts above and you got everything thats worth having without any shitty java :smile:

@Toast, I’m glad at least he got his guide written. Always useful to record things that work!

Your Moonlight pack, does it include wireless 360 controller (driver) or just wired? PS3?

– Up-to-date: /usr/local/share/mappings
– Up-to-date: /usr/local/share/mappings/xbox360.conf
– Up-to-date: /usr/local/share/mappings/default.conf
– Up-to-date: /usr/local/share/mappings/rumblepad2.conf
– Up-to-date: /usr/local/share/mappings/dualshock4.conf

pushing an update as we speak

and my wiiconf also :smiley:

less than a minute ago Jul 09, 2015 6:37am
Toast pushed to branch master at Toast / retrosmc_addons
8cfa1f57   modified: moonlight_embedded.tar.gz

enjoy

guess i could rewrite the stuff he did for moonlight and make it work so that there is an option to launch without retrosmc

That would be handy for those people who don’t use retrosmc… I’m unsure which “final” setup I will end up with but I have considered retrosmc+moonlight or retropie+kodi+moonlight… different ways to get the same result

im actually scrapping retrosmc for ignition.io since i was apart of their kickstarter, emulationstation is really nice and all but the ignition.io framework is gonna kick emulationstation ass now that igntition.io comes out of private development.

https://www.kickstarter.com/projects/1717505434/ignition-a-social-retro-gaming-os-for-the-raspberr/description

check out the vid

this emulator support so much more then the raspberry pi

Well the Dev seems to like it all private. Only backers on his forum. Lots of disgruntled posts from backers saying its 7m overdue and they want money back. Pity, it looks quite clever idea.

I wonder if/when a PUBLIC release will be available? Your a KS backer… any ideas?

https://github.com/alexjstubbs/ignition-buildroot

people tend to complain if its not done in the first 15m of announcement, normal users seldom get that coding isnt always easy.

its semi open you can build it yourself and that is my plan for osmc again this is gonna kick emulationstation and retroplayer for kodi ass since its a social network platform around an emulation kinda steam for retrogames :smiley: