Both,<br>if it always sounds ok then I guess CPU usage.<br><br><br><br><div class="gmail_quote">On Mon, Dec 7, 2009 at 2:58 PM, eaf <span dir="ltr"><<a href="mailto:erandr-junk@usa.net">erandr-junk@usa.net</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;"><br>
What do you want me to check while running these tests? Sound quality (it's<br>
good now even with original 1.0.4). Or CPU utilization?<br>
<br>
It's Debian 4.<br>
<div><div></div><div class="h5"><br>
<br>
Anthony Minessale-2 wrote:<br>
><br>
> Did you do each thing alone too to tell the difference?<br>
> -hp alone, disable monotonic alone (i did not see you mention the disable<br>
> monotonic)<br>
><br>
> as for your 4ms thing, yes we require high resolution timing, if we ask to<br>
> sleep 1000 microseconds that is what we need it to sleep for or at least<br>
> as<br>
> close as possible, and the main reason that thread is never sleeping is<br>
> because you can't actually count on it to run every 1ms but you mostly<br>
> can.<br>
> Hence the whole philosophy on only making 1 thread run hot all the time to<br>
> ensure that the rest don't have to repeat the same algorithm. We focus on<br>
> high end performance this was the point of your experimentation because we<br>
> will need to use a compile time defines and other logic to make it more<br>
> efficient on your platform, a platform which we are not using. I am<br>
> curious<br>
> what would happen if you install Kristian's astlinux on one of your<br>
> devices,<br>
> i think you should also compare the kernel versions.<br>
><br>
><br>
> What OS are you running anyway?<br>
><br>
> Here are some more things to try (running plain trunk with no mods) do<br>
> these<br>
> systematically each alone and all together with/without -hp or disable<br>
> monotonic etc to see what different combos create<br>
><br>
> comment out this line (line 10)<br>
> #define DISABLE_1MS_COND<br>
><br>
> rebuild, this tells it to run a conditional at 1ms in the same timer<br>
> thread<br>
> which will make all the switch_cond_next share a 1ms conditional instead<br>
> of<br>
> doing microsleeps<br>
><br>
> next<br>
><br>
> some kernels/devices work better using select(0) for sleep where others<br>
> work<br>
> better using usleep.<br>
> comment out line 109<br>
> apr_sleep(t);<br>
><br>
> and try<br>
> usleep(t)<br>
><br>
> also mac works better using nanosleep so you could try changing it so it<br>
> uses the code starting at 101 instead.<br>
><br>
><br>
> also your claim about JS should be investigated because I do not think it<br>
> should be the case.<br>
> but you may want to move this to a jira <a href="http://jira.freeswitch.org" target="_blank">http://jira.freeswitch.org</a><br>
><br>
> As for the asterisk comparison,<br>
> not sure how to answer you, that's your decision.<br>
><br>
><br>
><br>
> On Mon, Dec 7, 2009 at 9:28 AM, eaf <<a href="mailto:erandr-junk@usa.net">erandr-junk@usa.net</a>> wrote:<br>
><br>
>><br>
>> Here is what I found...<br>
>><br>
>> I tried high-priority scheduling as per your suggestion, reniced the<br>
>> program<br>
>> explicitly, rewrote timer thread to sleep on cond. variable and activate<br>
>> only when there are timers and only when the timer actually had to be<br>
>> clicked, turned off SQL thread and removed polling from sofia profile<br>
>> thread.<br>
>><br>
>> That pretty much eliminated all idle 1ms sleepers that were there except<br>
>> for<br>
>> three in sofia itself (su_epoll_port). And when I was about to be happy,<br>
>> I<br>
>> found that two outgoing calls through my VOIP providers when bridged<br>
>> together showed terrible distortions. I undid all my changes, tried<br>
>> 1.0.4,<br>
>> trunk (noticed btw that when I bridge two calls via loopback in JS in the<br>
>> trunk I must keep JS running, or the calls get terminated - NOT the same<br>
>> as<br>
>> in 1.0.4 where exitting JS left calls running), got pretty much the same<br>
>> sad<br>
>> results. At the same time calls bridged by freeswitch between LAN and any<br>
>> of<br>
>> the VOIP providers behaved just fine. And calls bridged by Asterisk any<br>
>> way<br>
>> were fine too. So that pretty much looked like the end of the freeswitch<br>
>> trials for me.<br>
>><br>
>> But then I timed your code, mine and found that all those 1ms sleeps that<br>
>> your timer thread was doing (and all those pollers were doing as well)<br>
>> were<br>
>> actually 4ms sleeps because you know what unless kernel is configured<br>
>> with<br>
>> HZ=1000, you can't sleep for less than 4ms (HZ=250) or perhaps even 10ms<br>
>> (HZ=100). Mine was 250.<br>
>><br>
>> This actually meant that the original timer thread was firing once,<br>
>> sleeping<br>
>> for 4ms, firing 3 more times back-to-back, sleeping for 4ms more, firing<br>
>> 4<br>
>> times back-to-back, etc. It was still firing 20ms timers on time, but<br>
>> 30ms<br>
>> ones of course were not, since 30ms doesn't divide by 4 evenly. Plus<br>
>> whoever<br>
>> relied on runtime.reference or switch_micro_time_now() were kind of<br>
>> screwed<br>
>> because both were running jumpy. Plus whoever assumed that<br>
>> apr_sleep(1000)<br>
>> or cond_yield() was sleeping for 1ms were also in for a surprise. It felt<br>
>> satisfying to find that, however it didn't explain why the same<br>
>> distortions<br>
>> were observed with rewritten timer thread and disabled RTP timers.<br>
>><br>
>> Anyway, I sighed (pretty much like you) and recompiled the kernel with<br>
>> HZ=1000. Recompiling kernel on these ALIX boards is fun. If smth goes<br>
>> south,<br>
>> you need to hook up serial console and see what the heck went wrong.<br>
>><br>
>> That eliminated distortions, ha! But made freeswitch more CPU hungry. Now<br>
>> the remaining 1ms threads sitting in sofia epoll were really polling for<br>
>> 1ms, not 4, and freeswitch was consistently sitting in the first line of<br>
>> the<br>
>> top chart showing 3% CPU utilization when idle.<br>
>><br>
>> Don't know whether it's because of the remaining epolls in sofia or<br>
>> whether<br>
>> it's because there are still some threads left in freeswitch that I<br>
>> neglected to change because they were sleeping with 100ms interval, so I<br>
>> figured, who cares. Maybe when all things come together (sofia, 100ms*N)<br>
>> freeswitch ends up spending 3% of CPU while doing pretty much nothing.<br>
>><br>
>> Btw, compared with Asterisk, the latter is not even visible on the first<br>
>> top's screen and spends 1% CPU when bridging two G711 calls and recording<br>
>> them to disk.<br>
>><br>
>> So, at this time I have both original Asterisk and FS setups running. One<br>
>> is<br>
>> seemless but clumsy in configuration, the other one is neat and stylish<br>
>> but<br>
>> too preoccupied with smth... Should I look into sofia epollers? That's<br>
>> kind<br>
>> of deep in the code. Or should I just stick with Asterisk?<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> Anthony Minessale-2 wrote:<br>
>> ><br>
>> > There is another user here with a 300mhz box. I am willing to<br>
>> investigate<br>
>> > this improved performance for weak devices but I need to do it in a<br>
>> sane<br>
>> > cross-platform way.<br>
>> ><br>
>> ><br>
>> > On Fri, Dec 4, 2009 at 1:32 PM, Yossi Neiman<br>
>> > <<a href="mailto:freeswitch@cartissolutions.com">freeswitch@cartissolutions.com</a><br>
>> >> wrote:<br>
>> ><br>
>> >> A word to the wise to the general FreeSWITCH community: If Anthony<br>
>> >> Minessale suggests that you try to do any number of things, it's a<br>
>> very<br>
>> >> good idea to try all those ideas before continuing on. I've known<br>
>> him,<br>
>> >> MikeJ, and bkw for several years, and they almost always have very<br>
>> good<br>
>> >> ideas as to troubleshoot a problem in FreeSWITCH. It's extremely<br>
>> >> frustrating to try to help people out who won't try the provided<br>
>> >> suggestions first.<br>
>> >><br>
>> >> And note directly to "eaf" - bogomips is quite possibly the least<br>
>> >> significant bit of data about a cpu that you will get out of<br>
>> >> /proc/cpuinfo... The name itself - bogo, means bogus.<br>
>> >> <a href="http://en.wikipedia.org/wiki/Bogomips" target="_blank">http://en.wikipedia.org/wiki/Bogomips</a><br>
>> >><br>
>> >> -Yossi<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:<br>
>> <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>
>> ><br>
>> ><br>
>> > --<br>
>> > Anthony Minessale II<br>
>> ><br>
>> > FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
>> > ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
>> > Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
>> ><br>
>> > AIM: anthm<br>
>> > <a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
>> <<a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a>><<br>
</div></div>>> <a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a><<a href="mailto:MSN%25253Aanthony_minessale@hotmail.com">MSN%253Aanthony_minessale@hotmail.com</a>><br>
<div class="im">>> ><br>
>> ><br>
>> GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><<a href="mailto:PAYPAL%253Aanthony.minessale@gmail.com">PAYPAL%3Aanthony.minessale@gmail.com</a>><br>
</div>>> <<a href="mailto:PAYPAL%253Aanthony.minessale@gmail.com">PAYPAL%3Aanthony.minessale@gmail.com</a><<a href="mailto:PAYPAL%25253Aanthony.minessale@gmail.com">PAYPAL%253Aanthony.minessale@gmail.com</a>><br>
<div class="im">>> ><br>
>> > IRC: <a href="http://irc.freenode.net" target="_blank">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="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a>><<br>
</div>>> <a href="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a><<a href="mailto:sip%25253A888@conference.freeswitch.org">sip%253A888@conference.freeswitch.org</a>><br>
<div class="im">>> ><br>
>> > <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
>> ><br>
>> <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><<a href="mailto:googletalk%253Aconf%252B888@conference.freeswitch.org">googletalk%3Aconf%2B888@conference.freeswitch.org</a>><br>
</div>>> <<a href="mailto:googletalk%253Aconf%252B888@conference.freeswitch.org">googletalk%3Aconf%2B888@conference.freeswitch.org</a><<a href="mailto:googletalk%25253Aconf%25252B888@conference.freeswitch.org">googletalk%253Aconf%252B888@conference.freeswitch.org</a>><br>
<div><div></div><div class="h5">>> ><br>
>> > pstn:213-799-1400<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>
>> ><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>
>><br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://old.nabble.com/Choppy-sound-with-PCMU-tp26594250p26678873.html" target="_blank">http://old.nabble.com/Choppy-sound-with-PCMU-tp26594250p26678873.html</a><br>
>> Sent from the Freeswitch-users mailing list archive at Nabble.com.<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>
><br>
><br>
> --<br>
> Anthony Minessale II<br>
><br>
> FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
> Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
><br>
> AIM: anthm<br>
> <a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a> <<a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a>><br>
> GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><<a href="mailto:PAYPAL%253Aanthony.minessale@gmail.com">PAYPAL%3Aanthony.minessale@gmail.com</a>><br>
> IRC: <a href="http://irc.freenode.net" target="_blank">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> <<a href="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a>><br>
> <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
> <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><<a href="mailto:googletalk%253Aconf%252B888@conference.freeswitch.org">googletalk%3Aconf%2B888@conference.freeswitch.org</a>><br>
> pstn:213-799-1400<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>
<br>
--<br>
</div></div>View this message in context: <a href="http://old.nabble.com/Choppy-sound-with-PCMU-tp26594250p26684048.html" target="_blank">http://old.nabble.com/Choppy-sound-with-PCMU-tp26594250p26684048.html</a><br>
<div><div></div><div class="h5">Sent from the Freeswitch-users mailing list archive at Nabble.com.<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>
</div></div></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>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</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>