WeTek Community Forum

Wetek Core + Hyperion via Arduino nano

Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
Hey all,

Coming from a RPi2 to a Wetek Core, but still very new to all of this stuff. I have been successfully using Hyperion and APA102 Led strips (tested and working with arduino as well) with the Pi to replicate the ambilight effect. I was hoping with Openelec that it would be possible to use this on the Core with an arduino hooked in through USB. I've tried this with wrxtasy's openelec 6.0 build as well as with the Openeelec 6 Unofficial builds. I installed hyperion based on these instructions for openelec : https://github.com/tvdzwan/hyperion/...-with-OpenELEC

Everything goes well with the install and no hangups, I setup the proper hyperion.config.json properties within the /storage/.config/ directory, however, when I go to execute hyperion with :
/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json (removed the /dev/null to get info) I get this in return:

/storage/hyperion/bin/hyperiond: error while loading shared libraries: libbcm_host.so: cannot open shared object file: No such file or directory

I understand the libbcm_host.so is for the BCM GPU chip on the Rpi2, is there anyway to get this working with the wetek core and the AML grabber? I attempted to grab a libusb.tar and extract it, as well as change framegrabber stanza to amlgrabber, to no avail. anyone have this working?

Edit (Ne0):
formatted text to be more readable

Comments

  • uroszurosz Posts: 47WeTek Community Member
    Hi,

    I don't know how Hyperion works but if it's something like boblight then we would need someone to enable some settings in kernel configuration so we would get /dev/amvideocap0 device.
    Boblight grabs data from that device. As far as I know there should be some setting in meson8_something.dts (device tree file) that configures this device when building the kernel.

    Until someone does that boblight/hyperion will most probably not work.

    Best regards.
  • Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
    Thanks for the response. Hyperion does function similar to boblight, albeit using much less CPU. . . I think you are correct in your statement of not having /dev/amavideocap0 enabled in the kernel. I played around with it a bit more and was able to get hyperion to function with the Kodi menu screens using the built in framegrabber, but i have been unsuccessful in getting the LEDs to work during video playback. I've attempted both using a UTV007 grabber, with the device set to /dev/video0 under the v4l2 grabber stanza (this does not seem to be supported either, as the core does not recognize the USB device like the pi and pi2 do.) as well as with the inbuilt video grabber section with the device set to /dev/fb0 (frame buffer 0 works with the menu screen) and /dev/fb1 (frame buffer 1 does not work in the menu or during video playback.

    Hoping someone can give me pointers on what i need to do to enable the videocap device in the kernel. My assumptions would be that i need to build and compile openelec with the proper device trees enabled to support the core hardware as well as the hardware hyperion is looking for. Google searching has not really turned up a good tutorial on where to begin with compiling custom openelec, so if someone has a good resource, id appreciate it. Should i assume there will also be some work done on the hyperion side as well?

    Thanks
  • Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
    can anyone assist me in the steps to how i am supposed to create OE from source to include the /dev/amvideocap0 device. I have found the meson8_something.dts under the linux-amlogic mkpkg, but dont know what to do to have it included in my compile. . .

    https://github.com/codesnake/OpenELEC.tv/blob/wetek_core/tools/mkpkg/mkpkg_linux-amlogic

    any help would be appreciated.

    Thanks
  • uroszurosz Posts: 47WeTek Community Member
    Hi Preston,

    I would love to help you but I'm also searching for the amvideocap.0 file/dev. I found out that AM video capture device is enabled in wetek core project linux.arm.conf and meson8m2_wetek_core.dtd file which is used to generate dts and dtb files has amdiceocap settings in it but there is still no amvideocap.0 file/dev. I also see amvideocap_init_module in dmesg but nothing else. We will probably need help from @codesnake to make this work.

  • Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
    Hi urosz,

    glad to see im not the only one looking around for this stuff :)
    I did find this PR from memphiz, not sure if it helps where you are, but it looks like this is what worked for the wetek play. I think it was PRed and merged with codesnakes, but im still learning how this whole git thing works, so im not sure that means what i think it does.

    https://github.com/Memphiz/linux-amlogic/commit/46afb27aee333999f91aba0a56cea4795a77fca0
  • wrxtasywrxtasy Posts: 1,221WeTek Community Member
    edited February 2016
    I've just run a little check:

    Kernel needs to be configured for AM_VIDEOCAPTURE=y: checked..
    https://github.com/OpenELEC/OpenELEC.tv/blob/master/projects/WeTek_Core/linux/linux.arm.conf#L1165

    Support written into Kernel meson8m2_wetek_core.dtd file: checked...
    //$$ MODULE = "DISP&MM-Amvideocap"
    //$$ DEVICE="amvideocap"
    //$$ L2 PROP_STR = "status"
    //$$ L3 PROP_U32 4 ="reg"
    amvideocap{
    compatible = "amlogic,amvideocap";
    dev_name = "amvideocap.0";
    status = "okay";
    reserve-memory = <0x00600000>;//1920*1088*3
    reserve-iomap = "true";
    };


    Result >>> still no /dev/amvideocap0 shows up which is required for Hyperion:

    Handballing this one over to Codesnake....

    If we get /dev/amvideocap0 to ever show up (like on the Odroid C1+), this guide may help:
    http://forum.odroid.com/viewtopic.php?f=114&t=16093&start=100#p109913
  • adminadmin Posts: 144Administrator - WeTek Community Manager
    Hello guys,

    We will take a look on this ASAP.
  • uroszurosz Posts: 47WeTek Community Member
    edited March 2016
    Hi,

    I have some great news. I have a working build with amvideocap0 device.
    There was a small error in dtd file which prevented the creation of the device.
    I removed /* from line 295 and */ from line 309 in meson8m2_wetek_core.dtd file.

    A working build can be downloaded from here. It will be available for a few days.

    Enjoy!

    EDIT:
    Before:
    /*
    /// ***************************************************************************************
    /// - DISP&MM-A/V Amvideocap
    //$$ MODULE = "DISP&MM-Amvideocap"
    //$$ DEVICE="amvideocap"
    //$$ L2 PROP_STR = "status"
    //$$ L3 PROP_U32 4 ="reg"
    amvideocap{
    compatible = "amlogic,amvideocap";
    dev_name = "amvideocap.0";
    status = "okay";
    reserve-memory = <0x00600000>;//1920*1088*3
    reserve-iomap = "true";
    };
    */
    After:
    /// ***************************************************************************************
    /// - DISP&MM-A/V Amvideocap
    //$$ MODULE = "DISP&MM-Amvideocap"
    //$$ DEVICE="amvideocap"
    //$$ L2 PROP_STR = "status"
    //$$ L3 PROP_U32 4 ="reg"
    amvideocap{
    compatible = "amlogic,amvideocap";
    dev_name = "amvideocap.0";
    status = "okay";
    reserve-memory = <0x00600000>;//1920*1088*3
    reserve-iomap = "true";
    };
  • Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
    Thanks @urosz, I'm so happy that someone could get to the bottom of this, as this coding stuff is beyond me ;). I'll download the development version and test it out.
  • uroszurosz Posts: 47WeTek Community Member
    edited March 2016
    I also don't know how to write code but these two lines seemed out of place because none of the other "devices" had them. So I removed them and made a new build. And I got it.

    So even if you don't know how to, try... Maybe you'll get lucky ;)

    I tested my boblight setup and it's working nicely on HD content. I have some problems with SD, juddering/frames skiping, but I don't know if they are amvideocap/boblight related.
  • Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
    Im using it with hyperion, I uploaded the TAR file and set the grabber sections as follows:
    "amlgrabber": {
    "width" : 64,
    "height" : 64,
    "frequency_Hz" : 20.0
    },

    everything is working great. My Emby server is down for a rebuild right now, so I dont have any SD content handy to test it out with. Ive tested it with an 720P .mkv and everything seems to be working well.

    Thanks again!
  • uroszurosz Posts: 47WeTek Community Member
    Which tutorial did you use to setup Hyperion?
  • Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
    edited March 2016
    I used the newly updated installer found here:
    https://github.com/tvdzwan/hyperion/issues/493

    Then from there I used hypercon.jar (https://github.com/tvdzwan/hyperion/wiki/configuration) to setup the number of lights I have. I assume you are using an arduino connected through USB (if you have it working through bluetooth, we need to talk!) to output to the lights, so here is my device stanza, i think rate should match what you have in the sketch uploaded to your arduino
    "device" :
    {
    "name" : "MyPi",
    "type" : "adalight",
    "output" : "/dev/ttyUSB0",
    "rate" : 115200,
    "delayAfterConnect" : 0,
    "colorOrder" : "rgb"
    },

    here is my framegrabber stanza:

    "framegrabber" :
    {
    "width" : 64,
    "height" : 64,
    "frequency_Hz" : 10.0
    },
    "amlgrabber": {
    "width" : 64,
    "height" : 64,
    "frequency_Hz" : 20.0
    },
    there are some test commands you can follow at the bottom of this Rpi installation, to get everything working.
    https://github.com/tvdzwan/hyperion/wiki/Installation-on-RPi-with-OpenELEC
  • uroszurosz Posts: 47WeTek Community Member
    Hey Preston,

    I got it working, tnx. I had a problrm with boblight and xvid encoded SD content. It was causing frame skipping. With Hyperion everything is working as it should.

    One question. How do you turn off "ambilight" when you turn off your TV?
  • Preston YoungsleyPreston Youngsley Posts: 9WeTek Community Member
    I use a script that fires based on HDMI CEC when I power the TV off. When the HDMI detects the TV is being shut down, it executes the script to shutdown Hyperion and then continues to shutdown the system as well. It was something I brought over from my RPI settings, I'll see if I can't find it tonight.
  • uroszurosz Posts: 47WeTek Community Member
    edited March 2016
    I think I found a simple solution. I just commented out the framegrabber part so that lights don't shine while in KODI menus.

  • mooz0rmooz0r Posts: 7WeTek Community Member
    edited May 2016
    I can't seem to get anything to happen using Lightberry USB with the Core. It seems to hang on init using the adalight apa102 firmware, which worked fine with the Pi2. I don't even get the light boot sequence. If I check the Hyperion log, it is hanging at Initializing Python Engine. Any ideas?
Sign In or Register to comment.
© Copyright 2014 - Creative Dreams | Powered by Vanilla
All times are UTC