asterisk/res
Russell Bryant 1fab70a1c6 Resolve issues with choppy sound when using res_timing_pthread.
The situation that caused this problem was when continuous mode was being
turned on and off while a rate was set for a timing interface.  A very easy
way to replicate this bug was to do a Playback() from behind a Local channel.
In this scenario, a rate gets set on the channel for doing file playback.
At the same time, continuous mode gets turned on and off about every 20 ms
as frames get queued on to the PBX side channel from the other side of the
Local channel.

Essentially, this module treated continuous mode and a set rate as mutually
exclusive states for the timer to be in.  When I dug deep enough, I observed
the following pattern:

   1) Set timer to tick every 20 ms.
   2) Wait almost 20 ms ...
   3) Continuous mode gets turned on for a queued up frame
   4) Continuous mode gets turned off
   5) The timer goes back to its tick per 20 ms. state but starts counting
      at 0 ms.
   6) Goto step 2.

Sometimes, res_timing_pthread would make it 20 ms and produce a timer tick,
but not most of the time.  This is what produced the choppy sound (or sometimes
no sound at all).

Now, the module treats continuous mode and a set rate as completely independent
timer modes.  They can be enabled and disabled independently of each other and
things work as expected.


(closes issue #14412)
Reported by: dome
Patches:
      issue14412.diff.txt uploaded by russell (license 2)
      issue14412-1.6.1.0.diff.txt uploaded by russell (license 2)
Tested by: DennisD, russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29 20:06:59 +00:00
..
ael Merged revisions 189462 via svnmerge from 2009-04-20 21:09:59 +00:00
ais Change g_eid to ast_eid_default. 2009-03-27 14:00:18 +00:00
snmp Convert the ast_channel data structure over to the astobj2 framework. 2009-04-24 14:04:26 +00:00
Makefile Make res_config_ldap compile with the official OpenLDAP 2.3.X versions. 2008-11-28 14:20:11 +00:00
res_adsi.c Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiating 2008-09-12 23:30:03 +00:00
res_adsi.exports Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_ael_share.c remove a bunch of useless #include "options.h" 2007-11-21 23:09:02 +00:00
res_ael_share.exports allow this module to export everything for now 2009-03-18 21:28:28 +00:00
res_agi.c Move AGI static documentation to the new AstXML form. 2009-05-24 16:17:31 +00:00
res_agi.exports Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_ais.c Mark res_ais as experimental, as the binary event format is subject to change. 2009-02-27 21:47:18 +00:00
res_calendar.c Add Calendaring support for Asterisk 2009-05-28 19:57:18 +00:00
res_calendar.exports Add Calendaring support for Asterisk 2009-05-28 19:57:18 +00:00
res_calendar_caldav.c Add Calendaring support for Asterisk 2009-05-28 19:57:18 +00:00
res_calendar_exchange.c Add Calendaring support for Asterisk 2009-05-28 19:57:18 +00:00
res_calendar_icalendar.c Add Calendaring support for Asterisk 2009-05-28 19:57:18 +00:00
res_clialiases.c Make the code that prevents an infinite loop from happening into a case insensitive check. 2009-05-06 16:09:27 +00:00
res_clioriginate.c Add new ast_complete_applications function so that we can use it with the 2009-05-26 14:36:11 +00:00
res_config_curl.c Merge str_substitution branch. 2009-04-29 18:53:01 +00:00
res_config_ldap.c a few more namespace updates... res_ael_share still needs some work before this can be merged to other release branches 2009-03-18 02:39:36 +00:00
res_config_odbc.c Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_config_pgsql.c Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_config_sqlite.c a few more namespace updates... res_ael_share still needs some work before this can be merged to other release branches 2009-03-18 02:39:36 +00:00
res_convert.c Merged revisions 196826 via svnmerge from 2009-05-26 18:20:57 +00:00
res_crypto.c Janitor, use ARRAY_LEN() when possible. 2008-12-05 10:31:25 +00:00
res_curl.c a few more namespace updates... res_ael_share still needs some work before this can be merged to other release branches 2009-03-18 02:39:36 +00:00
res_features.exports Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_http_post.c Support HTTP digest authentication for the http manager interface. 2009-04-23 20:36:35 +00:00
res_jabber.c Fix build under dev mode and remove some casts that are no longer necessary as 2009-05-22 16:10:33 +00:00
res_jabber.exports a few more namespace updates... res_ael_share still needs some work before this can be merged to other release branches 2009-03-18 02:39:36 +00:00
res_limit.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
res_monitor.c Fix build under dev mode and remove some casts that are no longer necessary as 2009-05-22 16:10:33 +00:00
res_monitor.exports Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_musiconhold.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
res_odbc.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
res_odbc.exports 2 symbols defined when DEBUG_THREADS 2009-03-19 17:00:13 +00:00
res_phoneprov.c fix typos 2009-04-29 22:56:55 +00:00
res_realtime.c Fix the build 2008-12-17 21:29:30 +00:00
res_rtp_asterisk.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
res_smdi.c Recorded merge of revisions 195366 via svnmerge from 2009-05-18 20:52:33 +00:00
res_smdi.exports Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_snmp.c Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_speech.c Const-ify the world (or at least a good part of it) 2009-05-21 21:13:09 +00:00
res_speech.exports Merged revisions 182808 via svnmerge from 2009-03-18 02:21:23 +00:00
res_timing_dahdi.c Add documentation for timing modules used in Asterisk 2009-03-03 20:59:16 +00:00
res_timing_pthread.c Resolve issues with choppy sound when using res_timing_pthread. 2009-05-29 20:06:59 +00:00
res_timing_timerfd.c Fix some timer state corruption. 2009-05-11 22:04:40 +00:00