BackyardBrains / Spike-Recorder

A neural recording app for the Windows, OS X (Mac) and Linux.
https://backyardbrains.com/products/spikerecorder
31 stars 27 forks source link

Problems with Linux #44

Closed ckemere closed 1 year ago

ckemere commented 2 years ago

There's an error when compiling under Linux (I'm using Ubuntu 20.04). Line 827 in src/engine/ArduinoSerial.cpp references a macro that is only defined for OSX - if (ioctl(portDescriptor, IOSSIOSPEED, &speed) == -1). I got things compiling and running by commenting this section and uncommenting the section above ("the comment described it as the traditional setup of baud rates").

That led to another error - I find that when I run SpikeRecorder, it starts up just fine, but it doesn't detect my MuscleBox plugged in. If I try with the Windows version of SpikeRecorder in a virtual machine, it works ok.

ckemere commented 2 years ago

I've now figured out a workaround for this. I needed a udev rules file. I created 80-backyardbrains.rules in /etc/udev/rules.d. That file has a line that I took from similar files that Arduino, Teensy, and MSP430-based devices need:

SUBSYSTEM=="usb", ATTR{idVendor}=="2e73", ATTR{idProduct}=="0001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"

ckemere commented 2 years ago

So I need to double check whether running with the IOSSIOSPEED macro works ok under Linux. If so, I'll make a pull request for the documentation to describe making a udev rules file...

gagegreg commented 2 years ago

Yes, I just noticed this same IOSSIOSPEED error when I was attempting to develop a Chromebook solution a few weeks ago. I was able to comment it out to get the app to show up in Chromebook (I needed a different version of audio library)... but was not able to see any of the serial devices. I suspected this could have been the error, but it was over my head. Thanks for taking a look.

The good news is that this error has prompted us to accelerate our development of a native Chromebook solution. We are now developing a flutter version of the app that will run on Chrome, Win, Mac, Linux, iOS and Android under one code base. We are currently testing USB access under all the OSs, and should have an idea if this will work later this week. But if you make progress on the Linux version here, we would have an immediate solution. Cheers!

Gemarcm commented 2 years ago

I can't compile Spikerecorder in my pop-os 22.04. The followint error after typing make.

make g++ -o src/engine/AudioInputConfig.o -c src/engine/AudioInputConfig.cpp -g -O2 -Isrc -Isupport -Isrc/libraries -I. -Lsrc/support -Wall -DSIGSLOT_PURE_ISO --std=c++11 sdl2-config --cflags g++ -o src/CalibrationWindow.o -c src/CalibrationWindow.cpp -g -O2 -Isrc -Isupport -Isrc/libraries -I. -Lsrc/support -Wall -DSIGSLOT_PURE_ISO --std=c++11 sdl2-config --cflags In file included from src/CalibrationWindow.cpp:6: src/engine/RecordingManager.h:19:10: fatal error: BYBBootloaderController.h: No such file or directory 19 | #include "BYBBootloaderController.h" | ^~~~~~~ compilation terminated. make: *** [Makefile:78: src/CalibrationWindow.o] Error 1

gagegreg commented 2 years ago

Strange... BYBBootloaderController.h is included under the directory. src/engine/firmware/BYBBootloaderController.h maybe try adding: -Isrc/engine/firmware

On Tue, May 31, 2022 at 8:15 AM Gemarcm @.***> wrote:

I can't compile Spikerecorder in my pop-os 22.04. The followint error after typing make.

make g++ -o src/engine/AudioInputConfig.o -c src/engine/AudioInputConfig.cpp -g -O2 -Isrc -Isupport -Isrc/libraries -I. -Lsrc/support -Wall -DSIGSLOT_PURE_ISO --std=c++11 sdl2-config --cflags g++ -o src/CalibrationWindow.o -c src/CalibrationWindow.cpp -g -O2 -Isrc -Isupport -Isrc/libraries -I. -Lsrc/support -Wall -DSIGSLOT_PURE_ISO --std=c++11 sdl2-config --cflags In file included from src/CalibrationWindow.cpp:6: src/engine/RecordingManager.h:19:10: fatal error: BYBBootloaderController.h: No such file or directory 19 | #include "BYBBootloaderController.h" | ^~~~~~~ compilation terminated. make: *** [Makefile:78: src/CalibrationWindow.o] Error 1

— Reply to this email directly, view it on GitHub https://github.com/BackyardBrains/Spike-Recorder/issues/44#issuecomment-1142055776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG52575UEGHZL3YTACPAQTVMX7GRANCNFSM5NGPEVBA . You are receiving this because you commented.Message ID: @.***>

