Launchcontrol (Alpha)
Launchcontrol is a server that can control a Launch. This project contains
plugins for both Kodi and VLC to communicate with the Launchcontrol server
(loading scripts, pausing playback, etc.)
Currently only Kiiroo scripts work, but the goal is to support multiple haptic
protocols/formats.
Launchcontrol is made for Linux but should also work on a Mac. Works great on a
Raspberry Pi with LibreELEC using the Kodi addon.
The Kodi and VLC addons should work on all platforms (Linux, Mac and Windows.)
Requires a Launch with (at least) firmware 1.2.
Build
go get ./...
go build
sudo setcap 'cap_net_raw,cap_net_admin=eip' ./launchcontrol
Usage
# Start server (listening on localhost:6969 by default)
./launchcontrol
# Load and play script
curl -XPOST --data-ascii "{0.50:1,1.00:4,1.15:0,2.00:2}" \
http://localhost:6969/v1/play
# Pause a playing script
curl http://localhost:6969/v1/pause
# Resume paused script
curl http://localhost:6969/v1/resume
# Jump to a position in the script
curl http://localhost:6969/v1/skip\?p=1m3s
# Stop and reset script
curl http://localhost:6969/v1/stop
# Start playing last loaded script
curl http://localhost:6969/v1/play
Kodi Integration
The Launchcontrol Kodi service addon connects to a local Launchserver and auto
loads scripts and synchronizes playback, taking into account actions like
pausing and seeking.
Scripts that are paired with the movie file will be loaded. Pairing is done by
placing a script file next a movie using the same base filename (this mirrors
the same convention as for nfo or artwork).
The addon uses Kodi's VFS while searching and loading scripts, so even movies
on remote sources like SMB or HTTP servers will work.
Movie/script pairing example:
/my movies/title.mp4
/my movies/title.kiiroo
Install
Download script.service.launchcontrol.zip
from the
releases page. Or package
the plugin yourself from contrib/kodi/script.service.launchcontrol
. Just zip
up the directory (or use the Makefile.)
This guide shows
how to install the zip file in Kodi. After installation the plugin will
automatically start.
NOTE: If you are running Launchcontrol on another machine then Kodi or
are not using the default port, the address can be changed in the add-ons
configure
menu.
VLC Integration
VLC extension for Launchcontrol loads script from the local machine into a
Launchcontrol server and plays them in sync with a video. Pairing works the
same as for the Kodi addon, just place the script file next to the video using
the same base filename.
Note: The VLC extension has less features then the Kodi addon, see VLC
Extension README for details on what's included.
Install
Place the launchcontrol.lua in VLC's
lua/extensions/
directory and reload extensions or restart VLC. The extension
must be enabled every time VLC is restarted by clicking view
->
Launchcontrol
. See VLC Extension README for more
details on the extension.
Raspberry Pi v2/v3 with LibreELEC
Make sure Bluetooth is disabled in the LibreELEC
Services
tab.
Build Launchserver for arm:
go get ./...
GOARCH=arm GOARM=7 go build
Build the script addon:
make -C contrib/kodi/
Note: Pre-build binaries are also available on the
releases page.
Copy the build results and an autostart.sh to the Raspberry Pi:
ssh root@libreelec 'mkdir /storage/launchcontrol'
scp launchcontrol root@libreelec:/storage/launchcontrol/
scp contrib/kodi/autostart.sh root@libreelec:/storage/.config/
scp contrib/kodi/script.service.launchcontrol.zip root@libreelec:/storage/
Reboot LibreELEC and
install the
script.service.launchcontrol.zip
addon.
Thats it!
Bluetooth requirements
See the gatt docs
for the Bluetooth requirements/setup.
Other examples
Build and run example (Linux)
go build contrib/examples/playkiiroo.go
sudo setcap 'cap_net_raw,cap_net_admin=eip' ./playkiiroo
./playkiiroo -file input.txt
Launchcontrol is released under a BSD-style license.