Coder Social home page Coder Social logo

icedborn / pipewire-screenaudio Goto Github PK

View Code? Open in Web Editor NEW
139.0 7.0 4.0 318 KB

Extension to passthrough pipewire audio to WebRTC Screenshare

Home Page: https://addons.mozilla.org/firefox/addon/pipewire-screenaudio/

License: GNU General Public License v3.0

JavaScript 43.82% HTML 7.90% Shell 42.01% Nix 6.27%
audio firefox firefox-addon firefox-extension pipewire screenshare webrtc

pipewire-screenaudio's Introduction

Welcome visitor



pipewire-screenaudio's People

Contributors

alansartorio avatar andreas02-dev avatar geoku avatar icedborn avatar jim3692 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pipewire-screenaudio's Issues

`Warning` | Deprecated argument for Firefox wrapper

When installing the native component using the NixOS Flakes example in the README, the following warning is shown:

trace: warning: The extraNativeMessagingHosts argument for the Firefox wrapper is deprecated, please use `nativeMessagingHosts`

When changing extraNativeMessagingHosts to nativeMessagingHosts, the native component works correctly without showing warnings.

Audio is not sent when using LibreWolf

Audio isn't transmitted despite the menu being accessible after putting the native bridge in ~/.librewolf. Known issue, putting this here to track any further developments.

The addon does not work "The native connector is misconfigured or missing!"

I am on Arch Linux, I have installed both the pipewire-screenaudio from AUR repo and the addon, I disabled fingerprinting and I checked Allow on all websites.
The addon just shows "The native connector is misconfigured or missing!"

I use version 0.3.4-1 of the native part, not the git version
I use LibreWolf 119.0.1-1
I use pipewire-pulse (pipewire with pulseaudio)

NixOS build still broken

Even after #65 was solved, the NixOS installation still does not work on my system. Given that everything else is the same as a working Arch Linux installation, the most likely explanation is that the native-messaging-modules linking is somehow broken. There is a lib/mozilla/native-messaging-hosts/com.icedborn.pipewirescreenaudioconnector.json under my Firefox folder in the Nix store, but that doesn't seem to do anything; meanwhile there isn't a ~/.mozilla/mozilla/native-messaging-hosts/com.icedborn.pipewirescreenaudioconnector.json but putting it there manually also doesn't seem to do anything.

Improve the installation section of the readme

The installation section could be improved by explicitly stating that you have to install the add-on from the Mozilla store as well. Only having the link on the top right might be not enough.

Nix build broken

The NixOS flake currently seems to be broken, as it does not create an util.sh file under lib/connector. This leads to the following error in the browser console:

stderr output from native app com.icedborn.pipewirescreenaudioconnector: /nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/lib/connector/pipewire-screen-audio-connector.sh: line 5: /nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/lib/connector/util.sh: No such file or directory

Here's the output of running ls -R /nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/:

/nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/:
lib

/nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/lib:
connector  mozilla  out

/nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/lib/connector:
connect-and-monitor.sh  pipewire-screen-audio-connector.sh  virtmic.sh

/nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/lib/mozilla:
native-messaging-hosts

/nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/lib/mozilla/native-messaging-hosts:
com.icedborn.pipewirescreenaudioconnector.json

/nix/store/z5djxzrz902l0anxvcabh233f3r03m29-pipewire-screenaudio/lib/out:

FYI: OpenSUSE package available via OBS.

I have packaged the client software for openSUSE

TL;DR:

Firefox addon:

From the firefox addons website as usual

Client software 1-click install:

Tumbleweed
Leap 15.5

Client software download page:

https://software.opensuse.org//download.html?project=home%3Apallaswept%3Abranches%3Apipewire-screenaudio&package=pipewire-screenaudio
In case you'd prefer to manually install it, there are commands there you can copypaste, or you can download the RPM packages.

About

