[SOLVED] Drumkv1 does not load samples

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

oscillator
Established Member
Posts: 27
Joined: Sat Jan 17, 2015 6:07 pm

[SOLVED] Drumkv1 does not load samples

Postby oscillator » Tue Jul 16, 2019 1:09 pm

Hi!

Using muse 3.0.2 and drumkv1 0.9.4 (and Debian 9 Stable).

When loading a new sample in drumkv1 plugin, nothing happens when I have pressed "Open" button. It is like nothing has been loaded.

Running the stand alone drumkv1_jack works ok, as does using drumkv1 in qtractor.

No message in log, even if I use the -D (or -D -D) switch.

Has anyone else experienced this or can help me?
You do not have the required permissions to view the files attached to this post.
Last edited by oscillator on Thu Jul 18, 2019 6:36 am, edited 1 time in total.

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

Re: Drumkv1 does not load samples

Postby Tim E. Real » Tue Jul 16, 2019 4:33 pm

Tested: Observed.
Actually, it's intermittent. I got it to load a few times by trying again and again. But it's very touchy, it only worked a few times.

Sigh. Yet another plugin with UI problems in MusE...

User avatar
rncbc
Established Member
Posts: 730
Joined: Mon Apr 19, 2010 12:20 pm
Contact:

Re: Drumkv1 does not load samples

Postby rncbc » Tue Jul 16, 2019 5:23 pm

notwithstanding any issues on either side, v0.9.4 is way too old to make a stance!

please update to v0.9.8 or later--new rel coming up in a few days now;)

cheers

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

Re: Drumkv1 does not load samples

Postby Tim E. Real » Tue Jul 16, 2019 9:39 pm

Hi Rui!
Yes I am using 0.9.8 on my side.
I am heavily debugging the situation...

Results so far...
Getting some very strange results in MusE...

I noticed that with MusE, in drumkv1's sample list, when I click or key up/down,
MusE receives the Qt event and sends it back to the plugin via QApplication::notify(),
BUT the plugin does not receive the signal most of the time.
The symptom is that most of the time the sample list window does not update correctly
and the GEN window does not update with the new list selection.

I put a breakpoint at moc_drumkv1widget.cpp line 194:

Code: Select all

        case 21: _t->updateSchedNotify((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;

To my surprise, when I click or key up/down drumkv1's sample list, that slot is only being called sometimes,
and most of the time it is NOT being called.

Very strange. What could MusE be doing wrong.
Still checking...
Tim.

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

Re: Drumkv1 does not load samples

Postby Tim E. Real » Tue Jul 16, 2019 10:22 pm

Same results with current drumkv1 git.

User avatar
rncbc
Established Member
Posts: 730
Joined: Mon Apr 19, 2010 12:20 pm
Contact:

Re: Drumkv1 does not load samples

Postby rncbc » Tue Jul 16, 2019 11:02 pm

hi Tim,

note that drumkv1.lv2 takes heavy use of the lv2_worker/schedule and lv2_patch/parameter interface protocols as also with traditional input control port(s) when changing sample elements in either way from a host generic/stock UI and/or from the native Qt/X11/external_ui.

otoh. notifications from the plugin to GUI (and in this direction only) is done via Qt's signal/slot mechanism (that being the updateSchedNotify() you're reading).

dunno about Muse, but this whole "complication" works fine on jalv, ardour(5.12 and 6+) and of course qtractor too.

hth.
cheers

oscillator
Established Member
Posts: 27
Joined: Sat Jan 17, 2015 6:07 pm

Re: Drumkv1 does not load samples

Postby oscillator » Wed Jul 17, 2019 6:05 am

Thank you Tim and Rui for helping me and looking into this.

Cheers,

Staffan

User avatar
rncbc
Established Member
Posts: 730
Joined: Mon Apr 19, 2010 12:20 pm
Contact:

Re: Drumkv1 does not load samples

Postby rncbc » Wed Jul 17, 2019 8:42 am

forgot to mention Carla the plugin swiss-army-knife these days...
you may test with it as long it works on Muse as well
cheers

oscillator
Established Member
Posts: 27
Joined: Sat Jan 17, 2015 6:07 pm

Re: Drumkv1 does not load samples

Postby oscillator » Wed Jul 17, 2019 3:03 pm

That is a good idea. But what is the difference between using Carla and running drumkv1 stand alone?

I can load drumkv1 in Carla ok, but the first time I try to load a sample I get the same behaviour -- nothing happens. Second time it all works fine.

I have tried loading up drumkv1 in Carla and muse sends midi which I can see that drumkv1 receives in Carla. When I connect the drumkv1 outputs (using Catia) evertyhing works fine!

And this is with drumkv1 v 0.9.4. So I will compile and install 0.9.8 tonight.

Cadence, Catia and now Carla (first time use for me) = awesome software!

User avatar
rncbc
Established Member
Posts: 730
Joined: Mon Apr 19, 2010 12:20 pm
Contact:

Re: Drumkv1 does not load samples

Postby rncbc » Wed Jul 17, 2019 4:20 pm

i meant Carla as a plugin inserted in Muse then drumkv1 inserted in Carla... yes kinda droste aka mise en abyme effect;)

