1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hyperion NG : Development environment?

Discussion in 'Development' started by Marko Hoepken, 30 December 2019.

  1. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Hi,

    I am from Germany and just trieded Hyperion out of the box... with USB camera.
    Worked good so far...

    Since there is still the open issue of "trapez distortion" comming from USB cam filming the screen.

    Long story short: I would like to work on that.... on the NG.. but do not know how...

    I have some experience with embeded software, but have not done linux SW development stuff.
    ...but have some long Linux user experience (engineer), so I know what bash, ssl, vnc... deamon, vi etc. is ;-)

    What I have done so far:

    1. Got Raspi 4b
    2. Got Camera
    3. Have 160 LED's around my large TV.
    4. All works with Hyperion as is...
    5. I managed to download NG, compiled it on the Raspi and it works.
    At home I have a Windows PC... with VM for Linux on demand.

    I had a first look to the C++ code of the NG and would like to "play" with it.

    My goal: Add good configurabel usb camera support to NG.

    1. Runs on latest Raspi 4 (need horsepower)
    2. USB cam image will get on the fly trapez correction (I what to add that)
    3. All function of the processing should work as from a "regular" frame grabber
    4. I don not want "special distorion matrix"... the Hyperion processing should work on a squar image.

    Why:

    I want to use my smart TV as is with out 4K, HDR, protection issues. I think a camera is the right way to go.

    Will it be good? Hopefully I can add as much image processing to get a good result.. the Raspi 4 has horepower...

    So my questions:

    How do YOU develope the Hyperion NG software?

    I did already spend 1/2 day of playing around, but that is not efficient.

    What is the best environment... ?

    1. On the Rasi?
    2. On Linux PC (ARM?)
    3. VM?
    4. Eclipse?
    5. Other?
    6. What about the QT
    7. What about the web server.....
    I managed to download all source and was able to build it on thr Raspi 4... took just one hour.

    I need a "super charge" by of one of you how to start.... I will figure out the rest..

    Does someone has as VM that includes all I / we need?

    Thanks Marko

    PS: I love Hyperion!
     
  2. SputnikElf

    SputnikElf New Member

    Messages:
    11
    Hardware:
    RPi2, RPi3, +Arduino, +nodeMCU/ESP8266
    Hallo Marko,
    Du kannst meinen Fork ausprobieren. Er läuft bei mir auf einem Pi3 mit PiCam.
    Die 4 Eckpunte vom Trapezoid können einzeln im Ledlayout unter Erweiterte Optionen angepasst werden.

    Michael
     
  3. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Hi Michael,

    ich hatte von Deiner Änderung gelesen (pull request) , aber wenn ich das korrekt versteh werden noch "nur" die LED Koordinaten umgerechnet, oder?
    Meine Annahme war, dass dann die automatischen Randerkennung nicht korrekt funktioniert.

    Falls der Trapezoid schon das Bild korrigiert... cool!

    Testen will ich das auf jeden Fall. In der Anlage eines Screenshots von meine TV... ist 75" 4K. screenshot.JPG

    Wie finde ich den Branch, bzw kannst mir einen Links schicken?

    Aber zu meiner Frage: Wie entwickelst Du? Auf dem Raspi?

    Ich glaub ja kaum, das man den C-code im Editor hackt und dann make macht... ;-) oder?


    Danke Marko
     
  4. Lord-Grey

    Lord-Grey Member Staff Member Developer

    Messages:
    42
    Hardware:
    RPi3, 32/64bit
    Hi Marko

    let me share my development environment. Others chime in, if there are other alternatives worth considering.

    I make use of the following components:

    OS: Ubuntu 18.10 in a VM-Ware player (I successfully compiled in Ubuntu 16 and 19, too).
    IDE: QT Creator, as it nicely fits with the QT framework
    GIT Repository: SmartGit
    Qt app inspection: GammaRay
    SQLight: DB Browser for SQLite, in case you want to update the hyperion.ng configuration DB without UI

    I build and run via command-line using the ./bin/create_all_releases.sh script (disabling some steps to avoid package building, etc.)
    You can also build and run via QT Creator (which I do in case I need to execute an interactive Debugger).

    To test hyperion.ng on a Raspberry Pi 3B+, I cross-compile in the Ubuntu environment.
    Step by step details you find in the CrossCompileHowto document (you may need to change the firmware & toolchain elements for rpi 4).
    Alternatively, you can compile on the rpi itself or in a docker container.
    As I am an impatient person, I have chosen the cross-compile way leveraging the power of the host system to get the job done.

    Testing the LED output:

    Besides testing the LED-output on my Nanoleaf network device, I find it handy to do some structured testing via the
    a) "File "device, here you can check the individual output records and timings against your expectation...
    b) HyperSim LED device simulator (I lately did a fork to support hyperion.ng LED layouts)

    Hoping that gives you a start...
    In case of questions, do not hesitate to come back.

    Happy development!
     
  5. SputnikElf

    SputnikElf New Member

    Messages:
    11
    Hardware:
    RPi2, RPi3, +Arduino, +nodeMCU/ESP8266
    Hallo Marko,

    ich entwickle unter Ubuntu 18.04 mit Visual Studio Code. Habe dort auch ein HyperionNg mit Webcam laufen.
    Die getesteten Änderungen schiebe dann auf meinem RPi3 und nehme dort das alte gute Make.
    Mein Fork steht hier:https://github.com/SputnikElf/hyperion.ng.git

    Viel Spaß
    Michael

    P.S.:kleineÄnderungen gehen auch im vi auf dem RPi....Oldschool halt
     
  6. Paulchen-Panther

    Paulchen-Panther Active Member Developer

    Messages:
    481
    Hardware:
    RPi1/Zero, RPi3, 32/64bit, +Arduino
    Also ich nehme Kdevelop unter Ubuntu falls dir das hilft. ;)
     
  7. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Hi all,

    thanks for the fast answers.

    Let me "compile" how you all seem to work:

    1. Development (code, test, debug) is done on fat client running Ubunut. This may be a virtual machine
    2. For testing, no leds are conneted to the pc, but file io or other methods are used
    3. Real capture devices (or camera) can be run on the PC as video source
    4. You compile x86 code for the development to run on ubuntu (guessing noboddy has ARM host)
    5. Real live testing is done on Raspi....
    6. For real testing compile (git update, make , make install) can be done on Raspi (takes long)
    7. Cross compile on fat host save time. Flow: On Ubuntu crosscompile, than scp to Raspi, than make install & test

    OK, that was the aswer I expected.

    I think I will go with the Lord Grey enviroment...

    OS: Ubuntu 18.10 in a VM-Ware player (I successfully compiled in Ubuntu 16 and 19, too).
    IDE: QT Creator, as it nicely fits with the QT framework
    GIT Repository: SmartGit
    Qt app inspection: GammaRay
    SQLight: DB Browser for SQLite, in case you want to update the hyperion.ng configuration DB without UI

    QUESTION: Is there a documtentation, how to setup all of this?

    If NO: I will try to create this how_to_develo,md


    Thanks Marko
     
  8. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Hi Lord Grey,

    today I started working on setting up the enviroment for full crosscompile and remote debug.
    There has been some good documents how to do it.

    But... all is > 1 year old and not done on Raspi 4.

    you wrote:

    IDE: QT Creator, as it nicely fits with the QT framework

    what 5.x QT version are you using?

    I try setup my build environment and run into some compile issues.
    I tried "latest" (5.14)... what may not be a good idea ;-)

    Beside that: for the configure step the QT configure step the build requires a device....
    I have an Raspi 4... that seem not supported yet.


    ../qt-everywhere-src-5.14.0/configure -opengl es2 -device linux-rasp-pi3-g++ ...

    So still some work to do.... before I can work on my project at all ... but cross compile and debug is an interesting concept.

    Marko
     
  9. Lord-Grey

    Lord-Grey Member Staff Member Developer

    Messages:
    42
    Hardware:
    RPi3, 32/64bit
    Hi Marko

    On Ubuntu, I always make use of the available Qt5 packages per apt.
    As I lately migrated my Ubuntu environment to 19.10, it is Qt version 5.12.4 in /usr/lib/x86_64-linux-gnu

    In addition, I installed Qt version 5.14. to make use of the latest Qt Creator version.
    There I do not have any compile issues.

    On the Raspberry Pi, I suggest you install the packages as per instructions, too
    Code:
    sudo apt-get install....
    For the cross-compile environment set-up, you should make use the same Qt5 version which you installed on the Raspberry Pi.
    (I may need to update the instructions to reflect this). Otherwise you will see "moc" compile errors.

    For Raspian buster it seems to be Qt 5.11.3.
    HTML:
    http://download.qt.io/archive/qt/5.11/5.11.3/qt-opensource-linux-x64-5.11.3.run
    To find out which Qt version is installed, run
    Code:
    qmake --version 
    On the toolchain, I will check, if one can go to the latest version
    HTML:
    https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz?revision=fed31ee5-2ed7-40c8-9e0e-474299a3c4ac&la=en&hash=76DAF56606E7CB66CC5B5B33D8FB90D9F24C9D20
    Important: If you change the Qt version and/or toolchain file, please update the respective entries in

    Code:
    $HYPERION_DIR/cmake/Toolchain-rpi.cmake
    
    SET(TOOLROOT ${PITOOLCHAIN}/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf )
    SET(QT_BIN_PATH ${CROSSROOT}/Qt5/5.7/gcc_64/bin)

    I suggest you go with the original one first and check that your Qt compile errors will go away.
     
  10. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Hi Lord-Grey,

    thanks for the information.
    That is helpfull!

    Overall the build environment is really a jungle with a lot of pitfalls.


    Currently I try (and wait a lot) the way how QT is recommending it.

    https://wiki.qt.io/RaspberryPi2EGLFS

    The overseen problem from ME is that:

    On Rapsi:
    sudo apt-get build-dep libqt5gui5

    Gets "any unknown for me" version of QT and on my PC host I try to crosscompile I explicitly downloaded: LTS qt-everywhere-src-5.12.6

    My bet: They are not matching.

    Currently I got much much further as in my last post, but still not full compiling.

    So my NEXT step:

    Check version I got on raspi and but THAT on the Ubuntu ;-) as you recomend:

    To find out which Qt version is installed, run
    Code:
    qmake --version


    I got: 5.11.3

    By cross compile version is: 5.12.6 ;-(

    On the toolchain currently try to use the one Raspery is giving us:

    git clone https://github.com/raspberrypi/tools

    NOT your suggested:

    https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz?revision=fed31ee5-2ed7-40c8-9e0e-474299a3c4ac&la=en&hash=76DAF56606E7CB66CC5B5B33D8FB90D9F24C9D20

    On the Ubuntu I decieded to use the LTS version: 18.04... also different than yours.

    So at the end of the day:

    THERE ARE A LOT COMBINATIONS, that will matter .... and I have not been aware about it.

    Let make a summary, what is important:

    1. Raspery Pi version (I will stick to 4b, since I need horsepower) --> Here I may need use optimisation of linux-rasp-pi3-vc4-g++ since newer may not be supported yet
    2. Ubuntu version (VM on PC) LTS 18.04 or newer?
    3. QT version on Raspi (--> fixed by package manager) 5.11.3
    4. Cross compile tool chain (https://github.com/raspberrypi/tools or ARM) ??? I will stay with the raspberrypi tool chain

    My step: Clean up and restart next approach ...

    Anyhow.. I take note of ALL steps I did an will finally have a way that works.

    This will go into a document, I will make up...

    Greeting, Marko
     
    • Like Like x 1
  11. Lord-Grey

    Lord-Grey Member Staff Member Developer

    Messages:
    42
    Hardware:
    RPi3, 32/64bit
    Hi Marko

    You should not trying to intermingle the Ubuntu compile environment and the one use for Cross-Compile.
    Until Paulchen-Panther has the PR not ready to be able to deliver Libs with Hyperion, you have to install the Qt version required to be used during cross-compile.

    That is a different version than the one used during the native Ubuntu compile.

    Net net, you have to have in mind that there is a set of Ubuntu files and in ADDITION another set only used for cross-compiling only (the files you copied from rip, the Qt matching files and the toolchain). Key is that the Qt libs on the rpi and the header and rcc/moc tool on cross-compile environment are in sync.

    Considering the above, you may give it another try and use the elements as per documentation. If you changing too many parts in the initial go, it may be hard to find where the cross-compile breaks.

    I had a hard time too, to get the latest instructions updated and running.
     
  12. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Hi,

    thanks for the advice.

    I think with the right version of QT was the key. I am on track again.

    The main issue for me here: I "just" want to code a new feature.. but has not been avare how complex the compile environment is.

    Compile is running.... let see ....

    Marko

    PS: The compile of Hyperion on the Raspi worked out of the box as documented... I READ documents and love them ;-)

    BUT: For development there is not a working "how to" .... yet ;-)
     
    • Agree Agree x 1
  13. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Next question:

    is there a elegant way to get the Hyperion source / build into QT Creator?

    Is "just"

    Project > Import Project > Import Existing Project

    working (beside cross compile settings)

    Is a "Project" file I can use?

    Marko
     
  14. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    QT cross compile worked... ;-)

    This mainreason: Mixed QT version :)

    Marko
     
    • Like Like x 1
  15. Lord-Grey

    Lord-Grey Member Staff Member Developer

    Messages:
    42
    Hardware:
    RPi3, 32/64bit
    That is great news! ...and it seems that you burned some midnight oil to get there :)

    Just for my curiosity, did you now stay with the documentation or which elements were changed?
     
  16. Lord-Grey

    Lord-Grey Member Staff Member Developer

    Messages:
    42
    Hardware:
    RPi3, 32/64bit
    Just do a "File > Project Open" and open the "CMakeLists.txt" in the Hyperion.ng root directory.

    I lately reduced the building Kits to two.
    Please find here my QTCreator configuration file"CMakeLists.txt.user": https://ufile.io/252z9rmz

    Just place it in the same directory as "CMakeLists.txt" in the Hyperion.ng root directory and update it in QtCreator to your directory structure.

    While looking at the cross-compile aspect yesterday again, I came across a link which describes the additional configuration on QtCreator to cross-compile, but the deploy and run on the rpi.

    8. Setup Qt Creator for Raspberry Pi cross compilation

    I have not given it a try yet, but you might find it hepful.
     
  17. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Hi, Lord Grey,

    "Burning Mitnight Oil".... yes, but its mostly waiting for the compile.
    Meanwhile I played online with my friends..

    I often stay up very very long.


    Quote: "8. Setup Qt Creator for Raspberry Pi cross compilation"

    I knew and found that also and used it as basis.

    I am aware of, that I have to set several things to get it running.

    On the compile side:

    "make" worked
    make install failed.... ;-(

    I stopped yesterday, and have a closer look now.

    Stay tuned, Marko
     
  18. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    Oh man....

    QT 5.11.3 is a pain... since old and not an official release... grrrr.

    My first (known) issue is:

    https://forum.qt.io/topic/75018/nat...get-errors-usr-bin-ld-cannot-find-lclip2tri/6

    Could be solved by this manual compile steps to fix missing compiles...

    WORK=$PWD
    cd ./qtlocation/src/3rdparty/clip2tri; make ; cd $WORK
    cd ./qtlocation/src/3rdparty/clipper; make ; cd $WORK
    cd ./qtlocation/src/3rdparty/poly2tri; make ; cd $WORK

    Now i ran into this:

    declarativemaps/qdeclarativegeomap.cpp:699:91: error: no matching function for call to ‘QDeclarativeGeoMap::connect

    https://forum.qt.io/topic/91073/fai...-on-centos-7-but-no-problem-with-qt-5-10-1/16

    Also known.... realted to "older" GCC 4.x instead of 5.x (Raspi tool chain) and old verson of QT... has been fixed... but not in 5.11.3 ;-(

    THAT is one of the main reasons why other use 5.12.x what is LTS (long term support).

    Let me see how to get around that....

    May I switch to ARM compile chain instead of Raspery tool?


    Just for the files: I try to compile QT on Ubuntu for a Raspi cross compile environment....

    This is NOT related to compile Hyperion.NG on the host... not there yet.


    Marko
     
    Last edited: 5 January 2020
  19. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    OK...

    https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/

    states.....

    You can omit the compilation of problematic or time consuming modules using the -skip argument. In this case, we have omitted the compilation of the qtwayland, qtlocation and qtscript modules.

    Means in configure by adding:

    -skip qtwayland -skip qtlocation -skip qtscript

    Will REMOVE the "problem" modules for me...

    I will now CLEAN, start again with this configure:

    ./configure -release -opengl es2 -device linux-rasp-pi3-vc4-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v -skip qtwayland -skip qtlocation -skip qtscript

    And... wait some hours ;-)

    Marko

    PS: When all works, I should try to bring the LTS to the Raspi ;-)
     
  20. Marko Hoepken

    Marko Hoepken New Member

    Messages:
    17
    Hardware:
    RPi3
    UPDATE: make & make install worked after adding -skip qtwayland -skip qtlocation -skip qtscript

    So, there are some modules I hopefully do not need.. when disabling them, all compiles (4 hours) AND installs.

    Victory!

    • Now I will push that to my Raspi... and do some test with simple cross compiling.
    • After that I will try to compile / install / debug Hyperion...
    • After that.. I will start thinking about my project... Making a Hyperion USB Camera.
    Thanks for your support so far.



    Marko