Reg: Multiple Camera Streaming

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reg: Multiple Camera Streaming

1,644 Views
vishvapathi
Contributor V

Hi,

   I am trying to stream 2 UVC cameras. i used the following commands for streaming.

$gst-launch v4l2src device=/dev/video1 ! mfw_isink disp-width=450 disp-height=300  axis-left=50 axis-top=100&

$gst-launch v4l2src device=/dev/video2 ! mfw_isink disp-width=450 disp-height=300 axis-left=550 axis-top=100&

But when i give the following command only one is working....

Response

$gst-launch v4l2src device=/dev/video1 ! mfw_isink disp-width=450 disp-height=300  axis-left=50 axis-top=100&

root@freescale /$ set color key

MFW_GST_ISINK_PLUGIN 3.0.7 build on Oct 15 2013 15:09:49.

Setting pipeline to PAUSED ...

Pipeline is live and does not need PREROLL ...

Setting pipeline to PLAYING ...

New clock: GstSystemClock

can not create threadmfw_gst_isink_setcaps:1489

hwbuf allocator zone(2457600) created

VS0 created. in fmt[YUYV] win(0,0-1280,960:1280x960) out win(50,100-500,400:450x300)

set deinterlace mode 0

hwbuf allocator zone(614400) created

hwbuf allocator zone(614400) destroied.

hwbuf allocator zone(614400) created

hwbuf allocator zone(614400) destroied.

hwbuf allocator zone(614400) created

hwbuf allocator zone(614400) destroied.

root@freescale /$ gst-launch v4l2src device=/dev/video2 ! mfw_isink disp-width=450 disp-height=300 axis-left=550 axis-top=100&

root@freescale /$ set color key

MFW_GST_ISINK_PLUGIN 3.0.7 build on Oct 15 2013 15:09:49.

Setting pipeline to PAUSED ...

uvcvideo: Failed to submit URB 0 (-28).

ERROR: Pipeline doesn't want to pause.

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Error starting streaming on device '/dev/video2'.

Additional debug info:

