Closed daniel-lerch closed 6 years ago
Strange. Seems to be working fine for me under Mono 4.6.2. My code is fairly similar to yours except is wrapped in AsyncContext.Run()
, although that wouldn't cause the EINVAL. Which runtime are you using with your code? Also, which Pi and Camera Module are you using?
I am using a Raspberry Pi 3B with the Sony IMX219 camera module. On Raspbian I am running an Avalonia Application which should provide its own async context. But the application crashes before calling any async method. The application is built on .NET Core 2.0 and published in Debug configuration as a self-contained app for linux-arm.
Ok, thanks. I'll give it a quick test on .NET Core.
Again, seems to be fine for me under netcoreapp2.0
however I am using a Pi 2B and the OV5647 module.
Could you tell me the output of /opt/vc/bin/vcgencmd version
please?
I'll try and find some time this evening to hook up my IMX219 module and see if anything throws up an issue.
Could you send a stacktrace over too?
Thanks, Ian
Hi Ian,
here is requested output:
pi@rasperrypi:/opt/vd/bin $ ./vcgencmd version
Mar 23 2018 16:35:52
Copyright (c) 2012 Broadcom
version d92349b3d22c277e44d508a2aae6af2b1e5bb224 (clean) (release)
Gist for Stacktrace and logfile
Note: This version uses I420
as output encoding from the ResizerComponent. Using other encodings ended up in the same Exception but in some cases twice the output:
mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL
mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x1bebf10 (EINVAL)
Thank you very much!
Daniel
Hi Daniel,
Sorry for the delay in getting back to you - it's been a busy few days. I've updated to the latest firmware and still not having the issues you're experiencing. I have however found a separate issue which is resolved in 4524186.
At this point it might be worthwhile making a fresh application without the UI framework based on the Resizer example in the Wiki and see if you have any luck.
What would also be helpful is if you can follow the steps here regarding vcdbg
and make a Gist of the output for me - that'll print out a lot of low level debugging info from the firmware to the console and is handy when issues like this crop up.
Thanks, Ian
Hi Ian,
sorry for this delay. Until today I was not able to do more tests.
I have pulled e616b3a4 and built a new Console Application from scratch using my old settings. Again I got an EINVAL. But once I copied your example code from the Wiki it worked. My first mistake was setting the resolution of the ResizerComponent to 0×0 or 65536×65536. However this mistake could not have happened in my lasts attempts with Avalonia where I used Resolution.As8MPixel
.
Now it works with both projects, Console Application and Avalonia UI. Many issues may have contributed to this error. Avalonia is not stable at all on Raspbian and my power supply had problems when moving the Pi. But I don't now what exactly caused this error. Just for the case I was incredibly stupid to the resolution to 0×0 by accident in all test cases, I will add an ArgumentOutOfRangeException
in my next pull request.
In case I experience this problem again, I will reopen this issue and send detailed vcdgb
information.
Thank You Daniel
Hi Daniel,
Really glad you've been able to get it sorted. Additional handling for this component is a good idea. I must admit I wasn't aware it would behave it that way if the resolution was set to 0x0 but I can understand why. Hopefully it won't crop up again - I'm tempted to try out Avalonia, hadn't heard of it until now.
Thanks, Ian
Hi Ian,
I am still trying to get an uncompressed image from MMALSharp. At first I tried your approach from
TakeRawPicture
but got an EINVAL when I tried to commit the image format ARGB. Then I searched with the new utility method from #17 for available encodings. Finally I tried many versions with ResizerComponent all resulting in an EINVAL at ConfigureOutputPort. No matter whether I useI420
,BGRA
orYUYV
, it always crashes.Here is my code:
The
MemoryCaptureHandler
simply writes all bytes on a MemoryStream.Daniel