cheers

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

Re: Drumkv1 does not load samples

Postby Tim E. Real » Wed Jul 17, 2019 4:43 pm

Gotcha, ye bugger :twisted:
It's the old "using out-of-scope data, causing corruption" (TM).
Fixed in git master now.

Plugins that use the LV2 worker extension, such as the *v1 suite, typically might pass worker message data to the host,
to pass to the worker thread, and receive as a worker response.
The data passed, at least in drumkv1, is local and goes out of scope at the end of passing it.
Fault in MusE: We kept a local pointer to that passed data, and expected the data to 'hang around'
for the worker thread to eventually get around to using the data. Fail :!:

Solution: I installed a std::vector and copy the data not just the pointer :idea:
I use vector.resize() and then memcpy() whenever we get message data to be passed.

Tested OK with drumkv1, navigating sample list, opening samples, manipulating, presets etc.
This should help any plugin that uses workers.

Blatant excuse: "I didn't write the original code" :wink:
I was sooo hoping this would fix a few other plugins/suites/families but no, the others I tested don't use workers as much.

For the interested, here's the observed sequence of operations:

Code: Select all

[ Click or key up/down in drumkv1 sample list. ]

drumkv1_lv2::selectSample()
{
  ...
  m_schedule->schedule_work(); // OK. atom.type = gen1_select = 39, atom.size = 8, key good.
  ...
}

->

MusE::LV2Synth::lv2wrk_scheduleWork()
{
  ...
  return state->wrkThread->scheduleWork();  // OK.
}

->

MusE::LV2PluginWrapper_Worker::scheduleWork()
{
   ...
   _mSem.release(1);  // OK.
   return LV2_WORKER_SUCCESS;
}


[ Now the 'other' side of the worker: ]
->

MusE::LV2PluginWrapper_Worker::run()
{
   while(true)
   {
      _mSem.acquire(1);
      if(_closing)
         break;
      makeWork();  // OK.
   }
}

->

MusE::LV2PluginWrapper_Worker::makeWork()
{
  ...
  _state->wrkIface->work();
}

->

drumkv1_lv2_worker_work()
{
  if (pDrumk && pDrumk->worker_work(data, size)) {
    respond(handle, size, data);
    return LV2_WORKER_SUCCESS;
  }
  // FAIL!
 
  // GOT HERE.
  return LV2_WORKER_ERR_UNKNOWN;
}

->

drumkv1_lv2::worker_work()
{
  const drumkv1_lv2_worker_message *mesg
    = (const drumkv1_lv2_worker_message *) data;

  // FAIL! mesg contains garbage.
  // Type is frequently zero or some garbage high value.
  // Same with all other members.
}

->

// And so on. Fails to call the notifier.


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

Re: Drumkv1 does not load samples

Postby Tim E. Real » Wed Jul 17, 2019 8:09 pm

Sampler plugins would naturally make use of the worker extensions,
to do heavy lifting of loading samples in the background.

Thus, not surprisingly, I'm happy to report that the LSP (multi)sampler series of plugins now works OK.
Their sample loading window was not working well before (sound familiar?). Tests OK now.

So potentially there are more plugins that will also work OK now.

oscillator
Established Member
Posts: 27
Joined: Sat Jan 17, 2015 6:07 pm

Re: Drumkv1 does not load samples

Postby oscillator » Wed Jul 17, 2019 11:14 pm

Awesome work, Tim! I compiled the master branch and now drumkv1 works in muse.

Thank you, impressive!

Staffan


Return to “MusE Sequencer”

Who is online

Users browsing this forum: No registered users and 1 guest