PluginAPI.writescore(): "Warning: QMutex: destroying locked mutex"

• May 11, 2023 - 22:13

Hi folks,

Has anyone encountered the "Warning: QMutex: destroying locked mutex" message using PluginAPI.writescore() to create ogg files and mp3 files? I've searched the forums and googled abroad but been unable to determine what I'm doing wrong. Here's a minimal QML plugin that replicates the error:

// BEGIN CODE
import QtQuick 2.0
import MuseScore 3.0

MuseScore {
      menuPath: "Plugins.pluginName"
      description: "Description goes here"
      version: "1.0"
      onRun: {
            console.log("hello world")
            var res = writeScore(curScore, "c:\\u\\temp\\MVP51-" + curScore.parts[0].longName, "mp3");
            console.log("writeScore result: " + res);
            Qt.quit()
            }
      }
// FINISH CODE

Reproduction steps:
- Load the Let_Me_Call_You_Sweetheart.mscz in Musescore 3.6.2
- Open the Plugin Creator
- Paste the QML snippet and ensure it's loaded
- Run the code

Results:
- File is generated
- Console output:

    Running…
    Plugin Details:
      Menu Path: Plugins.pluginName
      Version: 1.0
      Description: Description goes here
      Requires Score
    Debug: hello world
    Warning: QMutex: destroying locked mutex
    Debug: writeScore result: true
    Saving to:C:/Users/Kevin/Documents/MuseScore3/Plugins/poc01-muteChannels/mvp50-writeScore.qml

I'm raising this because I have a broader issue of a ~10sec pause that happens when I'm looping through each staff but I'll raise a separate ticket after dealing with the "Warning: QMutex: destroying locked mutex" message first.

Any guidance appreciated.

Regards,

Kevin

Attachment Size
Let_Me_Call_You_Sweetheart.mscz 19.98 KB

Comments

Well, I get this:
Screenshot 2023-05-12 120007.png
Screenshot 2023-05-12 120108.png
followed by Debug: writeScore result: false

Changing the code to drop the "\\u" I can reproduce the Qmutex warning though, but not such big delays, beyond that needed to create the MP3, and a brief pause of some 5 secs before the MP3 creation starts, so not the 10 secods you report

In reply to by Jojo-Schmitz

Hi Jojo-Schmitz,

Thanks for helping! I had created a directory call c:\u\temp on my Windows PC. I apologise for not mentioning that earlier. Maybe my 10-sec timing is wrong so I retested and indeed it was closer to 5-6sec before mp3 encoding.

Regards,

Kevin

Do you still have an unanswered question? Please log in first to post your question.