A good example of this might be Elektron removing CC 93 (solo) from the Digitakt firmware. I guess they did it to prevent people from soloing a track with a controller and no way on the machine to undo that. Too bad though, it was fun to have.
Same error with a board running a 4.x kernel. The first try was running 5.x kernel. I guess it has something to do with this piece of code, but I really have no idea how to fix it. Any clues would be appreciated
static void sighandler(int s){
printf("Shutting down ...\n",s);
shtdwn = 1;
}
int main(int argc, char *argv[]) {
// sighandler setup
struct sigaction sigIntHandler;
sigIntHandler.sa_handler = sighandler;
sigemptyset(&sigIntHandler.sa_mask);
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, NULL);
Just a wild guess without any context and possibly with other unwanted side effects. Maybe try replacing line
printf(âShutting down âŚ\nâ,s);
with
printf(âShutting down âŚ\nâ);
Different errors but same result. Maybe itâs only meant to be build on x86?
Scanning dependencies of target dtdump
[ 50%] Building C object CMakeFiles/dtdump.dir/dtdump.c.o
/root/dtdump/dtdump.c: In function âsighandlerâ:
/root/dtdump/dtdump.c:302:9: error: stray â\342â in program
printf(???Shutting down âŚ\nâ);
^
/root/dtdump/dtdump.c:302:10: error: stray â\200â in program
printf(???Shutting down âŚ\nâ);
^
/root/dtdump/dtdump.c:302:11: error: stray â\234â in program
printf(??Shutting down âŚ\nâ);
^
/root/dtdump/dtdump.c:302:12: error: âShuttingâ undeclared (first use in this function)
printf(âShutting down âŚ\nâ);
^~~~~~~~
/root/dtdump/dtdump.c:302:12: note: each undeclared identifier is reported only once for each function it appears in
/root/dtdump/dtdump.c:302:21: error: expected â)â before âdownâ
printf(âShutting down âŚ\nâ);
^~~~
/root/dtdump/dtdump.c:302:26: error: stray â\342â in program
printf(âShutting down ???\nâ);
^
/root/dtdump/dtdump.c:302:27: error: stray â\200â in program
printf(âShutting down ???\nâ);
^
/root/dtdump/dtdump.c:302:28: error: stray â\246â in program
printf(âShutting down ??\nâ);
^
/root/dtdump/dtdump.c:302:29: error: stray â\â in program
printf(âShutting down âŚ\nâ);
^
/root/dtdump/dtdump.c:302:31: error: stray â\342â in program
printf(âShutting down âŚ\n???);
^
/root/dtdump/dtdump.c:302:32: error: stray â\200â in program
printf(âShutting down âŚ\n???);
^
/root/dtdump/dtdump.c:302:33: error: stray â\235â in program
printf(âShutting down âŚ\n??); ^
CMakeFiles/dtdump.dir/build.make:62: recipe for target 'CMakeFiles/dtdump.dir/dtdump.c.o' failed
make[2]: *** [CMakeFiles/dtdump.dir/dtdump.c.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dtdump.dir/all' failed
make[1]: *** [CMakeFiles/dtdump.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Funny if I replace the quotations from â to " the error goes away but the build still fails.
Scanning dependencies of target dtdump
[ 50%] Building C object CMakeFiles/dtdump.dir/dtdump.c.o
[100%] Linking C executable dtdump
CMakeFiles/dtdump.dir/dtdump.c.o: In function `prepare_transfers':
dtdump.c:(.text+0x52): undefined reference to `libusb_alloc_transfer'
dtdump.c:(.text+0x70): undefined reference to `libusb_alloc_transfer'
CMakeFiles/dtdump.dir/dtdump.c.o: In function `free_transfers':
dtdump.c:(.text+0xb0): undefined reference to `libusb_free_transfer'
dtdump.c:(.text+0xbc): undefined reference to `libusb_free_transfer'
CMakeFiles/dtdump.dir/dtdump.c.o: In function `digitakt_init':
dtdump.c:(.text+0x170): undefined reference to `libusb_set_configuration'
dtdump.c:(.text+0x190): undefined reference to `libusb_set_configuration'
dtdump.c:(.text+0x1b0): undefined reference to `libusb_claim_interface'
dtdump.c:(.text+0x1d0): undefined reference to `libusb_claim_interface'
dtdump.c:(.text+0x1f2): undefined reference to `libusb_set_interface_alt_setting'
dtdump.c:(.text+0x214): undefined reference to `libusb_set_interface_alt_setting'
dtdump.c:(.text+0x234): undefined reference to `libusb_clear_halt'
dtdump.c:(.text+0x254): undefined reference to `libusb_clear_halt'
CMakeFiles/dtdump.dir/dtdump.c.o: In function `usb_shutdown':
dtdump.c:(.text+0x2d2): undefined reference to `libusb_close'
dtdump.c:(.text+0x2dc): undefined reference to `libusb_exit'
CMakeFiles/dtdump.dir/dtdump.c.o: In function `prepare_cycle':
dtdump.c:(.text+0x40a): undefined reference to `libusb_submit_transfer'
dtdump.c:(.text+0x422): undefined reference to `libusb_submit_transfer'
CMakeFiles/dtdump.dir/dtdump.c.o: In function `main':
dtdump.c:(.text+0x4d8): undefined reference to `libusb_init'
dtdump.c:(.text+0x58e): undefined reference to `libusb_open_device_with_vid_pid'
dtdump.c:(.text+0x5f0): undefined reference to `libusb_handle_events'
collect2: error: ld returned 1 exit status
CMakeFiles/dtdump.dir/build.make:96: recipe for target 'dtdump' failed
make[2]: *** [dtdump] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dtdump.dir/all' failed
make[1]: *** [CMakeFiles/dtdump.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
One step further anyways, thanks for the pointer!
The first 2 errors were simple. An unnessary parameter to printf and then a wrong character used as ASCII double-quote.
Now it compiles but fails linking, because it cannot find functions from library libusb.
The README.md states:
needs âŚ, libusb, libsndfile, âŚ
Have you installed these libs?
PS: there is nothing in the sourcecode that is bound to x86, so it should run on any modern linux platform.
Yeah I have those libs and their -dev versions installed. It does find them too when running the âcmake âŚ/â command.
Iâm running Debian for arm on this board. Itâs just plain Debian.
root@aml:~/dtdump/build# dpkg-query -l | grep usb
ii libusb-0.1-4:arm64 2:0.1.12-31 arm64 userspace USB programming library
ii libusb-1.0-0:arm64 2:1.0.21-2 arm64 userspace USB programming library
ii libusb-1.0-0-dev:arm64 2:1.0.21-2 arm64 userspace USB programming library development files
ii libusb-1.0-doc 2:1.0.21-2 all documentation for userspace USB programming
ii libusb-dev 2:0.1.12-31 arm64 userspace USB programming library development files
ii usbutils 1:007-4build1 arm64 Linux USB utilities
I thought maybe those 1.0 and 0.1.x versions of libusb could conflict but theyâre both needed. The other dependancy libsndfile is also installed, both normal and -dev package.
Well, itâs clearly the linker complaining. Iâve had a quick check (for at least the first missing function) if there is a version conflict, but the versions seems okay (matching function signatures). The makefile seems okay, too. It would stop if there is no libusb, before reaching the linker part.
Without setting up the stuff myself (sorry, no time for this now), I donât see whatâs wrong.
I think youâll need to wait for @droelf to help you out on this.
Thanks for helping thought. I doubt the arm boards are powerful enough to capture all tracks but recording the master pair shouldnât be a problem. Hope it can be compiled on arm so I can make a fun sized portable digital Digitakt recorder
I donât see why the arm boards shouldnât be powerful enough. Itâs just a stream of 10MB/s with almost no processing involved. Iâve done already more number crunching on a RaspberryPi and similar devices.
The limiting factor is only the speed of the storage device (as the original author stated, too).
I missed that part, even better!
I think the cc command fails as it needs to be adapted to maybe include the correct paths or something. Too bad my knowledge pretty much ends at fixing libs and dependancies for compiling code.
cc -rdynamic CMakeFiles/dtdump.dir/dtdump.c.o -o dtdump -lusb -lsndfile
Please excuse the messy code. Yes, it was only tested on x64. Iâll investigate later after work.
The tracks are being sent out by much slower ARM cores, so I guess without too much OS overhead and a fast board it should be possible.
Thereâs no overhead from the OS I think. Clean Debian install is pretty clean, not many deamons running. My dev boards have Mali 450, 1GB ram, 8gb emcc and quad core Cortex A53 @ 1.5ghz. Can be overclocked to 2ghz but then it needs a noisy fan. The storage is slim but theyâre lovely little boards.
The Digitakt uses a single-core Freescale Coldfire microprocessor (MCF54418x) which isnât ARM-based, but more like the m68k processors. And, yes, much slower. It runs @ 250MHz.
BTW: the Digitone uses two of these and a Xilinx Spartan FPGA to coordinate them.
Did you see the (debug?) header on the board of the Digitakt? Wonder what kind of (fun) stuff can be done with the board
Yes, sorry. I actually knew that.
I just reformatted the code and removed the string parameter. Also, added some info to the README, about the audio routing settings.
You fixed it
It compiles fine now. Will let you know how it performs once I get the chance to hook up the Digitakt. Thanks again for sharing this.
root@aml:~/dtdump/build# cmake ../
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LIBSNDFILE: /usr/lib/aarch64-linux-gnu/libsndfile.so
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'libusb-1.0'
-- Found libusb-1.0, version 1.0.21
-- Looking for libusb_get_device_list in /usr/lib/aarch64-linux-gnu/libusb-1.0.so
-- Looking for libusb_get_device_list in /usr/lib/aarch64-linux-gnu/libusb-1.0.so - found
-- LIBSNDFILE_INCLUDE_DIR='/usr/include'
-- LIBSNDFILE_LIBRARY=/usr/lib/aarch64-linux-gnu/libsndfile.so
-- LibUSB_INCLUDE_DIRS='/usr/include/libusb-1.0'
-- LibUSB_LIBRARIES=/usr/lib/aarch64-linux-gnu/libusb-1.0.so
-- Configuring done
-- Generating done
-- Build files have been written to: /root/dtdump/build
root@aml:~/dtdump/build# make
Scanning dependencies of target dtdump
[ 50%] Building C object CMakeFiles/dtdump.dir/dtdump.c.o
[100%] Linking C executable dtdump
[100%] Built target dtdump
root@aml:~/dtdump/build# ./dtdump
No Digitakt found!
root@aml:~/dtdump/build#
I did some testing, seem to work ok but it also lost a few minutes of recording. Was just recording some of the demo patterns and switching between them for a few minutes.
The finished recording was about 35 seconds long and 80mb. Ableton of course canât open these multi track wav files but Audacity can, or maybe a bit. Not sure where or what goes wrong but this is a great start.
My little arm board didnât seem to struggle at all. I will do some more and better testing tomorrow.
⌠and I just discovered a race condition while testing on a raspberry, which stops the transfer after a couple of seconds, at least on my rpi. But I guess I know what to fix, you donât see those issues on beefy desktop PCs. Also, going to move the disk writing to a separate process or thread. Thanks @Nevets, looks like youâre the first getting this to (at least) partially work, so people can see Iâm not trolling Btw. played/imported the 12 track WAVs in Ardour (open source DAW).