Occasional Rolling Video mx6 & adv7282-m

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

Occasional Rolling Video mx6 & adv7282-m

Jump to solution
1,744 Views
jcc273
Contributor III

Hello,

There is some relation to this questions and other posts on this forum, i figured it would be best to start a new thread though?  So i have followed advice on posts like this one:  iMX6, display problem with mipi adv7282-m device source 

In doing so i was able to get the i.MX 6 working with the ADV7282-m.  Things were working great with my NTSC camera, that is until i tried a different NTSC camera : /.  So my original camera works great with no issues.  This new brand of camera though it works i'd say about 50% of the time.  Half the time i start streaming the video from the camera and it looks perfect!  The other 50% of the time the video just scrolls vertically forever like it can't seem to figure out where the vertical sync is or something?  I don't know what would be different between the 2 cameras that would cause this and why it would work half the time?  The ADV7282-m is acheiving lock and finding NTSC format, and i have compared the status register values between the 2 cameras and they all match.  I am assuming it's something in i.MX Kernel driver land because it works if i simply restart the video pipeline a time or two without changing anything to do with the ADV7282-m.

My testing pipeline is something this (board has no display, video is streaming over WebRTC via Janus Gateway):

gst-launch-1.0 imxv4l2videosrc device=/dev/video0 ! deinterlace fields=1 ! openh264enc ! rtph264pay ! capssetter caps="application/x-rtp,profile-level-id=(string)42e01f" ! udpsink host=127.0.0.1 port=8080

There are no errors printing out and the video looks pretty good still besides the vertical scrolling, maybe a little shaky but pretty good.  Free-run mode works good every-time as well, the problem only happens when i am using certain cameras (i have several different ones that have been found to do a similar thing).

I am hoping someone has some advice as to at least where i should start looking because I am not sure where to focus to try and find any clues about what is going on : /.

Thanks,

Jarrod

Labels (4)
0 Kudos
1 Solution
1,596 Views
jcc273
Contributor III

Alright i was able to solve this.  Answers here:  ADV7282-M NTSC Video Vertical Rolling with i.mx 6 - Q&A - Video - EngineerZone 

Basically i had to enable I2P mode, then remove one of the patches i had applied according to this post:  iMX6, display problem with mipi adv7282-m device source that forces interlaced mode to true for GATED clock mode:

in drivers/media/platform/mxc/capture/ipu_csi_enc.c in the function int_csi_enc_setup:

case IPU_CSI_CLK_MODE_GATED_CLK:
case IPU_CSI_CLK_MODE_NONGATED_CLK:
case IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE:
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_DDR:
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR:
- params.csi_mem.interlaced = true;
+ params.csi_mem.interlaced = false

Then i still had to do deinterlace field=1 in my gstreamer pipeline.

The changes to I2P and the patch were ones i made to make my original PAL camera work so i will have to modify the drivers to conditionally choose the correct options based on a module parameter rather than auto-detect.

Thanks,

Jarrod

View solution in original post

0 Kudos
7 Replies
1,596 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jarrod

seems gstreamer-imx (imxv4l2videosrc) plugins used in the case,

one can post issue on Issues · Freescale/gstreamer-imx · GitHub 

Alternatively one can try with nxp gst1.0-plugins-fsl plugins, usage

can be found in Linux Guide included in Documentation

All linux documentation:

Embedded Linux for i.MX Applications Processors | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,596 Views
jcc273
Contributor III

Hello Igor,

Sorry for the delay, had to take care of some other things.  So i got the gst1.0-plugins all setup and same issue.  Here is my pipeline now:

gst-launch-1.0 imxv4l2src device=/dev/video0 ! deinterlace fields=1 ! openh264enc ! rtph264pay ! capssetter caps="application/x-rtp,profile-level-id=(string)42e01f" ! udpsink host=127.0.0.1 port=8080 &

Anything i have wrong in this pipeline?  Again the problem is that half the time the video work and displays perfectly, but the other half of the time the video scrolls slowly downwards vertically continuously.  I am not sure where to look to figure out why this is happening.  If i could either figure out where and why it happens or at least how to detect that it is happening so i can restart i could address it but i don't know where to look : /

Thanks,

Jarrod

0 Kudos
1,596 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jarrod

what bsp used in the case, one can try ones from nxp

source.codeaurora.org/external/imx/linux-imx repository
https://source.codeaurora.org/external/imx/linux-imx/tree/?h=imx_5.4.24_2.1.0

NXP linux documentation:

Embedded Linux for i.MX Applications Processors | NXP 

Best regards
igor

0 Kudos
1,596 Views
jcc273
Contributor III

Update:  Alright i did all the work of upgrading to the latest (rel_imx_5.4.24_2.1.0) and still acts exactly the same way, some cameras the video rolls vertically slow forever about half the time.  I can simply restart the gstreamer pipeline with no interaction occuring with the ADV7282-m and sometimes good sometimes bad.

So i guess i'll just start digging through the drivers a piece at a time and hopefully i'll be able to narrow down the offending code, i was just hoping someone would have an idea of where i should start my search : /.  Oh well, i'll post back when (if) i find the problem.

Thanks,

Jarrod

0 Kudos
1,597 Views
jcc273
Contributor III

Alright i was able to solve this.  Answers here:  ADV7282-M NTSC Video Vertical Rolling with i.mx 6 - Q&A - Video - EngineerZone 

Basically i had to enable I2P mode, then remove one of the patches i had applied according to this post:  iMX6, display problem with mipi adv7282-m device source that forces interlaced mode to true for GATED clock mode:

in drivers/media/platform/mxc/capture/ipu_csi_enc.c in the function int_csi_enc_setup:

case IPU_CSI_CLK_MODE_GATED_CLK:
case IPU_CSI_CLK_MODE_NONGATED_CLK:
case IPU_CSI_CLK_MODE_CCIR656_PROGRESSIVE:
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_DDR:
case IPU_CSI_CLK_MODE_CCIR1120_PROGRESSIVE_SDR:
- params.csi_mem.interlaced = true;
+ params.csi_mem.interlaced = false

Then i still had to do deinterlace field=1 in my gstreamer pipeline.

The changes to I2P and the patch were ones i made to make my original PAL camera work so i will have to modify the drivers to conditionally choose the correct options based on a module parameter rather than auto-detect.

Thanks,

Jarrod

0 Kudos
1,596 Views
jcc273
Contributor III

Hello Igor,

That is the one i am using; HOWEVER, i am using version:  rel_imx_4.1.15_2.1.0_ga

Do you think moving to the more recent tag will solve the problem?  I worry because i had to do lots of patching to even get the video working to begin with based on this thread:  iMX6, display problem with mipi adv7282-m device source 

As well as patches for other unrelated hardware on my custom board.

So i will need to go through and reconfigure all the patches to work on this new version and determine if they are even necessary.  If you think this will likely address the problem then i can go ahead and do that, but really i am just looking for some information as to what driver or section of code to look at to help me:

1. Determine how to detect when the rolling is occurring OR

2. Find the reason the rolling occurs

If i could figure out where to look to discover WHY this is happening i could probably come up with a way to fix it.

Thanks,

Jarrod

0 Kudos
1,596 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jarrod

for such kind of issues like old kernel (which is not more supported by nxp) and

reproducable only with some types of cameras may be recommended

to proceed with help of  Professional Engineering Services | NXP 

Best regards
igor

0 Kudos