cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
803 Views
Registered: ‎10-03-2018

Invocation of modetest In /media/card/autostart.sh Fail on ZCU-106, 2018.2 and 2018.3

Jump to solution

Good Morning Folks,

I have a standing problem with the ZCU-106 running under 2018.2 and 2018.3 - namely that the invocation of autostart.sh fails to keep modetest alive.  The reason is process dies, so all outstanding sub-processes are immediately slain. 

Unfortunately the modetest seems to be critical to healthy functioning of the DRM [Direct Rendering Manager] sub-system for use of SDI video output when I am using xmedia-ctl and GStreamer to qualify functionality of the video elements. 

I modified /media/card/autostart.sh as follows to try and force modetest to stick around...

function foo() { while true; do sleep 32767 ; done }
foo |  \
/usr/bin/modetest -M xlnx -s 36:3840x2160-60@YUYV \
-w 36:sdi_mode:5 -w 36:sdi_data_stream:8 -w 36:is_frac:0 &

This works, but feels very inelegant.  Which is to say wrong.  It certainly "fixes" a problem identified in the notes where manual invocation of "source /media/card/autostart.sh" may be necessary. 

 

What I've observed is that GStreamer does not emit SDI, unless I have modetest running.  For example:

xmedia-ctl --verbose --set-v4l '5:0 [fmt:UYVY8_1X16/3840x2160 field:none], 7:0 [fmt:UYVY8_1X16/3840x2160 field:none], 7:1 [fmt:VYYUYY8_1X24/3840x2160 field:none]' 

gst-launch-1.0 --eos-on-shutdown \
   v4l2src device=/dev/video0 io-mode=dmabuf  \
   ! queue max-size-bytes=0  \
   ! capsfilter caps=video/x-raw,format=NV12,framerate=60/1,height=2160,width=3840  \
   ! kmssink driver-name=xlnx

 

Obviously I am a video Noob, so all pointers that you give me are deeply appreciated. 

Many Thanks,
Peimann, Scott M.

Kind Regards,
Peimann, S. M.
----
Toddlers are the Storm-Troopers of the Great God Entropy.
Physics: Not Just a Good Idea, It's THE LAW.
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
497 Views
Registered: ‎10-03-2018

Re: Invocation of modetest In /media/card/autostart.sh Fail on ZCU-106, 2018.2 and 2018.3

Jump to solution

Hello folks,

I am going to close out this issue, as we know several things:

  1. The modetest tool is being used for devleopment purposes only - NO PRODUCTION APPLICATION SHOULD DEPEND ON modetest.
  2. The 2019.1 and earlier DRM/KMS drivers seem to support only the 8-bit 4:2:0 YUV format [a.k.a. NV12]; there are YUYV and RGB type planes available that we have not made good use of, likely due to my ignorance. 
  3. The relationship between the GStreamer kmssink element and DRM/KMS is very complex - likely this can be used to good affect. 

The bottom line is that modetest is a tool intended for inspecting DRM/KMS, limited test capability, and prototyping

Good Luck Everyone!

 

Kind Regards,
Peimann, S. M.
----
Toddlers are the Storm-Troopers of the Great God Entropy.
Physics: Not Just a Good Idea, It's THE LAW.

View solution in original post

4 Replies
Highlighted
Contributor
Contributor
555 Views
Registered: ‎10-27-2008

Re: Invocation of modetest In /media/card/autostart.sh Fail on ZCU-106, 2018.2 and 2018.3

Jump to solution

I do not have a "clean" answer to your question.

However, I want to thank you very much for sharing your hack for making modetest work in autostart.sh.

Best Regards,

Mario.

0 Kudos
Highlighted
Explorer
Explorer
548 Views
Registered: ‎10-03-2018

Re: Invocation of modetest In /media/card/autostart.sh Fail on ZCU-106, 2018.2 and 2018.3

Jump to solution

Hello @marron 

Thanks for the feedback. 

You can just use a longer sleep, if you don't care about it stopping, encapsulating in a function is just overkill. 

That was a relatively poor example of thought on my part, although use of "sleep $((365 * 24 * 60 * 60)) | modetest ... &" just seems cheesy. 

Or, perhaps "sleep 999999999 | modetest ... &". 

When you finally open and control the DRM/KMS device directly, you'll probably want to remove the "modetest" invocation, so that you don't have unexplainable or bizarre errors. 

Good luck with your project. 

--Scott

Kind Regards,
Peimann, S. M.
----
Toddlers are the Storm-Troopers of the Great God Entropy.
Physics: Not Just a Good Idea, It's THE LAW.
0 Kudos
Highlighted
Explorer
Explorer
498 Views
Registered: ‎10-03-2018

Re: Invocation of modetest In /media/card/autostart.sh Fail on ZCU-106, 2018.2 and 2018.3

Jump to solution

Hello folks,

I am going to close out this issue, as we know several things:

  1. The modetest tool is being used for devleopment purposes only - NO PRODUCTION APPLICATION SHOULD DEPEND ON modetest.
  2. The 2019.1 and earlier DRM/KMS drivers seem to support only the 8-bit 4:2:0 YUV format [a.k.a. NV12]; there are YUYV and RGB type planes available that we have not made good use of, likely due to my ignorance. 
  3. The relationship between the GStreamer kmssink element and DRM/KMS is very complex - likely this can be used to good affect. 

The bottom line is that modetest is a tool intended for inspecting DRM/KMS, limited test capability, and prototyping

Good Luck Everyone!

 

Kind Regards,
Peimann, S. M.
----
Toddlers are the Storm-Troopers of the Great God Entropy.
Physics: Not Just a Good Idea, It's THE LAW.

View solution in original post

Highlighted
Explorer
Explorer
82 Views
Registered: ‎08-04-2016

Re: Invocation of modetest In /media/card/autostart.sh Fail on ZCU-106, 2018.2 and 2018.3

Jump to solution

Hi @peimann ,

 

I have been struggling for half a day trying to get modetest to execute using start-stop-daemon when I came across your post. If modetest is not intended to be used in a production environment, is it expected that the user writes a program to take control of the DRM? Is this what you're doing? Can you point me to a simple program that does that?

I notice that VCU TRD comes with a drm_helper.c. This could be used but I'd really like to hear from you rather than experiment blindly.

0 Kudos