This package is held on a branch of my personal repository on the public OpenBuildService server, especially for pipewire-screenaudio. I've branched it from my main repository so you can add this one and won't have any concerns about accidentally installing other packages which I build.

It does also exist (in fact it is a link of the package) on my personal repository, so you can get it from there if you prefer - but this special branch for this project, is the 'official' spot to get it.

I am building from the main tree, but it is versioned as per the latest tagged release. So, this is really 'pipewire-screenaudio-git'. If you would like a proper tagged-release version of the package, just reply here and let me know - but I figure using the latest patches is the way to go, so that's just the way I've rolled it.

I will be using this software extensively, so if there are any problems with the git build, I'll roll back this package to the most recent working commit. If you come across any issues with the project's latest commit(s) and I haven't already rolled it back, again just reply here and let me know. Likewise if there is a recent commit and I haven't updated it yet, just let me know.

You're very welcome to branch it or copy it or outright 'steal' it, I don't care, there's no copyright or whatever on any of my work on this. If you have any suggestions or improvements or anything in mind, please do let me know and I'll get right on it.

connect-and-monitor.sh crashes because it fails to link (race condition)

While sharing, connect-and-monitor.sh process crashed. In the logs, I was able to see this:

[connect-and-monitor.sh] [Got New Node ID] ID: 271
[connect-and-monitor.sh] [Got Ports IDs] FL IDs: , FR IDs:

This is most probably a race condition, because we do:
ask for node info -> ask for a full pw-dump to get it's ports -> connect them.

