techyian / MMALSharp

C# wrapper to Broadcom's MMAL with an API to the Raspberry Pi camera.
MIT License
195 stars 33 forks source link

MMALNoMemoryException #31

Closed fabien-chevalley closed 6 years ago

fabien-chevalley commented 6 years ago

Hi,

I got the following exception during instanciation of MMALCamera :


An exception of type 'MMALSharp.MMALNoMemoryException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'Out of memory. Unable to create component'
   at MMALSharp.MMALCallerHelper.MMALCheck(MMAL_STATUS_T status, String prefix)
   at MMALSharp.MMALComponentBase.CreateComponent(String name)
   at MMALSharp.MMALComponentBase..ctor(String name)
   at MMALSharp.Components.MMALCameraComponent..ctor()
   at MMALSharp.MMALCamera..ctor()
   at MMALSharp.MMALCamera.<>c.<.cctor>b__38_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at MMALSharp.MMALCamera.get_Instance()

Do you have any idea of my mistake ?

For informations, I'm running the code on raspbian9 (RPi3-revB) with .netcore2.1

Fabien
techyian commented 6 years ago

Hi, could you post a sample of code you're running please so I can try locally? Also, what is the memory split for the GPU?

Thanks, Ian

fabien-chevalley commented 6 years ago

ok, I foud my mistake... I didn't activate the camera module on raspi-config !

Now, I can correctly grab image from raspistill but MMALSharp return 0byte image. I'm going to dig a little bit to try to find my mistake

fabien-chevalley commented 6 years ago

it's an issue of the remote debugger, if I run my code without vsbdg everthing works. Thank's for helping me and for the library !