cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wzab
Mentor
Mentor
2,533 Views
Registered: ‎08-24-2011

How to create video pipeline with my own video source?

For test purposes I wanted to create a design, where my own IP core generates the test video signal, routed finally to framebuffer write IP core.

However I need to define the video pipeline in the DT:

&amba_pl {
  video_cap_tpg {
   compatible = "xlnx,video";
   dmas = <&v_frmbuf_wr_0 1>;
   dma-names = "port0";

   ports {
     #address-cells = <1>;
     #size-cells = <0>;

     port@0 {
     reg = <0>;
     direction = "input";
     vcap_in: endpoint {
	remote-endpoint = <????>;
	};
     };
   };
  };
};

The problem is, that in case of my own source I do not have a phandle to put in the "remote-endpoint".

What can I use as the input endpoint in such case?

I tried to use the video generator producing directly the AXI4-Stream video data and another one emulating the video stream compatible with "Video In to AXI4 Stream" and "Video Timing Controller", but I can't find the right solution.

What have I missed?

 

TIA & Regards,

Wojtek

 

0 Kudos
Reply
4 Replies
florentw
Moderator
Moderator
2,464 Views
Registered: ‎11-09-2015

Hi @wzab,

 

If this is a TPG, then the endpoint should be an output no? And you should have no input enpoint.

 

The enpoint should be to connect the TPG to the frame buffer


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Reply
wzab
Mentor
Mentor
2,443 Views
Registered: ‎08-24-2011

Thanks, I'll check that fix as soon as I have access to the system for which I have generated the TPG license.

Maybe I have misunderstood the meaning of the "direction".

However what in case if I want to use my own IP core to generate the video signal (or to use my own Video input interface). How can I enable it to be used as a valid endpoint for pipeline definition in DT?

 

Maybe it is enough to create a dummy node in the DT with just the video output?

&amba_pl {
   my_video_src{
     ports {
        #address-cells = <1>;
        #size-cells = <0>;

        port@0 {
          reg = <0>;
          direction = "output";
          mysrc_out: endpoint {
	     remote-endpoint = <vcap_out>;
	  };
        };
     };
   };

  video_cap_my {
   compatible = "xlnx,video";
   dmas = <&v_frmbuf_wr_0 1>;
   dma-names = "port0";

   ports {
     #address-cells = <1>;
     #size-cells = <0>;

     port@0 {
     reg = <0>;
     direction = "output";
     vcap_out: endpoint {
	remote-endpoint = <&mysrc_out>;
	};
     };
   };
  };
};

Is it enough, or should I somehow specify  in the DT the video format produced by my source?

 

 

TIA & Regards,

Wojtek

0 Kudos
Reply
wzab
Mentor
Mentor
2,414 Views
Registered: ‎08-24-2011

| If this is a TPG, then the endpoint should be an output no? And you should have no input enpoint.

When I have changed endpoint to be an output:

 

&v_tpg_0 {
   clock-names = "fclk0";
   clocks = <&clkc 15>;
   reset-gpios = <&gpio0 55 1>;
   xlnx,vtc = <&v_tc_0>;
   ports {
      #address-cells = <1>;
      #size-cells = <0>;
      port@0 {
	reg = <0>;
	xlnx,video-format = <0>;
	xlnx,video-width = <8>;
	tpg_out: endpoint {
	remote-endpoint = <&vcap_out>;
	};
      };
   };
};


&amba_pl {
  video_cap_tpg {
   compatible = "xlnx,video";
   dmas = <&v_frmbuf_wr_0 1>;
   dma-names = "port0";

   ports {
     #address-cells = <1>;
     #size-cells = <0>;

     port@0 {
     reg = <0>;
     direction = "output";
     vcap_out: endpoint {
	remote-endpoint = <&tpg_out>;
	};
     };
   };
  };
};

I get the following results:

v4l2-compliance  v4l2-ctl         v4l2-dbg         v4l2-sysfs-path              
root@os_prj1:~# v4l2-compliance                                                 
Driver Info:                                                                    
        Driver name   : xilinx-vipp                                             
        Card type     : video_cap_tpg input 0                                   
        Bus info      : platform:video_cap_tpg:0                                
        Driver version: 4.9.0                                                   
        Capabilities  : 0x84200002                                              
                Video Output                                                    
                Streaming                                                       
                Extended Pix Format                                             
                Device Capabilities                                             
        Device Caps   : 0x04200002                                              
                Video Output                                                    
                Streaming                                                       
                Extended Pix Format                                             
[...]
root@os_prj1:~# ffprobe /dev/video0                                             
ffprobe version 3.1.3 Copyright (c) 2007-2016 the FFmpeg developers             
  built with gcc 6.2.1 (Linaro GCC 6.2-2016.11) 20161016                        
  configuration: --disable-stripping --enable-pic --enable-shared --enable-pthrv
  libavutil      55. 28.100 / 55. 28.100                                        
  libavcodec     57. 48.101 / 57. 48.101                                        
  libavformat    57. 41.100 / 57. 41.100                                        
  libavdevice    57.  0.101 / 57.  0.101                                        
  libavfilter     6. 47.100 /  6. 47.100                                        
  libswscale      4.  1.100 /  4.  1.100                                        
  libswresample   2.  1.100 /  2.  1.100                                        
  libpostproc    54.  0.100 / 54.  0.100                                        
[video4linux2,v4l2 @ 0x41a00] Not a video capture device.    

So dev video0 is recognized as an output device.

Please note, that I need to use TPG (or my own source) as an emulated video source.

 

 Regards,

Wojtek

0 Kudos
Reply
igorg
Contributor
Contributor
2,291 Views
Registered: ‎10-05-2017

Hello Wojtek,

 

the endpoint of video_cap_tpg node (port@0) should have an input direction, not output. So your custom IP's (or TPG) endpoint will be an output in this case (and there is a link between them). Note, that dummy node in DT is not enough to get it to work, you will have to write some kind of dummy Linux driver which implements v4l2-subdev and media functionality for your own IP. Take a look at the TPG driver (drivers/media/platform/xilinx/xilinx-tpg.c) - it's a good example of such a driver.

 

Kind regards,

Igor

0 Kudos
Reply