New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
desktopCapturer
Electron Client Screenshare with Audio Causes Participants to Hear Echo
#27337
Comments
desktopCapturer
Electron Client Screenshare with Audio Causes Participants to hear echodesktopCapturer
Electron Client Screenshare with Audio Causes Participants to Hear Echo
Same issue here. Also trying to capture the audio for one application/window results in getting the entire system audio instead of the audio for that specific application. |
Thanks for reporting this and helping to make Electron better! Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. I'm adding the Thanks in advance! Your help is appreciated. |
Thanks for reporting this and helping to make Electron better! Because of time constraints, triaging code with third-party dependencies is usually not feasible for a small team like Electron's. Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. I'm adding the Thanks in advance! Your help is appreciated. |
I'm closing this as there's no minimal repro available. I'm happy to reopen if you're able to provide a more directed example that shows the issue. |
@nornagon I hope this helps you |
Here’re some findings after struggling with this issue for months.
What I modified: |
Seems to work, should make a PR. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@dx200010 If possible, can you please provide your code snippet or repo with working example. |
Firstly, please make sure you have downloaded full source codes of electron by following official build instruction. Find the if (blink::IsScreenCaptureMediaType(device.type) ||
!blink::MediaStreamAudioProcessor::WouldModifyAudio(
audio_processing_properties)) { to if (//blink::IsScreenCaptureMediaType(device.type) ||
!blink::MediaStreamAudioProcessor::WouldModifyAudio(
audio_processing_properties)) { Then build a modified electron from source, and use this modified electron to build your own application. Now, you can enable echo cancellation by inserting the constraint like below. navigator.mediaDevices.getUserMedia({
audio : {
mandatory: {
echoCancellation: true,
chromeMediaSource: 'desktop'
}
},
video :
{
mandatory :
{
chromeMediaSource : 'desktop'
}
}
}) |
@dx200010 Thanks a lot for the details, But unfortunately this did not work for me. Could it be because of a certain electron version I need to checkout? the version I tried is : 12.0.1 |
Maybe... |
@dx200010 Have you had a chance to try your custom electron build on this repo? |
I point my package.json electron dependency to custom electron build like this Even though I am able to build the app with this, could that be wrong? What is the right way of adding custom electron build to a project? |
@Apak00 Maybe your app was still linked to an unmodified electron. Try launching your app directly from your own built electron for testing, If it does works, then it's just packaging issue. Or, this workaround may just not always works. |
Either way, would love to fix this upstream instead of having to build Electron which is quite time consuming for many. |
I've just built Electron by myself with the proposed patch and I can confirm that it works like a charm with the demo app from @Apak00! Thanks for your great effort to discover this @Apak00 ! Guys, it would really help so much if you could implement this in the officially build. I'd suggest to simply evaluate the (in this case unused) @codebytere, I could try to build a pull request, if you want me to, but I guess you guys will be 100 times faster than me. I have no experience in contributing to the Electron code base. |
@Apak00, I guess you probably solved the issue with packaging your app with a custom Electron build meanwhile. I had the same problem. My impression is that electron-builder is not using the Electron binaries installed in node_modules folder. Instead it seems to just lookup the Electron version number in package.json, but then downloads that Electron version by itself from the server, thus making it impossible to use a private Electron build. I found a way to workaround this by using the win-unpacked folder, by replacing the Electron files by my self-built ones manually. Its not nice, but it works. So in case others ran into the same issue: https://stackoverflow.com/questions/72633870/how-to-use-self-built-electron-binaries-with-electron-builder If someone knows how to properly use a self-built Electron in a an app please let me know/post a better answer on Stackoverflow. ;-) Thanks! |
I guess you are looking for 'electronDist' property on electron-builder configs, here; |
I just ended up writing an entire separate media engine for my app in native C++. Unfortunately, Electron almost never fixes or adds anything unless some major company needs it. |
@Apak00 @berkon I built my own electron with the suggested changes and ran my application from it. Although the |
@bzmaxat, did you see Apak00's post regarding the |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Bump |
FYI |
@nornagon, I tried to use |
@berkon please open a new issue with an example gist. Note that you'll have to install a handler in the main process using setDisplayMediaHandler. |
Support for getDisplayMedia apu does not related to this issue |
@berkon Could you provide an adapted demo? |
Please could someone open pr for this issue? The issue opened 1 year ago but still not solved on Electron codebase. |
Have you re-tested now what |
I did not test getDisplayMedia because has not good browser compatibility |
That's absolutely not true. Also this is Electron we're talking about so even if you were right, that wouldn't apply here. |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
bump |
can anyone share custom electron build with updated(commented or removed) line blink::IsScreenCaptureMediaType(device.type)? |
This should be closed by #37315 |
set |
bump |
I am using the desktop sharing feature of the Electron
desktopCapturer
on our demos. Some of our demos require to share audio of our application. When we share the desktop with audio on desktopCapturer electron client participants start to hear their own voice.Current behavior:
When screen share enabled with audio participant sounds echoing back to themselves.
Expected Behavior:
Only system sounds should be broadcasted to the conference.
Expected Solution:
Behaviour should be converted as same as chrome web client.
Steps:
1- Using
desktopCapturer
Electron2- Share screen with audio
3- Another participant starts to talk. (As a result, hears themself)
Environment:
Windows 10
Electron ^9.2.1
desktopCapturer Electron
The text was updated successfully, but these errors were encountered: