Changeset 1715
- Timestamp:
- Jan 19, 2008 9:39:52 AM (17 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r1664 r1715 98 98 * for the sound device, and will try to limit the delay caused 99 99 * by uneven callback calls to this delay. 100 * 101 * When this setting is enabled, the PJMEDIA_SOUND_BUFFER_COUNT 102 * macro will specify the maximum size of the delay buffer. 100 103 */ 101 104 #ifndef PJMEDIA_SOUND_USE_DELAYBUF 102 105 # define PJMEDIA_SOUND_USE_DELAYBUF 0 103 #endif104 105 106 /**107 * Whenever delay buffer is enabled for sound device,108 * PJMEDIA_SOUND_BUFFER_COUNT is better to be set to 1,109 * because sound callbacks will be called evenly thus110 * there's no need to have this buffer.111 */112 #if defined(PJMEDIA_SOUND_USE_DELAYBUF) && PJMEDIA_SOUND_USE_DELAYBUF!=0113 # define PJMEDIA_SOUND_BUFFER_COUNT 1114 106 #endif 115 107 … … 125 117 * combiner port, and dsound.c. 126 118 * 127 * Note that when PJMEDIA_SOUND_USE_DELAYBUF is enabled, it's best to128 * set PJMEDIA_SOUND_BUFFER_COUNT to 1 to reduce voice latency.129 *130 119 * Default: 6 131 120 */ -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r1692 r1715 56 56 57 57 #define THIS_FILE "conference.c" 58 #define RX_BUF_COUNT PJMEDIA_SOUND_BUFFER_COUNT 58 59 /* When delay buffer is used, we only need 1 frame buffering */ 60 #if defined(PJMEDIA_SOUND_USE_DELAYBUF) && PJMEDIA_SOUND_USE_DELAYBUF!=0 61 # define RX_BUF_COUNT 1 62 #else 63 # define RX_BUF_COUNT PJMEDIA_SOUND_BUFFER_COUNT 64 #endif 59 65 60 66 #define BYTES_PER_SAMPLE 2 -
pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c
r1669 r1715 41 41 /* Since there are two operations performed (get & put), */ 42 42 /* these macros value must be minimum 2 and should be even number */ 43 #define WAITING_COUNT 8 44 #define LEARN_COUNT 8 43 #define WAITING_COUNT 4 44 #define LEARN_COUNT 16 45 46 /* Number of buffers to add to learnt level for additional stability */ 47 #define SAFE_MARGIN 2 48 49 /* 50 * Some experimental data (with SAFE_MARGIN=1): 51 * 52 * System 1: 53 * - XP, WMME, 10ms ptime, 54 * - Sennheiser Headset+USB sound card 55 * - Stable delaybuf level: 6, on WAITING_COUNT=4 and LEARNING_COUNT=48 56 * 57 * System 2: 58 * - XP, WMME, 10ms ptime 59 * - Onboard SoundMAX Digital Audio 60 * - Stable delaybuf level: 6, on WAITING_COUNT=4 and LEARNING_COUNT=48 61 */ 45 62 46 63 struct pjmedia_delay_buf … … 134 151 b->state_count++; 135 152 if (b->state_count == LEARN_COUNT) { 136 /* give ONE frame compensation*/137 b->max_level += 1;153 /* give SAFE_MARGIN compensation for added stability */ 154 b->max_level += SAFE_MARGIN; 138 155 139 156 PJ_LOG(5,(b->obj_name,"Delay buffer start running, level=%u", -
pjproject/trunk/pjmedia/src/pjmedia/echo_speex.c
r1417 r1715 32 32 33 33 #define THIS_FILE "echo_speex.c" 34 #define BUF_COUNT 1634 #define BUF_COUNT PJMEDIA_SOUND_BUFFER_COUNT 35 35 #define MIN_PREFETCH 2 36 36 #define MAX_PREFETCH (BUF_COUNT*2/3) -
pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
r1665 r1715 364 364 #if PJMEDIA_SOUND_USE_DELAYBUF 365 365 status = pjmedia_delay_buf_create(pool, "snd_buff", samples_per_frame, 366 16, -1, &snd_port->delay_buf); 366 PJMEDIA_SOUND_BUFFER_COUNT, -1, 367 &snd_port->delay_buf); 367 368 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 368 369 #else -
pjproject/trunk/pjmedia/src/pjmedia/splitcomb.c
r1417 r1715 28 28 #define THIS_FILE "splitcomb.c" 29 29 #define TMP_SAMP_TYPE pj_int16_t 30 #define MAX_BUF_CNT PJMEDIA_SOUND_BUFFER_COUNT 30 31 /* When delay buffer is used, we only need 1 frame buffering */ 32 #if defined(PJMEDIA_SOUND_USE_DELAYBUF) && PJMEDIA_SOUND_USE_DELAYBUF!=0 33 # define MAX_BUF_CNT 1 34 #else 35 # define MAX_BUF_CNT PJMEDIA_SOUND_BUFFER_COUNT 36 #endif 31 37 32 38 #if 0
Note: See TracChangeset
for help on using the changeset viewer.