csi camera is too slow

Hi everyone

I’m trying to connect CSI camera (Samsung S5k4h5yc) to Jetson TK1.
I almost reused ‘imx135’ example code according to ‘Tegra Linux Driver Package Document’
Luckly camera image is displayed at screen. I checked it by using ‘cheese’ utility.
But the image display speed (fps) is very slow. Its CSI line speed is almost 40Khz.
I have to wait almost 5-6 seconds for image refresh.
Does anyone can let me know why it is too slow?
Is it sensor issue or tk1 configuration problem?
Please help~
Thanks.

Can you provide the following informations?
sensor output format/resolution/fps/lane number

Ok, It is as in the following.

Sensor output format : RAW8
Resolution : 1920x1080
FPS : 30
Lane number : 2lane, CSI_A

Resolution 640x480 is a little bit faster.
I think there is a bottleneck in kernel.

The csi bandwidth is good enough for your case. There must be some other issue.
Have you tried other ways to test it instead of cheese? such as some ways listed in the following weblink,
https://help.ubuntu.com/community/Webcam

I’v tried to test it with cheese, VLC, Mplayer, etc.
But performance is all the same.
I got some error messages from ‘gst-launch’ program.

dditional debug info:
gstbasesink.c(2791): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2791): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2791): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
There may be a timestamping problem, or this computer is too slow.
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2791): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
There may be a timestamping problem, or this computer is too slow.
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Output window was closed
Additional debug info:
xvimagesink.c(551): gst_xvimagesink_handle_xevents (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2791): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
There may be a timestamping problem, or this computer is too slow.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason error (-5)
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:48.515667950
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

I checked tegra_camera driver and found some strange points.
Following is code of file ‘drivers/media/platform/soc_camera/tegra_camera/common.c’

static void tegra_camera_work(struct work_struct *work)
{
	struct tegra_camera_dev *cam =
		container_of(work, struct tegra_camera_dev, work);
	struct tegra_camera_buffer *buf;

	while (1) {
		mutex_lock(&cam->work_mutex);

		spin_lock_irq(&cam->videobuf_queue_lock);
		if (list_empty(&cam->capture)) {
			cam->active = NULL;
			spin_unlock_irq(&cam->videobuf_queue_lock);
			mutex_unlock(&cam->work_mutex);
			return;
		}

		buf = list_entry(cam->capture.next, struct tegra_camera_buffer,
				queue);

		cam->active = &buf->vb;
		spin_unlock_irq(&cam->videobuf_queue_lock);

		tegra_camera_capture_frame(cam);

		mutex_unlock(&cam->work_mutex);
	}
}

This function returns at every 1 or 2 frame capture is finished.
And the approximated time occupied in calling ‘tegra_camera_work’ again is almost 500-600ms.
There is something wrong.

MasonG,
Seems the kernel source you are using is quite old.
The work queue has been replaced by kthread in the latest release.

I was using kernel source r21.4 version.
The lastest kernel version of jetson TK1 is r21.5.
I’v tested with it, but it has same problem.
So, I have plan to buy e-con systems camera and customize its driver source code.
Anyway, thanks!!