How to build an Ambilight for every HDMI input source

In this post I’m going to show how you can configure your Hyperion Ambilight for every HDMI source. If you don’t have an Ambilight setup yet, I kindly refer you to my previous guide, which will give you an initial ambilight effect for the media center running on the Rpi.

This guide will then go one step further and enable the ambilight effect for all kind of HDMI input sources like PS3, XBOX, Chromecast etc.

We need to get the color information from an HDMI input signal. For this purpose, it’s necessary to transform the digital HDMI signal to an analog composite one with a converter. After this, we can grab the composite signal with an USB video grabber connected to the Raspberry Pi. Now we’re able to feed Hyperion with the color information by the video grabber.

Parts list

AVR Receiver It’s essential. Most TVs don’t offer an HDMI output
HDMI to Analog converter Speaka Professional HDMI / Composite Converter. There are several others on the market
2 port HDMI splitter My AVR features two HDMI outputs. Otherwise make sure you’ll get one!
USB Video Grabber (Easycap) Make sure you got a grabber with the STK1160 chipset, because it’s fully supported on Linux! Check here for detailed instructions, this can be tricky…

I’d recommend a grabber with the UTV007 (Fushicai) chipset. It’s supported with OpenElec >=4.2.1 and features the best results for this purpose.

Composite cabel Just a standard video cinch cabel
Active USB Hub The Raspberry won’t be able to power most of the devices directly from it’s USB port.

Let’s wire it up. Connect the HDMI output from your AVR or from your HDMI splitter to the HDMI / Composite converter input. Use the composite cabel for connecting the USB video grabber with the Composite converter analog output. Plug the USB video grabber into the active USB hub, connect the hub to the Raspberry Pi.

If you already have a running media center then you might already have an analog video output on this machine. In this case, connect the analog output to the grabber, directly. Another possibility would be to go for an DisplayPort to composite converter that connects to the USB grabber. For both solutions, make sure that your existing media center is capable of playing your media to both outputs, simultaneously otherwise you’ll need to go for a 2 port HDMI splitter (without AVR) and HDMI to composite converter.

Here’s my setup connected, ready for video capturing from any HDMI input.

HDMI capturing setup

 

1. USB Video Grabber setup

Connect the USB Video Grabber to the Raspberry and type

Unfortunately, my device with “ID 1b71:3002″ features a Fushicai UTV007 chip, which is only initial supported with kernel 3.11. This forced me to compile the kernel module myself. If you got the same problem, here’s my precompiled module “usbtv.ko” for Raspbmc with kernel 3.10.36. Make sure you first load the modules “videobuf2-vmalloc” and “videobuf2-core”, than load the module with insmod usbtv.ko.

OpenElec (>=4.2.1) has the driver for Fushicai UTV007 already included, therefore it will work out of the box. Remember, to enable ssh you have to boot OpenElec with TV connected. After that, you won’t need the installed XBMC/KODI anymore. It seems like the current Raspbmc release has the driver not included. SSH to openelec and install hyperion:

Then copy your hyperion.config.json to the shared SMB “Configfiles” folder from your host system. The shared “Configfiles” folder is actually mapped to /storage/.config on the Rpi filesystem. After a Rpi reboot, Hyperion should autostart and load the config from /storage/.config/hyperion.config.json automatically, though.

Remember that you have to set the library path for OpenElec setups before you can execute any hyperion command:

Stop / Restart hyperion manually:

Take a screenshot from the grabber with following command. Remember to kill hyperiond before you can execute this command properly!

For further instructions, make sure to checkout the documentation.

2. Hyperion configuration

Hyperion already features capturing color information from a USB video grabber. Add following configuration to your hyperion.config.json file to enable it.

To adjust the cropping for your setup, you have to change the values “cropLeft, cropRight, cropTop, cropBottom” and make sure “device” matches with your ls /dev/video* output!

Check the created screenshot.png, adjust the crop-* values till the grabbed input has no black borders left. Then put the calibrated values into your /etc/hyperion.config.json file.

Screenshot from my USB grabber input, I was able to get rid of the upper and lower borders by adjusting the cropTop and cropBottom values. The green lines are most likely from the incomplete driver for my grabber.

screenshot.png

 

Let’s test some videos! If you don’t like the results, try to fine tune your setup with different SignalThresholds or try to adjust the hsv settings.

When you switch the HDMI source on your AVR to non HDMI sources, like for example audio only devices, the LED’s will light up in blue. Blue is the default color if no video source was detected for many AVRs. You can disable the LED’s in this situation by setting the blue-threshold value to 1.0.

3. Conclusion

Now you should be able to use your Ambilight for any HDMI input you have connected to your AVR. If you have any question, feel free to ask in the comments section. Enjoy your unleashed Ambilight!

