Boblight

From LinuxMCE
Jump to: navigation, search

Boblight with Adalight on Linuxmce

Until Linuxmce integrates the possibility to do some postprocessing in xine it looks like you have to run a separate xine process which enables postprocessing. I put this together based on my notes so if something does not work please let me know and improve this page.

install Boblight

sudo apt-get install libx11-dev libgl1-mesa-dev libxrender-dev libxext-dev libavcodec-dev libavformat-dev libswscale-dev libavdevice-device

svn checkout http://boblight.googlecode.com/svn/trunk/ boblight-read-only
cd boblight-read-only/

./configure --without-portaudio
make
make install
echo "/usr/local/lib/libboblight.so" > /etc/ld.so.conf.d/boblightlibs.conf
sudo ldconfig

Next create a startscript for the daemon

/etc/init/boblight.conf

# boblight service

description     "boblight"
author          "jordi"

start on started network-services
stop on starting shutdown

respawn

env EXEC="/usr/local/bin/boblightd"
env PIDFILE="/var/run/boblightd.pid"
env CONFFILE="/etc/boblight.conf"
env LOGFILE="/var/log/boblightd.log"

exec start-stop-daemon  -m --pidfile $PIDFILE --exec $EXEC --start -- -c $CONFFILE > $LOGFILE 2>&1

Lastly setup the configuration script for boblight at /etc/boblight.conf. Below is the basis for the configuration file to start from. You need to calculate the lights location and add those to the file. Use an online calculator for this:


[global]
interface 127.0.0.1
port      19333

[device]
name ambilight
type momo
output /dev/ttyUSB0
channels 150
#25 leds
#prefix 41 64 61 00 18 4D
#50 leds
prefix 41 64 61 00 31 64
#100 leds
#prefix 41 64 61 00 63 36
interval 10000
rate 115200
debug off #turn this on to see what it's doing with the serial port
delayafteropen 1000000 

[color]
name                            red
rgb                             FF0000
gamma                           1.1
adjust                          0.22
blacklevel                      0.01  

[color]
name                            green
rgb                             00FF00
gamma                           1.1
adjust                          0.22
blacklevel                      0.01 

[color]
name                            blue
rgb                             0000FF
gamma                           1.2
adjust                          0.2
blacklevel                      0.01 


Create a log rotate file:

# cat /etc/logrotate.d/boblightd 
/var/log/boblightd.log {
       daily
       rotate 7
       delaycompress
       compress
       missingok
       postrotate 
        [ ! -f /var/run/boblightd.pid ] || kill -HUP `cat /var/run/boblightd.pid`
       endscript
}


DFatmo plugin

sudo apt-get install libxine2-dev
git clone https://github.com/durchflieger/DFAtmo
cd DFAtmo/

make xineplugin
make xineinstall
make dfatmo
make dfatmoinstall

install xine player

to compile Xine_Player you need:

sudo apt-get install libxmu-dev \
libxxf86vm-dev \
libxtst-dev \
libcdparanoia-dev

then get the latest xine player from https://www.xine-project.org/homeand install it.

run

sudo start boblight
export DISPLAY=:0; xine --verbose=10  --hide-gui --geometry 1x1+0+1080  --post=dfatmo:driver=serial &
export DISPLAY=:0; boblight-X11 &