discord-screenaudio icon indicating copy to clipboard operation
discord-screenaudio copied to clipboard

Screenshare doesn't work

Open RedNekoderr opened this issue 2 years ago • 9 comments

'[userscript] Did not find 'discord-screenaudio-virtmic', trying again in 100ms' is repeated many times in the terminal

RedNekoderr avatar Dec 04 '22 09:12 RedNekoderr

I have the same issue... Did you find any fixes?

tomjeannesson avatar Jan 17 '23 20:01 tomjeannesson

Having same issue here. I'm using arch linux 6.1.9-zen1-1-zen using the AUR package. Did you use the same platform too, @RedNekoderr @tomjeannesson ? Maybe it's just a problem in the AUR package. I will test the flatpack if that fixes the issue

sbritorodr avatar Feb 04 '23 15:02 sbritorodr

Having same issue here. I'm using arch linux 6.1.9-zen1-1-zen using the AUR package. Did you use the same platform too, @RedNekoderr @tomjeannesson ? Maybe it's just a problem in the AUR package. I will test the flatpack if that fixes the issue

I'm on Ubuntu and fixed the issue by changing my audio drivers.

tomjeannesson avatar Feb 04 '23 15:02 tomjeannesson

Flatpak version only lead to more errors and missing deps than the AUR version. Having a quick look at the code without debbuging, it seems the error is in in assets/userscript.js file:

function setGetDisplayMedia(video = true, overrideArgs = undefined) {
  const getDisplayMedia = async (...args) => {
    var id;
    try {
      let myDiscordAudioSink = await getAudioDevice(
        "discord-screenaudio-virtmic"
      );
      id = myDiscordAudioSink.deviceId;
    } catch (error) {
      id = "default";
    }

Somehow cannot find discord-screenaudio-virtmic so it gives the error defined in getAudioDevice(). Virtmic traces back to src/virtmic.cpp. However, have zero knowledge on cpp here, so maybe the problem is there. The file has lots of references to pipewire and creates the discord-screenaudio-virtmic audio device in line 104:

  auto virtual_mic = core.create("adapter",
                                 {{"node.name", "discord-screenaudio-virtmic"},
                                  {"media.class", "Audio/Source/Virtual"},
                                  {"factory.name", "support.null-audio-sink"},
                                  {"audio.channels", "2"},
                                  {"audio.position", "FL,FR"}},
                                 pipewire::node::type, pipewire::node::version,
                                 pipewire::update_strategy::none);

Maybe always has been a problem with pipewire?

sbritorodr avatar Feb 04 '23 15:02 sbritorodr

I'm on Ubuntu and fixed the issue by changing my audio drivers.

Can you please provide more info? This could help us a lot 🙏

sbritorodr avatar Feb 04 '23 15:02 sbritorodr

I've kept searching on this problem. Turns out this code from assets/userscript.js doesn't work:

  await navigator.mediaDevices.getUserMedia({
    audio: true,
  });

Weird fact is my microphone doesn't work either. My guess is the "Allow to use the microphone?" alert when a website requests navigator.mediaDevices.getUserMedia doesn't shown to the user. Any more solutions? Maybe it's related to #78 ?

sbritorodr avatar Feb 04 '23 19:02 sbritorodr

Solved it by adding pipewire-pulse package

sbritorodr avatar Feb 04 '23 23:02 sbritorodr

I'm on Ubuntu and fixed the issue by changing my audio drivers.

Can you please provide more info? This could help us a lot pray

Yeah sure! I used the following advice to change from Pulse to PipeWire. https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/ Hope this helps!

tomjeannesson avatar Feb 05 '23 21:02 tomjeannesson

I'm on Ubuntu and fixed the issue by changing my audio drivers.

Can you please provide more info? This could help us a lot pray

Yeah sure! I used the following advice to change from Pulse to PipeWire. https://ubuntuhandbook.org/index.php/2022/04/pipewire-replace-pulseaudio-ubuntu-2204/ Hope this helps!

Thank you! I've solved the problem by installing pipewire-pulse in my system. It's weird because I've already been using pipewire in my system (Because pulseaudio is completely replaced by it) but for some reason discoord-sa doesn't detect the virtual mic.

My problem was related to this issue #78 in which I've posted my fix too. @RedNekoderr did you fixed i?

sbritorodr avatar Feb 06 '23 16:02 sbritorodr