How to port a raw RGB camera sensor to i.MX6 BSP

cancel
Showing results for 
Search instead for 
Did you mean: 

How to port a raw RGB camera sensor to i.MX6 BSP

Jump to solution
2,661 Views
brucecheng
Contributor II

High quality camera sensors usually output only raw RGB(Bayer pattern) data.

But FSL camera HAL can only preview HAL_PIXEL_FORMAT_YCbCr_420_SP format, which is supported by IPU and VPU both(see below codes in BSP).

void DeviceAdapter::setPreviewPixelFormat()

{

    int vpuFormats[MAX_VPU_SUPPORT_FORMAT];

    memset(vpuFormats, 0, sizeof(vpuFormats));

    int ret = mMetadaManager->getSupportedRecordingFormat(&vpuFormats[0],

                                    MAX_VPU_SUPPORT_FORMAT);

    if (ret != NO_ERROR) {

        FLOGE("getSupportedRecordingFormat failed");

        mPreviewPixelFormat = HAL_PIXEL_FORMAT_YCbCr_420_SP;

        return;

    }

    mPreviewPixelFormat = getMatchFormat(vpuFormats, MAX_VPU_SUPPORT_FORMAT,

                          mAvailableFormats, MAX_SENSOR_FORMAT);

}

How to modify the camera HALL to preview this type of sensor data?

Tags (3)
1 Solution
348 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For RAW RGB format, it was not supported by IMX6 IPU, so the driver can only capture it into memory as RAW format. In this case, preview was not supported, you need use software to convert it for preview.

For VPU, RAW RGB format was also not supported. So camera record function can't be supported too. You also need use software to convert RAW to NV12 format for VPU encode.

View solution in original post

0 Kudos
11 Replies
348 Views
YixingKong
Senior Contributor IV

Bruce

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 Kudos
348 Views
brucecheng
Contributor II

No. I still only use sensor which support YUV format.

Due to the i.MX6 Solo DualLite Reference Manual(Rev. 1, 04/2013, page 2788), the camera port can NOT convert Bayer RGB data On-The-Fly. So I don't think i.MX6 can preview the camera data that support bayer raw data only(e.g. Aptina AR0330 which is used in automovie market widely). But I really want to use it.

Is there any way to preview this type of data format? And how does VPU can use these data to compress.

0 Kudos
348 Views
YixingKong
Senior Contributor IV

Bruce

Had your question got answered? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 Kudos
349 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

For RAW RGB format, it was not supported by IMX6 IPU, so the driver can only capture it into memory as RAW format. In this case, preview was not supported, you need use software to convert it for preview.

For VPU, RAW RGB format was also not supported. So camera record function can't be supported too. You also need use software to convert RAW to NV12 format for VPU encode.

View solution in original post

0 Kudos
348 Views
jasonfan
Contributor I

Hi Qiang,

I also have the same issue for RAW RGB camera.

Do you have any suggested software or library for conversion? And how to capture the data from memory to deal with?

If using software to convert, does it influence the performance obviously?

Or you suggest to add an IC to do the conversion?

Thanks

Best Regards,

Jason

0 Kudos
348 Views
aurelienbouin
Contributor IV

hello Jason,

Have you find something about the conversion ? I am also interrested in finding a solution for an OV9712 sensor

Thank you for your help

Sincerely

Aurelien BOUIN

0 Kudos
348 Views
aravinthkumarja
Senior Contributor II

Hi Aurelien,

I'm also using raw camera. Can you please suggest any software or library to convert Raw camera data to NV12 or any other android supported format.

Regards,

Aravinth

0 Kudos
348 Views
aurelienbouin
Contributor IV

FYI you should look to this forum : http://forum.solid-run.com/linux-kernel-and-bootloaders-on-cubox-i-and-hummin-f10/ov5647-driver--t17...

My OV9712 is working now ! it takes process ... but it works ...

More info : Home · n-aizu/linux-linaro-stable-mx6 Wiki · GitHub

Regards

0 Kudos
348 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Hi Jason, I can't help you on this, I had never used software or hardware for RAW RGB to RGB/YUV converting. You can search it in Google.

0 Kudos
348 Views
YixingKong
Senior Contributor IV

Bruce, I am going to branch your issue into an interenal group and assign an engineer to look into it.

Thanks,

Yixing

0 Kudos
348 Views
YixingKong
Senior Contributor IV

Bruce

We are sorry for getting back to you so late. Are you still stuck with the issue? If you have somehow to resolved the issue, can we close the discussion? If you still need help, please feel free to reply with an update to this discussion.

Thanks,

Yixing

0 Kudos