[RELEASE] Official XBMC boblight Addon

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #1
XBMC boblight Addon pre-Eden/Eden:

This is the official XBMC boblight addon for using the open source ambilight clone ( http://code.google.com/p/boblight/ ) from within XBMC.
(It does NOT work with the old boblight from http://blogger.xs4all.nl/loosen)

Its available in the official XBMC Repo (services). Development can be followed here GitHub

Supported plattforms

For now the XBMC boblight addon supports the following plattforms:

Windows, Linux and OSX. Since June 2nd 2012 its also available on iOS (thx to davilla for fixing the ctypes module).

Though the required boblightd daemon (the server part of boblight) is only available on linux at the moment. It is not needed to run the server on the same mashine as the client (XBMC with addon in that case). I for example have the server running on my openwrt router and connect to the daemon via lan (boblight is connected to it via usb2rs232 adapter). So i can use boblight from within linux,osx and windows on my HTPC (for deving purposes mostly Wink ).

Accessing settings

You can access the addons settings as usual like with any other addon aswell. It is located in the services subcategory.

Beside that you can access the settings during video playback. For this just put the file script.xbmc.boblight.keymap.xml found HERE into your "userdata/keymaps" folder.

You can access the settings during playback by hitting the key "b" or "B". (Note: a former keymapping to that key will be overwritten by this keymap file. If there is a
conflict you just can change the mapped key to something else).

Meaning of the settings

* Saturation and value are multipliers for HSV color space: http://en.wikipedia.org/wiki/HSL_and_HSV

* Speed is a factor for a first order lowpass filter, it goes from 0 to 100, the higher you set it the faster the lights react.
Autospeed adjusts the speed on top of that based on how fast the colors are changing, it kind of sucks to be honest.

* Interpolation is a setting for a boblightd output device, when it's on it will interpolate between the last two writes of a client, I suggest turning it off in the xbmc addon.

* Pixels below the threshold value will be considered as black pixels, it goes from 0 to 255, I suggest setting it to something like 10.

Dependencies

First of all the following clarification: This addon only provides the client. You still need to run the boblightd - daemon somewhere in your network (either on the same mashine as XBMC or on any other mashine in your network, where your boblight hardware is connected to).

For this addon to be working you need a library for communicating with the boblightd - daemon. It should get automagically downloaded for you on the first run of the addon for Windows and OSX. If it doesn't ask you for the automatic download - disable and reenable the addon - this should get you going. Linux users should have installed the library libboblight.so.

Linux:
goto the projects site http://code.google.com/p/boblight/ and download the source code. Then compile and install the library by issueing the following commands (without the $'s):

Code:
$ cd <source of boblight>
$ ./configure --without-portaudio --without-opengl --without-x11 --prefix=/usr
$ make && sudo make install

This will install the libboblight.so library into /usr/lib - where the boblight addon will find it.

Features

1. Currently boblight is only driven when the videoplayer is running. We hope to be able to extend it to the menu and even music playback in the future- though this will need major changes in the XBMC core so it wouldn't be the near future Wink.

2. You can define a static light which is used whenever the videoplayer is not running.

3. You can choose between 2 presets (fast and slow) which only differ in the reaction speed and smoothness of the light changes. Maybe in the future there will be some more presets - according to the feedback users.

4. You can use custom defined boblight settings (saturation, value, speed, interpolation, threshold, autospeed).

5. It has 2 seperated sets of settings. Movie and MusicVideo. It is able to use the appropriate setting when it detects a Movie or a MusicVideo. The detection is based on the video library (content option).

6. Both sets can be used to switch between 2 different settings by using the "Override used category" feature. This allows for switching between these settings when no library is used or Movie and MusicVideo aren't the wanted decision rules.

Possible hardware solutions

1. Using an arduino and a TLC5940 pwm controller - http://code.google.com/p/tlc5940arduino/

2. Use my custom hardware which is based on the first one without arduino. It needs slightly adapted arduino firmware. Find everything here: Custom Boblight - The Memphiz Way. For powering the Atmel (not the lights - only the board logic) i use this usb2TTL5V converter Lipoly (any other TTL converter will work as long as it has a 5V levels including 5V VCC output).

3. Use an amblone hardware like described here

4. HowTo build multichannel adalight here

5. There are many more possibilitys - use google...

Calculator for boblight.conf and others

With this tool you are able to generate boblight and adalight (and maybe others) config files based on your led setup. Thx to Hansaplast.
Boblight Config Maker

Changelog
1.0.3
- fixed the lib downloading code on win32

1.0.2
- changed icon to something we own the copyright for

1.0.1
- ping boblightd and reconnect if connection is lost

1.0.0
- initial version

Images
[Image: boblightlogo1final.png][Image: boblightlogo2final.png]
Attached File(s) Thumbnail(s)
               

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
(This post was last modified: 2014-03-11 17:15 by Memphiz.)
find
Lunatixz Offline
Posting Freak
Posts: 1,887
Joined: May 2011
Reputation: 37
Location: New York
Post: #2
can you explain how you are running the daemon on openwrt... would this work on dd-wrt since they are both open source linux...


My XBMC is setup on a win7 pc... but I have a router running dd-wrt... would this work? can you explain how to setup the daemon...
I have a amblone system which runs on arduino mega, I have the boblight pde installed just waiting for the daemon Smile
(This post was last modified: 2011-12-07 08:28 by Lunatixz.)
find
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #3
Lunatixz Wrote:can you explain how you are running the daemon on openwrt... would this work on dd-wrt since they are both open source linux...


My XBMC is setup on a win7 pc... but I have a router running dd-wrt... would this work? can you explain how to setup the daemon...
I have a amblone system which runs on arduino mega, I have the boblight pde installed just waiting for the daemon Smile

not sure if dd-wrt allows you to install something? I thought they have a fixed partition only?

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #4
Well i've had another look. DD-WRT unfortunatly is not that open source as OpenWRT - it has more a commercial touch (though it is of course free). I didn't find a HowTo on building packages for it. But the wiki states, that OpenWRT packages might be compatible.

Well i'll try to get boblightd into official OpenWRT tree first. When OpenWRT buildbots start building it on a nightly base - you can try if you get it into your dd-wrt then. This might need some weeks i think.

Beside that you already should double check that your router has an USB port and that your amblone is compatible with boblightd and it has a usb2rs232 adapter on it which has drivers on ddwrt (see USB to Serial on http://www.dd-wrt.com/wiki/index.php/USB#USB_drivers for supported adapters).

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
(This post was last modified: 2011-12-07 10:05 by Memphiz.)
find
Lunatixz Offline
Posting Freak
Posts: 1,887
Joined: May 2011
Reputation: 37
Location: New York
Post: #5
Memphiz Wrote:Well i've had another look. DD-WRT unfortunatly is not that open source as OpenWRT - it has more a commercial touch (though it is of course free). I didn't find a HowTo on building packages for it. But the wiki states, that OpenWRT packages might be compatible.

Well i'll try to get boblightd into official OpenWRT tree first. When OpenWRT buildbots start building it on a nightly base - you can try if you get it into your dd-wrt then. This might need some weeks i think.

Beside that you already should double check that your router has an USB port and that your amblone is compatible with boblightd and it has a usb2rs232 adapter on it which has drivers on ddwrt (see USB to Serial on http://www.dd-wrt.com/wiki/index.php/USB#USB_drivers for supported adapters).

My router has a usb... and as far as i know my amblone supports boblightd since the pwm pins are the same... and there is code for the micro controller on boblightd's git...

Look forward to getting it working...thanks for the response...
find
snipah Offline
Junior Member
Posts: 45
Joined: Oct 2011
Reputation: 1
Post: #6
Hi Memphiz,

had the "old" version running with the boblightd & boblight-X11 and wanted to switch to the addon now.

The old version was started with following lines in /etc/rc.local

Code:
su - xbmc -c "boblightd -f"
sleep 7
su - xbmc -c "DISPLAY=:0.0 boblight-X11 -o speed=25 -o value=20 -o saturation=1.5 -o threshold=50"

I removed all this lines after installation of the script, but log says, that boblight can't connect to boblightd. In the addon the remote boblightd-option is not activated and you wrote, boblightd is not needed by the script.

My question: Do I still need the old 'boblight.conf' in /etc? I guess the addons pulls the host-address for boblightd from this file.

Can I delete to boblight.conf-file? If so, how are the ligihts defined?

libboblight.so is in /usr/lib/ ....


[edit]

Guess I found out: In boblight.conf the [global] section has to be commented out/ deleted, while the lights still have to be defined in this file. Correct?
(This post was last modified: 2011-12-07 12:29 by snipah.)
find
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #7
snipah Wrote:[edit]

Guess I found out: In boblight.conf the [global] section has to be commented out/ deleted, while the lights still have to be defined in this file. Correct?


- no incorrect. Leave the boblight.conf as is - but put the "su - xbmc -c "boblightd -f"" back in.


snipah Wrote:and you wrote, boblightd is not needed by the script.

Where did i write that? So i can fix this in the first post ...

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
(This post was last modified: 2011-12-07 12:38 by Memphiz.)
find
Clumsy Offline
Team-XBMC Forum Moderator
Posts: 641
Joined: Feb 2004
Reputation: 0
Post: #8
Is there a quick way to setup a toggle button for the addon? I personally use boblight only maybe 20% of the time I actually use xbmc, mostly when I watch movies and switch to my projector. So at the moment I use lirc with irexec to toggle boblight-X11 on, when I need it. If a toggle feature isn't supported I guess this counts as a feature request - ideally I would have a skin button in the OSD, but a button mapping would wpork as well I guess.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find
snipah Offline
Junior Member
Posts: 45
Joined: Oct 2011
Reputation: 1
Post: #9
Memphiz Wrote:- no incorrect. Leave the boblight.conf as is - but put the "su - xbmc -c "boblightd -f"" back in.




Where did i write that? So i can fix this in the first post ...

At least I understood it that way:

Memphiz Wrote:Though the required boblightd daemon (the server part of boblight) is only available on linux at the moment. It is not needed to run the server on the same mashine as the client (XBMC with addon in that case). I for example have the server running on my openwrt router and connect to the daemon via lan (boblight is connecte to it via usb2rs232 adapter). So i can use boblight from within linux,osx and windows on my HTPC (for deving purposes mostly ).

I already started the boblightd via rc.local and it works but I thought I could get rid of the deamon Smile
Does this plugin cause less processor load than the X11-Version?
(This post was last modified: 2011-12-07 13:57 by snipah.)
find
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #10
snipah Wrote:At least I understood it that way:



I already started the boblightd via rc.local and it works but I thought I could get rid of the deamon Smile
Does this plugin cause less processor load than the X11-Version?

No this should only mean that the daemon doesn't need to run on the same mashine (for example for XBMC on windows - there is no boblightd for windows).

I'll change it that there is still the need of a deamon, but it doesn't need to run on the same mashine (but somewhere else in the network)...

I can't answer the question about the CPU load compared to boblight-X11 ...

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #11
Clumsy Wrote:Is there a quick way to setup a toggle button for the addon? I personally use boblight only maybe 20% of the time I actually use xbmc, mostly when I watch movies and switch to my projector. So at the moment I use lirc with irexec to toggle boblight-X11 on, when I need it. If a toggle feature isn't supported I guess this counts as a feature request - ideally I would have a skin button in the OSD, but a button mapping would wpork as well I guess.

Not possible with the current addon api ... lets talk about that after eden again Wink

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find
snipah Offline
Junior Member
Posts: 45
Joined: Oct 2011
Reputation: 1
Post: #12
...how do I reconnect the addon to boblightd after s3? When entering s3 I'm killing boblightd and later restart it on resume...but the script doesn't reconnect.

Before I also startet boblight-X11 with the script and that still works, but I want to use your addon after resume...
find
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #13
Lunatixz Wrote:My router has a usb... and as far as i know my amblone supports boblightd since the pwm pins are the same... and there is code for the micro controller on boblightd's git...

Look forward to getting it working...thanks for the response...

You can track the ticket i've made to the openwrt guys here:

https://dev.openwrt.org/ticket/10562

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find
Memphiz Offline
Team-XBMC Developer
Posts: 10,139
Joined: Feb 2011
Reputation: 109
Location: germany
Post: #14
snipah Wrote:...how do I reconnect the addon to boblightd after s3? When entering s3 I'm killing boblightd and later restart it on resume...but the script doesn't reconnect.

Before I also startet boblight-X11 with the script and that still works, but I want to use your addon after resume...

Could you post a xbmc.log when resuming please?

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find
snipah Offline
Junior Member
Posts: 45
Joined: Oct 2011
Reputation: 1
Post: #15
Sure! Log is located here as a zip-file: LINK!

boblight-log posts this after resume:

Code:
20:30:08.023513 (InitLog)                        start of log /home/xbmc/.boblight/boblightd.log
20:30:08.023826 (PrintFlags)                     starting /usr/local/bin/boblightd -f
20:30:08.023892 (CConfig::LoadConfigFromFile)    opening /etc/boblight.conf
20:30:08.024477 (CConfig::CheckConfig)           checking config lines
20:30:08.025304 (CConfig::CheckConfig)           config lines valid
20:30:08.025401 (CConfig::BuildConfig)           building config
20:30:08.026640 (CConfig::BuildConfig)           built config successfully
20:30:08.026746 (main)                           starting devices
20:30:08.026909 (CClientsHandler::Process)       opening listening socket on 127.0.0.1:19333
20:30:08.029205 (CDevice::Process)               ambilight: starting with output "/dev/ttyUSB0"
20:30:08.029291 (CDevice::Process)               ambilight: setting up
20:30:08.057270 (CDevice::Process)               ambilight: setup succeeded
(This post was last modified: 2011-12-07 21:39 by snipah.)
find
Thread Closed