09-19-2020 07:22 AM
I'm using VCU TRD 2018.3 on ZCU106. I have an application that (among other things) detects hot plugs of the display. If the display is plugged out, it stops any gstreamer pipelines that are displaying and also tears down the DRM CRTC. The code works on x86 but hangs on the FPGA and it took me a long time to figure out why.
There is an issue with the KMS device, I'm not yet sure whether the issue is in the gstreamer kmssink element or Xilinx DRM KMS driver. When the HDMI display is unplugged, the pipeline cannot be made to change states. It's very easy way to reproduce the issue -
root@zcu106_vcu_trd:/opt/FA# gst-launch-1.0 videotestsrc ! kmssink bus-id="a0050000.v_mix" Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock ^Chandling interrupt. Interrupt: Stopping pipeline ... Execution ended after 0:00:10.390476637 Setting pipeline to PAUSED ...
Here, I have a simple test pattern on the display which works fine. Then, I press Ctrl+C to quit it and the pipeline hangs at PAUSED. Some investigation showed that the kmssink hangs and cannot change state further. If I plug the display back in at this point, the state change continues to NULL and the pipeline quits.
Any gstreamer experts around who can help isolate what part of the libraries/drivers has this bug? My project is pretty badly stuck because of this issue right now.
09-21-2020 11:31 AM
I am trying to reproduce this issue on my side with latest version of tool chain.
can you confirm if this are the steps you are running to create hang situation?
1. run videotestsrc pipeline on HDMI
2. Unplug the cable. this should switch the display back to black screen since no input source now.
3. you press ctrl+C to halt the pipeline.
4. now you plug the cable back and try to run the GST pipeline again but it fails.
09-21-2020 07:13 PM
Step 4 is not needed. If the same issue exists in the latest version, you should see it after step 3. The expected result is that the pipeline changes to NULL state and quits. But what actually happens is that it changes to PAUSED and hangs.
10-12-2020 10:13 AM
I ran steps as mentioned earlier with VCU TRD XV20 design for HDMI
gst-launch-1.0 -v videotestsrc pattern=snow ! video/x-raw,width=1920,height=1080,format=NV16_10LE32,stride=8192 ! kmssink bus-id="a00c0000.v_mix"
The display goes black and console becomes unresponsive If I unplug HDMI cable during live gst pipeline. I hope you are seeing the same. The moment I connect the HDMI cable back again, I see console becomes responsive and pipeline has been closed automatically and now If I run pipeline again you see the Display showing again the test pattern.
Now may I know what are your exact expectation? I will try to understand that and forward the request to concerned team.
Until then I will also request you to reach out to your FAE to get additional help from Xilinx.
10-12-2020 10:57 PM
Hi @kvasantr ,
Thanks for testing. What you report is exactly the problem I'm facing. In my application, the kmssink element is specifically the one that hangs. My expectation is that I should be able to safely remove the kmssink element from the pipeline and quit it if the display is unconnected. Whether the sink actually reports this through a gstreamer error or not is up to the element designers.
I can contact the local FAE, but I'm not sure what they could really do in this case other than forward it to the Xilinx engineers responsible for the DRM driver/kmssink element (which you're doing anyway).
10-14-2020 10:22 PM
I have done few more testing on this issue. So the understanding is as follows:
5. Another workaround (without my hack patch) is to press ctrl+c twice. ex. ctrl+c -> PAUSED state -> ctrl+c -> gstreamer pipeline will end
Let me know if you need any further help.
PS- I have changed the file extension to .txt. Please resave it as .patch before applying it into petalinux project.