-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfaults on Ubuntu Xenial #7
Comments
I have the exact same problem, same libraries, ruby version 2.5.1, fresh ubuntu install. My C is really rusty, but if there's anything I can do to help resolve this, please let me know. Details below:
|
What does your RawMIDI setup look like? Some info here that might be helpful |
Edited: premature posting, formatting fixes
I tested roughly the same script using python/mido/rtmidi, so it doesn't look like the hardware is the problem. |
I think the issue is that you need a RawMIDI device listed there. This should be handled better by the gem as to not segfault. See this guide and let me know if that helps. Unfortunately, I don't have an Ubuntu computer handy to try this all on, but I should in August |
Using that guide I do see my rawmidi device in there, the USB2MIDI hardware device. In case it helps, all that's connected is a FCB1010 control surface, just an input device, not a synth or other output. The same USB2MIDI + FCB1010 setup works well with alsa-rawmidi on ubuntu 14, by the way. Thanks for looking into it so far!
|
Hi, Here's a quick-and-dirty hack to avoid the segmentation fault:
This works with Ubuntu 18.04 as far as I tested. While I'm not familiar with the implementation of Ruby's FFI, I found that the problem behind this issue is that the latest alsa-rawmidi uses 'int' to store the address value. The patch above may have a problem on 32-bit environment and/or old Linux distributions because probably they uses 32-bit runtimes instead 64-bit. |
Thank you @fukuchi, that ulong patch was exactly what I needed to communicate with my USBMIDI device! |
@arirusso I'm also getting this error, on Ubuntu 20.04; any chance you could apply this patch and update the package? |
This patch also works for me! (debian buster amd64) Would be great to not have to hack this in manually. |
Fantastic. This patch unstuck me on Raspbian. Is it not applied because it's waiting for a PR? |
libasound2 & libasound2-dev installed
Gemfile
alsa-midi.rb
The text was updated successfully, but these errors were encountered: