Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 3799 [details]
When SGEN is enabled, the AVCaptureVideoDataOutputSampleBufferDelegate's DidOutputSampleBuffer, for an AVCaptureSession does not get called in a session. It works the first time (or first couple times), but subsequent sessions do not work. It almost seems like something is being GC'd, but I can't figure out what I might be not holding a reference to that would be causing this issue.
I've included a pretty simplified repro project with the problem as isolated and minimal as possible!
Here are the steps to reproduce the behaviour:
1. Build and run the repro on an iOS device
2. Tap the 'Play' bar button item
3. Notice the "SAMPLE" lines in the application output, this is happening inside OutputRecorder's 'DidOutputSampleBuffer' method.
4. Tap 'Stop'
5. Repeat Steps 2 and 3. You may need to try this a few times, but eventually, notice that "SAMPLE" no longer appears in the output, as DidOutputSampleBuffer is no longer called.
6. Change the project to not use SGEN and repeat Steps 1-5, notice that it works every time now.
Did you release the resources passed on the DidOutputSampelBuffer?
I think that is a FAQ at this point.
Yeah I've been pretty careful to release resources, but that still wouldn't explain why the DidOutputSampleBuffer is never called on a new AVCaptureSession, with a new AVCaptureVideoDataOutputSampleBufferDelegate instance... Basically after everything is created again, the delegate stops getting called (that includes the dropped frame called). I could see if I was getting an out of memory exception, but that's not the case.
So the smaple is correct, it is disposing the buffer.
It works on 6.2 so far.
So it is possible a 6.3 issue
I can reproduce it with 6.3 (from master-3.0).
The issue seems to be our internal usage of NSAutoreleasePool - we call [pool release] when threads exists, but something bad happens and [pool release] ends up exiting the thread immediately, preventing any subsequent code to be executed. Since we use locks in our implementation, the lock will never be released (and when more threads want to create/destroy NSAutoreleasePools they end up deadlocking).
sounds identical to #11836 and another test case to confirm it works
*** This bug has been marked as a duplicate of bug 11836 ***