did you test it in scenarios where the ptime is mismatched, every combination of sample rate transcoding, eavesdroping on a channel in all the above situations?<br><br>It would require a full suite of testing to confirm.<br>
<br>switch_core_io.c:432 does use read_codec for encode<br><br>i think cases arise where it does need both but we could change the code to delay when it inits until the <br>first time it needs it instead so it would only take place when necessary.<br>
<br>it would require changing all the codec modules in the if (encoding) if (decoding) so instead they<br>were functions we would call the first time encode or decode was actually called.<br><br><br><br><div class="gmail_quote">
On Mon, Apr 6, 2009 at 10:26 AM, Matteo <span dir="ltr"><<a href="mailto:mbrancaleoni@voismart.it">mbrancaleoni@voismart.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
I'm forwarding the message from my friend since is better suited<br>
for -dev ML.<br>
<br>
In addition, we changed the codec_init to ask only for DECODE on read<br>
and for ENCODE on write in sofia and skypiax and everything seems to<br>
work...<br>
<br>
there's a reason for that?<br>
<br>
are we going to break up things?<br>
<br>
regards,<br>
Matteo.<br>
<br>
----- Messaggio inoltrato -----<br>
Da: "Lele Forzani" <<a href="mailto:lele@windmill.it">lele@windmill.it</a>><br>
A: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Inviato: Venerdì, 3 aprile 2009 15:20:13 GMT +01:00 Amsterdam/Berlino/Berna/Roma/Stoccolma/Vienna<br>
Oggetto: [Freeswitch-users] codecs initialization flags in endpoint modules<br>
<br>
<br>
Hello,<br>
I've been experimenting with the use of mod_dahdi_codec and other ways<br>
to perform external transcoding for codecs, and came up with noticing<br>
that transcoding resources seemed to be used up twice what I expected.<br>
That is and 2x the number of call legs, ending up to two encoder and two<br>
decoder instances per leg.<br>
<br>
<br>
So, I looked at the code and noticed almost every endpoint module does<br>
something like this (excerpt from mod_sofia, sofia_glue.c:~1800):<br>
<br>
if (switch_core_codec_init(&tech_pvt->read_codec,<br>
tech_pvt->iananame,<br>
tech_pvt->rm_fmtp,<br>
tech_pvt->rm_rate,<br>
tech_pvt->codec_ms,<br>
1,<br>
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,<br>
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {<br>
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");<br>
switch_goto_status(SWITCH_STATUS_FALSE, end);<br>
}<br>
<br>
if (switch_core_codec_init(&tech_pvt->write_codec,<br>
tech_pvt->iananame,<br>
tech_pvt->rm_fmtp,<br>
tech_pvt->rm_rate,<br>
tech_pvt->codec_ms,<br>
1,<br>
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,<br>
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {<br>
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");<br>
switch_goto_status(SWITCH_STATUS_FALSE, end);<br>
}<br>
<br>
<br>
The flags being SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE<br>
seems to be causing the apparent 'double' allocation of transcoding<br>
resources, and I fail to understand the need for both, in both cases.<br>
<br>
Could someone please spend a minute to explain?<br>
<br>
<br>
thanks<br>
lele<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>