Conference and Speex Wideband audio quality problem
Hi Everyone, Hopefully, the answer to my problem isn't in the book as I've yet to order it. :) First off, I'm one ot the devs of BigBlueButton (http://code.google.com/p/bigbluebutton/). We currently use Asterisk for voice conference. Leif Jackson made BBB work with FreeSWITCH. Now, from BBB, a user can join a voice conference in FS. We have a java SIP client (based on Red5Phone) that calls FS. All is working well for Ulaw. I am now trying to make Speex WB work since Flash Player (where our client runs) supports Speex WB. Using Speex WB frees the java SIP client from transcoding between Nellymoser and Ulaw. The java SIP client just takes the speex audio data from RTMP and sends it to FS through RTP. However, the sound quality is bad. It is choopy and robotic. Let me describe what I have done and what I found from debugging so far. I modified vars.xml to add the speex codec. ================ <X-PRE-PROCESS cmd="set" data="global_codec_prefs=speex@16000h@20i,speex@8000h@20i,G7221@32000h,G7221@16000h,G722,PCMU,PCMA,GSM"/> <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=speex@16000h@20i,PCMU,PCMA,GSM"/> Setup the conference in dialplan/public.xml ================== <extension name="bbb_conferences"> <condition field="destination_number" expression="^(7\d{4})$"> <action application="answer"/> <action application="conference" data="$1@wideband"/> </condition> </extension> When I start up freeswitch, it looks like it's loading the speex codec fine. Full console log is here http://pastebin.com/rnHfgQYj =============== 2010-07-30 16:04:10.620375 [NOTICE] switch_loadable_module.c:251 Adding Application 'AvoidingDeadlock' 2010-07-30 16:04:10.620658 [CRIT] switch_loadable_module.c:926 Error Loading module /opt/freeswitch/mod/mod_g723_1.so **/opt/freeswitch/mod/mod_g723_1.so: cannot open shared object file: No such file or directory** 2010-07-30 16:04:10.620726 [CRIT] switch_loadable_module.c:926 Error Loading module /opt/freeswitch/mod/mod_g729.so **/opt/freeswitch/mod/mod_g729.so: cannot open shared object file: No such file or directory** 2010-07-30 16:04:10.621189 [CRIT] switch_loadable_module.c:926 Error Loading module /opt/freeswitch/mod/mod_amr.so **/opt/freeswitch/mod/mod_amr.so: cannot open shared object file: No such file or directory** 2010-07-30 16:04:10.621547 [CONSOLE] switch_loadable_module.c:944 Successfully Loaded [mod_ilbc] 2010-07-30 16:04:10.621618 [NOTICE] switch_loadable_module.c:185 Adding Codec 'iLBC' (iLBC) 8000hz 30ms 2010-07-30 16:04:10.621647 [NOTICE] switch_loadable_module.c:185 Adding Codec 'iLBC' (iLBC) 8000hz 20ms 2010-07-30 16:04:10.622043 [CONSOLE] switch_loadable_module.c:944 Successfully Loaded [mod_speex] 2010-07-30 16:04:10.622108 [NOTICE] switch_loadable_module.c:185 Adding Codec 'SPEEX' (Speex) 32000hz 20ms 2010-07-30 16:04:10.622135 [NOTICE] switch_loadable_module.c:185 Adding Codec 'SPEEX' (Speex) 16000hz 20ms 2010-07-30 16:04:10.622160 [NOTICE] switch_loadable_module.c:185 Adding Codec 'SPEEX' (Speex) 8000hz 20ms 2010-07-30 16:04:10.622513 [CONSOLE] switch_loadable_module.c:944 Successfully Loaded [mod_h26x] When I call into the conference, it looks like mod_conference does not use speex codec but L16@16000hz. ====== 2010-07-30 16:05:56.874138 [DEBUG] sofia.c:4317 Channel sofia/external/75115@192.168.0.166 entering state [completed][200] 2010-07-30 16:05:56.874138 [DEBUG] switch_core_session.c:647 Send signal sofia/external/75115@192.168.0.166 [BREAK] 2010-07-30 16:05:56.874138 [DEBUG] switch_channel.c:2494 (sofia/external/75115@192.168.0.166) Callstate Change RINGING -> ACTIVE 2010-07-30 16:05:56.874138 [NOTICE] mod_dptools.c:746 Channel [sofia/external/75115@192.168.0.166] has been answered EXECUTE sofia/external/75115@192.168.0.166 conference(75115@wideband) 2010-07-30 16:05:56.875481 [DEBUG] mod_conference.c:5237 Raw Codec Activation Success L16@16000hz 1 channel 20ms 2010-07-30 16:05:56.875481 [DEBUG] mod_conference.c:5282 Raw Codec Activation Success L16@16000hz 1 channel 20ms 2010-07-30 16:05:56.877940 [DEBUG] switch_core_codec.c:116 sofia/external/75115@192.168.0.166 Push codec L16:10 tport_wakeup_pri(0x95bfd98): events IN Is this the correct behavior? I've tried using xlite to connect to the conference, and the audio is good. Also, when connecting from our client, the audio file that gets played by FS to notify how many users are in the conference is good. It's my voice that's bad. I tried to use the echo application instead of the conference. When I call from the BBB client, the sound quality is good. I appreciate any tips on how I can fix the problem or proceed to figure out how to fix it. Thank you very much. Richard -- --- BigBlueButton http://www.bigbluebutton.org http://code.google.com/p/bigbluebutton
OK...figured out what the problem. Flash Player by default sends 2 frames per packet with 20ms of audio (320 samples) per frame. FS expects only a frame every packet. So setting mic.framesPerPacket = 1; in the flash client worked. Here's the complete Actionscript setting in case somebody in the future wants to work with Flash. private function setupMicrophone():void { mic.setUseEchoSuppression(true); mic.setLoopBack(false); mic.setSilenceLevel(0,20000); mic.codec = SoundCodec.SPEEX; mic.gain = 60; mic.framesPerPacket = 1; mic.rate = 16; // use 8 for Nelly LogUtil.debug("codec=SPEEX,gain=60,encodeQuality=10,framesPerPacket=2,rate=16"); } Richard On Fri, Jul 30, 2010 at 5:11 PM, Richard Alam <ritzalam@gmail.com> wrote:
Hi Everyone,
Hopefully, the answer to my problem isn't in the book as I've yet to order it. :)
First off, I'm one ot the devs of BigBlueButton (http://code.google.com/p/bigbluebutton/). We currently use Asterisk for voice conference.
Leif Jackson made BBB work with FreeSWITCH. Now, from BBB, a user can join a voice conference in FS. We have a java SIP client (based on Red5Phone) that calls FS.
All is working well for Ulaw.
I am now trying to make Speex WB work since Flash Player (where our client runs) supports Speex WB. Using Speex WB frees the java SIP client from transcoding between Nellymoser and Ulaw. The java SIP client just takes the speex audio data from RTMP and sends it to FS through RTP.
However, the sound quality is bad. It is choopy and robotic.
Let me describe what I have done and what I found from debugging so far.
I modified vars.xml to add the speex codec. ================ <X-PRE-PROCESS cmd="set" data="global_codec_prefs=speex@16000h@20i,speex@8000h@20i,G7221@32000h,G7221@16000h,G722,PCMU,PCMA,GSM"/> <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=speex@16000h@20i,PCMU,PCMA,GSM"/>
Setup the conference in dialplan/public.xml ================== <extension name="bbb_conferences"> <condition field="destination_number" expression="^(7\d{4})$"> <action application="answer"/> <action application="conference" data="$1@wideband"/> </condition> </extension>
When I start up freeswitch, it looks like it's loading the speex codec fine. Full console log is here http://pastebin.com/rnHfgQYj =============== 2010-07-30 16:04:10.620375 [NOTICE] switch_loadable_module.c:251 Adding Application 'AvoidingDeadlock' 2010-07-30 16:04:10.620658 [CRIT] switch_loadable_module.c:926 Error Loading module /opt/freeswitch/mod/mod_g723_1.so **/opt/freeswitch/mod/mod_g723_1.so: cannot open shared object file: No such file or directory** 2010-07-30 16:04:10.620726 [CRIT] switch_loadable_module.c:926 Error Loading module /opt/freeswitch/mod/mod_g729.so **/opt/freeswitch/mod/mod_g729.so: cannot open shared object file: No such file or directory** 2010-07-30 16:04:10.621189 [CRIT] switch_loadable_module.c:926 Error Loading module /opt/freeswitch/mod/mod_amr.so **/opt/freeswitch/mod/mod_amr.so: cannot open shared object file: No such file or directory** 2010-07-30 16:04:10.621547 [CONSOLE] switch_loadable_module.c:944 Successfully Loaded [mod_ilbc] 2010-07-30 16:04:10.621618 [NOTICE] switch_loadable_module.c:185 Adding Codec 'iLBC' (iLBC) 8000hz 30ms 2010-07-30 16:04:10.621647 [NOTICE] switch_loadable_module.c:185 Adding Codec 'iLBC' (iLBC) 8000hz 20ms 2010-07-30 16:04:10.622043 [CONSOLE] switch_loadable_module.c:944 Successfully Loaded [mod_speex] 2010-07-30 16:04:10.622108 [NOTICE] switch_loadable_module.c:185 Adding Codec 'SPEEX' (Speex) 32000hz 20ms 2010-07-30 16:04:10.622135 [NOTICE] switch_loadable_module.c:185 Adding Codec 'SPEEX' (Speex) 16000hz 20ms 2010-07-30 16:04:10.622160 [NOTICE] switch_loadable_module.c:185 Adding Codec 'SPEEX' (Speex) 8000hz 20ms 2010-07-30 16:04:10.622513 [CONSOLE] switch_loadable_module.c:944 Successfully Loaded [mod_h26x]
When I call into the conference, it looks like mod_conference does not use speex codec but L16@16000hz. ====== 2010-07-30 16:05:56.874138 [DEBUG] sofia.c:4317 Channel sofia/external/75115@192.168.0.166 entering state [completed][200] 2010-07-30 16:05:56.874138 [DEBUG] switch_core_session.c:647 Send signal sofia/external/75115@192.168.0.166 [BREAK] 2010-07-30 16:05:56.874138 [DEBUG] switch_channel.c:2494 (sofia/external/75115@192.168.0.166) Callstate Change RINGING -> ACTIVE 2010-07-30 16:05:56.874138 [NOTICE] mod_dptools.c:746 Channel [sofia/external/75115@192.168.0.166] has been answered EXECUTE sofia/external/75115@192.168.0.166 conference(75115@wideband) 2010-07-30 16:05:56.875481 [DEBUG] mod_conference.c:5237 Raw Codec Activation Success L16@16000hz 1 channel 20ms 2010-07-30 16:05:56.875481 [DEBUG] mod_conference.c:5282 Raw Codec Activation Success L16@16000hz 1 channel 20ms 2010-07-30 16:05:56.877940 [DEBUG] switch_core_codec.c:116 sofia/external/75115@192.168.0.166 Push codec L16:10 tport_wakeup_pri(0x95bfd98): events IN
Is this the correct behavior? I've tried using xlite to connect to the conference, and the audio is good. Also, when connecting from our client, the audio file that gets played by FS to notify how many users are in the conference is good. It's my voice that's bad.
I tried to use the echo application instead of the conference. When I call from the BBB client, the sound quality is good.
I appreciate any tips on how I can fix the problem or proceed to figure out how to fix it.
Thank you very much.
Richard
-- --- BigBlueButton http://www.bigbluebutton.org http://code.google.com/p/bigbluebutton
-- --- BigBlueButton http://www.bigbluebutton.org http://code.google.com/p/bigbluebutton
Stay tuned for mod_rtmp, coming soon to a freeswitch near you. Mike On Jul 30, 2010, at 5:47 PM, Richard Alam wrote:
OK...figured out what the problem.
Flash Player by default sends 2 frames per packet with 20ms of audio (320 samples) per frame. FS expects only a frame every packet. So setting mic.framesPerPacket = 1; in the flash client worked.
Here's the complete Actionscript setting in case somebody in the future wants to work with Flash.
private function setupMicrophone():void { mic.setUseEchoSuppression(true); mic.setLoopBack(false); mic.setSilenceLevel(0,20000); mic.codec = SoundCodec.SPEEX; mic.gain = 60; mic.framesPerPacket = 1; mic.rate = 16; // use 8 for Nelly LogUtil.debug("codec=SPEEX,gain=60,encodeQuality=10,framesPerPacket=2,rate=16"); }
Richard
On Sun, Aug 15, 2010 at 7:45 PM, Michael Jerris <mike@jerris.com> wrote:
Stay tuned for mod_rtmp, coming soon to a freeswitch near you.
Is there a link where I can follow the progress on this module? We are be very interested in helping test this out. Thanks. Richard
Mike
On Jul 30, 2010, at 5:47 PM, Richard Alam wrote:
OK...figured out what the problem.
Flash Player by default sends 2 frames per packet with 20ms of audio (320 samples) per frame. FS expects only a frame every packet. So setting mic.framesPerPacket = 1; in the flash client worked.
Here's the complete Actionscript setting in case somebody in the future wants to work with Flash.
private function setupMicrophone():void { mic.setUseEchoSuppression(true); mic.setLoopBack(false); mic.setSilenceLevel(0,20000); mic.codec = SoundCodec.SPEEX; mic.gain = 60; mic.framesPerPacket = 1; mic.rate = 16; // use 8 for Nelly LogUtil.debug("codec=SPEEX,gain=60,encodeQuality=10,framesPerPacket=2,rate=16"); }
Richard
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- --- BigBlueButton http://www.bigbluebutton.org http://code.google.com/p/bigbluebutton
Hi Richard, I know it has been a while since you posted this, but I encounter the exact same issue you descrive (robotic , bad quality audio from the Mic) when connecting to mod_conference/wideband. I am using the same parameters you posted bellow. Did you actually get it to work OK with all flash clients? In my case it works great with PC's, but on my Mac and Ipad the quality connecting to the wide-band conference is VERY bad. Same machine, using a sip client works great. so its not the mic/network. Any help appreciated. -Bellesoft Richard Alam wrote
OK...figured out what the problem.
Flash Player by default sends 2 frames per packet with 20ms of audio (320 samples) per frame. FS expects only a frame every packet. So setting mic.framesPerPacket = 1; in the flash client worked.
Here's the complete Actionscript setting in case somebody in the future wants to work with Flash.
private function setupMicrophone():void { mic.setUseEchoSuppression(true); mic.setLoopBack(false); mic.setSilenceLevel(0,20000); mic.codec = SoundCodec.SPEEX; mic.gain = 60; mic.framesPerPacket = 1; mic.rate = 16; // use 8 for Nelly
LogUtil.debug("codec=SPEEX,gain=60,encodeQuality=10,framesPerPacket=2,rate=16"); }
Richard
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Conference-and-Speex-Wideband-... Sent from the freeswitch-users mailing list archive at Nabble.com.
participants (3)
-
bellesoft
-
Michael Jerris
-
Richard Alam