The node can (and probably did) get removed between any of those steps, and it will crash when it reaches pw-link, which returns error exit status when it can't connect.
We either:

  1. Prevent this race condition from occurring between the first and second step by unifying them and getting pw-dump since the beginning and then query that for getting node info and port ids. (kinda costly doing full pw-dump for every node)
  2. Detect the race condition by checking if we successfully got the two ports in the second step (they shouldn't be empty strings).

But then if we lose the node before linking the ports, pw-link fails and because we've set set -e, the script will crash. So I think we should also ignore pw-link exit status code (pw-link ... || true) because we cant prevent this race condition.

Issue initiating screen share on discord

When I try to start a screen share on discord, I am immediately prompted for permission to use to virtmic source (as a 'microphone') but I am not prompted for permission to allow screen sharing and then select a screen to share, as normal. If I then click the screen share button quickly four times (a 'double-double-click') it will prompt me for permission and to select a screen as normal. If I saved the permission to use my voice microphone, I will not be prompted for permission to use the virtmic input, but I still need to do the rapid clicking to trigger the screen share, so I do not believe that the first permission prompt is blocking the second.
This does not occur without the addon enabled.
When I use the multiprocess console, I catch this error, which does suggest that something about the addon is preventing the user interaction from being 'seen' by the browser. (Edit: since it's in a relevant section of the code, yes this is a wayland session, although the same happens in an xwayland browser session (disabling wayland at the environment variables))

Uncaught (in promise) DOMException: getDisplayMedia requires transient activation from a user gesture.
    getDisplayMedia moz-extension://72163595-e19f-46ad-b355-e4831a6065b1/scripts/index.js:54
    get https://discord.com/assets/48449.8469d9c9b1c00451c4ce.js:1
    getDesktopSource https://discord.com/assets/48449.8469d9c9b1c00451c4ce.js:1
    p https://discord.com/assets/5593.46a8a38792be8a6b7f30.js:1
    I https://discord.com/assets/79f9f054693f411f6912.js:1
    onClick https://discord.com/assets/79f9f054693f411f6912.js:1
    eN https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    eB https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    re https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    re https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rt https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rs https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    sE https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    eC https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rs https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    tN https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    tF https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    ri https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rr https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    ro https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    ro https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    createRoot https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    20423 https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    l https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    u https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    O https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    <anonymous> https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    <anonymous> https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
index.js:54
    getDisplayMedia moz-extension://72163595-e19f-46ad-b355-e4831a6065b1/scripts/index.js:54
    InterpretGeneratorResume self-hosted:1475
    AsyncFunctionNext self-hosted:852
    (Async: async)
    get https://discord.com/assets/48449.8469d9c9b1c00451c4ce.js:1
    getDesktopSource https://discord.com/assets/48449.8469d9c9b1c00451c4ce.js:1
    p https://discord.com/assets/5593.46a8a38792be8a6b7f30.js:1
    I https://discord.com/assets/79f9f054693f411f6912.js:1
    onClick https://discord.com/assets/79f9f054693f411f6912.js:1
    eN https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    eB https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    re https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    re https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rt https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rs https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    sE https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    eC https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rs https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    tN https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    tF https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    (Async: EventListener.handleEvent)
    ri https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rr https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    ro https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    forEach self-hosted:4400
    ro https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    createRoot https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    20423 https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    l https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    u https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    O https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    <anonymous> https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    <anonymous> https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
Uncaught (in promise) DOMException: getDisplayMedia requires transient activation from a user gesture.
    getDisplayMedia moz-extension://72163595-e19f-46ad-b355-e4831a6065b1/scripts/index.js:58
    get https://discord.com/assets/48449.8469d9c9b1c00451c4ce.js:1
    getDesktopSource https://discord.com/assets/48449.8469d9c9b1c00451c4ce.js:1
    p https://discord.com/assets/5593.46a8a38792be8a6b7f30.js:1
    I https://discord.com/assets/79f9f054693f411f6912.js:1
    onClick https://discord.com/assets/79f9f054693f411f6912.js:1
    eN https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    eB https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    re https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    re https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rt https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rs https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    sE https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    eC https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rs https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    tN https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    tF https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    ri https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    rr https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    ro https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    ro https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    createRoot https://discord.com/assets/65573.3d56d56002765d7a9da8.js:1
    20423 https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    l https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    u https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    O https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    <anonymous> https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1
    <anonymous> https://discord.com/assets/web.bfd593fa9b13cdc9724f.js:1

I hope this helps!

I also just noticed, that when I click the screen share button, my microphone icon changes to red briefly (for about 2 seconds) before turning white again. It starts like so:
image
and changes to this for ~2 seconds:
image

Initial minor issues - not sure if normal?

Apologies for the further delay in getting the OpenSUSE package out. I had it 'working' for some time, but wanted to test it further as I did have some issues, and I wanted to make sure it was my system and the package was really OK.... but I've had it working flawlessly (NICE!) so I'm satisfied that this package should be fine to release.

As for the problems I had:

Pipewire quantum:
I found it was not compatible with the small (128/48000) pipewire quantum I usually configure for Firefox, and I needed to relax the timings significantly. Maybe you'll have better luck than I, but I couldn't get it to run properly with less than a 480/48000 (10ms) quantum which it selected by default, but I normally override it. and because I stick to powers-of-2 quanta, that means going up to 512/48000. Your mileage may vary, but if you find it working but the receiving end is cutting in and out, and you don't see any xruns (ERR column in pw-top) and you manually modify Firefox's quantum, this will be why. Stock pipewire installations should not suffer from this, their default quanta are well within the safe range.

Starting the share:
I found that the screen sharing was a little difficult to trigger. When you first click the 'Share your Screen' button in Discord, you will be prompted for permission to use a "microphone" - this is the pipewire-screenaudio virtual device, so be sure to pick that out of the list if it is not pre-selected - you don't want to actually select your microphone here. That should be allowed when you first join a voice channel. If you tick the "Remember this decision" checkbox, then it won't prompt you in future - but nor will it prompt you for permission to use your normal mic, so keep that in mind.

After this prompt to allow the 'microphone', or if you did tick the "Remember this decision" checkbox then immediately upon pressing the "Share your Screen" button, you should be prompted to select which screen to share. With this Firefox extension addon installed, that seems not to happen. I expect this is either a Firefox or KDE or discord bug of some sort, triggered by this add-on, but not an actual bug with this addon. The solution is not exactly scientific, but it is what it is: clicking several times quickly (a double-double click seems to do the trick every time or by clicking and holding, then releasing and quickly clicking again....but clicking fast seems to be the most effective way. Trouble is, you don't want to click too fast, or you'll miss the permission prompt. I recommend the double-double-click approach.

Brief false error message:
In a brand-new Firefox profile, I did not suffer this, but in my normal profile, when I open the application popup to select an audio stream to share, I see for a fraction of a second, an error message stating that "The native connector is misconfigured or missing!". This disappears so quickly I had to try like 10 times to be so fast as to press the key to screenshot it, and then everything works just fine. It looks like so, just for a that brief moment. There's nothing wrong with the connector or its configuration (as you will see when you get it working) so again, I suspect this is a Firefox bug:
image

WebRTC security plugin conflict:
I use an addon which disables WebRTC, for privacy/anti-fingerprinting reasons (I don't like ads targeting me). Obviously, I usually disable it before opening a discord session where I plan to use voice/video. It is required to enable WebRTC BEFORE selecting an audio stream from this plugin (specifically, it has to happen before the addon creates the virtual device). So, the order of events goes:
Enable WebRTC > Select audio source > open discord webpage

My thoughts on all this:
I'm unsure of whether these are issues specific to me, known issues, something actually broken, or considered normal working intended behaviour, so let me know which, if any, of these I should file a separate issue for. My thoughts on this:

The need for a relatively large quantum seems plausibly normal but a little odd, I certainly have no issues with my usual 128 quantum streaming from virtual devices over WebRTC (eg my real mic is at 128 quantum via a filter chain virtual device, I can link videos in YouTube to a virtual loopback device and stream that over WebRTC tests or discord's chat, etc), so I think perhaps there might be something up with the virtual device or perhaps Firefox's capture (strong chance this is it, because the capture was requesting 480/48000 even with the pulse env vars set and rules specifying 128/48000 and the rest of Firefox running at 128/48000 quantum - so this might be a Firefox bug) and that may need an issue filed for it. Please note this related but in firefox you'll need to know about that workaround I found, in order to get Firefox to abide by rules you set in pipewire-pulse.conf[.d], to get the lower quantum (TL;DR you need to use the PULSE_LATENCY or PULSE_LATENCY_MS environment variables, it will not follow those properties you command via those variables, but their usage will make Firefox follow rules you set in wireplumber, which it will otherwise ignore)

The weird partially unresponsive 'Share your Screen' button may be a KDE thing or a discord thing or a Firefox thing, it does only happen with this addon enabled, though, so perhaps that should have an issue filed against it, perhaps not? Do you guys get this same behaviour?

The brief error message is definitely related to my Firefox profile, a clean profile didn't do it - but it is strange because it is a false negative (as in, it says something's wrong, but there's not) so I think this might need an issue to fix it on this end.

The conflict with the Disable WebRTC addon seems normal and correct, although I can imagine that it could be possible to code this addon such that the WebRTC initialisation occurs when the outputs of this device are linked (to Firefox's inputs for the stream) rather than when the inputs are linked (to the source of audio to be shared) so perhaps this could be fixed here?

As for the severity of these issues: The need for an unusually large quantum that is normally not needed, is a fairly big problem because it taints the entire pipewire graph and negatively impacts the performance of the entire machine. The busted up button is a problem because it makes it really hard to change streams, you basically have to remove the permission to share the screen and then share it again, which kills your stream, which would be an annoyance to anyone watching it since they'd have to re-connect. The false error message is inconsequential but probably undesirable from the developer's perspective. The conflict with the Disable WebRTC addon seems normal and not difficult to avoid, but could probably be improved at this end.

Improve node filtering/blacklisting

Filter nodes by a user-chosen combination of any of the following properties:

  • application.process.binary
  • media.name
  • node.name

Nodes hidden using the extension's "Hide" button, should also be blocked from All Desktop Audio, if the user enables that option.

Audio Pitching fixed in Firefox Beta 120

We could update the README, telling that people can use Firefox Beta, as a more stable alternative to Firefox Nightly, to get rid of Audio Pitching until December 5th.

I was able to stream audio without distortions from Firefox 120.0b2 (AUR) to Firefox 118.0.2 (Nix).

Related to #22

Dropouts if plugin source sink is not otherwise connected

I noticed during testing, that when I selected a source, it would link to the virtmic capture ports, and it would share as expected - However if I then un-linked the ports from my normal audio sinks, leaving it only linked to the virtmic sink (so that it could not be heard locally), then it would cause dropouts/long stuttering, at the receiving end

For example there would be sound for ~0.5 seconds, then silence for ~2.5 seconds, and that would repeat quite rhythmically. I cannot help but notice the ratio is related to the fact that there are 6 audio outputs from the sink and and only 2 being captured by the virtmic device, but I do not have any 2 channel sources to test this, as all of my clients are upmixed (although I could alter my config for testing, but perhaps you will be able to see if you can reproduce this, if you do not use upmixed sources)

Allowing/forcing a larger quantum request from firefox seemed to work around this issue, but is undesirable as it increases latency.

I would not consider this urgent as this is probably not a real problem in most real scenarios where you would also be listening to whatever source you are sharing, but I can think of scenarios where disconnecting that source might be desirable (so you can play something to someone else but don't have to hear it)

Shell script function `intToBin` seems to be incompatible with Debian-based systems

The following line:

    xargs -I {} sh -c "printf '{}'" # Return raw bytes

seems semantically ambiguous in terms of how an escaped stdin sequence should be treated inside the "printf '{}'" argument. Apparently, on some systems, sh’s builtin printf command is capable of unescaping the format string on its own, while on others (particularly where sh is a symlink to dash) it is not.

(For reference, POSIX standard only defines octal \0NN/\1NN/\2NN/\3NN sequences for shell’s printf, but not hexadecimal \xNN ones.)

Please investigate this in more detail, and implement a solution which does not rely on such obscure semantic intricacies (for example, by using xxd -r -p - stage).

Can't build - Source Directory "pipewire-screenaudio/native/pipewire-screenaudio/rohrkabel" does not contain a CMakeLists.txt file

I did the following commands:

git clone https://github.com/IceDBorn/pipewire-screenaudio.git
cd pipewire-screenaudio/native
bash build.sh

However, the "rohrkabel" directory seems empty, which gives the following error when running bash build.sh.

-- The C compiler identification is GNU 13.1.1
-- The CXX compiler identification is GNU 13.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at pipewire-screenaudio/CMakeLists.txt:19 (add_subdirectory):
The source directory

/home/user/Downloads/pipewire-screenaudio/native/pipewire-screenaudio/rohrkabel

does not contain a CMakeLists.txt file.

-- Configuring incomplete, errors occurred!

I managed to narrow down the problem to the fact that it was a git submodule that wasn't initiated, which I fixed by running: git submodule update --init --remote --recursive at the root of the git repo.

A more permanent fix would be to include the --recursive argument when cloning this repo, you should update the README to include this.
In short, instead of:
git clone https://github.com/IceDBorn/pipewire-screenaudio.git
It should be:
git clone --recursive https://github.com/IceDBorn/pipewire-screenaudio.git

React/MUI port

UX/UI

  • Popup

Basic functions

  • Start
  • Stop

Features

  • Change nodes on the fly
  • Multiple nodes selection
  • All Desktop Audio

Bad audio quality on Discord.

The audio quality isn't anywhere near the audio quality that you get on Windows when screensharing. Maybe on Windows it bypasses some audio processing which is applied otherwise with this addon?

For testing I recommend opening two clients, enabling the addon on one and then just disabling the audio output from Spotify for example to internal stereo but keeping the output from the second client enabled so you hear only the screenshare audio.

Duplicated audio

First of all, thanks for this! It's the best tool for discord streaming I've found so far. No fps drops, good video, audio... But when I stream with audio (first I select the audio, desktop or the app, tried both) but I hear the app twice, for some reason, and I can't seem to be able to silence that second one without silencing the original one.
This is using discord on Firefox 115.0.2.
Any idea?

What is the "correct" way to re-add voice input?

I am using this extension to stream on discord calls on Manjaro Firefox. Everything works as advertised, but when I point the Discord microphone to pipewire-screenaudio, regardless of which audio source I choose (including [all desktop audio]), my voice no longer gets picked up. I can use Helvum to re-attach the microphone to the WebRTC engine, but that also means I cannot individually modify the volume of my talking and the audio being streamed, and those in the chat are telling me that my voice is very soft. What is the correct way to re-add voice to mitigate this issue? Helvum setup has been attached, linked to a video I have open on Firefox and the microphone, and feeding back to Discord's mic testing.
image

Having a second tty session breaks discord "audio duplication" workaround

We use a command to detect if session type is Wayland or x11. And apparently, the command prints a line for each session open, and the extension decides that it shouldn't use the discord workaround because sessionType = null.

Example of the command printing multiple lines:

> loginctl show-session $(awk '/tty/ {print $1}' <(loginctl)) -p Type | awk -F= '{print $2}'
tty

wayland

Blacklisting All Desktop Audio

If I click to hide the [All Desktop Audio] option, the entry in Local Storage looks like this:

blacklistedNodes: "[{"name":""}]"

Share All Desktop Audio crashes when starting it without nodes

The problem comes from using contains($streamIds) because if there's no initial nodes, it ends up being contains(), and that causes an error. The line that causes it is:

cat "$fullDumpFile" | jq -c "[ .[] | select(.type == \"PipeWire:Interface:Port\") | select(.info.direction == \"output\") | select(.info.props[\"node.id\"] | contains($streamIds)) ]" > $portsFile

The error produced by jq is:

jq: error: syntax error, unexpected ')' (Unix shell quoting issues?) at <top-level>, line 1:
[ .[] | select(.type == "PipeWire:Interface:Port") | select(.info.direction == "output") | select(.info.props["node.id"] | contains()) ]   

Virtmic outputs audio to yourself

Hello,

It seems that while streaming, you can hear the audio of the stream, resulting in hearing the application you are streaming twice (with a small delay).

Current system:

Void Linux (kernel 6.5.12)
Pipewire 0.3.85
Firefox 120
Xorg server 21.1.9
KDE Plasma 5.27

Individual volume control for each shared node

Passing the audio streams of shared nodes over new virtual nodes with the additional arg monitor.channel-volumes = true would allow us to have separate volume controls for each of those nodes.

Audio pitching info

For me Firefox 117 didn't fix anything in relation to audio pitching. It behaves absolutely the same as before.

But today I've made a discovery: when my stream is already going and the receiving end is hearing heavily distorted audio, it turns out it can be fixed by going to the Voice & Video section of Discord's settings and making any change to the "Input Device" dropdown. For example, I have my Razer mic selected there, so I switch to anything else. As soon as I do this, audio pitching is immediately fixed on the fly. Then I switch the dropdown back to my Razer mic, and the audio stays fixed.

TL;DR steps:

  1. Share a node using the extension and start your stream (viewer hears distorted audio);
  2. Go to Voice & Video settings in Discord;
  3. Change "Input Device" from your mic to anything else;
  4. Audio is immediately fixed;
  5. Change "Input Device" back to your mic.

It works even in Firefox 116. Firefox 117 didn't change anything.

AudioCallbackDriver no longer exists

It looks like in Firefox 121, the input nodes are no longer named AudioCallbackDriver, but they have the name of the tab or the frame which contains the call, in the media.name field.

Maybe we could utilize the injected script to get the title of the page and add it to the ignore list.

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.