Comments (3)
As an update on this one:
This issue manifested itself in multiple ways, sometimes MMALSharp would simply freeze following disabling of a processing port, and other times it would throw an exception due to running into an invalid buffer (null). I didn't notice this during my time with a Pi 2 (who's CSI port is now broken) funnily enough.
As a workaround, I've had to regrettably add a Thread.Sleep(1000)
call in when disabling ports. I suspect there may be something happening natively where my timings are off slightly and is causing MMAL itself to hang. I've done some extensive testing over the past few days and this final fix appears to resolve the issue. I didn't really want to introduce any blocking of the main thread, but as the MMALPortBase
class is unsafe, async calls are out of the question.
As a result, I'll be releasing a new version to Nuget and if anyone happens to run into this following upgrading, please let me know and I'll see what I can do.
Thanks,
Ian
from mmalsharp.
I'm also looking at possibly moving the wait to the ProcessAsync
method prior to disabling ports using an async delay call instead of Thread.Sleep
. Doing some testing before committing any more work on this. I'm aware of speed implications but a short wait before disabling ports is more desirable than a freeze. Will see how short I can realistically get the wait before issues start happening again - 1s may be too generous.
from mmalsharp.
Added an async delay instead which I think is more suitable. I've dropped the delay to 100ms, this is per processing port, so the more ports you have enabled, the longer the disabling process will take. For general use cases (image/video encoder with 1 output port), this will just be a single 100ms delay, but when using the splitter component, this delay will obviously grow.
I've given this change a good stress test and haven't ran into the problems relating to this bug. Hoping there won't be any further issues around this area.
from mmalsharp.
Related Issues (20)
- Allow splitter component to process still images HOT 2
- Delegated pixel-processing effect HOT 5
- TakePicture not setting ImageContext resolution HOT 4
- Bitmap.Save writes a raw RGB array as BGR HOT 4
- Unnecessary file output to post-process still captures
- Add user provided name to MMALPortConfig
- Allow user provided buffer number and size for camera ports HOT 1
- Setting ShutterSpeed not taking HOT 5
- Raw ImageContext output and padded resolutions HOT 1
- StereoMode not being set HOT 1
- Default motion detection example for v0.6 throws "Unhandled exception. System.TypeInitializationException: The type initializer for 'Gdip' threw an exception." HOT 10
- How to set camera number to capture from HOT 3
- MMALCamera.ProcessAsync sometimes hangs indefinitely HOT 7
- Question: LineDetection in Video HOT 3
- Capturing still image to memory stream no longer working HOT 2
- Camera warmup time question HOT 5
- Investigate use of ArrayPool to reduce allocations
- MMALSharp not working with new Raspbian GNU/Linux 11 (bullseye) OS HOT 4
- MMAP gives exception when initialising camera HOT 1
- Howto change PreviewPort after cam.Camera.PreviewPort.ConnectTo(video)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmalsharp.