Author Topic: Impact of plugin callback methods on playback  (Read 7595 times)

Elberet

  • Full Member
  • ***
  • Posts: 167
I've noticed that the debug version of my WiP plugin causes MusicBee's audio playback to slightly stutter whenever I'm doing something that could take longer then a couple microseconds, such as doing blocking file or network I/O on the thread where MusicBee delivers notifications. With the release build and no debugger attached to the process, there are no stutters. Those jitters could be a side-effect of the debugger, but I'm not conviced.

Is it okay for a plugin, in general, to use MusicBee's notification delivery thread for performing potentially costly tasks, or would that collide with other plugins or MusicBee's internals?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34346
your plugin and when sent a notification is in its own thread. You could test simply by putting in a Thread.Sleep(2000) for example to be sure. Playback is in its own thread as well.
You can intefere with the GUI if you do a synchronised invoke to the GUI thread (which some may need to do for certain types of plugins)

Elberet

  • Full Member
  • ***
  • Posts: 167
Okay, good to know. Tho now I wonder what the debugger does that the audio stream jitters.  ???