I see you have some homegrown solution there for Trill support, which makes troubleshooting harder on my side, why don't you get the latest version of rnbo.example.bela which has built-in support for multiple Trill devices and then reapply your changes for the DFRobot_VisualRotaryEncoder
on top of that? Then troubleshooting would be easier.
If you want to give it a quick try, you can also see if gdb (the GNU debugger) can help you with that. Start by stopping the program in the IDE and then in the console at the bottom of the IDE, run the following commands, replacing PROJECT_NAME
with your project's name:
cd projects/PROJECT_NAME;
gdb -ex run --args PROJECT_NAME;
the program will now run in the console at the bottom of the IDE, inside the debugger. It should stop when it receives the segmentation fault, printing something like:
Thread 3 "bela-audio" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb63b0450 (LWP 4271)]
0x000579d4 in render (context=0x758a8 , userData=0x0)
at /root/Bela/projects/basic/render.cpp:42
that should tell you the line number at which the issue occurred and you can type backtrace
to show how that function got called. It may be that the error is inside one of the RNBO functions, but that it is caused by the fact that you are passing invalid data to it. Once you are done with debugging, type quit
to exit the debugger. You can now make edits to your files and rebuild and run the project again. Note that you always should start the program from the IDE's button after each file change so that it gets rebuild. Restarting gdb in the console will not - by itself -rebuild the program.