Page 1 of 1

Weird ISP behaviour with RKMPI

Posted: 2024-08-29 13:00
by 14Og
Hi everyone! I've managed to create my own tiny application that can control video pipeline using RKMPI. Currently im facing a problem, connected with ISP, because every time i stop VI channel, ISP also turns off and video becomes raw and unprocessed (as it was with bare V4L2 ioctls). My current command flow looks like this:
On VI init (called once):

Code: Select all

RK_MPI_SYS_Init();
RK_MPI_SYS_InitPTSBase();
On VI start command:

Code: Select all

RK_MPI_VI_EnableDev();
RK_MPI_VI_SetDevBindPipe();
RK_MPI_VI_EnableChn();
On VI stop command:

Code: Select all

RK_MPI_VI_DisableChn();
RK_MPI_VI_DisableDev();
All this functions are called with proper required arguments. The RK_MPI_VI_DisableChn() causes this things in my syslogd daemon:

Code: Select all

RTDeviceV4L2     12:42:38-368 {ispStreamOff      :503} do ispStreamOff start
RTDeviceV4L2     12:42:38-431 {ispStreamOff      :514} do ispStreamOff done
RTDeviceV4L2     12:42:38-433 {close             :365} do RTDeviceV4L2 close
And it never starts again, so when i use command sequence like start->stop->start, second time i have those weird raw unprocessed images. I've also tried to use RK_MPI_VI_PauseChn(), but to no avail...
Is there any possible way to make those functions not disabling my ISP process? Or i have to manually restart ISP algorithm every time i'm recreating pipeline? All this command sequences were taken from samples/opencv example. Thanks in advance!

Re: Weird ISP behaviour with RKMPI

Posted: 2024-08-30 1:58
by Crocodile
Hello,
If you are working on an actual engineering project, I do not recommend using this method to stop and start the video stream. The VI component's purpose is to capture images and place them into the memory buffer pool. If it is not needed, you can simply stop retrieving from the memory buffer blocks in the next component or function. Repeatedly stopping and starting will add a lot of unnecessary delays.
If you are doing this for research purposes, then when you stop the VI device, please also use the SAMPLE_COMM_ISP_Stop function to stop the ISP(before VI stop). When restarting, use SAMPLE_COMM_ISP_Run to start the RKISP again.

Re: Weird ISP behaviour with RKMPI

Posted: 2024-09-02 7:26
by 14Og
Thank you, sir, will consider this. By the way, is there any plans to translate Chinese version of RKMPI documentation to English? I've translated it using google machine translation, it's better than nothing, but still quite hard to understand sometimes. Best regards!

Re: Weird ISP behaviour with RKMPI

Posted: 2024-09-02 7:48
by Crocodile
Unfortunately, I do not have enough skills and experience to translate documents. However, there is a useful browser plugin that might help you:https://immersivetranslate.com/en/

Re: Weird ISP behaviour with RKMPI

Posted: 2024-09-05 14:43
by 14Og
Thank you!