Speed up MusE startup

MusE is a MIDI/Audio sequencer with recording and editing capabilities, aiming to be a complete multitrack virtual studio for Linux. http://muse-sequencer.org/

Moderators: khz, MattKingUSA, spamatica

Basslint
Established Member
Posts: 151
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy

Speed up MusE startup

Postby Basslint » Thu Feb 21, 2019 8:01 pm

Hello,

I have a fairly powerful computer but MusE takes a while to start up (~5 seconds) and to close down (~1 second). A bulkier program, Blender, takes ~3 seconds to startup.

This happens not only when MusE starts JACK but also when a JACK server is already started (maybe it's a bit faster, but not noticeably).

Is there something I can do to speed up MusE's startup? Keep in mind that I only use MusE as a MIDI editor so I don't need any of the audio editing functionalities.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Tim E. Real
Established Member
Posts: 226
Joined: Sat Sep 15, 2012 12:36 am

Re: Speed up MusE startup

Postby Tim E. Real » Thu Feb 21, 2019 8:16 pm

Hello. There are command-line switches available to disable loading
of various plugin support, which can help improve loading time. Type muse3 -h to see the options.

Also if you are using the latest git version of MusE, there is now a plugin scanner which does add
considerable loading time - but only once. After the one-time scan it should be back to 'normal' speed.

Basslint
Established Member
Posts: 151
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy

Re: Speed up MusE startup

Postby Basslint » Thu Feb 21, 2019 8:27 pm

Tim E. Real wrote:Hello. There are command-line switches available to disable loading
of various plugin support, which can help improve loading time. Type muse3 -h to see the options.

Also if you are using the latest git version of MusE, there is now a plugin scanner which does add
considerable loading time - but only once. After the one-time scan it should be back to 'normal' speed.


Hello, I disabled all plugins and it did improve loading time. Now it's around 3 seconds when JACK is already open, and closing time is negligible, thank you. Is there something else I can do?
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Tim E. Real
Established Member
Posts: 226
Joined: Sat Sep 15, 2012 12:36 am

Re: Speed up MusE startup

Postby Tim E. Real » Thu Feb 21, 2019 8:54 pm

Mm, not much else I can think of.
If you are building MusE from source you can ensure that the build type
is 'Release' rather than 'Debug' which could help with speed.

Tim E. Real
Established Member
Posts: 226
Joined: Sat Sep 15, 2012 12:36 am

Re: Speed up MusE startup

Postby Tim E. Real » Thu Feb 21, 2019 9:07 pm

OK If you are actually counting seconds, then there is this in main.cpp at line 1086:

Code: Select all

        // WARNING Must do it this way. Call registerClient long AFTER Jack client is created and MusE ALSA client is
        // created (in initMidiDevices), otherwise random crashes can occur within Jack <= 1.9.8. Fixed in Jack 1.9.9.  Tim.
        // This initMidiDevices will automatically initialize the midiSeq sequencer thread, but not start it - that's a bit later on.
        MusECore::initMidiDevices();
        // Wait until things have settled. One second seems OK so far.
        for(int t = 0; t < 100; ++t)
          usleep(10000);
        // Now it is safe to call registerClient.
        MusEGlobal::audioDevice->registerClient();


You uh, could remove the 'for' and 'sleep' lines, if you heed the above warning :wink:

[Edit:] Done in git master now!
No more one-second wait :)
The hack is about six years old now, was for Jack <= 1.9.8. Jack 1.9.9.5 was released Dec 10 2012.
Commented out for now. To be removed at some point if we're all good.
Try it out.


Return to “MusE Sequencer”

Who is online

Users browsing this forum: No registered users and 1 guest