Ambilight using boblight and arduino

This is general talk area for things that NOT RELATED WITH TV! Instead, about internal works like web site, forum, wiki, or talking, etc...

sbav1
Official SamyGO Developer
Posts: 374
Joined: Fri Jan 15, 2010 10:20 am

Re: Ambilight using boblight and arduino

Post by sbav1 »

bole5 wrote:Hi,

...
Could you help me write a piece of code which could be used to find my framebuffer address?
Ain't no easy thing to do ( especially without access to actual D-Series model/hardware). I think I can offer some hints/ideas, though .

There is no single framebuffer (as such) in Samsung B-Series TV SoC (I believe that's still true for C/D-Series, most likely). Those SoCs are quite complex things; lots and lots of internal processing.. Typically there are many YCbCr buffers/planes (up to 32, depending of the mode/format) to choose from. You'll have to deal with different input/processing modes (YCbCR 4:4:4, 4:2:2, 4:2:0), image sizes, formats, user settings etc.

Establishing basic memory map for your TV model will be a good start. AFAIK, D65XX should have 768MB on-board DDR3 RAM (two channels, 512MB+256MB, ~400MB assigned to kernel, and ~350MB dedicated for internal processing -?). Look for DP0/DP1/DP2/DP3 memory areas (at least two should be present, mapped at both DDR buses, respecively).

In B-series, there was a nice option for printing system config/memory map in Top Debug Menu; I wonder if this option is still available in Genoa-S D-Series?

If not: perhaps there will be some conveniently available shortcuts for finding relevant plane/buffer addresses in D-series too. Eg. (again: in B-series)

* 4KByte (0xD090_0000 ~ 0xD090_0FFF)
* 0x3090_0000 ~ 0x3090_0338 : 52. ScalerBIF

Code: Select all

root@localhost:~/_scalerBIF# reg-range-print 0x30900000 206

0x30900000: 0x6C400000
0x30900004: 0x6C6D2000
0x30900008: 0x6C9A4000
0x3090000C: 0x6CC76000
0x30900010: 0x6CF48000
0x30900014: 0x6CF48000
0x30900018: 0x0
0x3090001C: 0x0
0x30900020: 0x6D21A000
0x30900024: 0x6D4EC000
0x30900028: 0x6D4EC000
0x3090002C: 0x6D7BE000
0x30900030: 0x0
0x30900034: 0x0
0x30900038: 0x0
0x3090003C: 0x0
0x30900040: 0x7DA80000
0x30900044: 0x7DD52000
0x30900048: 0x7E024000
0x3090004C: 0x7E2F6000
0x30900050: 0x7E2F6000
0x30900054: 0x7E2F6000
0x30900058: 0x7E2F6000
0x3090005C: 0x7E5C8000
0x30900060: 0x0
0x30900064: 0x0
0x30900068: 0x0
0x3090006C: 0x0
0x30900070: 0x0
0x30900074: 0x0
0x30900078: 0x0
0x3090007C: 0x0
0x30900080: 0x6D7BE000
0x30900084: 0x6DA90000
0x30900088: 0x6DD62000
0x3090008C: 0x6E034000
0x30900090: 0x6E306000
0x30900094: 0x6E306000
0x30900098: 0x0
0x3090009C: 0x0
0x309000A0: 0x6E5D8000
0x309000A4: 0x6E8AA000
0x309000A8: 0x6E8AA000
0x309000AC: 0x6EB7C000
0x309000B0: 0x0
0x309000B4: 0x0
0x309000B8: 0x0
0x309000BC: 0x0
0x309000C0: 0x7E5C8000
0x309000C4: 0x7E89A000
0x309000C8: 0x7EB6C000
0x309000CC: 0x7EE3E000
0x309000D0: 0x7EE3E000
0x309000D4: 0x7EE3E000
0x309000D8: 0x7EE3E000
0x309000DC: 0x7F110000
0x309000E0: 0x0
0x309000E4: 0x0
0x309000E8: 0x0
0x309000EC: 0x0
0x309000F0: 0x0
0x309000F4: 0x0
0x309000F8: 0x0
0x309000FC: 0x0
0x30900100: 0x0
0x30900104: 0x0
0x30900108: 0x0
0x3090010C: 0x0
0x30900110: 0x6EE65000
0x30900114: 0x6EF74000
0x30900118: 0x6F083000
0x3090011C: 0x0
0x30900120: 0x0
0x30900124: 0x0
0x30900128: 0x0
0x3090012C: 0x0
0x30900130: 0x0
0x30900134: 0x0
0x30900138: 0x0
0x3090013C: 0x0
0x30900140: 0x0
0x30900144: 0x6F308000
0x30900148: 0x0
0x3090014C: 0x0
0x30900150: 0x0
0x30900154: 0x0
0x30900158: 0x0
0x3090015C: 0x0
0x30900160: 0x0
0x30900164: 0x0
0x30900168: 0x0
0x3090016C: 0x0
0x30900170: 0x0
0x30900174: 0x0
0x30900178: 0x0
0x3090017C: 0x0
0x30900180: 0x0
0x30900184: 0x0
0x30900188: 0x0
0x3090018C: 0x0
0x30900190: 0x6F418000
0x30900194: 0x6F4A0000
0x30900198: 0x6F528000
0x3090019C: 0x6F5B0000
0x309001A0: 0x6F638000
0x309001A4: 0x6F6C0000
0x309001A8: 0x0
0x309001AC: 0x0
0x309001B0: 0x0
0x309001B4: 0x0
0x309001B8: 0x0
0x309001BC: 0x0
0x309001C0: 0x0
0x309001C4: 0x0
0x309001C8: 0x0
0x309001CC: 0x0
0x309001D0: 0x0
0x309001D4: 0x0
0x309001D8: 0x0
0x309001DC: 0x6F748000
0x309001E0: 0x6F7D0000
0x309001E4: 0x6F858000
0x309001E8: 0x0
0x309001EC: 0x6F8E0000
0x309001F0: 0x0
0x309001F4: 0x0
0x309001F8: 0x0
0x309001FC: 0x0
0x30900200: 0x0
0x30900204: 0x0
0x30900208: 0x0
0x3090020C: 0x0
0x30900210: 0x6F968000
0x30900214: 0x6F9F0000
0x30900218: 0x6FA78000
0x3090021C: 0x6FB00000
0x30900220: 0x6FB88000
0x30900224: 0x6FC10000
0x30900228: 0x0
0x3090022C: 0x0
0x30900230: 0x0
0x30900234: 0x0
0x30900238: 0x0
0x3090023C: 0x0
0x30900240: 0x0
0x30900244: 0x0
0x30900248: 0x0
0x3090024C: 0x0
0x30900250: 0x0
0x30900254: 0x0
0x30900258: 0x0
0x3090025C: 0x6FC98000
0x30900260: 0x6FD20000
0x30900264: 0x6FDA8000
0x30900268: 0x0
0x3090026C: 0x6FE30000
0x30900270: 0x0
0x30900274: 0x0
0x30900278: 0xA0A
0x3090027C: 0x2020
0x30900280: 0xA0A
0x30900284: 0x4
0x30900288: 0x404
0x3090028C: 0x606
0x30900290: 0x2020
0x30900294: 0x18
0x30900298: 0x1818
0x3090029C: 0xA0A
0x309002A0: 0x1F
0x309002A4: 0x0
0x309002A8: 0x80008
0x309002AC: 0x0
0x309002B0: 0x200020
0x309002B4: 0x200020
0x309002B8: 0x20
0x309002BC: 0x0
0x309002C0: 0x0
0x309002C4: 0xA600A6
0x309002C8: 0x7ADC0008
0x309002CC: 0x80
0x309002D0: 0x7ADFC000
0x309002D4: 0x7ADC0000
0x309002D8: 0x80008
0x309002DC: 0x2A2F00
0x309002E0: 0x2A2F00
0x309002E4: 0x2A2F00
0x309002E8: 0x2A2F00
0x309002EC: 0x0
0x309002F0: 0x100
0x309002F4: 0xFD100
0x309002F8: 0x0
0x309002FC: 0x0
0x30900300: 0x0
0x30900304: 0x0
0x30900308: 0x0
0x3090030C: 0x0
0x30900310: 0x0
0x30900314: 0x0
0x30900318: 0x0
0x3090031C: 0x0
0x30900320: 0x77500000
0x30900324: 0x77500000
0x30900328: 0xFC000
0x3090032C: 0x0
0x30900330: 0x77590000
0x30900334: 0x77590000 
* 4KByte (0xD0A0_0000 ~ 0xD0A0_0FFF)
* 0x30A0_0000 ~ 0x30A0_033C : 54. NRFC

Code: Select all

./reg-range-print 0x30A00000 208

0x30A00000: 0x6C400000
0x30A00004: 0x6C6D2000
0x30A00008: 0x6C9A4000
0x30A0000C: 0x6CC76000
0x30A00010: 0x6CF48000
0x30A00014: 0x6CF48000
0x30A00018: 0x0
0x30A0001C: 0x0
0x30A00020: 0x6D21A000
0x30A00024: 0x6D4EC000
0x30A00028: 0x6D4EC000
0x30A0002C: 0x6D7BE000
0x30A00030: 0x0
0x30A00034: 0x0
0x30A00038: 0x0
0x30A0003C: 0x0
0x30A00040: 0x7DA80000
0x30A00044: 0x7DD52000
0x30A00048: 0x7E024000
0x30A0004C: 0x7E2F6000
0x30A00050: 0x7E2F6000
0x30A00054: 0x7E2F6000
0x30A00058: 0x7E2F6000
0x30A0005C: 0x7E5C8000
0x30A00060: 0x0
0x30A00064: 0x0
0x30A00068: 0x0
0x30A0006C: 0x0
0x30A00070: 0x0
0x30A00074: 0x0
0x30A00078: 0x0
0x30A0007C: 0x0
0x30A00080: 0x6D7BE000
0x30A00084: 0x6DA90000
0x30A00088: 0x6DD62000
0x30A0008C: 0x6E034000
0x30A00090: 0x6E306000
0x30A00094: 0x6E306000
0x30A00098: 0x0
0x30A0009C: 0x0
0x30A000A0: 0x6E5D8000
0x30A000A4: 0x6E8AA000
0x30A000A8: 0x6E8AA000
0x30A000AC: 0x6EB7C000
0x30A000B0: 0x0
0x30A000B4: 0x0
0x30A000B8: 0x0
0x30A000BC: 0x0
0x30A000C0: 0x7E5C8000
0x30A000C4: 0x7E89A000
0x30A000C8: 0x7EB6C000
0x30A000CC: 0x7EE3E000
0x30A000D0: 0x7EE3E000
0x30A000D4: 0x7EE3E000
0x30A000D8: 0x7EE3E000
0x30A000DC: 0x7F110000
0x30A000E0: 0x0
0x30A000E4: 0x0
0x30A000E8: 0x0
0x30A000EC: 0x0
0x30A000F0: 0x0
0x30A000F4: 0x0
0x30A000F8: 0x0
0x30A000FC: 0x0
0x30A00100: 0x6EB7C000
0x30A00104: 0x6EBC0000
0x30A00108: 0x6EC04000
0x30A0010C: 0x6EC48000
0x30A00110: 0x6EE65000
0x30A00114: 0x6EF74000
0x30A00118: 0x6F083000
0x30A0011C: 0x6F192000
0x30A00120: 0x6F194000
0x30A00124: 0x6F1A5000
0x30A00128: 0x6F200000
0x30A0012C: 0x6F244000
0x30A00130: 0x6F24D000
0x30A00134: 0x6F24F000
0x30A00138: 0x6F260000
0x30A0013C: 0x6F2BB000
0x30A00140: 0x6F2FF000
0x30A00144: 0x6F308000
0x30A00148: 0x0
0x30A0014C: 0x0
0x30A00150: 0x0
0x30A00154: 0x0
0x30A00158: 0x0
0x30A0015C: 0x0
0x30A00160: 0x0
0x30A00164: 0x0
0x30A00168: 0x0
0x30A0016C: 0x0
0x30A00170: 0x0
0x30A00174: 0x0
0x30A00178: 0x0
0x30A0017C: 0x0
0x30A00180: 0x0
0x30A00184: 0x0
0x30A00188: 0x0
0x30A0018C: 0x0
0x30A00190: 0x6F418000
0x30A00194: 0x6F4A0000
0x30A00198: 0x6F528000
0x30A0019C: 0x6F5B0000
0x30A001A0: 0x6F638000
0x30A001A4: 0x6F6C0000
0x30A001A8: 0x0
0x30A001AC: 0x0
0x30A001B0: 0x0
0x30A001B4: 0x0
0x30A001B8: 0x0
0x30A001BC: 0x0
0x30A001C0: 0x0
0x30A001C4: 0x0
0x30A001C8: 0x0
0x30A001CC: 0x0
0x30A001D0: 0x0
0x30A001D4: 0x0
0x30A001D8: 0x0
0x30A001DC: 0x6F748000
0x30A001E0: 0x6F7D0000
0x30A001E4: 0x6F858000
0x30A001E8: 0x6F8E0000
0x30A001EC: 0x0
0x30A001F0: 0x0
0x30A001F4: 0x0
0x30A001F8: 0x0
0x30A001FC: 0x0
0x30A00200: 0x0
0x30A00204: 0x0
0x30A00208: 0x0
0x30A0020C: 0x0
0x30A00210: 0x6F968000
0x30A00214: 0x6F9F0000
0x30A00218: 0x6FA78000
0x30A0021C: 0x6FB00000
0x30A00220: 0x6FB88000
0x30A00224: 0x6FC10000
0x30A00228: 0x0
0x30A0022C: 0x0
0x30A00230: 0x0
0x30A00234: 0x0
0x30A00238: 0x0
0x30A0023C: 0x0
0x30A00240: 0x0
0x30A00244: 0x0
0x30A00248: 0x0
0x30A0024C: 0x0
0x30A00250: 0x0
0x30A00254: 0x0
0x30A00258: 0x0
0x30A0025C: 0x6FC98000
0x30A00260: 0x6FD20000
0x30A00264: 0x6FDA8000
0x30A00268: 0x6FE30000
0x30A0026C: 0x0
0x30A00270: 0x0
0x30A00274: 0x0
0x30A00278: 0x0
0x30A0027C: 0x0
0x30A00280: 0x0
0x30A00284: 0x0
0x30A00288: 0x0
0x30A0028C: 0x0
0x30A00290: 0x6FEB8000
0x30A00294: 0x6FEC5000
0x30A00298: 0x6FED2000
0x30A0029C: 0x0
0x30A002A0: 0x0
0x30A002A4: 0x0
0x30A002A8: 0x0
0x30A002AC: 0x0
0x30A002B0: 0x0
0x30A002B4: 0x0
0x30A002B8: 0x0
0x30A002BC: 0x0
0x30A002C0: 0x0
0x30A002C4: 0x0
0x30A002C8: 0x0
0x30A002CC: 0x0
0x30A002D0: 0x0
0x30A002D4: 0x0
0x30A002D8: 0x0
0x30A002DC: 0x0
0x30A002E0: 0x0
0x30A002E4: 0x0
0x30A002E8: 0x0
0x30A002EC: 0x0
0x30A002F0: 0x0
0x30A002F4: 0x0
0x30A002F8: 0x0
0x30A002FC: 0x0
0x30A00300: 0x0
0x30A00304: 0x0
0x30A00308: 0x0
0x30A0030C: 0x0
0x30A00310: 0x0
0x30A00314: 0x0
0x30A00318: 0x0
0x30A0031C: 0x0
0x30A00320: 0x77500000
0x30A00324: 0x77500000
0x30A00328: 0xFC000
0x30A0032C: 0x0
0x30A00330: 0x77590000
0x30A00334: 0x77590000
0x30A00338: 0xFC000
0x30A0033C: 0x12 
Another possibility is Samsung built-in screen dump hardware functionality. Looks like it is still implemented in C/D-series Samsung chips (a little differently, though; see relevant lldDp* functions in libSDAL.so for details). In many ways, it would be very convenient for your purposes: post-processed/scaled/final image (with or without OSD graphics), always in one single format ([A]RGB 1920x1080), with relatively simple control ( just 4 hardware registers involved).
However, it's apparently not intended for capturing live images (just stills). Can it be tweaked for capturing screen contents without momentary freeze? I dunno.. Perhaps..I did some simple experiments a couple of months ago (in B-series only). Mixed results; seems to work well for some inputs/modes (HDMI, 1920x1080@p24/p50/p60). Not so good results for DTV (SD) and/or interlaced inputs, unfortunately - there was (nearly always) some imminent image distortion. Test app attached below (will NOT work in D-Series models without some modifications).
You do not have the required permissions to view the files attached to this post.
bole5
Posts: 10
Joined: Tue Dec 27, 2011 11:26 am

Re: Ambilight using boblight and arduino

Post by bole5 »

Thank you very much for your help and the test apps. I hope to find some time to dump my TV's memory and see if I can find a suitable memory location.
I'll also try to see what I get from the libSDL. The following functions sound interesting: GetFrameBufferAddress(int) and _Z14GetDisplayInfoi.
sbav1
Official SamyGO Developer
Posts: 374
Joined: Fri Jan 15, 2010 10:20 am

Re: Ambilight using boblight and arduino

Post by sbav1 »

bole5 wrote:I'll also try to see what I get from the libSDL. The following functions sound interesting: GetFrameBufferAddress(int) and _Z14GetDisplayInfoi.
That may be helpful for obtaining OSG back (shadow ?) framebuffer address[es]. Interesting - yes, but: not what you need, most likely.
idbirch
SamyGO Project Donor
Posts: 72
Joined: Fri Nov 20, 2009 11:56 am

Re: Ambilight using boblight and arduino

Post by idbirch »

Any news on this one? I'm still very excited to see if this is possible.
abccba97

Re: Ambilight using boblight and arduino

Post by abccba97 »

i?m also VERY interested on a working solution. That Plugin would be the main reason for buying a Samsung tv to me!
kathy82
Posts: 1
Joined: Wed Jul 31, 2013 5:48 am
Location: San Francisco, CA

Re: Ambilight using boblight and arduino

Post by kathy82 »

dude im banging my head all over the place .. i found the 50 piece lights that you used which I got from http://www.lightingnext.com/12mm-ws2801 ... ixels.html , I was wondering do you think its possible to power up the lights via a usb port on the tv? i have one just sitting there doing nothing and would be great way to save on wall outlet..
JasonNorton
Posts: 1
Joined: Tue Aug 27, 2013 7:51 am

Re: Ambilight using boblight and arduino

Post by JasonNorton »

bole5 wrote:Hi,

I am looking into adding ambient lighting to my newly-acquired Samsung UE46D6500. After doing extensive research on the internet (and being a big supporter of xbmc) I finally settled for the following solution:

1. boblight for calculating colors and sending them over to arduino over the USB. It can communicate with multiple devices such as atmolight, ikea dioder, adalight etc...

2. Arduino UNO for driving the
led light

3. LEDs (cheap LED strips or more expensive digitally-controllable ones)

Boblight is great choice since it is a client-server solution and you can have them running on different devices. One example is client running on the XBMC communicating with server running on an openwrt router (for this setup check the xbmc forums). Arduino is a great open source hardware available for cca. 20$. We can easily drive LED stripes using PWM or much more sophisticated WS2801 based LED Pixels. Depending on your budget you can choose to order LED stripes from dealextreme (cca. 15$/meter) or LED Pixels from adafruit.

I would like to compile boblight for Samsung TV and adapt it to get the image directly from TV's framebuffer to calculate colors instead using xgetimage. I am still struggling to get the cross compiler running on my ubuntu 10.04 setup. Once that is done I will try to compile the server part and then adapt the client.

Questions:

- Do you think this is doable on D-series ARM? (Ideally I'd like to make it available for all models if possible)
- What is the least CPU-intensive way of getting image (screenshot) from the framebuffer?
- Has anyone succeeded in having a working cross compiler for D-series?
- Can I use pre-compiled toolchain from embdebian and if yes which one is the most suitable?
- Am I trying to reinvent the hot water/has anyone working ambilight setup already?


P.S. I tried to add direct links to the external resources such as boblight googlecode site but then I got following warning: "Your post looks too spamy for a new user, please remove off-site URLs.
"
hello friend were you able to find right Ambilight? I am searching for new Ambilight so please help me with your experience..Waiting for reply thanks in advance:)

Post Reply

Return to “General”