-- Gregory Gage, Ph.D. Backyard Brains, Inc. @.** mob: +1 (734) 968-7570 DIY Neuroscience TED Series: https://www.ted.com/series/diy_neuroscience Human TED talk: https://www.youtube.com/watch?v=rSQNi5sAwuc Plant TED talk: http://go.ted.com/greggage Cockroach TED* talk: https://www.ted.com/talks/the_cockroach_beatbox Neuroscience for Everyone!

Gemarcm commented 2 years ago

@gagegreg Thanks for the help, I add the path as you recommended, from directory: firmware/BYBBootloaderController.h only. Then I got a similar error and I had to add the same path (firmware/BYBBootloaderController.h) in the ArduinoSerial.cpp and it fixed it. It kept compiling until it gave me this new error and I have no idea how to fix it.

gema@pop-os:~/reposgit/Spike-Recorder$ make g++ -o src/engine/ArduinoSerial.o -c src/engine/ArduinoSerial.cpp -g -O2 -Isrc -Isupport -Isrc/libraries -I. -Lsrc/support -Wall -DSIGSLOT_PURE_ISO --std=c++11 sdl2-config --cflags src/engine/ArduinoSerial.cpp:165: warning: ignoring ‘#pragma mark ’ [-Wunknown-pragmas] 165 #pragma mark - Port scanning and opening
src/engine/ArduinoSerial.cpp:1622: warning: ignoring ‘#pragma mark ’ [-Wunknown-pragmas] 1622 #pragma mark - Reading and processing
src/engine/ArduinoSerial.cpp:2598: warning: ignoring ‘#pragma mark ’ [-Wunknown-pragmas] 2598 #pragma mark - Getters/parameters
src/engine/ArduinoSerial.cpp:2639: warning: ignoring ‘#pragma mark ’ [-Wunknown-pragmas] 2639 #pragma mark - Messages - Write

src/engine/ArduinoSerial.cpp: In member function ‘int BackyardBrains::ArduinoSerial::openPort(const char)’: src/engine/ArduinoSerial.cpp:886:36: error: ‘IOSSIOSPEED’ was not declared in this scope 886 | if (ioctl(portDescriptor, IOSSIOSPEED, &speed) == -1) { | ^~~ src/engine/ArduinoSerial.cpp: In member function ‘int BackyardBrains::ArduinoSerial::processDataIntoSamples(char, int, int16_t*)’: src/engine/ArduinoSerial.cpp:1812:13: warning: unused variable ‘g’ [-Wunused-variable] 1812 | int g=0; | ^ src/engine/ArduinoSerial.cpp:1813:14: warning: unused variable ‘enablePrint’ [-Wunused-variable] 1813 | bool enablePrint = false; | ^~~ make: *** [Makefile:78: src/engine/ArduinoSerial.o] Error 1

Gemarcm commented 2 years ago

I've now figured out a workaround for this. I needed a udev rules file. I created 80-backyardbrains.rules in /etc/udev/rules.d. That file has a line that I took from similar files that Arduino, Teensy, and MSP430-based devices need:

SUBSYSTEM=="usb", ATTR{idVendor}=="2e73", ATTR{idProduct}=="0001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"

I've now figured out a workaround for this. I needed a udev rules file. I created 80-backyardbrains.rules in /etc/udev/rules.d. That file has a line that I took from similar files that Arduino, Teensy, and MSP430-based devices need:

SUBSYSTEM=="usb", ATTR{idVendor}=="2e73", ATTR{idProduct}=="0001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"

@ckemere I have this same error while compiling BYB Spike Recorder on my pop os 22.04. Can you please be more specific how did you created udev rules file? Did you created 80-backyardbrains.rules under directory etc/udev/ besides rules.d file or did you add this line (> SUBSYSTEM=="usb", ATTR{idVendor}=="2e73", ATTR{idProduct}=="0001", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1") to the already rules.d file? Also, did you keep commenting OSX - if (ioctl(portDescriptor, IOSSIOSPEED, &speed) == -1) section? and uncommenting the section above this?

Thanks in advance.

Gemarcm commented 2 years ago

Hello again, I have done everything you said, and it keep compiling until this new error. I'll really appreciate your help here.

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /lib/../lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /usr/lib/../lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/11/../../../libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /usr/lib/libbass.so when searching for -lbass /usr/bin/ld: cannot find -lbass: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /lib/../lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /usr/lib/../lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/11/../../../libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /lib/libbass.so when searching for -lbass /usr/bin/ld: skipping incompatible /usr/lib/libbass.so when searching for -lbass collect2: error: ld returned 1 exit status make: *** [Makefile:81: SpikeRecorder] Error 1

DUOLabs333 commented 1 year ago

@Gemarcm #59 Should fix the issues you've been having :)