Opened 17 years ago

Closed 6 years ago

#323 closed enhancement (wontfix)

Code to use different clock for the bridge (thanks ChenHuan)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: Known-Issues-and-Ideas
Component: pjmedia Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by bennylp)

ChenHuan sent this code to the list on 2007/05/06, along with this mail:

Currently, it only uses PCMA & PCMU codec, and the quality of the 
voice on Windows Mobile is almost as good as on PC's
 
These are the key points I conclude:
 
1. I did not use the speaker thread to stimulate the sending of RTP 
packets, but used another clock thread. There are many methods to 
achieve this, but my method is to change the file : conference.c. 
The advantage is that we have not to modify other files including 
the program on PJSIP.
 
I added a pjmedia_clock and a speaker thread buffer member into 
struct conf_port. Particularly, the speaker buffer is similar to the 
mic thread buffer. The function get_frame just only reads frames 
from the speaker buffer, and leaves other things to the 
clock_callback function.
 
The attachment is my conference.c
 
2. Don't use any ACE
Simple ACE is not recommended, because it will cause the outgoing 
voices quite instable, which means the volume of the sound 
alternates between low and high. Whether you use the default 
PJMEDIA_ECHO_SUPPRESS_FACTOR 4 or 2, it did't work out.
 
Also the normal ACE algorithm is too costly for my device, I have to 
give it up
 
So, I suggest that ACE should be disabled on Windows Mobile
You can do it by this way:
#define PJMEDIA_HAS_SPEEX_AEC               0
#define PJMEDIA_ECHO_SUPPRESS_FACTOR        1
 
After doing the two steps above, the quality of the voice will 
improved a lot, and if you feel the quality is very bad when calling 
PSTN phones, maybe the following method will help
 
3. Change the jitter buffer's parameters when necessary
Supposing you are using pjsua, you can do it by this:
    app_config.media_cfg.jb_max     = 80;
    app_config.media_cfg.jb_init    = 40;
    app_config.media_cfg.jb_min_pre = 20;
    app_config.media_cfg.jb_max_pre = 80;
These codes can be put on the tail of func : default_config
 
 
I hope it will help.

ChenHuan
2007-06-06 20:01:10
chenhuan@sict.ac.cn

Attachments (1)

conference.c (58.1 KB) - added by bennylp 17 years ago.

Download all attachments as: .zip

Change History (3)

Changed 17 years ago by bennylp

comment:1 Changed 17 years ago by bennylp

  • Description modified (diff)

comment:2 Changed 6 years ago by nanang

  • Backported unset
  • Resolution set to wontfix
  • Status changed from new to closed

TeluuCon? 2018: conference bridge can use master port for its clock, see also this FAQ.

Note: See TracTickets for help on using tickets.