Skip to content
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

Use built-in RtMidi on Linux too #2542

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from

Conversation

hfiguiere
Copy link
Contributor

This replace #2534

The idea is to use the bundled RtMidi on Linux too (using ALSA)

@SunderB
Copy link
Contributor

SunderB commented Nov 8, 2020

Maybe it could be configurable using an option to use the system library if wanted, to make it easier to make things like .deb/rpm packages?

@hfiguiere
Copy link
Contributor Author

This doesn't prevent building rpm/deb packages.

It make things work.

@rbnpi
Copy link
Contributor

rbnpi commented Nov 8, 2020

I have used both versions (system package and bundled RtMidi) and either will work. (In fact the bundled version is version 4.0.0 whereas the package (at least in Debian) is currently 3.0.0 but either is good), depending on how you modify the CMakeLists.txt file.
At present there are issues with Sp_Midi on Linux which still need resolving (basically midi connections multiply uncontrollably when you add or remove a hardware midi device) and these issues (which may possibly affect the CMakeLists file) need to be resolved first.

@hfiguiere
Copy link
Contributor Author

tbf I haven't tested the MIDI feature yet. (I'm also new to Sonic Pi as a user)

@hfiguiere
Copy link
Contributor Author

I think that using the same version across the board should be easier on support for SonicPi developers.

Fedora 33 also only has 3.0.0.

@ethancrawford
Copy link
Collaborator

@samaaron what do we wish to do re bundled vs system installed here?

@SunderB
Copy link
Contributor

SunderB commented Jan 18, 2021

I don’t have much experience in packaging what-so-ever, but this is what I gather about it:
When packaging for e.g. a .deb package, it’s generally recommended to use the system installed libraries and state them as dependencies to be installed with sonic pi. (I believe that’s what the maintainers of the sonic-pi pkg in Debian have done)
However, for things like making AppImages or portable builds, including uncommon libraries can be useful.
And I don’t know how these sort of library dependencies work in flatpaks. (I imagine some uncommon libraries are bundled?)

Maybe it would be nice to have options to pick between bundled and system installed libraries? (maybe though a cmake option, or command arg like --build-aubio in the current build scripts)
flexibility & ease of use = win! 🙂

@hfiguiere
Copy link
Contributor Author

For the flatpak whatever is needed will be built.

But on Raspberry Pi OS (64-bits) there is only rtmidi 3.0, so using the system one ain't really an option.
Same on Fedora 33.

All in all it's probably the best solution to for consistency across platforms.

@hfiguiere
Copy link
Contributor Author

I updated the pull request against main / v3.3.0

@lilyinstarlight
Copy link
Contributor

lilyinstarlight commented Feb 10, 2022

Given it's a small-ish library without external deps other than ALSA/JACK and is fairly distro/system agnostic, I think it would be good idea to build RtMidi in by default on Linux to reduce maintenance and support burden

I've made a patch at lilyinstarlight/sp_midi@777c1dc which turns built-in RtMidi on by default but gives the option to use the system-provided library via the CMake option USE_SYSTEM_RTMIDI

I want to PR the above patch, but I would like input from @samaaron and everyone else in this thread about whether that is the right way to go forward with this (specifically on Linux whether to default to using built-in RtMidi and provide an option to exclude it, or whether to leave it out by default and provide an option to include it)

@llloret
Copy link
Collaborator

llloret commented Feb 10, 2022 via email

@hfiguiere
Copy link
Contributor Author

but when no one has the package, it just doesn't work. when I submitted the patch I did it because I couldn't build on the latest Fedora. Let alone build on distro based on much older code.

@lilyinstarlight solution is more flexible (i.e. better than this one), so I'm personally OK with superceding this PR with it.

But if you want contributions to better support Linux, being able to easily build the project should be priority number 1.

@llloret
Copy link
Collaborator

llloret commented Feb 10, 2022 via email

@lilyinstarlight
Copy link
Contributor

This was just a thought because some maintainers are not willing to make packages that have vendors dependencies.

As a package maintainer, I made sure to keep the option available to link against the system RtMidi via a CMake option (I just don't think it should do that by default)

If you wanted or if there is demand for it, I could also add a flag to the prebuild script (like the -n flag is now) to set the USE_SYSTEM_RTMIDI CMake option

@llloret
Copy link
Collaborator

llloret commented Feb 10, 2022 via email

@samaaron
Copy link
Collaborator

I'm all for using the built-in rtmidi by default with an option for using the system version should package maintainers prefer to use that.

@lilyinstarlight
Copy link
Contributor

I've opened the PR as sonic-pi-net/sp_midi#29, so further discussion can occur there

@hfiguiere
Copy link
Contributor Author

So this is solved by sonic-pi-net/sp_midi#29, right?

@lilyinstarlight
Copy link
Contributor

So this is solved by sonic-pi-net/sp_midi#29, right?

Yep, it should be once that PR gets synced to this repo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants