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
jack-midi support #19246
base: master
Are you sure you want to change the base?
jack-midi support #19246
Conversation
ce43ca7
to
b218652
Compare
7638762
to
22128db
Compare
999e2a8
to
7a2a941
Compare
3e582e1
to
24705bc
Compare
f56bf85
to
01f03a1
Compare
932c742
to
77c9dbe
Compare
- move out alsaaudiodriver things into alsaaudiodriver - linuxaudiodriver is the driver hander, that musescore talks to, and is responsible for running jack or alsa
* separate linux-midi from linux-alsa * move alsa to own directory * midimodule separate linux/alsa
A commandline-option to handle changes in the jack-transport delay caused by buffering.
* seek possible if not playing * jack is soft-realtime, use separate musescore access thread * start/stop transport from musescore * take into account wall-clock elapse by non-realtime worker when calculating musescore seek position * allow for some time-imprecision in playbackPositionInSeconds * avoid playbackPositionInSeconds due to imprecision * playbackposition remote{seek|playOrStop} * adjustable delay by cli jackTransportDelay
The callback member isn't really a specification, so we need to copy it around, because it is set above the linuxdriver class, and needed if we change driver
This is the only branch that seems to work for me in Ubuntu 24.04. Yikes! The master release doesn't properly connect to audio or play back in the latest OS (which is the LTS release). Jack capability may be necessary and most dependable going forward with Pipewre being the default sound server. EDIT: Ubuntu (Studio) 24.04 has Pipewire set by default to 48000. That's why this branch works while the trunk does not. One can (if they figure it out) switch Pipewire to 44100 to use M4 master trunk. I think that a sample rate selection is essential for M4 and if this branch can resolve that issue as well, that would be great. |
This branch has a samplerate selection (dropdown), it should work. The only issue is that it requires a restart of Mu, so perhaps a warning message of that would be nice too (but not in scope for this PR as I dont know how). Also, there should be a checkbox to turn off jack transport, because it is a bit intrusive if not being used. That shouldn't be too much work because there exist prior work we can copy. |
I see the drop down in the Linux build, but it only has the default 48000 in the closed field and the drop down box is empty. I remember a build quite a while ago that listed sample rates, but the current one doesn't seem to have options. |
So it looks like you can run multiple M4 sessions in sync and mix down to DAW with this branch: If anyone was wondering. |
Purpose
For linux users, the ability to at runtime switch between alsa and jack audio+midi driver.
Changes
class design changes
Before:
After:
Audio Tests
Midi tests
Optional cleanups / redesign
Remove LinuxAudioDriver and keep only AlsaAudioDriver and JackAudioDriver as two independent implementations. To switch between them, you need to add another class, something like IAudioDriverProvider. This is what you need to add to IoC (and remove the drivers from IoC). Access the driver through this class, like:
This greatly simplifies everything, each class becomes simple and does one thing.
Moreover, such a system is easily scalable; we can easily add other drivers, cross-platform or platform-specific.
Not in scope for this PR
Known cleanups & fixes before merge
Misc. needed for jack #22373
If possible do mutual dependency Injection between module Audio and Midi.Testing confirmed, can't inject modules.
Injection is used, but not at modul level.
No 'requires restart' added
automatic connection to audio ports upon startNot in scope, brings in too much arbitrary heuristics code from Mu3.