gstv4l2object.c(2143): gst_v4l2_object_start_streaming (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

system error: No space left on device

Setting pipeline to NULL ...

Freeing pipeline ...

[--->FINALIZE isink

Kindly advice me how can i stream 2 cameras simultaneously!!!

DaianeAngolini

shanmugamsundar

LeonardoSandovalGonzalez

Raybiztech

Labels (2)
0 Kudos
8 Replies

758 Views
Yuri
NXP Employee
NXP Employee

Just to clarify the issue.

Do You mean that separate pipes are working, when running as single entities ?

This command is working in itself :

$gst-launch v4l2src device=/dev/video1 ! mfw_isink

and this is working been run as single command

$gst-launch v4l2src device=/dev/video2 ! mfw_isink

0 Kudos

758 Views
vishvapathi
Contributor V

Hi,

I meant separate pipe lines are not working..

I have 2 UVC cameras connected to my IMX. i.e /dev/video0 and /dev/video1.

How can i display/stream both cameras at the same time..

0 Kudos

758 Views
lily_zhang
NXP Employee
NXP Employee

If you use early BSP version, you can consider to apply for the following changes

diff --git a/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c b/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c

index 704b7d7..c00baaa 100644

--- a/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c

+++ b/drivers/media/video/mxc/capture/ipu_bg_overlay_sdc.c

@@ -117,7 +117,10 @@ static irqreturn_t csi_enc_callback(int irq, void *dev_id)

{

  cam_data *cam = (cam_data *) dev_id;

- ipu_select_buffer(cam->ipu, CSI_MEM, IPU_OUTPUT_BUFFER, csi_buffer_num);

+if(irq == 1)

+ ipu_select_buffer(cam->ipu, CSI_MEM1, IPU_OUTPUT_BUFFER, csi_buffer_num);

+if(irq == 0)

+ ipu_select_buffer(cam->ipu, CSI_MEM0, IPU_OUTPUT_BUFFER, csi_buffer_num);

  schedule_work(&cam->csi_work_struct);

  csi_buffer_num = (csi_buffer_num == 0) ? 1 : 0;

  return IRQ_HANDLED;

@@ -231,14 +234,25 @@ static int csi_enc_setup(cam_data *cam)

  }

  pr_debug("vf_bufs %x %x\n", cam->vf_bufs[0], cam->vf_bufs[1]);

- err = ipu_init_channel(cam->ipu, CSI_MEM, &params);

+if(cam->csi == 1)

+ err = ipu_init_channel(cam->ipu, CSI_MEM1, &params);

+if(cam->csi == 0)

+ err = ipu_init_channel(cam->ipu, CSI_MEM0, &params);

  if (err != 0) {

   printk(KERN_ERR "ipu_init_channel %d\n", err);

   goto out_1;

  }

  pixel_fmt = IPU_PIX_FMT_UYVY;

- err = ipu_init_channel_buffer(cam->ipu, CSI_MEM, IPU_OUTPUT_BUFFER,

+if(cam->csi == 1)

+ err = ipu_init_channel_buffer(cam->ipu, CSI_MEM1, IPU_OUTPUT_BUFFER,

+          pixel_fmt, cam->crop_current.width,

+          cam->crop_current.height,

+          cam->crop_current.width, IPU_ROTATE_NONE,

+          cam->vf_bufs[0], cam->vf_bufs[1], 0,

+          cam->offset.u_offset, cam->offset.u_offset);

+if(cam->csi == 0)

+ err = ipu_init_channel_buffer(cam->ipu, CSI_MEM0, IPU_OUTPUT_BUFFER,

           pixel_fmt, cam->crop_current.width,

           cam->crop_current.height,

           cam->crop_current.width, IPU_ROTATE_NONE,

@@ -248,7 +262,10 @@ static int csi_enc_setup(cam_data *cam)

   printk(KERN_ERR "CSI_MEM output buffer\n");

   goto out_1;

  }

- err = ipu_enable_channel(cam->ipu, CSI_MEM);

+if(cam->csi == 1)

+ err = ipu_enable_channel(cam->ipu, CSI_MEM1);

+if(cam->csi == 0)

+ err = ipu_enable_channel(cam->ipu, CSI_MEM0);

  if (err < 0) {

   printk(KERN_ERR "ipu_enable_channel CSI_MEM\n");

   goto out_1;

@@ -256,8 +273,15 @@ static int csi_enc_setup(cam_data *cam)

  csi_buffer_num = 0;

- ipu_select_buffer(cam->ipu, CSI_MEM, IPU_OUTPUT_BUFFER, 0);

- ipu_select_buffer(cam->ipu, CSI_MEM, IPU_OUTPUT_BUFFER, 1);

+if(cam->csi == 1)

+ ipu_select_buffer(cam->ipu, CSI_MEM1, IPU_OUTPUT_BUFFER, 0);

+if(cam->csi == 1)

+ ipu_select_buffer(cam->ipu, CSI_MEM1, IPU_OUTPUT_BUFFER, 1);

+

+if(cam->csi == 0)

+ ipu_select_buffer(cam->ipu, CSI_MEM0, IPU_OUTPUT_BUFFER, 0);

+if(cam->csi == 0)

+ ipu_select_buffer(cam->ipu, CSI_MEM0, IPU_OUTPUT_BUFFER, 1);

  return err;

out_1:

  if (cam->vf_bufs_vaddr[0]) {

@@ -288,9 +312,9 @@ static int csi_enc_enabling_tasks(void *private)

{

  cam_data *cam = (cam_data *) private;

  int err = 0;

-

- ipu_clear_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF);

- err = ipu_request_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF,

+ ipu_clear_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF + cam->csi);

+ err = ipu_request_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF + cam->csi,

          csi_enc_callback, 0, "Mxc Camera", cam);

  if (err != 0) {

   printk(KERN_ERR "Error registering CSI0_OUT_EOF irq\n");

@@ -307,7 +331,7 @@ static int csi_enc_enabling_tasks(void *private)

  return err;

out1:

- ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam);

+ ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF + cam->csi, cam);

  return err;

}

@@ -390,9 +414,9 @@ static int bg_overlay_stop(void *private)

  if (cam->overlay_active == false)

   return 0;

- err = ipu_disable_channel(cam->ipu, CSI_MEM, true);

+ err = ipu_disable_channel(cam->ipu, CSI_MEM1, true);

- ipu_uninit_channel(cam->ipu, CSI_MEM);

+ ipu_uninit_channel(cam->ipu, CSI_MEM1);

  csi_buffer_num = 0;

@@ -474,7 +498,7 @@ static int bg_overlay_disable_csi(void *private)

  /* free csi eof irq firstly.

   * when disable csi, wait for idmac eof.

   * it requests eof irq again */

- ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF, cam);

+ ipu_free_irq(cam->ipu, IPU_IRQ_CSI0_OUT_EOF + cam->csi, cam);

  return ipu_disable_csi(cam->ipu, cam->csi);

}

0 Kudos

758 Views
vishvapathi
Contributor V

Hi,

Sorry for Delayed response.

But i am using USB Camera's.

0 Kudos

758 Views
LeonardoSandova
Specialist I

Your device (SD) is full..

Even if you are not storing anything on the pipeline, the OS needs some space for pagination/swaping, so you need to delete some files.

0 Kudos

758 Views
vishvapathi
Contributor V

Hi,

I have 4GB SD card. And it has 1.36GB free space.

$df -H

Filesystem             Size   Used  Avail Use% Mounted on

rootfs                 4.0G   2.5G   1.3G  66% /

/dev/root              4.0G   2.5G   1.3G  66% /

tmpfs                  460M    58k   460M   1% /dev

shm                    460M      0   460M   0% /dev/shm

rwfs                   525k   525k      0 100% /mnt/rwfs

rwfs                   525k   525k      0 100% /tmp

rwfs                   525k   525k      0 100% /var

Does it mean 1.36GB is not enough?? should i go for 8GB SD??

0 Kudos

758 Views
LeonardoSandova
Specialist I

How did you build the image? Using Yocto? There are some system partitions which looks pretty small to me (1/2 Mega). Have you done any change somewhere on /etc?

Leo

0 Kudos

758 Views
vishvapathi
Contributor V

i built the image using LTIB. I havent done any changes on /etc

0 Kudos