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

MusE crashes when moving fx plugin order #1028

Closed
StaffanMelin opened this issue Jun 18, 2021 · 10 comments
Closed

MusE crashes when moving fx plugin order #1028

StaffanMelin opened this issue Jun 18, 2021 · 10 comments

Comments

@StaffanMelin
Copy link
Contributor

I got the attached 3 plugins on Out
add Dragonfly Hall Reverb LV2 as 4th fx
right click on it and select Move up
crash with the following error messages on console:

Setting project path to /home/staffan/Documents/projects/music/gate_of_aldebaran/gate_of_aldebaran_ring_of_moons
JackEngine::XRun: client = MusE was not finished, state = Running
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Running
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
JackEngine::XRun: client = MusE was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 12 val1 = 5 val2 = 8
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 12 val1 = 7 val2 = 6
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 12 val1 = 9 val2 = 3
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 12 val1 = 10 val2 = 4
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 8 val2 = 0
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 7 val2 = 0
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 9 val2 = 0
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 10 val2 = 0
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 8 val2 = 0
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 7 val2 = 0
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 9 val2 = 0
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = MusE notification = 10 val1 = 10 val2 = 0
Unknown error...
terminate called after throwing an instance of 'Jack::JackTemporaryException'
  what():  

OS: Debian 10/Buster with xfce4
MusE: 4.0 (built from source about 1 month ago)

01

@StaffanMelin
Copy link
Contributor Author

gate_of_aldebaran_ring_of_moons.med.zip

Newly created song with only Surge LV2 softsynth plugin (and some Calf FX and Dragonfly reverbs.

@StaffanMelin
Copy link
Contributor Author

Actually it is fairly easy to crash MusE when moving plugins up or down. It doesn't seem to matter if the song is playing or not.

@spamatica
Copy link
Member

I had to work a bit to get it to crash but using the song you supplied it does crash.

No time to look further right now but thought I would report that it crashes in midiseq.cpp on line 612
// Play all events up to curFrame.
for (iMidiDevice id = MusEGlobal::midiDevices.begin(); id != MusEGlobal::midiDevices.end(); ++id)
{
MidiDevice* md = *id;
const MidiDevice::MidiDeviceType type = md->deviceType(); <------------ here
// Only for ALSA devices.
switch(type)

@spamatica
Copy link
Member

Tried some more. It does not happen often on this computer but I got a new crash that is closer to the actual operation, happened during plugin apply in in lilv.h

static inline void lilv_instance_run(LilvInstance* instance,
uint32_t sample_count)
{
instance->lv2_descriptor->run(instance->lv2_handle, sample_count);
}
Not sure exactly what access it crashes on but something must be corrupted or uninitialized.

@StaffanMelin
Copy link
Contributor Author

Thanks for looking into it. It is not a new bug, it has been around for a long time, sorry I have not reported it earlier. But this time I saw a clear pattern of operations (I hope).

@terminator356
Copy link
Member

Although I can't reproduce this yet, the problem may be in the following code.
The portion that swaps the plugins is not real-time safe although the
portion that swaps controllers is.
This function is called from the GUI thread. During the first few lines here,
it is likely our real-time process comes along in the middle of those lines
and tries to dutifully 'apply' the effects chain on each cycle, but the swap
has not completed yet so it gets messed up.
I note that the other operations such as adding, removing, and replacing
a plugin in the rack do seem to be real-time safe.
I'll see if I can replace these lines with a proper real-time thread synchronized operation.
I'm thinking at the same time I could make it undoable but the other operations
such as adding, removing, and replacing would also need to be undoable operations
for it to work properly.

void Pipeline::move(int idx, bool up)
{
      PluginI* p1 = (*this)[idx];
      if (up)
      {
            (*this)[idx]   = (*this)[idx-1];

          if((*this)[idx]) {
            (*this)[idx]->setID(idx);
          }

            (*this)[idx-1] = p1;

          if(p1)
          {
            p1->setID(idx - 1);
            if(p1->track())
              MusEGlobal::audio->msgSwapControllerIDX(p1->track(), idx, idx - 1);
            }
      }
      else

@terminator356
Copy link
Member

Hi should be fixed in github master now. Can you guys try it?

@StaffanMelin
Copy link
Contributor Author

Works very well for me now! Thanks a lot for fixing this, Tim!

@StaffanMelin
Copy link
Contributor Author

I closed this issue. I don't know if you want me to do it, or if it is better if you developers do it.

@spamatica
Copy link
Member

It's fine I think :) If it needs to be reopened we can reopen it

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

No branches or pull requests

3 participants