Choppy sounds when using MOH(musiconhold)

Hi all,

I have studied this problem for awhile and feel very frustrated. Really need a hand :frowning:

Here is my situation:
My asterisk version is and is installed on an embedded board(MT7620). The music is recorded with PCM format , 8K sample/sec, wav extension but it cannot be played smoothly when the SIP_Client is in hold.

Mostly people said you should enable internal_timing=yes in asterisk.conf. I have do so. But the situation is not getting better:



At first, I thought the problem is caused by no timing interface is not enable in asterisk because I dont have DAHDI. Thererfore, I use res_pthread_timing (I monitor pthread using core show threads, I can see it running) but the music is still choppy.

Then, I trace the code to res_musiconhold.c and measure the time in bridge_p2p_loop. I found the time interval between sending the music data is too long (about 30ms ~ 50ms). It is a little weird that asterisk does not generate music at 20ms pace when the music is 8K sample/sec.

Thanks for sparing your time reading my problem!