ubuntu-rockchip icon indicating copy to clipboard operation
ubuntu-rockchip copied to clipboard

Upate rkaiq camera engine to v5.0x4.1

Open peyton-howe opened this issue 10 months ago • 5 comments

Latest version of the rkaiq camera engine for rk3588 devices. Source code for the package can be found here.

peyton-howe avatar Apr 05 '24 06:04 peyton-howe

I would like to upgrade this but don't have time at the moment to dig through that package. Preferably id like to see the source from rockchip and upload it to Launchpad.

Joshua-Riek avatar Apr 07 '24 18:04 Joshua-Riek

Source code is stored on Firefly-Linux's Gitlab here. There's one slight modification that needs to be made, the rkaiq_3A_server.cpp code isn't updated on that tag and throws segfaults due to multi camera errors. To fix this, use the rkaiq_3A_server.cpp from the rk3588/linux_release_v1.3.0e tag.

I would have just used the rk3588/linux_release_v1.3.0e tag entirely, but that rkaiq version is only v5.0x3.0 while the rk356x/linux5.10_release_v1.4.0b tag is v5.0x4.1, so I figured I'd go with the newest.

The package I have in this pull request is the compiled code for v5.0x4.1 with the correct rkaiq_3A_server for rk3588 devices. I copied the structure from the existing packages that I was attempting to replace.

peyton-howe avatar Apr 07 '24 19:04 peyton-howe

I see thank you, I will still need some time to take a look. I'm currently busy porting the rootfs build process to livecd-rootfs to follow upstream Ubuntu, it's taking some time but the images produced by it are perfect.

Joshua-Riek avatar Apr 07 '24 19:04 Joshua-Riek

Sounds good! If there's anything other questions or if you need any help from me, just let me know :)

peyton-howe avatar Apr 07 '24 20:04 peyton-howe

Sorry for delay in getting back to this, but this needs to be packaged on Launchpad and I would like to find the exact rockchip release tags in correspondence to the 6.1 kernel and 5.10 kernel releases.

Joshua-Riek avatar May 13 '24 18:05 Joshua-Riek

I am working on integrating the source code into Launchpad, which can be found here.

As for the release tags corresponding to kernel 5.10 and kernel 6.1, I know for sure that this tag works with kernel 5.10. It may also work fine with 6.1, but I cannot get cameras to work on kernel 6.1 at all, so I'm unable to test at this time.

peyton-howe avatar May 21 '24 11:05 peyton-howe

Do you have a list of build deps and build instructions?

Joshua-Riek avatar Jun 14 '24 21:06 Joshua-Riek

@peytonicmaster6 I started to package the camera engine rkaiq, source code is linked below but i still need to test it out.

https://git.launchpad.net/~jjriek/+git/camera-engine-rkaiq?h=rk3588

Joshua-Riek avatar Jun 18 '24 15:06 Joshua-Riek

@Joshua-Riek I tried out your launchpad code and it built perfectly! There's only one slight issue, you're pulling outdated tuning files from the source code. The location to the current tuning files is rkaiq/iqfiles/isp3x. Once I updated the CmakeLists file and rebuilt, everything worked as intended! I've tested with two cameras running simultaneously and no issues at all.

On another note, there's some externally stored iqfiles that I think people would be interested in, namely the ones for the raspberry pi cameras. Radxa has the tuning files or the V1 and V2 cameras here, and the tuning file for the V3 camera can be found here. I plan on updating the tuning files for the V1 and V2 cameras from the OpenHD repo so that all the tuning files are in one spot.

peyton-howe avatar Jun 19 '24 12:06 peyton-howe

Got it, i still need to do some packaging fixes before adding it to my PPA. Also I stumbled across some documentation and I should be able to patch Cheese to work with these cameras.

Joshua-Riek avatar Jun 19 '24 21:06 Joshua-Riek

@peytonicmaster6 I should have the rkaiq package finished my tomorrow night, your assistance has been extremely helpful and I can't thank you enough!

Joshua-Riek avatar Jun 20 '24 21:06 Joshua-Riek

Sweet, I look forward to it! Also, I’m happy to help out any way I can, your Ubuntu images have been a lifesaver!

On another note, could you share the documentation you found for cheese? I’d be interested to take a look at it.

