{"action":"created","issue":{"url":"https://api.github.com/repos/MonoGame/MonoGame/issues/5238","repository_url":"https://api.github.com/repos/MonoGame/MonoGame","labels_url":"https://api.github.com/repos/MonoGame/MonoGame/issues/5238/labels{/name}","comments_url":"https://api.github.com/repos/MonoGame/MonoGame/issues/5238/comments","events_url":"https://api.github.com/repos/MonoGame/MonoGame/issues/5238/events","html_url":"https://github.com/MonoGame/MonoGame/issues/5238","id":184673703,"number":5238,"title":"DynamicSoundEffectInstance assert on Linux","user":{"login":"hifi","id":106598,"avatar_url":"https://avatars.githubusercontent.com/u/106598?v=3","gravatar_id":"","url":"https://api.github.com/users/hifi","html_url":"https://github.com/hifi","followers_url":"https://api.github.com/users/hifi/followers","following_url":"https://api.github.com/users/hifi/following{/other_user}","gists_url":"https://api.github.com/users/hifi/gists{/gist_id}","starred_url":"https://api.github.com/users/hifi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hifi/subscriptions","organizations_url":"https://api.github.com/users/hifi/orgs","repos_url":"https://api.github.com/users/hifi/repos","events_url":"https://api.github.com/users/hifi/events{/privacy}","received_events_url":"https://api.github.com/users/hifi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-23T06:01:09Z","updated_at":"2016-10-23T13:11:34Z","closed_at":null,"body":"I get an assert from within DynamicSoundEffectInstance when playing a second sound effect after a first one has finished playing.\r\n\r\nThere's a check for disposed status but it's being ignored when on OpenAL: https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework/Audio/SoundEffectInstancePool.cs#L108\r\n\r\nApparently there should be a check within `Stop()` for OpenAL and `PlatformStop()` called regardless of disposed status. Since I don't know if there's a possibility for another race condition, I didn't make it a pull request.\r\n\r\n```\r\n[ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.\r\n  at Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance.AssertNotDisposed () <0x414e4830 + 0x00033> in <filename unknown>:0 \r\n  at Microsoft.Xna.Framework.Audio.DynamicSoundEffectInstance.Stop (Boolean immediate) <0x414e6400 + 0x00017> in <filename unknown>:0 \r\n  at Microsoft.Xna.Framework.Audio.SoundEffectInstancePool.Update () <0x413c0ca0 + 0x00085> in <filename unknown>:0 \r\n  at Microsoft.Xna.Framework.Game.DoUpdate (Microsoft.Xna.Framework.GameTime gameTime) <0x413c0be0 + 0x00037> in <filename unknown>:0 \r\n  at Microsoft.Xna.Framework.Game.Tick () <0x413c0540 + 0x00373> in <filename unknown>:0 \r\n  at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop () <0x413c00c0 + 0x0004b> in <filename unknown>:0 \r\n  at Microsoft.Xna.Framework.Game.Run (GameRunBehavior runBehavior) <0x41340f20 + 0x001e0> in <filename unknown>:0 \r\n  at Microsoft.Xna.Framework.Game.Run () <0x41340ec0 + 0x00027> in <filename unknown>:0 \r\n```"},"comment":{"url":"https://api.github.com/repos/MonoGame/MonoGame/issues/comments/255587786","html_url":"https://github.com/MonoGame/MonoGame/issues/5238#issuecomment-255587786","issue_url":"https://api.github.com/repos/MonoGame/MonoGame/issues/5238","id":255587786,"user":{"login":"Jjagg","id":14875382,"avatar_url":"https://avatars.githubusercontent.com/u/14875382?v=3","gravatar_id":"","url":"https://api.github.com/users/Jjagg","html_url":"https://github.com/Jjagg","followers_url":"https://api.github.com/users/Jjagg/followers","following_url":"https://api.github.com/users/Jjagg/following{/other_user}","gists_url":"https://api.github.com/users/Jjagg/gists{/gist_id}","starred_url":"https://api.github.com/users/Jjagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jjagg/subscriptions","organizations_url":"https://api.github.com/users/Jjagg/orgs","repos_url":"https://api.github.com/users/Jjagg/repos","events_url":"https://api.github.com/users/Jjagg/events{/privacy}","received_events_url":"https://api.github.com/users/Jjagg/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T13:11:34Z","updated_at":"2016-10-23T13:11:34Z","body":"Looks like the Stop call was added here https://github.com/MonoGame/MonoGame/commit/35e91094c9b9274909601f15143ed52b1f1566b4#diff-9686e4f3c40d28958fcdbf4a9a0933c3R109\r\n@mrhelmut I suppose we can just omit the Stop call when `instance.IsDisposed` is true? It also seems unnecessary when the sfxi is already stopped so I guess you added that line mostly in case the third condition there is true?\r\n\r\n> There's a check for disposed status but it's being ignored when on OpenAL\r\n\r\n@hifi Not sure what you mean by this. It seems like you just dispose of the sound effect without stopping it first which causes the SFXIPool to call `Stop` on the instance and crash because the instance is disposed. You should get the error without playing a second soundeffect too the same frame you dispose of one because of this issue."}}
{"actor":{"display_login":"Jjagg"}}