<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lockstockmods &#187; boblight</title>
	<atom:link href="http://www.lockstockmods.net/tag/boblight/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lockstockmods.net</link>
	<description>If its not broken... take it apart and mod it</description>
	<lastBuildDate>Sat, 26 Feb 2011 20:15:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>XBMC Live / Linux with amBX lighting</title>
		<link>http://www.lockstockmods.net/2010/05/22/xbmc-live-linux-with-ambx/</link>
		<comments>http://www.lockstockmods.net/2010/05/22/xbmc-live-linux-with-ambx/#comments</comments>
		<pubDate>Sat, 22 May 2010 21:02:47 +0000</pubDate>
		<dc:creator>Kode</dc:creator>
				<category><![CDATA[HTPC]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Media]]></category>
		<category><![CDATA[amBX]]></category>
		<category><![CDATA[amBX Linux]]></category>
		<category><![CDATA[boblight]]></category>
		<category><![CDATA[combustd]]></category>
		<category><![CDATA[Philips amBX]]></category>
		<category><![CDATA[XBMC]]></category>
		<category><![CDATA[XBMC amBX]]></category>
		<category><![CDATA[XBMC Live]]></category>

		<guid isPermaLink="false">http://www.lockstockmods.net/?p=128</guid>
		<description><![CDATA[This tutorial will guide you through the process of using a Philips amBX Lighting system (Philips amBX Starter Kit is used in the tutorial) with the fantastic XBMC Live or Linux media centre (Using Boblight and Combustd).  Together they create a truly immersive and visually compelling addition to anyones home entertainment system.]]></description>
			<content:encoded><![CDATA[<p><object style="float:right;" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Nr5FvBUzhEU?hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Nr5FvBUzhEU?hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>I have recently been experimenting with XBMC and a Philips amBX Starter Kit, this is a little howto for when i inevitably hose my installation and have to reinstall, i hope it helps others as well.  The video on the right doesn&#8217;t do justice to the effect in real life.</p>
<p>This howto would not be possible without the guys from the XBMC forums.</p>
<p>In particular thanks need to go to<br />
<a href="http://forum.xbmc.org/showthread.php?t=71912">CharlesNasi for the original guide</a><br />
<a href="http://blogger.xs4all.nl/loosen/">Bob</a> for the fantastic <a href="http://code.google.com/p/boblight/">Boblight utility</a><br />
<a href="http://code.google.com/p/combustd/">The creators of CombustD</a><br />
jaaps for some modifications to Boblight specific to amBX</p>
<p>If you cant get the files from their official sources you can get boblight and ruby usb here:<br />
Note: There is a file embedded within this post, please visit this post to download the file.</p>
<h2>Changelog</h2>
<p>2010-05-22 &#8211; Initial draft published<br />
2010-06-07 &#8211; Updated step 4 and 10 to use combustd 0.2 rather than 0.1 and removed step 11 as depreciated.<br />
2010-06-07 &#8211; Removed libc6-dev-i386 as it breaks installation but doesn&#8217;t seem to be needed.</p>
<p>Ok so lets start</p>
<h2>Getting started</h2>
<ol>
<li> First open a terminal, either Ctrl + Alt + F1 in xbmc or ssh into the machine</li>
<li> Create a working directory and move into it
<pre><code>mkdir ambx
cd ambx</code></pre>
</li>
<li>(If not installed) install Subversion
<pre><code>sudo apt-get install subversion</code></pre>
</li>
<li>get combustd from svn
<pre><code>svn checkout http://combustd.googlecode.com/svn/branches/combustd-ruby-0.2</code></pre>
</li>
<li>Download Boblight and extract it to something you want, there is an svn version on googlecode, but i couldnt get it to make
<pre><code>wget http://www.xs4all.nl/~loosen/boblight/boblight-1.3.tar.gz
tar zxvf boblight-1.3.tar.gz</code></pre>
</li>
<li>Get dependencies to compile Boblight, if you have any issues try one package at a time to find the problem, also some of these packages were already installed, can&#8217;t remember which ones though.
<pre><code>sudo apt-get update
sudo apt-get install gcc libusb-dev ruby ruby-dev libportaudio-dev libavdevice-dev libswscale-dev libavformat-dev libavcodec-dev libxrender-dev libsdl1.2-dev libx11-dev</code></pre>
</li>
<li>Build the package &#8216;Boblight&#8217;:
<pre><code>cd boblight-1.3
sudo ./configure
sudo make
sudo make install
cd ..
</code></pre>
</li>
<li>Configure Boblight<br />
Open a text-editor, i use nano, but its up to you and edit the file &#8216;boblight.conf (It probably wont already exist, thats fine).</p>
<pre><code>sudo nano /etc/boblight.conf</code></pre>
<p>Add the following code into the file, this is courtesy of jaaps and allows use of all 5 lights, Z3rO also added some lines to allow adding things like proportional, satuation, black threshold in the config rather than on the commandline.</p>
<pre><code>[global]
interface 127.0.0.1
port 19333

[device]
name AmbX_Combust
output "ruby /usr/local/combustd/applications/boblight/boblight.rb"
channels 15
type popen
interval 20000

[color]
name red
rgb FF0000

[color]
name green
rgb 00FF00

[color]
name blue
rgb 0000FF

[light]
name left
color red AmbX_Combust 1
color green AmbX_Combust 2
color blue AmbX_Combust 3
hscan 0 33.33
vscan 0 66.66
saturation 3.0
proportional 20.0
value 3
threshold 20
interpolation on

[light]
name right
color red AmbX_Combust 4
color green AmbX_Combust 5
color blue AmbX_Combust 6
hscan 66.66 100
vscan 0 66.66
saturation 3.0
proportional 20.0
value 3
threshold 20
interpolation on

[light]
name wwleft
color red AmbX_Combust 7
color green AmbX_Combust 8
color blue AmbX_Combust 9
hscan 0 40
vscan 0 33.33
saturation 3.0
proportional 20.0
value 3
threshold 20
interpolation on

[light]
name wwright
color red AmbX_Combust 10
color green AmbX_Combust 11
color blue AmbX_Combust 12
hscan 60 100
vscan 0 33.33
saturation 3.0
proportional 20.0
value 3
threshold 20
interpolation on

[light]
name wwcenter
color red AmbX_Combust 13
color green AmbX_Combust 14
color blue AmbX_Combust 15
hscan 33 66
vscan 0 33.33
saturation 3.0
proportional 20.0
value 3
threshold 20
interpolation on</code></pre>
<p>Save the file and exit. (Ctrl + O then Ctrl + X)</p>
<p>If you are hiding the left and right lights behind the TV, use value 15 on the appropriate lines of the config as above, if you aren&#8217;t then use value 3, value sets how bright the lights are.</p>
<p>Boblight is now configured.</li>
<li>Download, Install and compile Ruby-usb
<pre><code>wget http://www.a-k-r.org/ruby-usb/ruby-usb-0.2.tar.gz
tar -zxvf ruby-usb-0.2.tar.gz
cd ruby-usb-0.2
sudo ruby extconf.rb
sudo make &amp;&amp; sudo make install
cd ..
</code></pre>
</li>
<li>CombustD
<pre><code>sudo mv combustd-ruby-0.2 /usr/local/combustd</code></pre>
</li>
</ol>
<h2>Running boblight</h2>
<p>That should be everything configured, now start the daemon.</p>
<pre><code>sudo boblightd</code></pre>
<p>Test if its working</p>
<pre><code>boblight-constant ff00ff; sleep 5; killall boblight-constant</code></pre>
<p>All the lights should come on for 5 seconds (they will be a pinky color) then go off.</p>
<p>Time to start the magic</p>
<pre><code><del datetime="2010-06-01T10:31:30+00:00">boblight-X11 -s 5 -t 0.1 -a 20 -v 3</del>
boblight-X11 -t 0.1</code></pre>
<p>This starts the binary, <del datetime="2010-06-01T10:31:30+00:00">sets the saturation to 5, the interval between refreshes to 0.1 seconds, brightness to 3 and the speed to 20</del> and sets the interval between refreshes to 0.1 seconds (the other options aren&#8217;t needed as they are now set in the config).  If you get an error about ERROR: Can&#8217;t open display (null) the DISPLAY environment variable isn&#8217;t set, just type:</p>
<pre><code>export DISPLAY=:0.0</code></pre>
<p>You will need to redo this when you reboot.</p>
<h2>Boblight Configuration Options</h2>
<p>You can change the way boblight works by supplying options, the list of options is:</p>
<pre><code>boblight-X11 1.3

Usage: boblight-x11 [OPTION]
Start the X11 grabber for boblight

  -s	set the saturation
  -v	set the value
  -i	set the interpolation, use "-i on" or "-i off"
  -a	set the proportional
  -p	set the priority, default is 128
  -t	set the timer interval, default is 0.5 second,
  -u	set the lights to use, comma separated list
  -e	set the server address[:port]
  -g	grab n pixels on n lines
    	default is 100 for XShmGetImage and 16 for XGetImage
  -m	grab method, use "-m average" or "-m median"
  -x	use XGetImage instead of XShmGetImage (slow!)
  -b	set the black threshold</code></pre>
<h2>Todo.</h2>
<p><span style="text-decoration: line-through;">Look into starting boblight on startup</span><br />
Look into creating a boblight script for xbmc allowing users to change settings and start/stop through GUI<br />
Add some pictures and a youtube video</p>
<h2>Automatically starting amBX</h2>
<p>By utilising udev we can set amBX to turn on when we press the power button on the amBX system, if you never turn the system off by the power button on the amBX unit, then the lights will automatically come on when xbmc boots.</p>
<p>Create a new udev rule:</p>
<pre><code>sudo nano /etc/udev/rules.d/99-ambx.rules</code></pre>
<p>Copy the code below into it and save:</p>
<pre><code>SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="083f", ACTION=="add", RUN+="/usr/bin/startambx"</code></pre>
<p>Create the startambx script:</p>
<pre><code>sudo nano /usr/bin/startambx</code></pre>
<p>Copy the code below into it and save:</p>
<pre><code>#!/bin/sh
boblightd
sudo su - xbmc -c "DISPLAY=:0.0 boblight-X11 -t 0.1"</code></pre>
<p>If you are using a username other than xbmc replace the instance above with the appropriate username.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lockstockmods.net/2010/05/22/xbmc-live-linux-with-ambx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: www.lockstockmods.net @ 2012-02-04 19:04:12 -->
