Linux visualization.projectm from git crashes
#1
Hi guys, hopefully somebody here can point me in the right direction. I'm on Ubuntu 16.10 running Kodi RC3 (Git:20170119-nogitfound). There are no packages in ppa for visualizations on Yakkety (other than spectrum), so I tried my hand at building one.

Cloned the latest from http://github.com/notspiff/visualization.projectm (commit 8064b36 from 01/05/2017), ran cmake, make & make install, enabled in Kodi and went to play a song... Kodi crashed to desktop.

Here's my terminal log of the build: http://paste.ubuntu.com/23908786/

Here's a debug log, nothing grabbed my attention there, but I'm a little out of my depth: http://paste.ubuntu.com/23908748/
Reply
#2
intel + projectm = crash on modern kodi (GLEW and EGL do not like each other). i have some patches somewhere that should work on theory, but you will have to build libprojectm yourself. if you wanna help me test those...
Reply
#3
I'll give it a shot. Where can I grab the patches?

Other than libprojectm-dev & libprojectm2v5 are there any other packages I'll need to remove and build manually?
Reply
#4
grab glew_removal_attempts from my git (i'm notspiff). see commit message, patch for projectm sits in top of the add-on tree.

only those should be necessary, make sure it doesn't remove the dependencies (ftgl and such).
Reply
#5
Found it, will give it a try in the A.M. Thank you!
Reply
#6
Building libprojectM from source is turning into a pain. After wading through dependency hell I'm now stuck here and unsure how to resolve (I am not a programmer)
Code:
Scanning dependencies of target Renderer
[  1%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/FBO.cpp.o
[  2%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/MilkdropWaveform.cpp.o
[  2%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/PerPixelMesh.cpp.o
[  3%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/Pipeline.cpp.o
[  4%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/Renderer.cpp.o
[  5%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/ShaderEngine.cpp.o
[  5%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/UserTexture.cpp.o
[  6%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/Waveform.cpp.o
[  7%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/Filters.cpp.o
[  8%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/PerlinNoise.cpp.o
[  9%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/PipelineContext.cpp.o
[  9%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/Renderable.cpp.o
[ 10%] Building CXX object src/libprojectM/Renderer/CMakeFiles/Renderer.dir/BeatDetect.cpp.o
/root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp: In member function ‘void BeatDetect::getBeatVals(float*, float*)’:
/root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:159:30: error: ‘isnan’ was not declared in this scope
    if ( projectM_isnan( treb ) ) {
                              ^
/root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:159:30: note: suggested alternative:
In file included from /root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:36:0:
/usr/include/c++/6/cmath:655:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^~~~~
/root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:162:29: error: ‘isnan’ was not declared in this scope
    if ( projectM_isnan( mid ) ) {
                             ^
/root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:162:29: note: suggested alternative:
In file included from /root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:36:0:
/usr/include/c++/6/cmath:655:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^~~~~
/root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:165:30: error: ‘isnan’ was not declared in this scope
    if ( projectM_isnan( bass ) ) {
                              ^
/root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:165:30: note: suggested alternative:
In file included from /root/building/projectM-complete-2.1.0-Source/src/libprojectM/Renderer/BeatDetect.cpp:36:0:
/usr/include/c++/6/cmath:655:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^~~~~
src/libprojectM/Renderer/CMakeFiles/Renderer.dir/build.make:350: recipe for target 'src/libprojectM/Renderer/CMakeFiles/Renderer.dir/BeatDetect.cpp.o' failed
make[2]: *** [src/libprojectM/Renderer/CMakeFiles/Renderer.dir/BeatDetect.cpp.o] Error 1
CMakeFiles/Makefile2:293: recipe for target 'src/libprojectM/Renderer/CMakeFiles/Renderer.dir/all' failed
make[1]: *** [src/libprojectM/Renderer/CMakeFiles/Renderer.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Found some references on google about changing "isnan" to "std::isnan" but in the projectM source the actual (command? function?) is "projectM_isnan". Sticking a std:: in the middle of that ("projectM_std::isnan") won't compile either so I'm stuck.

I'm wondering if starting with the libprojectM tarball from 2012 and trying to build it on Ubuntu 16.10 might be half the problem. ProjectM has much newer code on github, but the patch fails on CMakeLists against the git source, and again I'm unsure of what might be changed there to make it go.
Code:
patching file src/libprojectM/CMakeLists.txt
Hunk #1 FAILED at 196.
Hunk #2 FAILED at 207.
2 out of 2 hunks FAILED -- saving rejects to file src/libprojectM/CMakeLists.txt.rej
patching file src/libprojectM/Renderer/CMakeLists.txt
Hunk #1 succeeded at 53 (offset 9 lines).
patching file src/libprojectM/Renderer/FBO.cpp
Hunk #1 succeeded at 94 (offset -3 lines).
patching file src/libprojectM/Renderer/FBO.hpp
Hunk #1 succeeded at 37 with fuzz 1 (offset 5 lines).
Reply
#7
I tried building projectM from git sources even though the one file failed to patch.
Code:
patching file src/libprojectM/CMakeLists.txt
Hunk #1 FAILED at 196.
Hunk #2 FAILED at 207.
2 out of 2 hunks FAILED -- saving rejects to file src/libprojectM/CMakeLists.txt.rej
patching file src/libprojectM/Renderer/CMakeLists.txt
Hunk #1 succeeded at 53 (offset 9 lines).
patching file src/libprojectM/Renderer/FBO.cpp
Hunk #1 succeeded at 94 (offset -3 lines).
patching file src/libprojectM/Renderer/FBO.hpp
Hunk #1 succeeded at 37 with fuzz 1 (offset 5 lines).

Built easily without having to hack any files in the source and with no compiler errors.

Now, instead of crashing Kodi, when I start playing music I get a pop-up dialog with a warning "Add-on couldn't be loaded. Can't load shared library." I can just click OK in the dialog and music continues to play - doesn't play visualizations but doesn't crash Kodi either.

I found this in the debug loge (full log here):
Code:
ERROR: Unable to load /usr/lib/x86_64-linux-gnu/kodi/addons/visualization.projectm/visualization.projectm.so.1.1.1, reason: /usr/lib/x86_64-linux-gnu/kodi/addons/visualization.projectm/visualization.projectm.so.1.1.1: undefined symbol: _ZTI5Shape

I'm not sure if this is progress or not.
Reply
#8
Any thoughts or pointers on that error?
Reply
#9
Hmm, did you build libprojectm as a static library? What does ldd addonbinary show?
Reply
#10
I built from projectm's git tree... the Sourceforge tarball mentioned in your tree was from 2012 and I couldn't satisfy the dependencies on my brand new Ubuntu system.

The patch for projectm failed on src/libprojectM/CMakeLists.txt but patched the other three files without issue and then it compiled without any problems. I'm not sure if there is anything that I need to to to build it as a static library beyond "make && make install"

I don't know how to interpret or troubleshoot the "undefined symbol" error.
Reply
#11
well, you could start by answering my questions. i didn't say you should build it as a static, i asked if you did. did you get libprojectm.so.xxx or libprojectm.a ? ldd will show which libraries the add-on was linked to, which can hold important clues. for instance, if you skipped the cmake part of the patch, you still possibly link glew.
Reply
#12
right. i dug out the git, i assume you are referring to http://github.com/projectM-visualizer/projectm

i pushed a patch for the git projectm into the add-on, update the branch. also they have indeed changed to a static library by default in git, and this is what is causing the linking issues. configure libprojectm with -DBUILD_PROJECTM_STATIC=0

make sure you remove the static library that was installed on your system, most likely /usr/local/lib/libprojectM.a !

using a static library is troublesome, you need several other patches to pull that off, ref depends/linux/projectm.
Reply
#13
I just ran into the same problem and found this thread. I was able to build a patched version of the projectM library from git and the Kodi addon on Debian/stretch (I'm using Debian's Kodi package). The projectM visualization now works fine for me. Thanks for the patches! Smile
Reply
#14
(2017-02-19, 16:55)jlpII Wrote: I just ran into the same problem and found this thread. I was able to build a patched version of the projectM library from git and the Kodi addon on Debian/stretch (I'm using Debian's Kodi package). The projectM visualization now works fine for me. Thanks for the patches! Smile

jlpII, is that a projectM add-on and library that can be shared and installed into other's add-on files? I am running LibreELEC and Kodi Krypton at the moment. (fingers crossed)
Reply
#15
how about you read the thread you post in?
Reply

Logout Mark Read Team Forum Stats Members Help
visualization.projectm from git crashes0