Coder Social home page Coder Social logo

Comments (12)

jan-ivar avatar jan-ivar commented on July 23, 2024 1

sometimes (as with headphones on the non-default device with mechanical-path echo), the right device is something else.

Does it matter which device is outputting the echo? The sound being captured is the same. What information is the user agent missing to cancel echo coming from a headset?

from mediacapture-extensions.

zoschfrosch avatar zoschfrosch commented on July 23, 2024 1

Hi, I was asked to describe my usecase in this thread because I made a feature request for a flag to switch off programmatically the new chrome-wide-echo-cancellation: https://bugs.chromium.org/p/chromium/issues/detail?id=1372451

My use case is a platform for vocal coaches and their pupils. They are connected by a WebRTC video session. The coach - let's say he's sitting at the far end of the connection - is able to remotely start and stop the playback of audio sources like midi singing lessons or songs. The pupil sings at the near end of the connection. The playback and the sound of the lessons is played with loudspeakers, and all sound is gathered by a microphone and sent back to the vocal coach.

With the new chrome-wide-echo-cancellation, all audio produced inside Chrome browser is filtered out. The coach does not hear the playback, and even worse, the voice of the singer is completely mangled.

If the chrome://flags/#chrome-wide-echo-cancellation would be removed in a later Chrome version, my platform would be absolutely useless.

I guess that a possibility to specify the source of the echo cancellation reference signal would have the same effect as switching off chrome-wide-echo-cancellation.

from mediacapture-extensions.

alvestrand avatar alvestrand commented on July 23, 2024

In the case where you have the conference on headphones, and have a completely different sound playing on the room-directed speakers, and strong coupling between the headphones and the microphone, cancelling against the room sound is useless; that's not the sound that can cause echoes.

from mediacapture-extensions.

o1ka avatar o1ka commented on July 23, 2024

The echo canceller needs to receive a reference output signal (audio going to the output device) to be canceled from the microphone signal. The echo canceller does not necessarily have an ability to deal with multiple reference output signals (audio streams going to different output devices): canceling multiple outputs with different acoustic paths is much more channeling and resource-demanding problem. Being able to cancel payback of only one physical output is a common limitation of echo cancellation solutions.

In most cases, the audio is played to a default output device. But the application may choose to output audio to a non-default device. If echo cancellation is limited to cancelling playback of a single output device (a common situation), the application needs to be able to specify the output device which playback it wants to cancel from the microphone (i.e. the device the application plays audio to).

from mediacapture-extensions.

o1ka avatar o1ka commented on July 23, 2024

Here may be a possible source of confusion: echo cancellation happens not on the side which experiences (plays) echo. It happens on the side which generates echo. The echo is a playback signal picked up by the microphone and eventually transmitted to the remote end, so that the remote end hears it. The echo canceller processes the microphone signal to remove the playback signal from it, before sending it over to the network. To do so, the echo canceller needs to know what is being played out (the reference signal). The rest - see above.

from mediacapture-extensions.

padenot avatar padenot commented on July 23, 2024

In most cases, the audio is played to a default output device. But the application may choose to output audio to a non-default device. If echo cancellation is limited to cancelling playback of a single output device (a common situation), the application needs to be able to specify the output device which playback it wants to cancel from the microphone (i.e. the device the application plays audio to).

The implementation knows the device to which the important output is routed to for a given application, including after processing/mixing via Web Audio or via multiple HTMLMediaElement in a row, and this should be used as the reverse stream.

Although not perfect, it is a very robust technique in practice, and will work better in the field that something application developers have to do. This has been implemented for years in Gecko.

from mediacapture-extensions.

o1ka avatar o1ka commented on July 23, 2024

The implementation knows the device to which the important output is routed to for a given application, including after processing/mixing via Web Audio or via multiple HTMLMediaElement in a row, and this should be used as the reverse stream.

Although not perfect, it is a very robust technique in practice, and will work better in the field that something application developers have to do. This has been implemented for years in Gecko.

The main problem is what to consider as an important output if an application choses to play different elements to different output devices (simultaneously, or at different points in time).
Also, configuring echo cancellation is not "for free". Depending on the order in which capture and playback are set up by an application, the implementation may have to make a decision on what is the important output and to reconfigure echo cancellation multiple times.

For example, an application may call getUserMedia(), then set up WebAudio playback, and then set up media element playback to a non-default device.
Should it be left to implementation to decide which output will be cancelled? In that case, an application would have zero control over echo cancellation.

from mediacapture-extensions.

alvestrand avatar alvestrand commented on July 23, 2024

@padenot can you reply to the Nov 29 comment?

from mediacapture-extensions.

alvestrand avatar alvestrand commented on July 23, 2024

@padenot after more discussion inside Google, we've decided to follow the "make a heuristic" course at least for the current iteration.
I wonder if I can ask you to explain more about how the Gecko heuristic works - in particular how you tell what the important output is?

from mediacapture-extensions.

alvestrand avatar alvestrand commented on July 23, 2024

Of course, the moment it was shipped, someone came up with an example:

https://crbug.com/687574

from mediacapture-extensions.

Annoraaq avatar Annoraaq commented on July 23, 2024

The situation described by @zoschfrosch does seem like a valid use case to me. Are there any updates on this?

from mediacapture-extensions.

alvestrand avatar alvestrand commented on July 23, 2024

@padenot missing your response on the request from October 2022.

from mediacapture-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.