[Telepathy] looking for dumn audioresampler

Alexey Fisher bug-track at fisher-privat.net
Tue Apr 12 12:55:17 PDT 2011


Hallo all,

i try to reduce cpu usage of empathy-av. With perf tool i see that
gstaudioresample use more cpu than speexenc(!). 

i attached names on all resample elements found in farsight and empathy
but i still cand find the correct one.
With this command:
/usr/lib/empathy/empathy-av --gst-debug=audioresample:5

i get fallowing result:
0:00:38.189954044  8171      0x22556e0 DEBUG          audioresample
gstaudioresample.c:1258:gst_audio_resample_transform:<audioresample1>
input = samples [886600, 887040) = [20104308390, 20114285714) ns;
output = samples [160803, 160883) = [20100360544, 20110360544) ns
0:00:38.198865163  8171      0x22556e0 LOG            audioresample
gstaudioresample.c:542:gst_audio_resample_transform_size:<audioresample1> asked to transform size 3520 in direction SINK
0:00:38.198887093  8171      0x22556e0 DEBUG          audioresample
gstaudioresample.c:472:gst_audio_resample_parse_caps: incaps
audio/x-raw-float, endianness=(int)1234, width=(int)32, rate=(int)44100,
channels=(int)2, outcaps audio/x-raw-float, width=(int)32,
rate=(int)8000, channels=(int)2, endianness=(int)1234


This element has default name "audioresample1", i changed all name to
test_1,2 ... - "audioresample name=test_1". So it is probably not in
farsight or empathy.

It resample "rate=(int)44100, channels=(int)2" to "rate=(int)8000,
channels=(int)2". Interesting thing is: target 8000 mean it should be
before speexenc. But pulseaudio say, we grub 8000 from PA.
So it looks like:
PA(8000kHz)->empathy(resample(44100)->speexenc(8000))-Network->(speexdec(8000)->resample(44100))->PA(44100)
One more bad thing is, it do resample for 2(!)channels, it mean double
cpu usage. Even if we use only 1 channels.


May be some one see what i do not see.

Thank you for any tips.

Here are my changes:
--- farsight2-0.0.26/gst/fsrtpconference/fs-rtp-discover-codecs.c
2010-11-22 22:09:25.000000000 +0100
+++ old-farsight2-0.0.26/gst/fsrtpconference/fs-rtp-discover-codecs.c
2011-04-12 21:15:26.909645195 +0200
@@ -640,6 +640,7 @@
       tmpfact = gst_element_factory_find ("audioresample");
       if (tmpfact)
       {
+        g_object_set(G_OBJECT(tmpfact), "name", "test_1", NULL);
         codec_blueprint->send_pipeline_factory = g_list_append (
             codec_blueprint->send_pipeline_factory,
             g_list_append (NULL, tmpfact));

--- farsight2-0.0.26/gst/fsrawconference/fs-raw-session.c	2011-02-23
21:42:03.000000000 +0100
+++ old-farsight2-0.0.26/gst/fsrawconference/fs-raw-session.c	2011-04-12
21:15:03.347939757 +0200
@@ -764,7 +764,7 @@
 
   if (mtype == FS_MEDIA_TYPE_AUDIO)
     return gst_parse_bin_from_description_full (
-      "audioconvert ! audioresample ! audioconvert", TRUE, NULL,
+      "audioconvert ! audioresample name=test_2 ! audioconvert", TRUE,
NULL,
       GST_PARSE_FLAG_NONE, error);
   else if (mtype == FS_MEDIA_TYPE_VIDEO)
     return gst_parse_bin_from_description_full ("ffmpegcolorspace !
videoscale",

-- 
Regards,
        Alexey



More information about the telepathy mailing list