peyton-howe avatar Jun 21 '24 13:06 peyton-howe

This PDF has a lot of good information, Cheese is on chapter 6.7.1 or page 33: Rockchip_Developer_Guide_Debian_EN.pdf

I've not been able to get Cheese to find the video node yet.

Joshua-Riek avatar Jun 21 '24 15:06 Joshua-Riek

Hmm anyone know if there is any source code for the rkisp? I need to package that as well.

Joshua-Riek avatar Jun 21 '24 21:06 Joshua-Riek

Try here

peyton-howe avatar Jun 21 '24 21:06 peyton-howe

I saw that firefly repo but it seems so outdated and there are a lot of compile errors. I will try to do some hacking to fix what i can.

Joshua-Riek avatar Jun 21 '24 22:06 Joshua-Riek

From the PDF you linked, rkisp is

The full name is Rockchip Image Signal Processor, image signal processor. Which is mainly used to implement camera's 3A effect, suitable for ISP1.X chips, such as RK3288, RK33999...etc

All of the newer processors are using the ISP3x or ISP2x. Are any of the boards your Ubuntu images support RK3288 or RK3399?

peyton-howe avatar Jun 21 '24 22:06 peyton-howe

No, ive only worked with RK3588 and RK3566.

Joshua-Riek avatar Jun 21 '24 22:06 Joshua-Riek

It's so annoying how Rockchp does not provide easy access and open source repositories.

Joshua-Riek avatar Jun 21 '24 22:06 Joshua-Riek

Gotcha. You shouldn't need to package it up then. I only have the rkaiq package on my system and the cameras work perfectly fine.

peyton-howe avatar Jun 21 '24 22:06 peyton-howe

For the Orange Pi cameras the rkisp package seems to be required. I may just hack in the binarys, but i really do not like the idea of it since Ive been putting more effort into doing things properly.

Joshua-Riek avatar Jun 21 '24 22:06 Joshua-Riek

Are you referring to this one? https://media.githubusercontent.com/media/Joshua-Riek/ubuntu-rockchip/main/packages/rkaiq/camera_engine_rkisp-v2.2.0_arm64.deb

I only have rkaiq installed on my OPI 5B and am using a OV13855 from orange pi. What's the error you're getting?

P.S. if you want quicker help with debugging/testing, feel free to join the discord I made for camera development. https://discord.gg/XvFJP2UZ

peyton-howe avatar Jun 21 '24 22:06 peyton-howe

Closing as the camera engine has been packaged and is now included by default in images.

Joshua-Riek avatar Jun 24 '24 01:06 Joshua-Riek

Are you referring to this one? https://media.githubusercontent.com/media/Joshua-Riek/ubuntu-rockchip/main/packages/rkaiq/camera_engine_rkisp-v2.2.0_arm64.deb

I only have rkaiq installed on my OPI 5B and am using a OV13855 from orange pi. What's the error you're getting?

P.S. if you want quicker help with debugging/testing, feel free to join the discord I made for camera development. https://discord.gg/XvFJP2UZ

Hi @peytonicmaster6 , I am also doing some camera development with LubanCat4 RK3588s, could you send the discord link again, I want to join to talk about some issues. Thanks~

shingoxy avatar Jul 09 '24 00:07 shingoxy

Hi @shingoxy, here's the invite link! https://discord.gg/HTCxRd5c

peyton-howe avatar Jul 09 '24 05:07 peyton-howe

Hi @shingoxy, here's the invite link! https://discord.gg/HTCxRd5c

@peytonicmaster6 Thanks~I have joined the channel~My new image sensor could not found iqfile and rkaiq is not working, I am on debugging it.

shingoxy avatar Jul 09 '24 07:07 shingoxy

Hi @shingoxy, here's the invite link! https://discord.gg/HTCxRd5c

Hi, Please may I also receive a Discord invite? I'm also having issues with my Orange Pi 5 Pro + OV13855 camera - using the latest Ubuntu server 24.04LTS from Joshua Riek, but v4l2-ctl --list-devices only shows my USB webcam, not the OrangePi camera

PsiMation avatar Jul 16 '24 16:07 PsiMation

@PsiMation heres the link. This one shouldn’t expire anymore.

https://discord.gg/XC9jvy4HmT

peyton-howe avatar Jul 16 '24 23:07 peyton-howe