Setting audio constraint echoCancellation in mediaDevices.getUserMedia result in wrong device

1,007 views
Skip to first unread message

William Thivierge

unread,
Aug 22, 2016, 2:22:25 PM8/22/16
to discuss-webrtc
Hi

We run a webRTC teaching software in Thailand and have had great success up t'il now with our change to webRTC. The video quality and packet loss dissimulation has been of great help in our rural and difficult areas. 

One of the things we still have lots of problem with are local techs using the wrong inputs or wrongly configured (device level AGC can wreck havoc paired with chrome AGC enabled all at once).

We need 2 things in order to achieve audible audio quality from different schools. 

1 - Audio device selection wizard : We provide decent hardware for classes but often our local tech do not select the right inputs in the browser settings. 
Solution: I did a device selection wizard which list using mediaDevices.enumerateDevices(), we pre-select our provided hardware and user can go on selecting the right hardware without even knowing. 

2 - Turning off audio processing : Some classes are in pretty bad shape, they have concrete floors, walls and very little fournitures so the echo can get crazy. In theses cases we want to turn off audio processing and manually adjust volume very low to try and barely hear the students. 

My problem :

Using navigator.mediaDevices.getUserMedia() is necessary to get the user selected inputs and it works flawlessly unless i add optional or mandatory constraint about audio. 

This returns the right device: 


navigator
.mediaDevices.getUserMedia({
            video
: {
                deviceId
: { exact: this.data.videoInputDevice.id },
           
},
            audio
: {
                deviceId
: { exact: this.data.audioInputDevice.id },              
           
}
       
}).then(



while this returns "some" audio devices

navigator.mediaDevices.getUserMedia({
            video
: {
                deviceId
: { exact: this.data.videoInputDevice.id },
           
},
            audio
: {
                deviceId
: { exact: this.data.audioInputDevice.id },
                optional
: [
                   
{ echoCancellation: this.data.audioProcessingEnabled }
               
]
           
}
       
}).then(...


And this returns "some" device as well

navigator.mediaDevices.getUserMedia({
            video
: {
                deviceId
: { exact: this.data.videoInputDevice.id },
           
},
            audio
: {
                deviceId
: { exact: this.data.audioInputDevice.id },
                mandatory
: {
                    echoCancellation
: this.data.audioProcessingEnabled,
               
}


           
}
       
}).then(


I've been looking at the mediaDevices Shim provided by google or at Chromium sources but i can't figure out what is happening and why can't i get both My devices and my desired audio processing. 

If i use navigator.getUserMedia() with echoCancellation to false it works perfectly as well. 

If there a new keyword needed for mediaDevices API ? Is turning Off echo cancellation not available there yet ?

Chrome Version 52.0.2743.116 m

P-Ai

unread,
Apr 3, 2017, 2:49:21 AM4/3/17
to discuss-webrtc
Hi, 

I have exactly the same problem..,

Do you finally find a solution ?

Henrik Lundin

unread,
May 19, 2017, 4:48:17 AM5/19/17
to discuss...@googlegroups.com
What Chrome version has this been tested with recently? The OP says M52, which is now quite some time back.


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/2e911b3f-ce00-4a85-be57-3423be5f8450%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages