Tuesday, 29 March 2016

Kodi, Moonlight, 360 controllers, Mounted network shares, and RetroPie v3.6

Alright, after several days of configurations I figured I would share my progress and also ask for a bit of help.

I have everything working as intended except for a slight hiccup.

So here are my configs and a guide for installation.

To begin, I installed the Kodi experimental package through the RetroPie configs. This is really easy, you just select RetroPie through EmulationStation, then go down to RetroPie-Configs, then to experimental packages, then select and install Kodi. Keep in mind that you need a Nvidia GPU for moonlight and I am unaware of anything similar for AMD. You'll want to upgrade/downgrade Nvidia Geforce Experience to 2.10 and enable SHIELD streaming under Preferences.

GeForce Experience 2.11 does NOT work.

Now, you need to switch to the CLI or use Putty/winSCP.

sudo nano /etc/emulationstation/es_systems.cfg 

Edit that by adding:

<system> <name>kodi</name> <fullname>Kodi</fullname> <path>~/RetroPie/roms/kodi</path> <extension>.sh .SH</extension> <command>bash %ROM%</command> <platform>kodi</platform> <theme>kodi</theme> </system> 

and while we're there:

<system> <name>steam</name> <fullname>Steam</fullname> <path>/home/pi/RetroPie/roms/steam</path> <extension>.sh .SH</extension> <command>%ROM%</command> <platform>steam</platform> <theme>steam</theme> <directlaunch/> </system> 

Now ctrl+x to exit, y to save, enter to finalize.

sudo mkdir ~/RetroPie/roms/kodi sudo mkdir ~/RetroPie/roms/steam cd sudo nano kodi.ini 

This will create kodi.ini under your /home/pi directory

# Kodi Configuration # ================== #X1: 0 Y1: 0 X2: 0 Y2: 0 du:0 dd:0 dl:0 dr:0 start:0 back:0 TL:0 TR:0 A: 0 B: 0 X: 0 Y: 0 black: 0 white: 0 LT: 0 RT: 0 [xboxdrv] #ui-clear = true extra-devices = false extra-events = false deadzone = 6000 device-name = "Microsoft Xbox 360 Wireless Controller" [ui-buttonmap] # Face buttons A = KEY_ENTER B = KEY_BACKSPACE X = KEY_X Y = KEY_ESC # D-Pad du = KEY_UP dd = KEY_DOWN dl = KEY_LEFT dr = KEY_RIGHT # Start / Back buttons start = KEY_SPACE back = KEY_L # Bumper Left / Right white = KEY_C black = KEY_I # Stick buttons TL = BTN_RIGHT # Left stick buttons TR = BTN_LEFT # Right stick buttons # Triggers Right / Left RT = KEY_EQUAL # Right trigger LT = KEY_MINUS # Left trigger [ui-axismap] #x2=REL_RX:10 #y2=REL_RY:-10 x1=REL_X:10 y1=REL_Y:10 # The resp filter moves the neutral position to zero to work around a # bug in Kodi, that causes bogus events when neutral position is # elsewhere. It loses a bit of precision in the trigger as result, but # that isn't noticeable. LT^resp:127:255=ABS_Z RT^resp:127:255=ABS_RZ # EOF # 

Now to create start.sh in the same directory

sudo nano start.sh 

and fill that with

#!/bin/bash rmmod xpad modprobe uinput modprobe joydev /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --config /home/pi/xbmc.ini --silent --autofire RT=25 --autofire LT=25 --autofire du=200 --autofire dd=200 --autofire dl=500 --autofire dr=500 & 

then edit the permissions of those files with

sudo chmod 777 start.sh sudo chmod 777 kodi.ini 

Now to create the actual command to run kodi through emulationstation

sudo nano ~/RetroPie/roms/kodi/kodi.sh 

and fill with (if wireless 360 controller)

#!/bin/bash xboxdrv_pwid=`pidof xboxdrv` sudo kill -SIGTERM $xboxdrv_pwid sudo /home/pi/start.sh sudo kodi xboxdrv_pwid=`pidof xboxdrv` sudo kill -SIGTERM $xboxdrv_pwid sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --daemon --wid 0 --led 2 --deadzone 4000 --silent --trigger-as-button --next-controller --wid 1 --led 3 --deadzone 4000 - silent --trigger-as-button --dbus disabled --detach-kernel-driver & 

or (if wired 360 controller)

#!/bin/bash xboxdrv_pid=`pidof xboxdrv` sudo kill -SIGTERM $xboxdrv_pid sudo /home/pi/start.sh sudo kodi xboxdrv_pid=`pidof xboxdrv` sudo kill -SIGTERM $xboxdrv_pid sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --daemon --id 0 --led 2 --deadzone 4000 --silent --trigger-as-button --next-controller --id 1 --led 3 --deadzone 4000 - silent --trigger-as-button --dbus disabled --detach-kernel-driver & 

Now, kodi should be working with a controller... But it will be second controller if plugged in (slight hiccup from earlier)

Alright, I have a virtual server on my desktop for streaming videos. I'd imagine if you want kodi, you have something similar whether it's a virtual server, NAS, or whatever.

To mount those

sudo nano etc/fstab 

Then add a line to the bottom of that file that says

//SE.RV.ER.IP/FOLDER /media cifs username=SHAREFOLDERUSER,password=SHAREFOLDERPASS 0 0 

Obviously, you'll need to change what is in caps. My folders are not password protected, so anyone on my LAN can access them. You may have to dig around here for help with your particular set up.

Moving on to Moonlight.

sudo nano /etc/apt/sources.list 

Add in the following line

deb http://archive.itimmer.nl/raspbian/moonlight wheezy main 

Then ctrl+x, y, enter to save

sudo apt-get update sudo apt-get install moonlight-embedded mkdir ~/Moonlight cd ~/Moonlight moonlight pair YO.UR.PC.IP 

Now, you should get a 4 digit PIN, which you will need to go to your gaming rig and enter. There should be a prompt from Nvidia GeForce Experience on your desktop asking for it.

cd ~/RetroPie/roms/steam sudo nano steam.sh 

And I had trouble here with the controller triggers going off forever... So I toyed around with steam.sh and put this in there

#!/bin/bash moonlight stream YO.UR.PC.IP -720 -30fps -mapping /opt/retropie/configs/moonlight/controllername.map sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --daemon --id 0 --led 2 --deadzone 4000 --silent --trigger-as-button & 

Now, you will get an error here from the daemon, but it should work just fine. I couldn't figure out any other way to use that controller map with the triggers as buttons, without which any time you pull a trigger it will just go off continuously until you quit.

So, I hope this helps some people and if anyone has any suggestions for the 2nd controller issue with Kodi, please let me know!

Sources: https://github.com/RetroPie/RetroPie-Setup/issues/1082
https://www.reddit.com/r/RetroPie/comments/3mcf4y/kodi_with_xbox_360_controller/



Submitted by jpfarre | #Specialdealer Special Offer Online Shopping Store 2016

No comments:

Post a Comment