[tim-janik/beast] Eliminate global Soundfont Mutex (#84)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[tim-janik/beast] Eliminate global Soundfont Mutex (#84)

Gnome - Beast mailing list

Merging of the Soundfont branch introduced a global (per project) mutex around fluidsynth in bsesoundfontrepo.cc that prevents parallel processing of engine modules.
E.g. for a polyphonic track, thread 1 might be processing a fluid voice, while threads 2,3,4 try to process polyphonic voices of the same track which leads to blocking on the mutex held by thread 1 instead of picking up other modules that need processing.

This problem needs to be eliminated to allow full multi-threaded processing of the sound engine.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/tim-janik/beast","title":"tim-janik/beast","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/tim-janik/beast"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Eliminate global Soundfont Mutex (#84)"}],"action":{"name":"View Issue","url":"https://github.com/tim-janik/beast/issues/84"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/issues/84", "url": "https://github.com/tim-janik/beast/issues/84", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Eliminate global Soundfont Mutex (#84)", "sections": [ { "text": "", "activityTitle": "**Tim Janik**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@tim-janik", "facts": [ { "name": "Repository: ", "value": "tim-janik/beast" }, { "name": "Issue #: ", "value": 84 } ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"tim-janik/beast\",\n\"issueId\": 84,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"tim-janik/beast\",\n\"issueId\": 84\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/tim-janik/beast/issues/84" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 392914903\n}" } ], "themeColor": "26292E" } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Eliminate global Soundfont Mutex (#84)

Gnome - Beast mailing list

Here is my proposal for fixing this: #85


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/tim-janik/beast","title":"tim-janik/beast","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/tim-janik/beast"}},"updates":{"snippets":[{"icon":"PERSON","message":"@swesterfeld in #84: Here is my proposal for fixing this: https://github.com/tim-janik/beast/pull/85"}],"action":{"name":"View Issue","url":"https://github.com/tim-janik/beast/issues/84#issuecomment-430699138"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/issues/84#issuecomment-430699138", "url": "https://github.com/tim-janik/beast/issues/84#issuecomment-430699138", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [tim-janik/beast] Eliminate global Soundfont Mutex (#84)", "sections": [ { "text": "", "activityTitle": "**Stefan Westerfeld**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@swesterfeld", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"tim-janik/beast\",\n\"issueId\": 84,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"tim-janik/beast\",\n\"issueId\": 84\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/tim-janik/beast/issues/84#issuecomment-430699138" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 392914903\n}" } ], "themeColor": "26292E" } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Eliminate global Soundfont Mutex (#84)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

Just two more remarks.

  1. Note that I think there is a wrong understanding what happens in the way you describe the bug:

E.g. for a polyphonic track, thread 1 might be processing a fluid voice, while threads 2,3,4 try to process polyphonic voices of the same track which leads to blocking on the mutex held by thread 1 instead of picking up other modules that need processing.

For a polyphonic track there will only be one single sound font osc instantiated. This one sound font osc handles all voices for this track, no matter how many voices are active. So to stall the engine in the way you describe, you need many tracks with sound font oscs (which is however a valid use case, I won't deny this).

  1. "full multi-threaded processing of the sound engine" may not actually be faster than single threaded processing.

I've tried to measure how much faster party monster renders when given multiple cpus here:

https://mail.gnome.org/archives/beast/2018-July/msg00009.html

The result: not at all, the engine is slower if more cpus are used. But this again may not always be the case (if something else than party monster were used to measure performance), and even if it were, I'd agree that we're looking at two issues here, one in the soundfont code and one in the engine, and the engine inefficiency should be fixed in the engine.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/tim-janik/beast","title":"tim-janik/beast","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/tim-janik/beast"}},"updates":{"snippets":[{"icon":"PERSON","message":"@swesterfeld in #84: Just two more remarks.\r\n\r\n1. Note that I think there is a wrong understanding what happens in the way you describe the bug:\r\n\r\n\u003e E.g. for a polyphonic track, thread 1 might be processing a fluid voice, while threads 2,3,4 try to process polyphonic voices of the same track which leads to blocking on the mutex held by thread 1 instead of picking up other modules that need processing.\r\n\r\nFor a polyphonic track there will only be *one* single sound font osc instantiated. This one sound font osc handles all voices for this track, no matter how many voices are active. So to stall the engine in the way you describe, you need many tracks with sound font oscs (which is however a valid use case, I won't deny this).\r\n\r\n2. \"full multi-threaded processing of the sound engine\" may not actually be faster than single threaded processing.\r\n\r\nI've tried to measure how much faster party monster renders when given multiple cpus here:\r\n\r\nhttps://mail.gnome.org/archives/beast/2018-July/msg00009.html\r\n\r\nThe result: not at all, the engine is slower if more cpus are used. But this again may not always be the case (if something else than party monster were used to measure performance), and even if it were, I'd agree that we're looking at two issues here, one in the soundfont code and one in the engine, and the engine inefficiency should be fixed in the engine."}],"action":{"name":"View Issue","url":"https://github.com/tim-janik/beast/issues/84#issuecomment-430750475"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/issues/84#issuecomment-430750475", "url": "https://github.com/tim-janik/beast/issues/84#issuecomment-430750475", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [tim-janik/beast] Eliminate global Soundfont Mutex (#84)", "sections": [ { "text": "", "activityTitle": "**Stefan Westerfeld**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@swesterfeld", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"tim-janik/beast\",\n\"issueId\": 84,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"tim-janik/beast\",\n\"issueId\": 84\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/tim-janik/beast/issues/84#issuecomment-430750475" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 392914903\n}" } ], "themeColor": "26292E" } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Eliminate global Soundfont Mutex (#84)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

Closed #84.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/issues/84?email_source=notifications\u0026email_token=AIVS7XXTLNVXWM66VXHL5O3P64PNZA5CNFSM4F3LM7L2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSOIC7MQ#event-2475700146", "url": "https://github.com/tim-janik/beast/issues/84?email_source=notifications\u0026email_token=AIVS7XXTLNVXWM66VXHL5O3P64PNZA5CNFSM4F3LM7L2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSOIC7MQ#event-2475700146", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast
Reply | Threaded
Open this post in threaded view
|

Re: [tim-janik/beast] Eliminate global Soundfont Mutex (#84)

Gnome - Beast mailing list
In reply to this post by Gnome - Beast mailing list

The global soundfont lock has been eliminated with merging #102 so I close this issue.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/tim-janik/beast/issues/84?email_source=notifications\u0026email_token=AIVS7XUWBGAMTUSP2UIK6L3P64PNZA5CNFSM4F3LM7L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZWP5TY#issuecomment-510459599", "url": "https://github.com/tim-janik/beast/issues/84?email_source=notifications\u0026email_token=AIVS7XUWBGAMTUSP2UIK6L3P64PNZA5CNFSM4F3LM7L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZWP5TY#issuecomment-510459599", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
_______________________________________________
beast mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/beast