GNOME Bugzilla – Bug 685888
Add a debug option to show the GStreamer pipeline
Last modified: 2012-10-12 13:52:35 UTC
Dumping the GStreamer pipeline to a DOT file can be useful while debugging VOIP issues.
Created attachment 226180 [details] [review] empathy-call: Add a debug option to dump the GStreamer pipeline This is what I have been using recently. With this you have: Help -> Debug -> Gstreamer Telepathy Not sure what is the cleanest way to present this option. Maybe I should set the GST_DEBUG_DUMP_DOT_DIR in the code itself? If yes, what would the default location be? pwd?
Created attachment 226187 [details] [review] empathy-call: Add a debug option to dump the GStreamer pipeline - Set GST_DEBUG_DUMP_DOT_DIR to g_get_tmp_dir (), if not already set. - Run dot on the generated file and gtk_show_uri the png. If dot is not installed, this step will silently fail.
Review of attachment 226187 [details] [review]: That doesn't seem to work here, I get "Error: dot: can't open lt-empathy-call-1349963767.dot" and I don't have any .dot file in /tmp. ::: src/empathy-call-window.c @@ +1400,3 @@ + dot_cmd = g_strdup_printf ("dot -Tpng -o %s.png %s.dot", + filename, + gchar *filename; shouldn't you append dot_dir here to have the full path of the dot file?
(In reply to comment #3) > Review of attachment 226187 [details] [review]: > > That doesn't seem to work here, I get "Error: dot: can't open > lt-empathy-call-1349963767.dot" and I don't have any .dot file in /tmp. What does g_get_tmp_dir return on your setup? > ::: src/empathy-call-window.c > @@ +1400,3 @@ > + dot_cmd = g_strdup_printf ("dot -Tpng -o %s.png %s.dot", > + filename, > + gchar *filename; > > shouldn't you append dot_dir here to have the full path of the dot file? Earlier, that is what I was doing. Then I thought that I will "clean it up" and switched to passing dot_dir as the working directory to g_spawn_async. It works for me. I am not running empathy from the source tree. I make install it to /opt and then run /opt/libexec/empathy-call manually.
(In reply to comment #4) > (In reply to comment #3) > > Review of attachment 226187 [details] [review] [details]: > > > > That doesn't seem to work here, I get "Error: dot: can't open > > lt-empathy-call-1349963767.dot" and I don't have any .dot file in /tmp. > > What does g_get_tmp_dir return on your setup? /tmp > > ::: src/empathy-call-window.c > > @@ +1400,3 @@ > > + dot_cmd = g_strdup_printf ("dot -Tpng -o %s.png %s.dot", > > + filename, > > + gchar *filename; > > > > shouldn't you append dot_dir here to have the full path of the dot file? > > Earlier, that is what I was doing. Then I thought that I will "clean it up" and > switched to passing dot_dir as the working directory to g_spawn_async. It works > for me. I am not running empathy from the source tree. I make install it to > /opt and then run /opt/libexec/empathy-call manually. Oh I see.
gst_debug_bin_to_dot_file() is a no-op because priv_gst_dump_dot_dir is NULL. It looks like gst.c:init_pre() (setting priv_gst_dump_dot_dir) is called before we set the env variable in Empathy. If I manually set GST_DEBUG_DUMP_DOT_DIR it works fine.
Couldn't we just call g_setenv() before calling gst_debug_bin_to_dot_file() ?
Created attachment 226320 [details] [review] empathy-call: Add a debug option to dump the GStreamer pipeline Sorry about that. I had the environment variable set in my .bash_profile too, which is why it was working for me. I have moved the g_setenv call to be done earlier in main.
(In reply to comment #7) > Couldn't we just call g_setenv() before calling gst_debug_bin_to_dot_file() ? Yes, we could too. But then I thought that calling it every time someone clicks the menuitem is not needed, right. We can just do it once per process. I don't really care. :-)
Thanks it works now. I'd find it cleaner to set the env variable before calling gst_debug_bin_to_dot_file() and only if the variable is not set yet (so user can still override it if he wants to). That's an extra call each time we select the menu but I doubt people will spend their life generating this graph over and over again. :)
(In reply to comment #10) > Thanks it works now. I'd find it cleaner to set the env variable before calling > gst_debug_bin_to_dot_file() and only if the variable is not set yet (so user > can still override it if he wants to). The "only if the variable is not set" should work now because we call g_setenv with the 3rd parameter (gboolean overwrite) set to FALSE. So, if it is already set, it should be a no-op. That said, I can move the call away from main just before gst_debug_bin_to_dot_file as you are saying.
(In reply to comment #11) > (In reply to comment #10) > > Thanks it works now. I'd find it cleaner to set the env variable before calling > > gst_debug_bin_to_dot_file() and only if the variable is not set yet (so user > > can still override it if he wants to). > > The "only if the variable is not set" should work now because we call g_setenv > with the 3rd parameter (gboolean overwrite) set to FALSE. So, if it is already > set, it should be a no-op. Oh right. > That said, I can move the call away from main just before > gst_debug_bin_to_dot_file as you are saying. Please do and then I think this patch is good to go.
(In reply to comment #12) >> That said, I can move the call away from main just before >> gst_debug_bin_to_dot_file as you are saying. > > Please do and then I think this patch is good to go. I just tried that and it is not working, and looking at your comment 6, it seems that the environment variable has to be set before GStreamer is initialized. I just checked Transmageddon and it also sets the environment variable before everything thing else.
Oh yeah of course. I'll merge thanks for your patch!
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.