-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Faster pipelines" #3
Conversation
This was the stack trace from coredump: |
Is this with sub-frame? |
No, just a plain exposure full frame. |
Strange, i took about 50 pictures with my V2 (NoIr version) camera now and no crashes. Also tried sub-frames with all kinds of odd offset and shapes and did not get a single crash related to that decoder. If you can reproduce, could you check what bytes_consumed, maxX, maxY and the addresses of frame_buffer and pu32 at the crash site are? I did get one crash in INDI::CCDChip::setFrameBufferSize though, which i unfortunately could not reproduce, even with the same settings. Since the line that crashes is trying to write to the frame buffer, maybe there is an issue there? The pointer values and bytes_consumed should give us a hint if i'm really writing beyond the frame buffer or if the buffer is too small for some reason. Here's the stack trace: |
That is strange, perhaps my setup was faulty in some way then. Ill do some more testings with your PR.. Also, what exact version of the camera do you have, 2.1 or just 2? (wasn't even aware that there was multiple versions...) |
I'm on: |
Forget it. When i recompile everything now from scratch its all working fine on both imx219 and ov5647. Not sure what happened. I did upgrade one of my RPI:s to latest version of raspian. Ill try to bring in your patch on master and the create a PR for inidi-3rdparty. Sorry for the inconveniance. |
Ok, forget the forget (sorry for being so confused). Seems your original PR with final commit 29989b6 works fine for both cameras, but after updating it with my latest master then resulting in commit 5287b79 does actually crash on V2 camera.... |
Here are the printouts from gdb you requested from the core-file: frame_buffer = 0 does not sound too good. Maybe the pipeline reset it not being done properly here... I saw you had some comments about that in raw10...::reset() |
Hehe, no worries, i know the feeling 👍 |
Ah, ok. Can you try to put |
I originally thought all those states where there in the reset, because you have ccd->getSubX() etc in there, but apparently this is not always the case. It looks like there is a race condition between the setup thread and the callback thread. On my instance it works fine with the frame_buffer assign in the reset function but, yeah, i saw it fail in this manner before but thought that was fixed with your latest master, so i put it back up there. |
I just did, but same result, frame_buffer is 0 at crash. |
I get the feeling the frame_buffer in the ccd-object is overwritten somehow? |
I added an assertion of the CCD framebuffer in mmaldriver::StartExposure and its framebuffer is null there already. |
Found it, the error was actually allready in my branch. I commented out call to UpdateCCDFrame because I did not think that the driver should call that itself. Seems the frame buffer was missing if not done. This change made it work. Ill test on all other cameras also and try to merge it on top of master: diff --git a/indi-rpicam/mmaldriver.cpp b/indi-rpicam/mmaldriver.cpp -// // Should probably not be called by the subclass of CCD - not clear.
|
Also this here:
|
I think I am doing that already? |
Whoops sorry, missed that. |
Not sure no, but my code for sure was missing an explicit allocation of the buffer. Perhaps your kstars or other software is actually causing a call to UpdateCCDFrame for some other reason and that would have allocated the buffer. |
I've tested on all cameras now and created a pr upstream. There still seems to be a problem with long exposure. It didn't work at start but then after just restarting I started to work again. I suspect there are some parameter default setting missing some where but I'll have to look into that later. I also saw that the raw10... Does not nudge the msb ccd bit to bit15 in the imag buffer resulting in quite dark images.. I'll check that later also |
Yes, i've been trying to figure out that exposure problem too. For me, the v1 does not go beyond 1s and the v2 does not go beyond 6s, but raspistill does not seem to have any problems with that.
Ah, i did not realize that was on purpose. I thought that was a typo/bug coming over from the 12bit decoder (never actually looked at that one) and put it back to bit10. |
I think I found the problem with long exposure for the other two cameras in commit d265fc2 . I also stretched bit9 to bit15, not sure I got your code correct so you are very welcome to test that on both v1 and v2 camera. I think the color on v2 is not correct, but then my v2 camera is partly broken so Im not sure. |
Seems to be something wrong with the alignmen on V2, the bayer info gets shifted one pixel somehow. |
Just a sec, i need to hook up the other camera |
Ok i see what you mean. Don't they have the same pixel layout? The V1 has the right colors. Is that shift in Y or in X? |
Great, looks like they changed the filter pattern on the sensor between v1 and v2 ...
V2
Plus the lsb pattern has to be changed too. I'll prepare another PR... |
Wow, ok . just to make life easier for us I presume. I suspect this information is somehow available in the broadcom 32K header block. But not sure where. Thanks. |
It's not ... Funnily, the V2 version is GBRG and the original decoder should have produced color shifted outputs on V2. Coincidentally there seems to be also an offset error of 5 pixels to the left, which turns the GBRG into BGGR which makes the picture correct again, albeit shifted to the left. I'm trying to find out where that offset is coming from now and then it's just a question of setting |
Never mind about that shift, it looks like i'm just not handling the end of a line properly and the last few pixels are cut off somehow. There is still something wrong though, because the old, byte wise decoding should be correct for the V1 and wrong for the V2 but it's exactly the other way around... |
I created another pull request for the color fixes which also fixed the problem with the cut off pixels at the right side of the frame. I'm not really happy that the color pattern is exactly the opposite of the documentation but i also can't find out where there that +/- 1 offset is introduced, so i'm leaving i suggest to leave it like that for now. Does your master already contain the fix for the exposure time? My cameras still don't go beyond 1s for V1 and 6s for V2. |
One more thing: I am not sure if the 2 LSBs for every pixel are set correctly. The only test i can think of right now would be to put an appropriate color filter in front of the camera and check which bits go up. However the pedestal is already > 2 bit and the pixel noise would make this almost impossible. |
Thanks for the PR3, checking shortly (no more holiday sadly). I created a discussion board for my fork, lets move discussion there instead of this closed PR... Its here https://github.com/lboclboc/indi-3rdparty/discussions |
Reverts #2
Sorry, but this change actually crashes the imx219 camera instead. Reverting.