Dear Experts,
I'm using the isp-imx-4.2.2.11.0 for the porting of our custom camera (Sony IMX296) and build it in Partial/Release mode. Following are the steps for running the test program :
1. Run daemon in first console :
root@IMX8MPEVK:/opt/imx8-isp/bin# export ISP_LOG_LEVEL=8
root@IMX8MPEVK:/opt/imx8-isp/bin# ./run.sh -c imx296 -lm
RUN_SCRIPT=/opt/imx8-isp/bin/run.sh
RUN_SCRIPT_PATH=/opt/imx8-isp/bin
Trying configuration "imx296"...
Removing vvcam-isp...
Removing vvcam-dwe...
Removing vvcam-video...
Removing imx8-media-dev...
Removing ov2775...
Removing os08a20...
Removing imx296...
Removing basler-camera-driver-vvcam...
Loading module imx296 ...
imx296
Loaded /lib/modules/5.4.70/kernel/drivers/staging/media/imx/imx296.ko
Loading module imx8-media-dev ...
imx8_media_dev
Loaded /lib/modules/5.4.70/kernel/drivers/staging/media/imx/imx8-media-dev.ko
Loading module vvcam-video ...
vvcam_video
Loaded /lib/modules/5.4.70/kernel/drivers/staging/media/imx/vvcam-video.ko
Loading module vvcam-dwe ...
vvcam_dwe
Loaded /lib/modules/5.4.70/kernel/drivers/staging/media/imx/vvcam-dwe.ko
Loading module vvcam-isp ...
vvcam_isp
Loaded /lib/modules/5.4.70/kernel/drivers/staging/media/imx/vvcam-isp.ko
Starting isp_media_server with configuration file CAMERA0
INFO : [ISP_MEDIA_SERVER] ******************************************************************
INFO : [ISP_MEDIA_SERVER] VIV ISP Media Control Framework V4.2.2p11 (Jul 23 2021, 05:50:38)
INFO : [ISP_MEDIA_SERVER] ******************************************************************
dmesg before :
[ 104.559510] imx296: loading out-of-tree module taints kernel.
[ 104.560776] imx296 1-001a: 1-001a supply vdda not found, using dummy regulator
[ 104.560856] imx296 1-001a: 1-001a supply vddd not found, using dummy regulator
[ 104.560893] imx296 1-001a: 1-001a supply vddo not found, using dummy regulator
[ 104.592081] imx296 1-001a: imx296_set_ctrl : ctrl = {.id = 0x009f0903, .val = 0x00000000}
[ 104.592088] imx296 1-001a: I2C writing value 00 at address 0x3238
[ 104.592711] imx296 1-001a: I2C writing value 01 at address 0x3008
[ 104.593309] imx296 1-001a: I2C writing value 3c at address 0x3254
[ 104.594161] imx296 1-001a: I2C writing value 00 at address 0x3255
[ 104.594774] imx296 1-001a: I2C writing value 00 at address 0x3008
[ 104.595388] imx296 1-001a: I2C writing value 01 at address 0x3022
[ 104.596008] imx296 1-001a: no limit for max-data_rate
[ 104.596014] imx296 1-001a: Camera is found
[ 104.637765] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[ 104.638782] mx8-img-md: Registered sensor subdevice: imx296 1-001a (1)
[ 104.638793] mx8-img-md: created link [imx296 1-001a] => [mxc-mipi-csi2.0]
[ 104.638800] mxc-md 32c00000.bus:camera: mxc_md_create_links
[ 104.644498] imx296 1-001a: imx296_set_fmt : fmt = {.which = 0x00000000}
[ 104.644509] imx296 1-001a: imx296_set_fmt : mode = {.width = 1440, .height = 1080, .pixel_rate = 74250000}
[ 104.644529] enter imx296_ioc_qcap
[ 104.693421] enter viv_video_init_module
[ 104.751994] enter viv_dwe_init_module
[ 104.752429] enter dwe_hw_probe
[ 104.752901] vvcam dewarp driver probed
[ 104.843932] enter viv_isp_init_module
[ 104.844359] enter isp_hw_probe
[ 104.844689] vvcam isp driver registered
[ 104.858084] enter isp_mi_stop
Run the ./video_test program in another console :
root@IMX8MPEVK:~# export ISP_LOG_LEVEL=8
root@IMX8MPEVK:/opt/imx8-isp/bin# ./video_test -w 1440 -h 1080 -f RAW10 -t 2 -m0 -d0
INFO : [VIDEOTEST] Open Device: /dev/video0 (fd=3)
INFO : [VIDEOTEST] Driver: viv_v4l2_device
INFO : [VIDEOTEST] found viv video dev /dev/video0
INFO : [VIDEOTEST] openDevice Control User Controls
INFO : [VIDEOTEST] openDevice Control viv_ext_ctrl
INFO : [VIDEOTEST] openDevice, find viv ctrl id 0x98f901
INFO : [VIDEOTEST] open camdev ret : 3
INFO : [VIDEOTEST] Open Device: /dev/video0 (fd=3)
INFO : [VIDEOTEST] Driver: viv_v4l2_device
INFO : [VIDEOTEST] Card: VIV
INFO : [VIDEOTEST] Version: 5.4.70
INFO : [VIDEOTEST] All Caps: 84200001
INFO : [VIDEOTEST] Dev Caps: 04200001
ERROR : [VIDEOTEST] Video Test:Get Caps Supports Failed[-1]
Message in 1st console :
INFO : [MediaPipeline] NativeSensor Creat
loading []...
./run.sh: line 376: 601 Segmentation fault (core dumped) ./isp_media_server $RUN_OPTION
dmesg after :
[ 140.133526] imx296 1-001a: imx296_set_fmt : fmt = {.which = 0x00000000}
[ 140.133535] imx296 1-001a: imx296_set_fmt : mode = {.width = 1440, .height = 1080, .pixel_rate = 74250000}
[ 140.133545] enter imx296_ioc_qcap
[ 140.174000] imx296 1-001a: imx296_set_fmt : fmt = {.which = 0x00000000}
[ 140.174012] imx296 1-001a: imx296_set_fmt : mode = {.width = 1440, .height = 1080, .pixel_rate = 74250000}
[ 140.174020] enter imx296_ioc_qcap
[ 140.174058] imx296 1-001a: imx296_set_fmt : fmt = {.which = 0x00000000}
[ 140.174065] imx296 1-001a: imx296_set_fmt : mode = {.width = 1440, .height = 1080, .pixel_rate = 74250000}
[ 140.174074] enter imx296_ioc_qcap
[ 140.202126] enter isp_mi_stop
The handler of VIDIOC_QUERYCAP ioctl call is copied for existing examples (ov2775, os08a20) :
int imx296_ioc_qcap(struct imx296 *sensor, void *args)
{
struct v4l2_capability *cap = (struct v4l2_capability *)args;
pr_debug("enter %s\n", __func__);
strcpy((char *)cap->driver, "imx296");
sprintf((char *)cap->bus_info, "csi%d",sensor->csi);
if(sensor->i2c_client->adapter)
{//bus_info[8]-i2c bus dev number
cap->bus_info[VVCAM_CAP_BUS_INFO_I2C_ADAPTER_NR_POS] = (__u8)sensor->i2c_client->adapter->nr;
}
else
{
cap->bus_info[VVCAM_CAP_BUS_INFO_I2C_ADAPTER_NR_POS] = 0xFF;
}
return 0;
}
To update, I add debug message into vvcam/v4l2/video/video.c
static int viv_post_event(struct v4l2_event *event, void *fh, bool sync)
{
struct viv_video_file *handle = priv_to_handle(fh);
struct v4l2_fh *video_fh = (struct v4l2_fh *)fh;
if(!video_fh || !event) {
pr_err("%s: invalid inputs (NULL pointer detected)", __func__);
return -EINVAL;
}
if(!video_event_subscribed(video_fh->vdev, event, RETRY_TIMES_MAX)) {
pr_err("%s: unsubscribed event id =%d type=0x%08x",
__func__, event->id, event->type);
return -EAGAIN;
}
if (sync)
reinit_completion(&handle->wait);
mutex_lock(&handle->event_mutex);
v4l2_event_queue(handle->vdev->video, event);
mutex_unlock(&handle->event_mutex);
if (sync) {
if (wait_for_completion_timeout(&handle->wait, msecs_to_jiffies(
VIV_VIDEO_EVENT_TIMOUT_MS)) == 0) {
pr_err("%s: completion timeout", __func__);
return -ETIMEDOUT;
}
}
return 0;
}
and dmesg gave :
[ 805.538307] enter isp_mi_stop
[ 810.462078] viv_post_event: completion timeout
Could someone tell me what's wrong with the capture capacities or why did the timeout happen, please ?
Thanks in advance and best regards,
Khang