Stereo microphones

237 views
Skip to first unread message

brenda...@gmail.com

unread,
Aug 27, 2020, 2:37:57 AM8/27/20
to BigBlueButton-dev
Hi everyone,

I currently have a stereo microphone which I am using in the BBB sessions. Unfortunately, the listeners seem to be receiving the audio in mono.

I believe there are four parts in the whole process that I need to look into:

a. capturing of the microphone input as stereo (audioTrack constraint) in compatibility/sip.js

b. establishing the WebRTC connection (createOffer and createAnswer with stereo=1) between my client and the server

c. processing of the audio in Freeswitch as stereo

d. establishing the WebRTC connection between my viewers and the server (createOffer and createAnswer with stereo=1)

I have checked my code to ensure that a, b and d support stereo but am facing some difficulties with item c.

Would it suffice to just add channels=2 in the "cdquality" section of:

/opt/freeswitch/conf/autoload_configs/conference.conf.xml

and then restart FreeSwitch?

Or am I missing something else?

Thanks in advance!

Martin Thomas SChrott

unread,
Aug 27, 2020, 3:48:18 AM8/27/20
to bigblueb...@googlegroups.com, brenda...@gmail.com

> I have checked my code to ensure that a, b and d support stereo but am
> facing some difficulties with item c.
>
> Would it suffice to just add channels=2 in the "cdquality" section of:
>
> /opt/freeswitch/conf/autoload_configs/conference.conf.xml
>

I guess this should solve it.

Maybe someone who did this could jump in here .. hm. Think Richard did
transfer in stereo...

Anyway, try the channels in conference, maybe this is the only part
missing ;-)


And if you got everything together, please considder a pull request
where you offer the changes as option configurable in the settings - if
you could acomplish that, this would be great.


cheers

Martin


brenda...@gmail.com

unread,
Aug 27, 2020, 3:53:58 AM8/27/20
to BigBlueButton-dev
Thanks Martin, unfortunately I did try adding "channels=2" to the cdquality profile and restarted the FreeSwitch service after that but to no avail. The output was still in mono so I'm trying to find out which part of the processing chain down-mixes the stereo source into mono.

And yes, I would definitely be keen to do a PR to implement this as a configurable setting once I have got this working.

Martin Thomas Schrott

unread,
Aug 27, 2020, 4:05:40 AM8/27/20
to bigblueb...@googlegroups.com, brenda...@gmail.com
try to search the old "crackly audio" threads and see if you find
richards and riccardos posts where stereo transmission was mentioned. I
think if you add your question to that thread, someone who succeeded
would answer and should be able to help you.


cheers

Martin


Martin Thomas Schrott

unread,
Aug 27, 2020, 4:10:39 AM8/27/20
to bigblueb...@googlegroups.com, brenda...@gmail.com
Hi,


found the thread ...

and roberto and Stephen also where talking about that ...

To view this discussion on the web visit
https://groups.google.com/d/msgid/bigbluebutton-setup/01886955-aff0-4a33-ac6f-723f63b97e39%40mtsonline.at.


hope someone can help you there ...

cheers

Martin

--

brenda...@gmail.com

unread,
Aug 27, 2020, 4:20:08 AM8/27/20
to BigBlueButton-dev
Thanks Martin, I'm not in that group so I'm not able to post there but I think I can provide some inputs to resolve the crackling issue because that is also something that happens a lot in the gaming world (especially on VMs).


I believe the key is to configure the VM instance to use MSI instead of the default Line-Based Interrupts.

As for the enabling stereo, I have already done what Roberto and Stephen had mentioned but to no avail, sadly.

sd...@distancelearning.cloud

unread,
Aug 27, 2020, 8:14:42 PM8/27/20
to bigblueb...@googlegroups.com

The major issue with stereo mics,  chrome requires you turn off AEC when you set 2 channel constraint on mic.,  so headphones are required because of loss of echo cancellation.

 

Add 2channels in cdquality will get mod_conference in stereo is correct correct.

 

Try using firefox, stereo will work….

 

Chrome stereo requires you hack the local sdp, and send a remote SDP with stereo the stereo-prop set if I remember correctly. 

 

Safari and IOS will not support any webrtc stereo.

 

I add a stereo prompt to dialplan. That plays sound in left and right channel,  so you can clearly tell webrtc is getting stereo at the endpoint.

 

Regards,

Stephen

--
You received this message because you are subscribed to the Google Groups "BigBlueButton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigbluebutton-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bigbluebutton-dev/49d17442-499a-43bb-8ae7-aa73735565a4n%40googlegroups.com.

brenda...@gmail.com

unread,
Aug 27, 2020, 9:27:18 PM8/27/20
to BigBlueButton-dev

Hi Stephen,

Thanks, I've:

1.    added channels=2 in the cdquality profile in the conference.xml file

2.    modified compatibility/adapter.js by adding sprop-stereo=1 and stereo=1 to "a=rtpmap:0 opus/48000/2\r\n" (in the definition of mediaSectionsInOffer)

3.    added "googEchoCancellation: false" and "echoCancellation: false" in my audio constraints for getUserMedia (mic)

but they don't t seem to make a difference. Do you remember if there were any other aspects that you had to tweak (particularly in sip.js) to get the stereo source to reach the viewers?

Thanks

Bren

sd...@distancelearning.cloud

unread,
Aug 28, 2020, 8:18:23 PM8/28/20
to bigblueb...@googlegroups.com

<X-PRE-PROCESS cmd="set" data="global_codec_prefs=opus@48000h@20i@2c,speex@16000h@20i,speex@8000h@20i,G7221@32000h,G7221@16000h,G722,PCMU,PCMA,GSM,VP8" />

<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=opus@48000h@20i@2c,speex@16000h@20i,PCMU,PCMA,GSM,VP8" />

 

Try forcing in vars.xml

 

Also you can capture the audio in freeswitch, right as it is decoded and save to file, then look at a audio graphically to see if left/right channel are separated before it gets into md_conference.

brenda...@gmail.com

unread,
Aug 28, 2020, 8:38:47 PM8/28/20
to BigBlueButton-dev
Thanks Stephen, that seemed to boost the stream fidelity quite a bit (the audio's very clear and sharp) but still mono though. :(
Reply all
Reply to author
Forward
0 new messages