haubie / midiex

Cross platform Midi library in Elixir. Powered by midir, a Rust midi library and Rustler.
MIT License
8 stars 4 forks source link

Building for Nerves #9

Open thejohncotton opened 3 days ago

thejohncotton commented 3 days ago

Hey David, this is less an issue and more of a discussion but this seems like the right place to have the discussion. I have done some raspberry pi testing with your library and have found that the off the shelf system for rpi4 doesn't have the necessary underlying packages from buildroot to support all of the ALSA utils required for Midiex. I have a fork that will currently work at: https://github.com/thejohncotton/nerves_system_rpi4

This library won't currently build for the rpi3 system due to an issue of:

==> midiex
Compiling 10 files (.ex)

== Compilation error in file lib/midiex/backend.ex ==
** (RuntimeError) precompiled NIF is not available for this target: "arm-unknown-linux-gnueabihf".
The available targets are:
 - aarch64-apple-darwin
 - x86_64-apple-darwin
 - x86_64-unknown-linux-gnu
 - x86_64-unknown-linux-musl
 - aarch64-unknown-linux-gnu
 - aarch64-unknown-linux-musl
 - riscv64gc-unknown-linux-gnu
 - x86_64-pc-windows-msvc
 - x86_64-pc-windows-gnu
    lib/midiex/backend.ex:9: (module)
could not compile dependency :midiex, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile midiex --force", update it with "mix deps.update midiex" or clean it with "mix deps.clean midiex"

which might be something you can help with while we get the system builds in a good stable place for ALSA compatibility.

haubie commented 1 day ago

Thanks @thejohncotton.

I'll see if I can get a build working for "arm-unknown-linux-gnueabihf".

I had attempted to get rust to cross compile a build for rpi0 but I had to put it down as it taking too much time with little progress! Maybe rpi3 will have more success.

thejohncotton commented 17 hours ago

@haubie I sent an invite to join an org for nerves-audio if you feel so inclined. I've got a custom rpi-4 system that works with ALSA and will build and run Midiex. I need to do a little work to host the pre-compiled binaries for the nerves system (assuming that the nerves project core team doesn't want the ALSA config as part of the rpi systems they support). I'm going to switch gears and see if I can get a rpi-3b system running and confirm I have the same ALSA performance. Then if you have the build working for "arm-unknown-linux-gnueabihf" I'd expect Midiex to 'just work' on it. :)

thejohncotton commented 15 hours ago

Confirming that the rpi3 system I added just now will build the same alsa utils and I can sniff USB midi devices. I'm going to try for rpi0 tomorrow and see if I can get some of the binaries available so as to not require anyone to compile the systems themselves.