-
- Posts: 23
- Joined: Tue Mar 06, 2012 6:37 pm
Re: Boblight possible?
I am looking into getting boblight running alongside a Raspberry Pi running a flavor of XBMC, a current work around is to use the Arduino board via a USB, but it looks like this could actually be possible to do with a Gertboard plugged directly onto the Raspberry Pi.
http://forum.xbmc.org/showthre.....tid=116331
http://forum.xbmc.org/showthre.....tid=116331
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6954
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boblight possible?
I don't know much about this, but I believe you need a crudely subsampled version of the image being displayed to determine the LED colours.
Currently the ARM doesn't see the decoded video, but an openMAX component could subsample the decoded image and send back the pixels. That would be a full HD image resize every frame which will be more expensive than necessary.
We could possibly add a cheaper option of just pulling out a small set of pixels more slowly - e.g. at 1 frame per second. What data do you need?
Currently the ARM doesn't see the decoded video, but an openMAX component could subsample the decoded image and send back the pixels. That would be a full HD image resize every frame which will be more expensive than necessary.
We could possibly add a cheaper option of just pulling out a small set of pixels more slowly - e.g. at 1 frame per second. What data do you need?
Re: Boblight possible?
Hi, anyone working on that for the pi ?
Re: Boblight possible?
I've managed to control a strip of lights used in Adalight project (http://www.ladyada.net/products/pixel12mm/), with SPI driver from here http://www.open.com.au/mikem/bcm2835/.
I use the Boblight popen device that send data (float in ASCII) to my program, this one parses data and sends data light to the strip, but it is very flickering ...
I'm not a C/C++ developper and maybe the bcm2835 library is not optimize for the LEDs strip...
An idea is to create a raspberry device for boblight (raspilight ??)
I use the Boblight popen device that send data (float in ASCII) to my program, this one parses data and sends data light to the strip, but it is very flickering ...
I'm not a C/C++ developper and maybe the bcm2835 library is not optimize for the LEDs strip...
An idea is to create a raspberry device for boblight (raspilight ??)
Re: Boblight possible?
Raspbmc RC3 with boblight : http://www.youtube.com/watch?v=5FRV4z_VOVs
It only works with static background light
It only works with static background light
Re: Boblight possible?
is it possible to get it working with dynamic lights ? I've seen on http://forum.xbmc.org/showthread.php?tid=116331&page=43 that the rpi is not using GLES for playback. so no chance with this addon ?
Re: Boblight possible?
plfort, have you made any progress on this?
It would be pretty awesome if we could get this running
It would be pretty awesome if we could get this running
Re: Boblight possible?
Hi please make sure that you have the following:
The SPI protocol is universal so it should work on the Raspberry Pi. Just make sure your power source is good enough. I
- The LED pixels should have an external power source. You can not connect the pixels to the Raspberry Pi because they draw to much power (You need 1.5 Ampere for 25 pixels, 60mA per RGB LED)
Connect the Raspberry Pi Ground with the LED pixels ground
Connect the LED pixel green wire (Clock) to SPI SCK
Connect the LED pixel yellow wire (Serial Data) to MOSI (NOT MISO)
The SPI protocol is universal so it should work on the Raspberry Pi. Just make sure your power source is good enough. I
Re: Boblight possible?
This thread is quite confusing, but I don't want to open a new one, so I'll post here.
First of all boblight consist of two parts, the client and the demon.
A client is the machine that its display you want to analyze and send this information to the demon.
For example a client it's a RPi running XBMC, and you want to analyze the video that is played.
A demon is the machine that can receive this information and lights the leds according to it.
My idea is to have RPi running as both the client and the demon.
Getting the RPi act as a demon should be a piece of cake, there's really nothing to it.
Getting the RPi act as a client would require much more development skills.
I'm no developer and I'm a bit linux n00b, but from what I think happens (without really understanding the source code):
Boblight for linux has 3 clients:
1. boblight-X11 for the application that use x-org, maybe xbmc gui, maybe even analyze images.
2. boblight-constant nothing really analyzed, maybe just sending constant color scheme.
3. boblight-v4l this is the client used to analyze video (note the videograbber.cpp file).
(I'm continuing with my guessing)
The RPi has a dedicated video player, omxplayer, to decode video & audio utilizing the openmax api, the v4l library isn't used by omxplayer so the boblight-v4l has no info to analyze.
As Dom mention above to get Boblight client on the RPi you'll need to get the info by using openmax api.
Regards Dom's goodwill and development abilities to help in the matter:
Please have a look at the source files in the library boblight-v4l of the boblight project at http://code.google.com/p/boblight/
Just to make thing clearer:
XBMC boblight addon for linux use the same boblight client as mention above.
I haven't done much research in the matter but there probably more than few of these philips ambilight clones clients, but for linux I believe boblight is the default.
First of all boblight consist of two parts, the client and the demon.
A client is the machine that its display you want to analyze and send this information to the demon.
For example a client it's a RPi running XBMC, and you want to analyze the video that is played.
A demon is the machine that can receive this information and lights the leds according to it.
My idea is to have RPi running as both the client and the demon.
Getting the RPi act as a demon should be a piece of cake, there's really nothing to it.
Getting the RPi act as a client would require much more development skills.
I'm no developer and I'm a bit linux n00b, but from what I think happens (without really understanding the source code):
Boblight for linux has 3 clients:
1. boblight-X11 for the application that use x-org, maybe xbmc gui, maybe even analyze images.
2. boblight-constant nothing really analyzed, maybe just sending constant color scheme.
3. boblight-v4l this is the client used to analyze video (note the videograbber.cpp file).
(I'm continuing with my guessing)
The RPi has a dedicated video player, omxplayer, to decode video & audio utilizing the openmax api, the v4l library isn't used by omxplayer so the boblight-v4l has no info to analyze.
As Dom mention above to get Boblight client on the RPi you'll need to get the info by using openmax api.
Regards Dom's goodwill and development abilities to help in the matter:
Please have a look at the source files in the library boblight-v4l of the boblight project at http://code.google.com/p/boblight/
Just to make thing clearer:
XBMC boblight addon for linux use the same boblight client as mention above.
I haven't done much research in the matter but there probably more than few of these philips ambilight clones clients, but for linux I believe boblight is the default.
Re: Boblight possible?
Can u give us a "how-to" page with step by step instructions and a picture about leds connecting into the pi, please? (i already have the leds and the pi, but i dont know the connections)plfort wrote:Raspbmc RC3 with boblight : http://www.youtube.com/watch?v=5FRV4z_VOVs
It only works with static background light
id like to use this, even if it is "only" static light.
Re: Boblight possible?
As far as I see we need an OpenMAX component to plug into the video pipline of omxplayer. I have tried to summarize my thoughts here: http://stackoverflow.com/questions/1394 ... e-to-start .
Who is willing to help?
Who is willing to help?
Re: Boblight possible?
I've never heard of boblight, but does this link help any?
https://code.google.com/p/boblight/wiki ... spberry_Pi
https://code.google.com/p/boblight/wiki ... spberry_Pi
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6954
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boblight possible?
I'd imagine:Stasik0 wrote:As far as I see we need an OpenMAX component to plug into the video pipline of omxplayer. I have tried to summarize my thoughts here: http://stackoverflow.com/questions/1394 ... e-to-start .
Who is willing to help?
Code: Select all
video_decode->video_schedule->video_splitter->video_render
|->resize
Re: Boblight possible?
hi dom,
can i also read the data out of a OMX.broadcom.video_splitter port? Or even out of a render port? Using a separate thread?
I mean as far as I understood, I can not define own OMX components without broadcom's help? Is it correct?
Could you help me a bit on getting into reading ports? Can I read them from ARM memory space? Or are they locked in their own memory area?
Otherwise could you at Broadcom define an additional component which can accept callback functions (is may be actually needed since a sync information may be needed)?
Regards,
can i also read the data out of a OMX.broadcom.video_splitter port? Or even out of a render port? Using a separate thread?
I mean as far as I understood, I can not define own OMX components without broadcom's help? Is it correct?
Could you help me a bit on getting into reading ports? Can I read them from ARM memory space? Or are they locked in their own memory area?
Otherwise could you at Broadcom define an additional component which can accept callback functions (is may be actually needed since a sync information may be needed)?
Regards,
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6954
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boblight possible?
Read the OpenMAX IL 1.0 spec here:Stasik0 wrote:can i also read the data out of a OMX.broadcom.video_splitter port? Or even out of a render port? Using a separate thread?
I mean as far as I understood, I can not define own OMX components without broadcom's help? Is it correct?
Could you help me a bit on getting into reading ports? Can I read them from ARM memory space? Or are they locked in their own memory area?
Otherwise could you at Broadcom define an additional component which can accept callback functions (is may be actually needed since a sync information may be needed)?
http://www.khronos.org/openmax/
Then read this:
https://github.com/raspberrypi/firmware ... components
and look at code here:
https://github.com/xbmc/xbmc/tree/maste ... /omxplayer
Re: Boblight possible?
IL specs are heavy! Just to be curious, is there a way of setting something like "inputBufferWritten" event handler for the rendering element?
There is a Decode call in omxplayer, however it is a bit too early, i need to hook up the buffer of the scheduler or of the renderer.
There is a Decode call in omxplayer, however it is a bit too early, i need to hook up the buffer of the scheduler or of the renderer.
Re: Boblight possible?
ok, so now, my plan is to hook up the decoder and mark buffers there. After the marked buffers have reached the renderer I can process them and do everything else.
I changed OMXVideo.cpp part
to
So as far as I understood the sepcs, an event handler of the renderer should be called by the after a frame is processed by it, however, it does never happen 
I changed OMXVideo.cpp part
Code: Select all
if(demuxer_bytes == 0)
omx_buffer->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME;
Code: Select all
if(demuxer_bytes == 0){
omx_buffer->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME;
omx_buffer->hMarkTargetComponent = m_omx_render.GetComponent();
omx_buffer->pMarkData = m_omx_render.GetComponent();
}

Re: Boblight possible?
Setting buffer marks gives me OMX_ErrorInsufficientResources
so i need an another approach for timing :/

Code: Select all
typedef struct OMX_MARKTYPE
{
OMX_HANDLETYPE hMarkTargetComponent;
OMX_PTR pMarkData;
} OMX_MARKTYPE;
OMX_MARKTYPE mark;
mark.hMarkTargetComponent = m_omx_render.GetComponent();
mark.pMarkData = m_omx_render.GetComponent();
omx_err = m_omx_sched.SendCommand(OMX_CommandMarkBuffer, m_omx_sched.GetInputPort(), &mark);
Re: Boblight possible?
Hey, don.. I am trying to use an write_still or image_write element to capture frames to ramdrive
however setting uri gives me a (0x80001009) hardware error?!
Code: Select all
componentName = "OMX.broadcom.image_write";
if(!m_omx_write.Initialize(componentName, OMX_IndexParamVideoInit))
return false;
//setting uri of the image output
const char* filename = "file:///dev/shm/omxplayer_fb.bmp";
size_t uri_size = strlen(filename) + 1;
size_t param_size = sizeof(OMX_PARAM_CONTENTURITYPE) + uri_size - 1;
write_param = reinterpret_cast<OMX_PARAM_CONTENTURITYPE *>(new char[param_size]);
OMX_INIT_STRUCTURE(*write_param);
write_param->nSize = param_size;
memcpy(write_param->contentURI, filename, uri_size);
omx_err = m_omx_write.SetParameter(OMX_IndexParamContentURI, &write_param);
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - error OMX_IndexParamContentURI omx_err(0x%08x)\n", CLASSNAME, __func__, omx_err);
}
Re: Boblight possible?
I now tried a different approach of getting data directly out of the splitter port, this works well, however I can not recognize the format of the data... it gives me about 1.5byte per pixel is it RGB 444?
Can I extract RGB values directly out of it?
I tried an RGB conversion like this:
however an error (0x80001005) bad parameter is returned
Can I extract RGB values directly out of it?
I tried an RGB conversion like this:
Code: Select all
OMX_VIDEO_PARAM_PORTFORMATTYPE video_param;
OMX_INIT_STRUCTURE(video_param);
video_param.nPortIndex = m_omx_split.GetOutputPort();
video_param.eCompressionFormat = OMX_VIDEO_CodingUnused;
video_param.eColorFormat = OMX_COLOR_Format16bitBGR565;
omx_err = m_omx_split.SetParameter(OMX_IndexParamVideoPortFormat, &video_param);
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - error OMX_IndexParamVideoPortFormat omx_err(0x%08x)\n", CLASSNAME, __func__, omx_err);
return false;
}
Re: Boblight possible?
Hi dom,
it seems to be YUV 420 planar data. Can I make the GPU to convert it to RGB values? I can not connect video_split to image_encode or video_encode directly becoming ports not compatible errors.
it seems to be YUV 420 planar data. Can I make the GPU to convert it to RGB values? I can not connect video_split to image_encode or video_encode directly becoming ports not compatible errors.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6954
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Boblight possible?
I believe you can set:Stasik0 wrote:it seems to be YUV 420 planar data. Can I make the GPU to convert it to RGB values? I can not connect video_split to image_encode or video_encode directly becoming ports not compatible errors.
param->format.video.eColorFormat = OMX_COLOR_Format16bitRGB565.
from a OMX_IndexParamPortDefinition.
If you want more formats you can attach a resize component to outside of splitter (and the resize would probably be useful - you don't really want to send 1920x1080 images to ARM),
That also supports OMX_COLOR_Format32bitARGB8888.
Re: Boblight possible?
thanks for the hint, i am trying the following
The code gives me an OMX_ErrorIncorrectStateOperation error. The splitter is initialized before and should be in stateLoaded. What am I doing wrong?
Code: Select all
m_omx_split.DisablePort(m_omx_split.GetInputPort(), false);
OMX_PARAM_PORTDEFINITIONTYPE port_image;
OMX_INIT_STRUCTURE(port_image);
port_image.nPortIndex = m_omx_split.GetOutputPort();
omx_err = m_omx_split.GetParameter(OMX_IndexParamPortDefinition, &port_image);
port_image.format.video.eColorFormat = OMX_COLOR_Format16bitRGB565;
omx_err = m_omx_split.SetParameter(OMX_IndexParamPortDefinition, &port_image);
m_omx_split.EnablePort(m_omx_split.GetInputPort(), false);
omx_err = m_omx_split.SetStateForComponent(OMX_StateExecuting);
if (omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "COMXVideo::Open error m_omx_split.SetStateForComponent\n");
return false;
}
Re: Boblight possible?
ok, i kinda got image grabbing working, unfortunately I do not have the LEDs yet. If someone having an RPi and a running boblightd has interest to play a beta-tester - please PM me.
Re: Boblight possible?
Hi Stasik0,
maybe you should have a look at xbmc.org.
It's a full blown media center which has the ability to install add ons.
It is also available as a bundle with an linux distro (openelec.tv). OpenELEC is able to run on the raspberry pi (http://wiki.openelec.tv/index.php?title ... spberry_Pi).
After it is installed you can extend it with addons. Especially in your case there is an boblightd addon and a boblight client add on which automatically should grab images from the omxplayer (which is used in xbmc) if there were a method implemented which is called "CRenderCapture". And i hope you implemented this method.
It would be cool if you could contact Memphiz from the xbmc.org forum. He is one of the major developers of xbmc and he created the boblight client addon (http://forum.xbmc.org/showthread.php?tid=116331).
Also i started a thread for a feature request that the boblight client should work on the raspberry pi too (only the CRenderCaputure method in omxplayer is missing as far as i know). Maybe you could post your code/experience there. So that memphiz our someone else with the required skills could use it in xbmc.
Thank you in advance
If you have any questions about xbmc/openelec/ambilight feel free to ask.
I would love to see ambilight working on raspberry pi.
Best regards
regnets
maybe you should have a look at xbmc.org.
It's a full blown media center which has the ability to install add ons.
It is also available as a bundle with an linux distro (openelec.tv). OpenELEC is able to run on the raspberry pi (http://wiki.openelec.tv/index.php?title ... spberry_Pi).
After it is installed you can extend it with addons. Especially in your case there is an boblightd addon and a boblight client add on which automatically should grab images from the omxplayer (which is used in xbmc) if there were a method implemented which is called "CRenderCapture". And i hope you implemented this method.
It would be cool if you could contact Memphiz from the xbmc.org forum. He is one of the major developers of xbmc and he created the boblight client addon (http://forum.xbmc.org/showthread.php?tid=116331).
Also i started a thread for a feature request that the boblight client should work on the raspberry pi too (only the CRenderCaputure method in omxplayer is missing as far as i know). Maybe you could post your code/experience there. So that memphiz our someone else with the required skills could use it in xbmc.
Thank you in advance
If you have any questions about xbmc/openelec/ambilight feel free to ask.
I would love to see ambilight working on raspberry pi.
Best regards
regnets