osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

Fix exceptions for `AudioComponent` enqueue operations being left unobserved

Open VPeruS opened this issue 7 years ago • 10 comments

It's make lib not found exception pop up if libbass_fx wasn't installed

As documented: https://msdn.microsoft.com/en-us/library/dd321435(v=vs.110).aspx

VPeruS avatar Jun 21 '18 21:06 VPeruS

Appveyor reach timeout on tests

VPeruS avatar Jun 22 '18 15:06 VPeruS

Generally that means there's some failing test in the branch and you should run it locally. Stuck a second time around.

smoogipoo avatar Jun 25 '18 03:06 smoogipoo

Local tests: image

VPeruS avatar Jul 31 '18 00:07 VPeruS

Appveyor vm don't emulate audio device.

VPeruS avatar Aug 04 '18 04:08 VPeruS

Yeah, apparently we've been missing these exceptions until now. I'm running into the same issue on https://github.com/ppy/osu-framework/pull/1759 and will be looking at fixing it properly.

peppy avatar Aug 04 '18 05:08 peppy

I... think we still want this to be thing?

In testing on latest master, exceptions in this flow are being logged (as unobserved), but arguably they should be throwing upwards from the point of calling? Not 100% sure.

peppy avatar Feb 14 '22 08:02 peppy

Based on https://github.com/ppy/osu-framework/runs/5180654607?check_suite_focus=true alone I think this is a change we do want to make...

peppy avatar Feb 14 '22 08:02 peppy

Being the one who originally committed the assertions this has tripped in cleanUpSyncs(), I have to say that maybe the assertions are a bit too strict and may just be a red herring (you could just allow no-op if there is nothing to clean up, after all). But then again I'm not sure how it can ever be tripped, at least not without concurrent writes to Mixer or something...

Also really weird that this change is apparently surfacing video errors that CI doesn't normally throw...? I don't recall seeing any of those before.

bdach avatar Feb 14 '22 18:02 bdach

With regard to the video errors: I believe they have always been happening but only show up when another failure happens alongside them.

peppy avatar Feb 15 '22 03:02 peppy

I adjusted the cleanUpSyncs method to not assert so hard, but that just caused things to fail elsewhere. I think there's an actual issue with mixer logic somewhere. Note that this does not repro 100% of the time, so there may be thread timings involved.

-AssertionException
   at osu.Framework.Logging.ThrowingTraceListener.Fail(String message1, String message2) in /Users/dean/Projects/osu-framework/osu.Framework/Logging/ThrowingTraceListener.cs:line 25
   at System.Diagnostics.TraceInternal.Fail(String message, String detailMessage)
   at System.Diagnostics.TraceInternal.TraceProvider.Fail(String message, String detailMessage)
   at System.Diagnostics.Debug.Fail(String message, String detailMessage)
   at osu.Framework.Audio.Mixing.Bass.BassAudioMixer.AddChannelToBassMix(IBassAudioChannel channel) in /Users/dean/Projects/osu-framework/osu.Framework/Audio/Mixing/Bass/BassAudioMixer.cs:line 305
   at osu.Framework.Audio.Track.TrackBass.set_Mixer(AudioMixer value) in /Users/dean/Projects/osu-framework/osu.Framework/Audio/Track/TrackBass.cs:line 412
   at osu.Framework.Audio.Track.Track.osu.Framework.Audio.Mixing.IAudioChannel.set_Mixer(AudioMixer value) in /Users/dean/Projects/osu-framework/osu.Framework/Audio/Track/Track.cs:line 131
   at osu.Framework.Audio.Mixing.AudioMixer.<>c__DisplayClass5_0.<Add>b__0() in /Users/dean/Projects/osu-framework/osu.Framework/Audio/Mixing/AudioMixer.cs:line 47
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)

JetBrains Rider-EAP 2022-02-15 at 09 10 56

I've pushed the changes for the clean up method as I think it reads better (and is more expected behaviour). Let's see what CI thinks.

peppy avatar Feb 15 '22 09:02 peppy