This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM365: Single Shot mode and vertical slicing

I am using a 2456x2058 resolution Bayer format camera attached to the DM365 EVM.  We have been using the capture_prev_rsz_on_the_fly_bayer demo application as a base.  We have successfully been able to capture a full resolution image from our camera and resize it down to 720x480 YUV 4:2:2 format for display in continuous mode.  Now, we would like to switch to single shot mode so we can create a 2456x2058 YUV 4:2:2 image.  However, I'm getting confused on how to setup the drivers and the ioctl calls I need to make in my loop.

I currently have the drivers setup for single shot mode and I have the Resizer chained to the Previewer.  When I make the VIDIOC_DQBUF ioctl call on the capture driver, I believe I am getting the raw Bayer image.  How do I feed this through the Previwer and Resizer?  What ioctl calls do I make?  And how do I feed two different vertical slices so I can retain the full resolution of the image?

  • Bryan Evenson said:
    When I make the VIDIOC_DQBUF ioctl call on the capture driver, I believe I am getting the raw Bayer image.  How do I feed this through the Previwer and Resizer?  What ioctl calls do I make? 

    There are a couple other example files you may want to take a look at to get a better idea of what calls you will need to make, in particular I suspect you have seen dvsdk_3_10_00_19/examples-r37/imp-prev-rsz/dm365/capture_prev_rsz_ss_raw_yuv.c which shows single shot operation which is at least half of it, and is the closest I know of for DM365. Though I have not done a real in depth analysis, you may also find dvsdk_3_10_00_19/examples-r37/imp-prev-rsz/dm355/capture_prev_ss_raw_bayer.c userful, though it targets DM355 it appears to show the operation you are looking for, of single shot resize with bayer conversion.

    Bryan Evenson said:
    And how do I feed two different vertical slices so I can retain the full resolution of the image?

    There is at least one example of a multi-pass resize operation within dvsdk_3_10_00_19/examples-r37/resizer/yuv_multipass_resize/yuv_multipass_resize.c, though it does it through file operations and leaves out the capture portion, the basic operation should be similar, as you will have to do this operation from memory anyway.

  • I didn't notice a couple of those demo applications since they weren't under the DM365 folder, and they look like they may be useful.  I'll give things a shot.

    So far it looks like I will need to make multiple PREV_PREVIEW ioctl calls to convert the 5 MP image in vertical slices.  Is this a blocking call, or do I have to do something in between calls to PREV_PREVIEW to verify it is finished with one slice before passing it the next slice?

  • Bryan Evenson said:
    Is this a blocking call, or do I have to do something in between calls to PREV_PREVIEW to verify it is finished with one slice before passing it the next slice?

    It looks like it is blocking, there is a mutex_lock_interruptible() call in the PREV_PREVIEW ioctl code (drivers/char/imp_previewer.c ~line 520) which should block it if you already have a channel open.

    EDIT: Actually that referenced line is not what actually makes it blocking, that just protects multi-threading, I think you want line 1486 of drivers/char/imp_common.c where it waits for completion.

  • When looking into the examples and how to do vertical slicing, I stumbled upon the "frame_div_mode_en" parameter in the prev_single_shot_config struct.  From searching it's usage in dm365_ipipe.c, it looks like when I enable this parameter that the IPIPE may do the vertical slicing for me.  However, it looks like when the IPIPE driver validates parameters it doesn't allow "frame_div_mode_en" to be set; it says this feature is not supported.  So is the frame division mode code in the DM365 IPIPE driver fully functional but just was never turned on, or does the frame division mode not work properly in the driver at this point?  I'm using DVSDK 3.10.00.19.

  • Bryan Evenson said:
    So is the frame division mode code in the DM365 IPIPE driver fully functional but just was never turned on, or does the frame division mode not work properly in the driver at this point? 

    I suspect it does not work properly, or at least that it is not fully tested, otherwise it would not have the 'not supported' error in the code. Hopefully one of the PSP engineers can comment further on the status.

    On the positive side in the mean time, if you wanted to give it a shot it does not look like it would be hard to change the code to allow it to try the frame_div_mode_en setting, though I have never seen it used.