89 thoughts on “How to build an Ambilight for every HDMI input source

  1. hi Christian!
    First thank you for your very helpful topic. I succeeded in running my own ambilight on openelec with a fushikai grabber. It works on my PC but when I power up the hdmi2av (or the grabber) it forces the Pc to lower its resolution. It seems to be the same issue as Tamesh. I can not understand how it is possible and how I can fix this annoying problem… Any idea?
    Cheers,
    Alex

  2. Hello Christian

    I’m new into this adventure !!
    My ambilight work fine but how make for a 3d movie.
    By defaut, the setting is “2D” how make change when have a SBS or TAB movie ?

    I have a grabber with chip Fushicai and raspbmc.
    Regards

    Sorry for my bad english !!

      1. Hi Christian

        Thanks for your answer.
        Thus the solution for 3d movies would be to have a 2nd raspberry ?

        To install openelec on the 2nd raspberry, but is it possible to connect leds in parallel with the 1st raspberry ?

        1. Well, you’d need a Rpi with a media center installed as described in this post: How to build your own Ambilight TV with Raspberry Pi and XBMC for auto 3d detection to work.
          I’m actually not quite sure what happens when you connect the LED strip in parallel to the two Rpi SPI controllers. They would most likely interfere each with other especially if they are both turned on. I could imagine that a simple hardware switch between the Rpi and the LED strip could solve this problem but then you have to manually choose which Rpi you want to use.
          You have to try it out and see if it works.. :-)

          1. Thanks for your answer.
            I am soon going to study it.

            I have another question, i have a Rpi with raspbmc and fushicai support from lightberry. It’s possible that hyperion detect the strips black ?

            I don’t have light when i have strip black.

            I don’t have lightberry leds, i have led strips ws2801.

  3. Hi,

    I have an issue where my PS4 is connected to the splitter, but my monitor then auto detects the max res. as 480p and the video grabber (UTC007) works fine, but that resolution is no good for the PS4 so if I force it to 1080p then the video grabber input stops receiving anything, has anyone encountered this issue?

    Cheers, Tamesh

    1. Hi Tamesh, it seems like the splitter is detected as unknown HDMI device and therefore the resolution is automatically reduced, would try a better one.
      It’s strange that the video grabber stops working with 1080p, the HDMI to analog converter should in any case reduce the resolution to one that is supported by the analog video grabber. Maybe the converter doesn’t support 1080p as input resolution?
      Regards Chris

    1. No, I’d try to replace the grabber instead. Since there are currently some issues with the STK1160 grabbers in combination with the newer Linux kernels, I’d go for a Fushicai UTV007. They work pretty good with OpenElec >= 4.2.1.

  4. Hi Christian,

    I found your article very handy for setting up and configuring hyperion in openelec, however i have two issues that i can’t seem to resolve. The first is hyperion seems to crash within 30-60 seconds.

    /storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.jso
    n /dev/null
    Effect directory can not be loaded: /opt/hyperion/effects
    effect Rainbow swirl fast not found
    terminate called after throwing an instance of ‘std::runtime_error’
    what(): VIDIOC_DQBUF error 19, No such device
    Aborted
    XBMC:~ #

    i seem to have to restart hyperion before it will pick up the usb video grabber.

    Any help would be appreciated.

    Cheers,
    Chris

    1. Hi Chris, /dev/null seems wrong to me. Did you configure your video grabber correctly in the “grabber-v4l2″ section in hyperion.config.json?
      e.g


      "grabber-v4l2" :
      {
      "device" : "/dev/video0",
      "input" : 0,
      ...
      }

  5. Hi Chris,

    First of all thank you very much for taking the time to share (and update) this great tutorial ! Extremely clear and very accessble even for beginners like me :-) The end result looks fantastic and is definitely motivating !

    I already spent few weekends trying to set this up… but I am not quite there yet :-( I am using a Raspberry PI running latest version of RaspBMC as well as a Sabrent USB-AVCPT A/V-to-USB 2.0 Digital Video Adapter (which I double checked to be an STK 1160 – 48000 chip – as shown in output of lsusb below) plugged to a powered USB hub. I had to downgrade from Kernel 3.12 to 3.10 in order to get it recognized as /dev/video0. I was also able to successfully install Hyperion and light up my LEDs using hyperion-remote.

    I am currently stuck on capturing a screenshot via my USB grabber: after stopping Hyperion, I tried to run sudo hyperion-v4l2 –screenshot but it remains stuck on V4L2 grabber started (please see command output below) and does not capture a screenshot in my home folder. At this point I don’t really know what else I can try…

    Could you please let me know if that sounds like a familiar error / behavior to you ?

    Of course please let me know if there is anything else I should provide to further clarify my issue or setup ! Thank you !

    pi@raspbmc:~$ lsusb
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
    Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
    Bus 001 Device 005: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device

    pi@raspbmc:~$ lsusb -v -d 05e1:0408 | grep tSamFreq | sed -e "s,^.* ,,"
    Couldn't open device, some information will be missing
    48000

    pi@raspbmc:~$ sudo hyperion-v4l2 --screenshot

    V4L2 width=720 height=480

    V4L2 pixel format=UYVY

    V4L2 grabber signal threshold set to: {0,0,0}

    V4L2 grabber started

    pi@raspbmc:~$ sudo hyperiond /etc/hyperion.config.json

    Application build time: Sep 22 2014 20:48:42

    QCoreApplication initialised

    Selected configuration file: /etc/hyperion.config.json

    ColorTransform 'default' => [0; 49]

    Device configuration:

    {

    "colorOrder" : "rgb",

    "name" : "MyPi",

    "output" : "/dev/spidev0.0",

    "rate" : 250000,

    "type" : "ws2801"

    }

      1. Hi Chris,

        Thanks for taking the time to help me ! I have been trying several things (fresh installs of OpenElec and RaspBMC, different Kernels 3.10 and 3.12). But no matter what I tried I am still stuck on V4l2 grabber started.

        I tried the command you mentioned:
        pi@raspbmc:~$ hyperion-v4l2 -d /dev/video0 –screenshot
        V4L2 width=720 height=480
        V4L2 pixel format=UYVY
        V4L2 grabber signal threshold set to: {0,0,0}
        V4L2 grabber started

        pi@raspbmc:~$ v4l2-ctl –all
        Driver Info (not using libv4l2):
        Driver name : stk1160
        Card type : stk1160
        Bus info : usb-bcm2708_usb-1.3.1
        Driver version: 3.10.24
        Capabilities : 0x85000001
        Video Capture
        Read/Write
        Streaming
        Format Video Capture:
        Width/Height : 720/480
        Pixel Format : ‘UYVY’
        Field : Interlaced
        Bytes per Line: 1440
        Size Image : 691200
        Colorspace : Broadcast NTSC/PAL (SMPTE170M/ITU601)
        Video input : 0 (Composite0: ok)
        Video Standard = 0x00001000
        NTSC-M
        Streaming Parameters Video Capture:
        Frames per second: 29.970 (30000/1001)
        Read buffers : 2
        Priority: 2

        I am thinking to test another grabber… maybe the Fushicai…

        Please let me know if you have any other ideas ! Thanks again for the help !

        Quentin

        1. Hi Chris, I made some progress ! I finally got a screenshot using hyperion-v4l2 (yay!). Unfortunately, the screenshot is really ugly… the image is black/white distorted and barely recognizable :-(

          Thanks again for the great tutorial !

          Quentin

  6. Hi Chris,
    I have tried to do some more fault finding. I have tried a few things but i think the main thing is that I just have the frame grabber plugged into my Rpi but have not connected the other end and tried to take a screenshot and got the same screen as a usually do. So this would mean my framegrabber isn’t working. I did use an old TV with a composite out and tried that going straight to the Rpi but that still gave the same screenshot.
    Is there another way I can test the framegrabber? Maybe using my laptop?

  7. My TV has no analog input for the RCA cables so i can’t test that.

    My system is connected as follow:

    Blu-ray & Sky Box connected to HDMI Switcher input
    Switcher output goes to HDMI Spliter input
    Splitter output 1 is to the TV & output 2 goes to Analog converter
    Analog Converter goes to Frame grabber
    Frame grabber goes to Rpi

    When i type:
    LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperiond /storage/.config/hyperion.config.json

    I get the following;
    XBMC video checker created and started
    Display opened with resolution: 720×480
    Frame grabber created and started
    V4L2 width=720 height=480
    V4L2 pixel format=YUYV
    V4L2 grabber signal threshold set to: {255,255,255}
    V4L2 grabber started
    V4l2 grabber created and started
    Json server created and started on port 19444
    Proto server created and started on port 19445
    XBMC Connected
    BORDER SWITCH REQUIRED!!
    CURRENT BORDER TYPE: unknown=0 hor.size=0 vert.size=0
    Message from XBMC: {“id”:666,”jsonrpc”:”2.0″,”result”:[]}
    XBMC checker: switching to OFF mode
    BORDER SWITCH REQUIRED!!
    CURRENT BORDER TYPE: unknown=0 hor.size=5 vert.size=0
    Message from XBMC: {“id”:668,”jsonrpc”:”2.0″,”result”:{“System.ScreenSaverActive”:true}}
    Message from XBMC: {“id”:670,”jsonrpc”:”2.0″,”result”:{“version”:{“major”:13,”minor”:2,”revision”:”0f3db05″,”tag”:”stable”}}}
    V4L2 grabber stopped
    effect finished
    V4L2 grabber started
    V4L2 Grabber: Signal lost

    Does this give any more clues to whats wrong?

    1. First of all thanks Chris for this great tutorial! I can’t wait to get everything going.

      To Mark and whoever else may be having similar problems: I’m trying to process my Mitsubishi DLP’s analog out (no hdmi splitter or digital to analog converter). After much finagling I finally read the TV’s manual and found out its analog out doesn’t work with the HDMI inputs. And all I was getting from the video capture was black and green lines. As Chris mentioned the black and green screenshots are likely caused by no input signal. Might be relevant..something to look into anyways.

  8. Hi Chris,

    I making progress but it is all baby steps. I know have all my LEDS working and i am using a 2m cable to my Rpi and also managing to run it of a 3a micro USB supply.
    But when I have my system all connected up the amblight doesn’t work with the TV. If i play a movie through OpenELEC it works fine. So i’m guessing its to do with the frame grabber, what can i do to check this?

    1. Try to capture a grabber screenshot with hyperion. This allows you to analyse the captured analog video signal that hyperion uses to color up the leds.
      When this seems ok, check the frame grabber config and its priority.
      Regards

      1. How do i take a screenshot with hyperion/openelec?

        I tried to use the command in your guide but it doesn’t work with OE.

        1. Connect to openelec and switch to dir “/storage/hyperion/bin” and execute hyperion-v4l2 with your settings. “LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperion-v4l2 /storage/.config/hyperion.config.json -–screenshot” as descriped in the guide. Remember to kill hyperiond first.

          1. I login in to OE and type:
            killall hyperiond

            This all works fine. I then change directory to hyperion/bin and type:
            LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperion-v4l2 /storage/.config/hyperion.config.json -–screenshot

            From this i get the following read out and a screenshot in the bin folder of a black screen with lots of horizontal green lines.

            V4L2 width=720 height=480
            V4L2 pixel format=YUYV
            V4L2 grabber signal threshold set to: {0,0,0}
            V4l2 grabber started
            V4l2 grabber stopped

            If i type hyperion-v4l2 first as the start of a command it just says
            -sh: hyperion-v4l2: not found

            Does any of this make sense?

          2. Well, if you have got a screenshot, than the grabber should work with hyperion. The green lines are ok, I got them as well. But it seeems like you don’t have any input signal or otherwise an input signal which shows a black image from your source. What and how did you connect to the splitter, grabber? Did you try out to connect the analog signal directly to the TV, most TVs still have got an analog input. This way we can make sure that your analog signal is fine.

  9. Instead of converting the HDMI stream to composite, would it be possible to utilize the composite video monitor out on a receiver?

    1. Hi Chad, yes this should be technically possible but you have to test if the avr is really capable of converting an hdmi input signal to hdmi and composite in parallel. You will still need an usb grabber, though
      Let me know your results. Regards, Chris

  10. When I do my lsusb, I get the following info:

    pi@raspbmc:~$ lsusb
    Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
    Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
    Bus 001 Device 005: ID 05e1:0408 Syntek Semiconductor Co., Ltd STK1160 Video Capture Device
    Bus 001 Device 006: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter

    but when I do the ls /dev/video* command I see the following:
    pi@raspbmc:~$ ls /dev/video*
    ls: cannot access /dev/video*: No such file or directory

    Any ideas to try to get past this point ?
    Thanks !

  11. Hi Chris, I got it to work!!! Well sort of, the issue i had was that my data leads had come of the strip but as i had heat sinked them in i couldn’t see.

    However my next issue is that not all the LED’s are working. I have 21 up the sides and 33 at the top & bottom. At the moment it stops at around the 73 LED, so it works up the first side and all along the top but as it starts coming down teh other side only the first few LED’s work.

    Any Idea’s?

    1. good job! :-)

      Well, this must be a problem with your hyperion.config.json. Doublecheck your hypercon config. Does the number on the bottom right represent your total LED count?
      – Does your power supply offer enough power to power up all your LEDs?

      1. I thought that, so I have been playing around with it so that if I choose a lower amount of LEDS it will stop but then when I increase the number to get past that 57 one it stops. I thought it could be the next LED in the row so added different ones and that didn’t work. I get 5v at the end of the string and my power supply is rated for 8 amps so that can’t be the problem. I even used a 3a micro USB power supply and that worked fine for the 57 LEDS.

        Could it be that the 57th is preventing data going any further?

        Maybe I need to make up another string of LEDs and test that and see what happens.

  12. Unfortunately I have had no success getting the Somagic SMI-2021CBE Video grabber to work (Comes up with (no firmware) under the lsusb command.

    Can someone verify that the chipsets that should work ?

    I know STK1160 is mentioned in the article but I am having no luck finding that chipset to order. I also see the Fushicai UTV007 mentioned. Can someone clarify if these chipsets work properly in the Raspberry Pi/Raspbmc/Hyperion config from the article or so I need to ditch that configuration to look at the OpenElec that is mentioned on here (Is OpenElec analogous with the Raspbmc ?

    Thanks for any clarification.

    1. Update: I have found one with the STK1160 Chipset (If I get the solution working I’ll post a link of where to get it).

      A couple of questions about updating the Hyperion Config step
      1. Where do I add the snippet (I am thinking it would go right before “endOfJson” : “endOfJson”}
      2. When I add this code, will the Hyperion Remote still work or will it be only driven by the HDMI source ?

      Thanks !

  13. Hi Chris,

    Really sorry about the ambush of messages but i do think i am close now.

    For now ignore all my other comments and lets try and start again.
    So I had another play with those 2 commands you gave and as far as i can tell from the command window in Putty they seem to work but nothing happens with my LED’s. What I also noticed is that i can seem the command line registering commands when I use the Hyperion APP but still nothing happens with the LED’s.

    How can I check my LED’s?

    1. Well, that’s good to hear.
      There are a lot of different things to check:
      – Check the device section in hyperion.config.json. Is the output set to “/dev/spidev0.0″? What is the output of “ls /dev/spidev*”? You could try setting it to “/dev/spidev0.1″ and reboot.
      – Doublecheck the spi bus connectors (DI,CI on the diagram), are they connected to the correct GPIO pin? Do you have a Revision 2 Rpi? Maybe check the pinout, it has slightly changed to the version shown in the post, which is for rev 1.0
      – Did you connect the power supply directly to the +5V/GND connectors of the first LED strip’s input side and left the last LED strip’s output empty? Do you use a sufficient power supply? Try to power a shorter strip if all is connected properly.

      HTH, Chris

      1. Thanks for that I will try those things now but something else i read was that the length of my cables could cause an issue, my cables are about 2m?

          1. Shorter cables didn’t work.

            When i type ls /dev/spidev I get the response:
            ls: /dev/spidev: No such file or directory

            I got the pinouts from the drawing for Rpi B+

            I have only made connections to 1 end of the strip. When i do plug in the power all the LED’s give a very quick and feint flash of red/green/blue.

            I have a 5v 8A supply, I can measure 5v on the strip so its getting power.

            I did notice that there are 2 config files, one located in /storage/.config and another in /storage/hyperion/config so i copied my new file to both locations. Shoud i delete 1?

            Please Chris give me another life line!

  14. AAHHHH This is sooo frustrating as i believe i am so close but it still isn’t working!?!??!

    Ok, i don’t have everything hooked up as i am just trying to check the main parts. I just have the LED’s and a TV connected to my Pi and thought I can use the Android App to test my LED’s and it says that it is unable to connect. I have also tried running the test script for the LED’s to go RED for 5000 but that also says ‘unable to connect to host’

    I though this might be the OUTPUT setting on the config tool as in another of the test scripts for Openelec install i noticed it ended with /dev/null and the default in the config tool is spidev??

    Please tell me what i’m doing wrong as this is beginning to longer be fun and i’m losing sight of my end result :0(

    1. Ok a quick update, i turned off the PI and re-conncted with Putty and tried to do the LED test again using the command:
      storage/hyperion/bin/hyperion-remote.sh –priority 50 — color red — duration 5000

      Now i get the response:
      -sh: storage/hyperion/bin/hyperion-remote.sh: not found

      But if i connect with WinSCP i can scroll to the file, does this make any sense?

      1. try connect with putty and type: LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperio
        n/bin/hyperion-remote -c red

        If this doesn’t work, doublecheck your hyperion.config.json file:
        vi /storage/hyperion/config/hyperion.config.json
        your device section should look like that:
        "device" :
        {
        "name" : "MyPi",
        "type" : "ws2801",
        "output" : "/dev/spidev0.0",
        "rate" : 250000,
        "colorOrder" : "rgb"
        },

        output and type is essential, output must point to the spi bus device hook, type must match the LED chip type. After every change in the config file, you have to restart hyperion or reboot the Rpi.
        killall hyperiond
        LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperiond /storage/.config/hyperion.config.json

        This will show you the output of hyperion as well. This could come in handy for further investigations..

        regards

        1. Thanks again for your support, if you wasn’t doing this my project would have long been scrapped!

          So, after typing: LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperio
          n/bin/hyperion-remote -c red

          I get the response:
          /storage/hyperion/bin/hyperion-remote: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory

          Then when i typed:
          LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperiond /storage/.config/hyperion.config.json

          I get the response that it starts loading all the effects but then ends with the following:
          Hyperion created and initialised
          run effect Rainbow swirl fast on channel 0
          Boot sequence(Rainbow swirl fast) created and started
          XBMC video checker created and started
          Display opened with resolution: 1920×1080
          Frame grabber created and started
          terminate called after throwing an instance of ‘std::runtime_error’
          what(): Json server could not bind to port
          Aborted

          Do i need to have the system fully connected or can i get away with just having the LED’s and my TV connected to the HDMI of the Rpi?

          1. Another update is that i tried the first command again after the second and the response is:
            Connected to localhost:19444
            Set color to 255 0 0

            But nothing happens with the LED’s?

            Any Ideas?

  15. Hi Chris,

    I finally finished my setup but wanted to do some checks before i mount it back on the wall. My concerns to start is that there isn’t enough Amps, i have a 5v 3a (a guess) supply which I have just plugged into the micro USB. So first what did you mean when you said to Thomas to ground the GPIO pin? But secondly after using your method it seems I would need 6a in total. Is it best then not to use the micro usb port?
    Finally should i be able to use the Hyperion Android app with just my LED’s connected as a test?

    Thanks again for your help

    1. Hi, glad you could follow. Generally, you’ll need 1 A per meter LED strip and 1 A for the Rpi. As described in the diagram, you have to power up the LED directly by a power supply and not through the Rpi. Basically, you don’t connect any +/- of the LED strip to the GPIO of the Rpi instead you connect them to the PS. If you go for the micro usb port variant, than you connect only the GND (-) of the PS/LED strip to the GND of the GPIO and power the Rpi by a plain cell phone charger. This will reduce any interference on the SPI bus.

      Hope this helps.
      Regards Chris

      1. Yeah link is about UTV007, but it does work with STK1160 as well. Just installed raspbmc yesterday with Network image (newest) and /dev/video* didnt show up, after kernel change it was there.

        Here is more information about this:
        https://github.com/raspberrypi/linux/issues/660

        It seem that it wont work directly with 3.12+ kernels.

        Disclaimer: Didn´t test grabber yet with Video signal, still waiting HDMI2AV adapter.

  16. Anyone have the inside track on where to buy the EasyCap clone with the proper Chipset??? Thanks to Christian’s help I made it through part one of this tutorial and now I am trying to tackle part 2. The first EasyCap one I got from Amazon and it came with the Somagic SMI Grabber SMI-2021CBE which my Raspbmc didn’t see automatically.
    I have looked at some of the web sites on here that explain how you are supposed to be able to compile the driver but none of them have given me that “a ha” moment to get it to work, so I am trying to find one of the EasyCaps that can be detected automatically like the STK1160. Thanks for any help you can provide on finding this elusive part !

  17. Hi,

    Thanks alot for the help I really appreciate it. I was running 4.0.6 of OpenELEC so i will try the new beta. If this has teh driver do i need to still paste in that extra stuff in the config file?

    Best Regards

  18. Hi Chris,
    i have switched to openelec and now trying to install hyperion using on that. When i do the ‘lsusb’ i get ID 1b71:3002 and when I ask for ‘ls /dev/video’ i get ‘no such file or directory’. This isn’t going well is it?

    What else can i try? I don’t we could skype or facetime if that isn’t too much of an invasion? I’m really excited about getting this install going but fear it could take me a while to get the programming part right :0(

    Best Regards – Dumbass

    1. Hi, it doesn’t look too bad, just read carefully, I wrote: “ls /dev/video*” with a *, which should result in “/dev/video0″ and lsusb should result in: “Bus 001 Device 005: ID 1b71:3002 Fushicai USBTV007 Video Grabber [EasyCAP]”.
      Make sure, you use the latest Beta OpenElec. I tried with 4.1.6, which includes the driver. You can easily upgrade openelec by copying the *.tar file to the update folder and then reboot.

      After that, follow this installation guide for hyperion for OpenElec: https://github.com/tvdzwan/hyperion/wiki/Installation-on-RPi-with-OpenELEC
      For the hyperion LED configuration, check my previous guide.
      Regards Chris

  19. Hi Chris,

    Thanks for the tutorial, following yours has got me the closest so far and I have tried about 4!!

    I always get really stuck on the programming part and I am so close to finishing that I’m getting really frustrated so pease help. I have RaspBMC and I’m I have the Fushicai USB grabber and I’m lost on how to install the extra modules, how do I do it?

    I’m sure it’s really easy and feel free to start your reply with “Hey Dumbass”, looking forward to your reply.

    thanks

    1. Hi, I’m glad to help. Simply switch to openelec, it already includes the necessary kernel modules for the Fushicai grabber to work without loading modules.
      Anyway, what is the output of “lsusb” and “ls /dev/video*”?

      You can load the kernel driver with:
      modprobe spi-bcm2708
      modprobe videobuf2-vmalloc
      modprobe videobuf2-core
      insmod usbtv.ko
      You can download a precompiled usbtv.ko from the blog post, but I’m not sure if it will work with the recent RaspBMC builds.

      Regards Chris

  20. Hi,

    This is a great guide. I’ve followed the first half and through xbmc it’s all looking great. I have the parts for this on order.
    Do you still need a raspbmc build or can you just do it via raspbian as the input is now the usb grabber?
    Is there a setting to switch Hyperion between the USB grabber and XMBC (if you keep that build on)
    Thanks for any help and for a really brilliant guide!
    G

    1. Hi, thanks a lot.

      Basically, you can use any linux distribution that supports your USB grabber. Just make sure that your Rpi has still enough resources for running the grabber. You can switch between different hyperion clients (Hyperion app, grabber, xbmc grabber) by using the priority setting for each grabber in hyperion.config.json.
      Regards Chris

  21. Hi Christian. Thanks for your response. I’m sorry I haven’t been as quick to reply, but things have been a little hectic.

    After further reading, I agree that a USB bandwidth issue could be the source of the problem, although changing frameDecimation and sizeDecimation parameters did not manage to fix the problem. (I believe I read somewhere that frame decimation and size decimation only take place after the image has been captured by the pi (after moving through USB)).

    My lights also all occasionally flash Blue (matching the background of the XMBC) regardless of what is playing.

    I also noticed that changing “Standard” from “no-change” to “PAL” reduced the number of errors displayed before a frame was captured (even though my converter was set to “NTSC”), but in doing so the image turned to black and white again. Changing the value on the HDMI2AV converter and the config file to PAL increased the number of errors again, but made the image color.

    Do you think adjusting the configuration in framegrabber may help? Mine is currently set to defaults at:

    /// The configuration for the frame-grabber, contains the following items:
    /// * width : The width of the grabbed frames [pixels]
    /// * height : The height of the grabbed frames [pixels]
    /// * frequency_Hz : The frequency of the frame grab [Hz]
    “framegrabber” :
    {
    “width” : 64,
    “height” : 64,
    “frequency_Hz” : 10.0
    },

    I’ve also read that the SD card speed may affect results. I’m currently using a Class 4 8GB card. Do you think moving my image to a class 10 will help?

    Thank you again for your help.

    1. Hi Freddy, well I don’t think moving to a class 10 will help that much. I’m using an first generation Rpi,256 MB Ram and a class 6 SD card. Well the setting of the converter and the hyperion config should be equal.
      I’m not sure what causes the problem, you could try another usb hub or grabber.

      my settings:

      “standard” : “no-change”,
      “width” : -1,
      “height” : -1,

      Regards Chris

  22. Is it possible to run the screenshot in command in OpenELEC? When I try “hyperion-v412 –screenshot” it says “hyperion-v412 not found” and “./ hyperion-v412 –screenshot” results in “permission denied”

    1. Hi Chase, I have to look into it, since I didn’t adjust the settings after switching to openelec.

      Connect to openelec and switch to dir “/storage/hyperion/bin” and execute hyperion-v4l2 with your settings. “LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperion-v4l2 /storage/.config/hyperion.config.json –screenshot”.

      Regards Chris

  23. Hello!

    I’m trying out your commands on my raspi running Hyperion but am getting the following errors:

    Frame too small: 824656 != 829440
    Frame too small: 823284 != 829440
    Frame too small: 818602 != 829440
    Frame too small: 821906 != 829440
    Frame too small: 817630 != 829440

    etc, where the first number constantly changes, but is always below 829440

    I am using a stk1160 and I am using the same hyperion configuration file as you and getting the same results when I do lsusb and ls/dev/video* (I also remembered to kill hyperion)

    do you have any idea what is going on? I’m having trouble understanding what could be causing this error message.

    Any help would be greatly appreciated. Thank you for creating this guide.

    1. Hi Freddy,
      It seems like hyperion receives too little information from the grabber. This could be an USB hub bandwidth issue. You could also try to increase the “frameDecimation” and “sizeDecimation” parameters in the hyperion.config.json file.
      Hope this helps, regards Chris

  24. Hi,
    I followed your guide – it helped a lot.
    I am tring to get the screenshot from my grabber but I keep getting an error:
    “VIDIOC_S_FMT error 16, Device or resource busy”

    What does this mean?
    Thanks!

  25. I will also go with one more question. As I would like to connect 4 HDMIs (TV, XBMC, PS4 and blu-ray) to the ambilight – what kind of splitter should I go with? Should I simply have 4 splitters?

  26. Dear Christian,
    Indeed great guide. I will probably follow it step by step. The only thing which bothers me is the efficiency/latency. Have you observed any delays between the screen and ambilight colours?
    Thanks,
    Tomasz

    1. Hi Thomasz,
      I didn’t observe any noteworthy delays with my USB grabber, yet. If you have 4 HDMI inputs, you probably want to connect them to an AVR and then the single output of the AVR to one single splitter. Perhaps there is a cheaper HDMI switch, to reach a simular solution.
      Regards, Chris

  27. Great guide. I’ve followed all of the instructions but I’m having an issue with the HDMI2AV converter. When I connect my HDMI source, it detects the 480p composite connection output and changes the output resolution to match, thus I see my PS4 on the TV and via the USB video grabber, but the resolution is no longer 1080p, it’s changed to 480. Does this happen on yours? Could it be an issue with the HDMI2AV converter?

    1. Hi Aaron,
      Yes, this is as it should be. Composite, analog video does not support 1080p (max 480i or 576i). So, Hyperion will capture color information from the USB video grabber with a lower resolution than the original HDMI input signal. But this doesn’t matter at all, because we just extract the color information from the signal and don’t show any images. Furthermore, your Rpi will thank you for the less work load ;-)
      Regards Chris

  28. How long is the delay with this solution compared to the XBMC-solution? You don’t happen to have a video showing the colors changes with this setup?

    1. Hi Marcus
      Well, In my opinion the delay is not really noticeable compared to the XBMC solution. I don’t have a video to show yet, but will made one soon. Will upgrade my Rpi xbmc build to the current openelec one, so I’ll be able to test with a more up to date kernel driver for my USB grabber.

  29. Hi,

    latest OpenElec testbuilds for Raspberry Pi have the usbtv module included for now on (as of 19-Jun-2014 #0619)!
    https://github.com/OpenELEC/OpenELEC.tv/issues/3140
    http://forum.xbmc.org/showthread.php?tid=192380

    So after that, it’s just a matter of installing Hyperion on Openlec (it also works for the testbuilds following the instructions from https://github.com/tvdzwan/hyperion/wiki/Installation-on-RPi-with-OpenELEC )

    I’m also using a Fushicai UTV007 (ID 1b71:3002) and it now works perfectly.

    It’s now really simple to install and simplify your how to.

    Anyway thank you very much, my ambilight is really awesome thanks to you :-)

    Regards.

    1. Hi, you’re welcome and I’m glad that you enjoy your ambilight experience!

      Yes, it seems they have closed my opened issue but I didn’t have the time to retest it, so thanks for your testing feedback! ;-)
      Regards, Chris

  30. Hi there Christian,
    Interesting post and I am going to set up the ambilight.
    1 question, my I use my old PC as my HTPC. It uses a VGA output to my television. Would this be compatible? And what changes would I have to make?

    1. Well, you have to feed the USB grabber connected to the Rpi with an analog signal from the HTPC. Perhaps your old PC supports simultaneous output of two analog video signals? You could test this with a second analog monitor connected to your HTPC.

  31. Hi Christian. Thank you very much for these instructional posts. I intend to try this out as soon as possible but I was wondering, would it suffice to use an xbox one with a HDMI splitter instead of an AVR. The xbox one has both an HDMI input and output. Thanks once again.

    1. Hi Abbas, well I don’t have a xbox one to test but it should work when you connect the xbox one HDMI output to the HDMI splitter. Then from the splitter directly to the the TV and to the HDMI to composite converter/ USB grabber which will finally lead to the Raspberry Pi.
      This way you should got ambient light for the xbox media as well for the devices connected to the xbox HDMI input.
      Regards

  32. Looks like it was a driver problem, I was able to get it working pretty well using an old kernel 3.6.11+ which had an easycap driver instead of a STK1160 driver. That worked fairly well, was down to about a .25 second delay. It also didn’t crash or randomly flash LEDs. I then tried the opposite and used a bleeding edge kernel build of Raspbian, 3.12.19+. It apparently updated the STK1160 driver and now I’m down to a .1 delay which pretty much looks good.
    I’m still looking to see if It can go any lower though. Compared to AmbiBox which I used before and running on the same computer it’s still noticeably slower. There’s almost 0 delay when it’s being generated on the same computer.

    I’ve ordered a couple more random easycap devices on Amazon to see if I can’t get a UTV007 in the mix and see if there’s a noticeable increase.

  33. You may actually have been lucky you got the Fushicai UTV007 instead of STK1160. I just got all my parts and been trying to get the STK1160 working decently, but there’s been many issues such as randomly Flashing LED and when it does work there’s about .75 second delay which for the lights is unusable.
    Reading some of the comments on Hyperion’s forum it seems the Fushicai is actually the way to go.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">