voc / voctomix

Full-HD Software Live-Video-Mixer in python
https://c3voc.de/
MIT License
573 stars 104 forks source link

Running with max gstreamer debug `-ggg` causes a crash #302

Open wlcx opened 9 months ago

wlcx commented 9 months ago

While trying to debug another issue, I ran voctocore with -ggg:

❯ python voctocore/voctocore.py -ggg
Traceback (most recent call last):
  File "/home/samw/prog/voctomix/voctocore/voctocore.py", line 111, in <module>
    main()
  File "/home/samw/prog/voctomix/voctocore/voctocore.py", line 98, in main
    voctocore = Voctocore()
  File "/home/samw/prog/voctomix/voctocore/voctocore.py", line 49, in __init__
    self.pipeline = Pipeline()
  File "/home/samw/prog/voctomix/voctocore/lib/pipeline.py", line 169, in __init__
    self.pipeline.use_clock(Clock)
AttributeError: 'Bin' object has no attribute 'use_clock'. Did you mean: 'set_clock'?

The really weird thing is that something is causing Gst.parse_launch to return a different type of object. If we add:

--- a/voctocore/lib/pipeline.py
+++ b/voctocore/lib/pipeline.py
@@ -166,6 +166,7 @@ class Pipeline(object):
         for bin in self.bins:
             bin.attach(self.pipeline)

+        print(type(self.pipeline))
         self.pipeline.use_clock(Clock)

         # fetch all queues

and run with -gg, we see (as expected):

❯ python voctocore/voctocore.py -gg                                     
<class 'gi.overrides.Gst.Pipeline'>
^C

but if we run with -ggg, the type has changed!:

❯ python voctocore/voctocore.py -ggg
<class 'gi.overrides.Gst.Bin'>
.... traceback omitted ....

I've narrowed it down to Gst.debug_add_log_function in debug.py. If you comment that out, it works. So it seems to be a combination of setting the default threshold to DEBUG and adding a log function.

To be honest this caused me psychic damage but I thought I'd better write it down somewhere...

This is on voctomix 27e2c58eaeda59cc021a6596d36fdb1ed28a4ace.

    INFO root: Python Version: sys.version_info(major=3, minor=10, micro=12, releaselevel='final', serial=0)
    INFO root: GStreamer Version: (major=1, minor=22, micro=5, nano=0)