Ok, so here's an appropriate topic for this issue. I noticed the wish process was using too much cpu from some revisions on and reverted to 10950. From rev. 10950 to 10967, 10952 had the lower cpu usage; after that I found the faulty revision:
svn up -r 10952
U protocol.tcl
[OK]
svn up -r 10953
U lang/langel
[OK]
svn up -r 10954
U guicontactlist.tcl
U skins/default/settings.xml
[OK]
svn up -r 10955
U protocol.tcl
U gui.tcl
[OK]
svn up -r 10956
U sip.tcl
[OK]
svn up -r 10957
U protocol.tcl
U sip.tcl
U utils/farsight/src/tcl_farsight.c [GOOD]
[OK]
svn up -r 10958
U utils/farsight/src/tcl_farsight.c [FAULTY]
[BAD]
It looks odd, but I think it's a tcl_farsight issue. Everytime I start aMSN, it starts using a very high amount of cpu (54% in general) and *slowly* decrease until it reaches 5.6% or something (rev 10952 started from 33% and reached 4% very soon), from 10958 to 10967 it bounces to 98% and stucks to ~60%.
I'll give you the output of `diff tcl_farsight.c_10957 tcl_farsight.c_10958` (I'm sorry, but I can't
code it), but remember that this file was updated twice after that (in rev. 10966 and 10967).
19a20
> #include <gst/interfaces/xoverlay.h>
47c48
< static GList * get_plugins_filtered (gboolean source);
---
> static GList * get_plugins_filtered (gboolean source, gboolean audio);
54,59c55,67
< char *source = NULL;
< char *source_device = NULL;
< char *source_pipeline = NULL;
< char *sink = NULL;
< char *sink_device = NULL;
< char *sink_pipeline = NULL;
---
> char *audio_source = NULL;
> char *audio_source_device = NULL;
> char *audio_source_pipeline = NULL;
> char *audio_sink = NULL;
> char *audio_sink_device = NULL;
> char *audio_sink_pipeline = NULL;
> char *video_source = NULL;
> char *video_source_device = NULL;
> gulong video_preview_xid = NULL;
> char *video_source_pipeline = NULL;
> char *video_sink = NULL;
> gulong video_sink_xid = NULL;
> char *video_sink_pipeline = NULL;
67d74
< FsSession *session = NULL;
69,72c76,85
< FsStream *stream = NULL;
< gboolean candidates_prepared = FALSE;
< gboolean codecs_ready = FALSE;
< Tcl_Obj *local_candidates = NULL;
---
> FsSession *audio_session = NULL;
> FsStream *audio_stream = NULL;
> FsSession *video_session = NULL;
> FsStream *video_stream = NULL;
> gboolean audio_candidates_prepared = FALSE;
> gboolean audio_codecs_ready = FALSE;
> Tcl_Obj *audio_local_candidates = NULL;
> gboolean video_candidates_prepared = FALSE;
> gboolean video_codecs_ready = FALSE;
> Tcl_Obj *video_local_candidates = NULL;
123,127d135
< if (stream) {
< g_object_unref (stream);
< stream = NULL;
< }
<
133,135c141,158
< if (session) {
< g_object_unref (session);
< session = NULL;
---
> if (audio_stream) {
> g_object_unref (audio_stream);
> audio_stream = NULL;
> }
>
> if (audio_session) {
> g_object_unref (audio_session);
> audio_session = NULL;
> }
>
> if (video_stream) {
> g_object_unref (video_stream);
> video_stream = NULL;
> }
>
> if (video_session) {
> g_object_unref (video_session);
> video_session = NULL;
156a180,187
> if (levelIn) {
> gst_object_unref (levelIn);
> levelIn = NULL;
> }
> if (levelOut) {
> gst_object_unref (levelOut);
> levelOut = NULL;
> }
158,159c189,192
< candidates_prepared = FALSE;
< codecs_ready = FALSE;
---
> audio_candidates_prepared = FALSE;
> audio_codecs_ready = FALSE;
> video_candidates_prepared = FALSE;
> video_codecs_ready = FALSE;
162,164c195,202
< if (local_candidates) {
< Tcl_DecrRefCount(local_candidates);
< local_candidates = NULL;
---
> if (audio_local_candidates) {
> Tcl_DecrRefCount(audio_local_candidates);
> audio_local_candidates = NULL;
> }
>
> if (video_local_candidates) {
> Tcl_DecrRefCount(video_local_candidates);
> video_local_candidates = NULL;
329a368
> /* TODO */
339,340c378,379
< static void
< _notify_prepared ()
---
> static void _notify_prepared (gchar *msg, FsSession *session,
> Tcl_Obj *local_candidates)
341a381,383
> Tcl_Obj *local_codecs = Tcl_NewListObj (0, NULL);
> GList *codecs = NULL;
> GList *item = NULL;
343,344c385
< if (codecs_ready && candidates_prepared) {
< Tcl_Obj *local_codecs = Tcl_NewListObj (0, NULL);
---
> g_object_get (session, "codecs", &codecs, NULL);
346,347c387,394
< GList *codecs = NULL;
< GList *item = NULL;
---
> for (item = g_list_first (codecs); item; item = g_list_next (item))
> {
> FsCodec *codec = item->data;
> Tcl_Obj *tcl_codec = NULL;
> Tcl_Obj *elements[3];
> elements[0] = Tcl_NewStringObj (codec->encoding_name, -1);
> elements[1] = Tcl_NewIntObj (codec->id);
> elements[2] = Tcl_NewIntObj (codec->clock_rate);
349c396,398
< g_object_get (session, "codecs", &codecs, NULL);
---
> tcl_codec = Tcl_NewListObj (3, elements);
> Tcl_ListObjAppendElement(NULL, local_codecs, tcl_codec);
> }
351,358c400
< for (item = g_list_first (codecs); item; item = g_list_next (item))
< {
< FsCodec *codec = item->data;
< Tcl_Obj *tcl_codec = NULL;
< Tcl_Obj *elements[3];
< elements[0] = Tcl_NewStringObj (codec->encoding_name, -1);
< elements[1] = Tcl_NewIntObj (codec->id);
< elements[2] = Tcl_NewIntObj (codec->clock_rate);
---
> fs_codec_list_destroy (codecs);
360,362c402,412
< tcl_codec = Tcl_NewListObj (3, elements);
< Tcl_ListObjAppendElement(NULL, local_codecs, tcl_codec);
< }
---
> _notify_callback (msg, local_codecs, local_candidates);
> }
>
> static void
> _notify_audio_prepared ()
> {
>
> if (audio_codecs_ready && audio_candidates_prepared) {
> _notify_prepared ("PREPARED_AUDIO", audio_session, audio_local_candidates);
> }
> }
364c414,416
< fs_codec_list_destroy (codecs);
---
> static void
> _notify_video_prepared ()
> {
366c418,419
< _notify_callback ("PREPARED", local_codecs, local_candidates);
---
> if (video_codecs_ready && video_candidates_prepared) {
> _notify_prepared ("PREPARED_VIDEO", video_session, video_local_candidates);
395a449,454
> Tcl_Obj **local_candidates = NULL;
>
> if (stream == audio_stream)
> local_candidates = &audio_local_candidates;
> else
> local_candidates = &video_local_candidates;
397,399c456,458
< if (local_candidates == NULL) {
< local_candidates = Tcl_NewListObj (0, NULL);
< Tcl_IncrRefCount(local_candidates);
---
> if (*local_candidates == NULL) {
> *local_candidates = Tcl_NewListObj (0, NULL);
> Tcl_IncrRefCount(*local_candidates);
425c484
< Tcl_ListObjAppendElement(NULL, local_candidates, tcl_candidate);
---
> Tcl_ListObjAppendElement(NULL, *local_candidates, tcl_candidate);
433,436c492,500
< candidates_prepared = TRUE;
<
< _notify_debug ("CANDIDATES ARE PREPARED");
< _notify_prepared ();
---
> if (stream == audio_stream) {
> audio_candidates_prepared = TRUE;
> _notify_debug ("AUDIO CANDIDATES ARE PREPARED");
> _notify_audio_prepared ();
> } else {
> video_candidates_prepared = TRUE;
> _notify_debug ("VIDEO CANDIDATES ARE PREPARED");
> _notify_video_prepared ();
> }
448d511
<
458c521
< if (name == "dtmfsrc" || name == "audiotestsrc")
---
> if (name == "dtmfsrc" || name == "audiotestsrc" || name == "videotestsrc")
522c585
< static GstElement * _create_source ()
---
> static GstElement * _create_audio_source ()
537,540c600,603
< _notify_debug ("Creating source : %s --- %s -- %s",
< source_pipeline ? source_pipeline : "(null)",
< source ? source : "(null)",
< source_device ? source_device : "(null)");
---
> _notify_debug ("Creating audio_source : %s --- %s -- %s",
> audio_source_pipeline ? audio_source_pipeline : "(null)",
> audio_source ? audio_source : "(null)",
> audio_source_device ? audio_source_device : "(null)");
542c605
< if (source_pipeline) {
---
> if (audio_source_pipeline) {
550c613
< desc = g_strdup_printf ("bin.( %s ! queue )", source_pipeline);
---
> desc = g_strdup_printf ("bin.( %s ! queue )", audio_source_pipeline);
563c626
< _notify_debug ("Error while creating source pipeline (%d): %s",
---
> _notify_debug ("Error while creating audio_source pipeline (%d): %s",
569c632
< _notify_debug ("Waiting for source_pipeline to go to state READY");
---
> _notify_debug ("Waiting for audio_source_pipeline to go to state READY");
579c642
< } else if (source) {
---
> } else if (audio_source) {
581,583c644,646
< src = gst_element_factory_make (source, NULL);
< if (src && source_device)
< g_object_set(src, "device", source_device, NULL);
---
> src = gst_element_factory_make (audio_source, NULL);
> if (src && audio_source_device)
> g_object_set(src, "device", audio_source_device, NULL);
587c650
< _notify_debug ("Waiting for %s to go to state READY", source);
---
> _notify_debug ("Waiting for %s to go to state READY", audio_source);
604c667
< _notify_debug ("Using source %s", *test_source);
---
> _notify_debug ("Using audio_source %s", *test_source);
612c675
< sources = get_plugins_filtered (TRUE);
---
> sources = get_plugins_filtered (TRUE, TRUE);
623c686
< _notify_debug ("Using source %s", *test_source);
---
> _notify_debug ("Using audio_source %s", *test_source);
636c699
< static GstElement * _create_sink ()
---
> static GstElement * _create_audio_sink ()
639c702
< if (sink_pipeline) {
---
> if (audio_sink_pipeline) {
646c709
< desc = g_strdup_printf ("bin.( %s ! queue )", sink_pipeline);
---
> desc = g_strdup_printf ("bin.( %s ! queue )", audio_sink_pipeline);
659c722
< _notify_debug ("Error while creating sink pipeline (%d): %s",
---
> _notify_debug ("Error while creating audio_sink pipeline (%d): %s",
662,665c725,728
< } else if (sink) {
< snk = gst_element_factory_make (sink, NULL);
< if (snk && sink_device)
< g_object_set(snk, "device", sink_device, NULL);
---
> } else if (audio_sink) {
> snk = gst_element_factory_make (audio_sink, NULL);
> if (snk && audio_sink_device)
> g_object_set(snk, "device", audio_sink_device, NULL);
672a736
> /* TODO */
674c738,739
< _src_pad_added (FsStream *self, GstPad *pad, FsCodec *codec, gpointer user_data)
---
> _audio_src_pad_added (FsStream *self, GstPad *pad,
> FsCodec *codec, gpointer user_data)
684c749
< snk = _create_sink ();
---
> snk = _create_audio_sink ();
686c751
< _notify_error_post ("Could not create sink");
---
> _notify_error_post ("Could not create audio_sink");
696c761
< _notify_error_post ("Could not add sink to pipeline");
---
> _notify_error_post ("Could not add audio_sink to pipeline");
784c849
< _notify_debug ("Could not link sink to level out");
---
> _notify_debug ("Could not link audio_sink to level out");
794c859
< _notify_error_post ("Could not link sink to converter");
---
> _notify_error_post ("Could not link audio_sink to converter");
824c889
< _notify_error_post ("Unable to set sink to PLAYING");
---
> _notify_error_post ("Unable to set audio_sink to PLAYING");
830c895
< _notify_error_post ("Unable to set sink to PLAYING");
---
> _notify_error_post ("Unable to set audio_sink to PLAYING");
836,837c901,902
< static void
< _codecs_ready (FsSession *session)
---
>
> static GstElement * _create_video_source ()
839c904,922
< codecs_ready = TRUE;
---
> GstElement *src = NULL;
> GList *sources, *walk;
> gchar *priority_sources[] = {"gconfv4l2src",
> "v4l2src",
> "v4lsrc",
> NULL};
> gchar **test_source = NULL;
>
> _notify_debug ("Creating video_source : %s --- %s -- %s",
> video_source_pipeline ? video_source_pipeline : "(null)",
> video_source ? video_source : "(null)",
> video_source_device ? video_source_device : "(null)");
>
> if (video_source_pipeline) {
> GstPad *pad = NULL;
> GstBin *bin;
> gchar *desc;
> GError *error = NULL;
> GstStateChangeReturn state_ret;
841c924,927
< _notify_debug ("CODECS ARE READY");
---
> /* parse the pipeline to a bin */
> desc = g_strdup_printf ("bin.( %s ! queue )", video_source_pipeline);
> bin = (GstBin *) gst_parse_launch (desc, &error);
> g_free (desc);
843c929,1058
< _notify_prepared ();
---
> if (bin) {
> /* find pads and ghost them if necessary */
> if ((pad = gst_bin_find_unlinked_pad (bin, GST_PAD_SRC))) {
> gst_element_add_pad (GST_ELEMENT (bin), gst_ghost_pad_new ("src", pad));
> gst_object_unref (pad);
> }
> src = GST_ELEMENT (bin);
> }
> if (error) {
> _notify_debug ("Error while creating video_source pipeline (%d): %s",
> error->code, error->message? error->message : "(null)");
> }
>
> state_ret = gst_element_set_state (src, GST_STATE_READY);
> if (state_ret == GST_STATE_CHANGE_ASYNC) {
> _notify_debug ("Waiting for video_source_pipeline to go to state READY");
> state_ret = gst_element_get_state (src, NULL, NULL,
> GST_CLOCK_TIME_NONE);
> }
>
> if (state_ret == GST_STATE_CHANGE_FAILURE) {
> gst_object_unref (src);
> return NULL;
> }
> return src;
> } else if (video_source) {
> GstStateChangeReturn state_ret;
> src = gst_element_factory_make (video_source, NULL);
> if (src && video_source_device)
> g_object_set(src, "device", video_source_device, NULL);
>
> state_ret = gst_element_set_state (src, GST_STATE_READY);
> if (state_ret == GST_STATE_CHANGE_ASYNC) {
> _notify_debug ("Waiting for %s to go to state READY", video_source);
> state_ret = gst_element_get_state (src, NULL, NULL,
> GST_CLOCK_TIME_NONE);
> }
>
> if (state_ret == GST_STATE_CHANGE_FAILURE) {
> gst_object_unref (src);
> return NULL;
> }
> return src;
> }
>
> for (test_source = priority_sources; *test_source; test_source++) {
> GstElement *element = _test_source (*test_source);
> if (element == NULL)
> continue;
>
> _notify_debug ("Using video_source %s", *test_source);
> src = element;
> break;
> }
>
> if (src)
> return src;
>
> sources = get_plugins_filtered (TRUE, FALSE);
>
> for (walk = sources; walk; walk = g_list_next (walk)) {
> GstElement *element;
> GstElementFactory *factory = GST_ELEMENT_FACTORY(walk->data);
>
> element = _test_source (GST_PLUGIN_FEATURE_NAME(factory));
>
> if (element == NULL)
> continue;
>
> _notify_debug ("Using video_source %s", *test_source);
> src = element;
> break;
> }
> for (walk = sources; walk; walk = g_list_next (walk)) {
> if (walk->data)
> gst_object_unref (GST_ELEMENT_FACTORY (walk->data));
> }
> g_list_free (sources);
>
> return src;
> }
>
> static GstElement * _create_video_sink ()
> {
> GstElement *snk = NULL;
> if (video_sink_pipeline) {
> GstPad *pad = NULL;
> GstBin *bin;
> gchar *desc;
> GError *error = NULL;
>
> /* parse the pipeline to a bin */
> desc = g_strdup_printf ("bin.( %s ! queue )", video_sink_pipeline);
> bin = (GstBin *) gst_parse_launch (desc, &error);
> g_free (desc);
>
> if (bin) {
> /* find pads and ghost them if necessary */
> if ((pad = gst_bin_find_unlinked_pad (bin, GST_PAD_SINK))) {
> gst_element_add_pad (GST_ELEMENT (bin), gst_ghost_pad_new ("sink", pad));
> gst_object_unref (pad);
> }
> snk = GST_ELEMENT (bin);
> }
> if (error) {
> _notify_debug ("Error while creating video_sink pipeline (%d): %s",
> error->code, error->message ? error->message : "(null)");
> }
> } else if (video_sink) {
> snk = gst_element_factory_make (video_sink, NULL);
> }
> if (snk == NULL)
> snk = gst_element_factory_make ("autovideosink", NULL);
>
> return snk;
> }
>
>
> static void
> _codecs_ready (FsSession *session)
> {
> if (session == audio_session) {
> audio_codecs_ready = TRUE;
> _notify_debug ("AUDIO CODECS ARE READY");
> _notify_audio_prepared ();
> } else {
> video_codecs_ready = TRUE;
> _notify_debug ("VIDEO CODECS ARE READY");
> _notify_video_prepared ();
> }
901,902c1116,1117
< if (!codecs_ready) {
< g_object_get (session, "codecs-ready", &ready, NULL);
---
> if (!audio_codecs_ready) {
> g_object_get (audio_session, "codecs-ready", &ready, NULL);
904c1119
< _codecs_ready (session);
---
> _codecs_ready (audio_session);
976a1192,1197
> } else if (gst_structure_has_name (s, "prepare-xwindow-id")) {
> GstXOverlay *xov = GST_MESSAGE_SRC (message);
>
> /* TODO : need to differenciate between preview and sink */
> _notify_debug ("Setting window id %d on sink", video_sink_xid);
> gst_x_overlay_set_xwindow_id (xov, video_sink_xid);
1026a1248,1249
> } else if (gst_structure_has_name (s, "prepare-xwindow-id")) {
> goto drop;
1053c1276,1277
< int Farsight_Test _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp,
---
>
> int Farsight_TestAudio _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp,
1100c1324
< src = _create_source ();
---
> src = _create_audio_source ();
1109c1333
< _notify_debug ("Couldn't add source to pipeline");
---
> _notify_debug ("Couldn't add audio_source to pipeline");
1112c1336
< goto no_source;
---
> goto error;
1127c1351
< _notify_debug ("Could not link source to volume");
---
> _notify_debug ("Could not link audio_source to volume");
1247d1470
< no_source:
1250c1473
< snk = _create_sink ();
---
> snk = _create_audio_sink ();
1252c1475
< Tcl_AppendResult (interp, "Could not create sink",
---
> Tcl_AppendResult (interp, "Could not create audio_sink",
1356c1579
< _notify_debug ("Could not link sink to level out");
---
> _notify_debug ("Could not link audio_sink to level out");
1367c1590
< Tcl_AppendResult (interp, "Could not link sink to converter",
---
> Tcl_AppendResult (interp, "Could not link audio_sink to converter",
1387a1611,1793
> int Farsight_TestVideo _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp,
> int objc, Tcl_Obj *CONST objv[]))
> {
> GstBus *bus = NULL;
> GstElement *src = NULL;
> GstPad *sinkpad = NULL, *srcpad = NULL;
> GstPad *tempsink;
> GstElement *snk = NULL;
> GstElement *src_colorspace = NULL;
> GstElement *sink_colorspace = NULL;
> GstElement *capsfilter = NULL;
> GstElement *videoscale = NULL;
> GstPadLinkReturn ret;
> gint state = 0;
>
> // We verify the arguments
> if( objc != 1) {
> Tcl_WrongNumArgs (interp, 1, objv, "");
> return TCL_ERROR;
> }
>
> main_tid = Tcl_GetCurrentThread();
>
> if (pipeline != NULL) {
> Tcl_AppendResult (interp, "Already started" , (char *) NULL);
> return TCL_ERROR;
> }
>
> if (test_pipeline != NULL) {
> Tcl_AppendResult (interp, "Already testing" , (char *) NULL);
> return TCL_ERROR;
> }
>
> test_pipeline = gst_pipeline_new ("pipeline");
> if (test_pipeline == NULL) {
> Tcl_AppendResult (interp, "Couldn't create gstreamer pipeline" ,
> (char *) NULL);
> goto error;
> }
>
> bus = gst_element_get_bus (test_pipeline);
> gst_bus_set_sync_handler (bus, _bus_callback, NULL);
> gst_object_unref (bus);
>
> src = _create_video_source ();
> if (src == NULL) {
> _notify_debug ("Couldn't create video source, using videotestsrc");
> src = gst_element_factory_make ("videotestsrc", NULL);
> }
>
> if (gst_bin_add (GST_BIN (test_pipeline), src) == FALSE) {
> _notify_debug ("Couldn't add video_source to pipeline");
> gst_object_unref (src);
> src = NULL;
> goto error;
> }
>
> srcpad = gst_element_get_static_pad (src, "src");
>
> src_colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
> if (gst_bin_add (GST_BIN (test_pipeline), src_colorspace) == FALSE) {
> Tcl_AppendResult (interp, "Could not add source colorspace to pipeline",
> (char *) NULL);
> gst_object_unref (src_colorspace);
> goto error;
> }
>
> tempsink = gst_element_get_static_pad (src_colorspace, "sink");
> if (gst_pad_link (srcpad, tempsink) != GST_PAD_LINK_OK) {
> gst_object_unref (tempsink);
> _notify_debug ("Couldn't link the src to converter");
> gst_bin_remove (GST_BIN (test_pipeline), src_colorspace);
> gst_object_unref (src_colorspace);
> goto error;
> }
>
> gst_object_unref (srcpad);
>
> videoscale = gst_element_factory_make ("videoscale", NULL);
> if (gst_bin_add (GST_BIN (test_pipeline), videoscale) == FALSE) {
> Tcl_AppendResult (interp, "Could not add videoscale to pipeline",
> (char *) NULL);
> gst_object_unref (videoscale);
> goto error;
> }
>
> if (gst_element_link(src_colorspace, videoscale) == FALSE) {
> Tcl_AppendResult (interp, "Could not link source colorspace to videoscale",
> (char *) NULL);
> goto error;
> }
> srcpad = gst_element_get_static_pad (videoscale, "src");
>
> capsfilter = gst_element_factory_make ("capsfilter", "capsfilter");
> if (capsfilter) {
> GstPad *caps_sink;
> GstCaps *caps;
>
> if (gst_bin_add (GST_BIN (test_pipeline), capsfilter) == FALSE) {
> _notify_debug ("Could not add capsfilter to pipeline");
> gst_object_unref (capsfilter);
> goto no_capsfilter;
> }
>
> caps_sink = gst_element_get_static_pad (capsfilter, "sink");
> if (gst_pad_link (srcpad, caps_sink) != GST_PAD_LINK_OK) {
> gst_object_unref (caps_sink);
> _notify_debug ("Couldn't link the volume/level/src to capsfilter");
> gst_bin_remove (GST_BIN (test_pipeline), capsfilter);
> goto no_capsfilter;
> }
>
>
> caps = gst_caps_new_simple ("video/x-raw-rgb",
> "width", G_TYPE_INT, 320,
> "height", G_TYPE_INT, 240,
> NULL);
> g_object_set (capsfilter, "caps", caps, NULL);
>
> gst_object_unref (srcpad);
> srcpad = gst_element_get_static_pad (capsfilter, "src");
> } else {
> _notify_debug ("couldn't create capsfilter");
> }
> no_capsfilter:
>
> snk = _create_video_sink ();
> if (snk == NULL) {
> Tcl_AppendResult (interp, "Could not create video_sink",
> (char *) NULL);
> goto error;
> }