hi there, is it worthwhile to update to the newest release, since that includes heavy on the bela image? and i see we don't have to use gcc anymore, is there a performance benefit in doing that? right now i use heavy on board but i have to compile with:

root@bela:~# make -C ~/Bela PROJECT=granular COMPILER=gcc run

    lokki hi there, is it worthwhile to update to the newest release, since that includes heavy on the bela image?

    I wouldn't say so. Including it on the image is as simple as copying it over, as I think you did before.

    Actually the fix that allows to use clang (this one) is not even on the most recent Bela image. clang is definitely faster at compiling than gcc, but I have not checked the performance of the generated code recently. In the past (gcc4.9 / clang3.8), the "Techno world" patch would have the following CPU usage:

    libpd                62%
    heavy/gcc       39% 
    heavy/clang    29%

    so i simply issue a

    make -C ~/Bela PROJECT=granular  run

    and if this works i am good to go...

    ok, i get some errors. i have now changed the HvLightPipe.c manually, i still had the unpatched version. on to recompile and see if it works.

    getting further HvLightPipe compiles, but at the end i get:

    Building render.cpp...
     ...done
     
    Linking...
     ...done
    Running /root/Bela/projects/granular/granular 
    __hv_noteout: 0xd1d4ac2
    __hv_ctlout: 0xe5e2a040
    __hv_pgmout: 0x8753e39e
    __hv_touchout: 0x476d4387
    __hv_polytouchout: 0xd5aca9d1
    __hv_bendout: 0xe8458013
    __hv_midiout: 0x6511de55
    : 0
    Bus error
    Makefile:515: recipe for target 'runonly' failed
    make: *** [runonly] Error 135
    make: Leaving directory '/root/Bela'

    Better clean the project and rebuild only with clang

    did that already. still the same error. maybe it is time to checkout the hvcc from your repo.

    You could also try to clean and compile with CPPFLAGS="-O0 -g" then run the project inside gdb and see if that points out something useful about the error.
    Also, I hope you are on a >= v0.3 Bela image, right?

      giuliomoro Also, I hope you are on a >= v0.3 Bela image, right?

      yes i am on v 0.36

      the python part stays the same i guess:

      python2.7 ~/hvcc/hvcc.py ~/Bela/projects/granular_patch/_main.pd -o /tmp/hvtmp -n bela -g c

      also i get a ton of these warnings (excerpt):

      /root/Bela/projects/granular/Heavy_bela.hpp:5173:16: warning: private field 'cBinop_91Yd6GIf' is not used [-Wunused-private-field]
        ControlBinop cBinop_91Yd6GIf;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5174:16: warning: private field 'cBinop_xM9L6rtB' is not used [-Wunused-private-field]
        ControlBinop cBinop_xM9L6rtB;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5175:16: warning: private field 'cBinop_iXLNeOBL' is not used [-Wunused-private-field]
        ControlBinop cBinop_iXLNeOBL;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5176:16: warning: private field 'cBinop_MKGD40Kf' is not used [-Wunused-private-field]
        ControlBinop cBinop_MKGD40Kf;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5177:16: warning: private field 'cBinop_rIZAlgWU' is not used [-Wunused-private-field]
        ControlBinop cBinop_rIZAlgWU;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5184:16: warning: private field 'cBinop_Gvg4XdPM' is not used [-Wunused-private-field]
        ControlBinop cBinop_Gvg4XdPM;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5185:16: warning: private field 'cBinop_X2VsXBKa' is not used [-Wunused-private-field]
        ControlBinop cBinop_X2VsXBKa;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5186:16: warning: private field 'cBinop_YkTDTmsr' is not used [-Wunused-private-field]
        ControlBinop cBinop_YkTDTmsr;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5187:16: warning: private field 'cBinop_WNywptxP' is not used [-Wunused-private-field]
        ControlBinop cBinop_WNywptxP;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5197:16: warning: private field 'cBinop_iVY3cZQE' is not used [-Wunused-private-field]
        ControlBinop cBinop_iVY3cZQE;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5200:16: warning: private field 'cBinop_DG7GtOCA' is not used [-Wunused-private-field]
        ControlBinop cBinop_DG7GtOCA;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5204:16: warning: private field 'cBinop_W54Xo401' is not used [-Wunused-private-field]
        ControlBinop cBinop_W54Xo401;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5210:16: warning: private field 'cBinop_dXTJbKu0' is not used [-Wunused-private-field]
        ControlBinop cBinop_dXTJbKu0;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5211:16: warning: private field 'cBinop_WfQujrjE' is not used [-Wunused-private-field]
        ControlBinop cBinop_WfQujrjE;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5217:16: warning: private field 'cBinop_cFVLi9DT' is not used [-Wunused-private-field]
        ControlBinop cBinop_cFVLi9DT;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5233:16: warning: private field 'cBinop_6S60AzrN' is not used [-Wunused-private-field]
        ControlBinop cBinop_6S60AzrN;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5235:16: warning: private field 'cBinop_BOCunN0Z' is not used [-Wunused-private-field]
        ControlBinop cBinop_BOCunN0Z;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5237:16: warning: private field 'cBinop_qZxqM3zS' is not used [-Wunused-private-field]
        ControlBinop cBinop_qZxqM3zS;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5241:16: warning: private field 'cBinop_Xt9AFzM7' is not used [-Wunused-private-field]
        ControlBinop cBinop_Xt9AFzM7;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5242:16: warning: private field 'cBinop_cY9pW9P2' is not used [-Wunused-private-field]
        ControlBinop cBinop_cY9pW9P2;
                     ^
      /root/Bela/projects/granular/Heavy_bela.hpp:5254:16: warning: private field 'cBinop_wXhMB50h' is not used [-Wunused-private-field]
        ControlBinop cBinop_wXhMB50h;
                     ^
      428 warnings generated.
       ...done

      yes will try with something simpler. i am now compiling again with gcc and the warnings are very different, i get these:

      Building Heavy_bela.cpp...
      In file included from /root/Bela/projects/granular/Heavy_bela.hpp:43:0,
                       from /root/Bela/projects/granular/Heavy_bela.cpp:33:
      /root/Bela/projects/granular/HvSignalTabread.h: In function 'void __hv_tabread_stoppable_f(SignalTabread*, float32x4_t*)':
      /root/Bela/projects/granular/HvSignalTabread.h:134:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (o->head == ~0x0) {
             ~~~~~~~~^~~~~~~
      In file included from /root/Bela/projects/granular/Heavy_bela.hpp:44:0,
                       from /root/Bela/projects/granular/Heavy_bela.cpp:33:
      /root/Bela/projects/granular/HvSignalTabwrite.h: In function 'void __hv_tabwrite_stoppable_f(SignalTabwrite*, float32x4_t)':
      /root/Bela/projects/granular/HvSignalTabwrite.h:77:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (o->head != HV_TABWRITE_STOPPED) {

      which are not present in clang (but instead the ones above)

      ok. a simpler patch compiles and runs fine...

      ok i have a patch with just a reverb abstraction that fails... same Bus error. i use this reverb in the other patch as well.

      so, to investigate further i compile with the flags you wrote and then how do i run inside gdb?

      ok i figured it out with gdb, i get this after i try to run the reverb patch inside gdb:

      (gdb) run
      Starting program: /root/Bela/projects/reverb/reverb 
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
      [New Thread 0xb693d450 (LWP 2621)]
      __hv_noteout: 0xd1d4ac2
      __hv_ctlout: 0xe5e2a040
      __hv_pgmout: 0x8753e39e
      __hv_touchout: 0x476d4387
      __hv_polytouchout: 0xd5aca9d1
      __hv_bendout: 0xe8458013
      __hv_midiout: 0x6511de55
      : 0
      
      Thread 1 "reverb" received signal SIGBUS, Bus error.
      0x00041e48 in sLine_init ()
      (gdb) 

      sorry, i need a little assistance now :-)

      list

      will tell you where that happened.

      You can also send me the patch and I will try to have a look. I am very afraid this could be something as horrible to track down as this one, and equally impossible to solve (as it was a bug in clang).

        giuliomoro

        OK, will do when i get home. is it easier for you with a simpler patch or can i send the original patch?