23 | | == Windows Mobile Workaround == |
24 | | |
25 | | Chen Huan observed stutters on Windows Mobile devices, and it turns out that this was caused by '''frame duration or {{{samples_per_frame}}} setting that is set too low when opening the sound device'''. |
26 | | |
27 | | The usual settings for frame duration is 10ms or 20ms, which is good to provide low delay streaming. But it seems that Windows Mobile just can't handle this, and increasing the frame duration to 80ms seems to cure the problem. |
28 | | |
29 | | Example: |
30 | | |
31 | | {{{ |
32 | | #define PTIME 20 |
33 | | |
34 | | int clock_rate = 8000; |
35 | | int channel_count = 1; |
36 | | int samples_per_frame = clock_rate * PTIME / 1000; |
37 | | int bits_per_sample = 16; |
38 | | |
39 | | |
40 | | status = pjmedia_conf_create( pool, /* pool to use */ |
41 | | port_count, /* number of ports */ |
42 | | clock_rate, |
43 | | channel_count, |
44 | | samples_per_frame, |
45 | | bits_per_sample, |
46 | | 0, /* options */ |
47 | | &conf /* result */ |
48 | | ); |
49 | | }}} |
50 | | |
51 | | The snippet above will create a conference bridge '''with internal sound device''', using frame duration setting of 20ms (the PTIME macro). To fix the stutter problem, change PTIME to 80. |
52 | | |