ShayBox / Mon2Cam

Workaround for multi-monitor Discord screensharing
MIT License
337 stars 33 forks source link

Uncaught Error: Xrandr output has changed and this code needs updated #36

Closed benpm closed 3 years ago

benpm commented 3 years ago

Unable to run mon2cam, I get this error on Ubuntu 20.04.1 LTS:

➜  ~ mon2cam -v=log
Exec Context: 45535de0-9b4c-4d5f-b346-df935def5186
    Exec Options:  { verbose: true, output: 3 }
    Exec Command: sudo modprobe -r v4l2loopback
    Exec Command Splits:  [sudo,modprobe,-r,v4l2loopback]
    Exec Result:  { status: { code: 1, success: false }, output: "" }
Exec Context: 45535de0-9b4c-4d5f-b346-df935def5186

Exec Context: 987b2bdd-c5df-4970-9909-d2a009026178
    Exec Options:  { verbose: true, output: 3 }
    Exec Command: sudo modprobe v4l2loopback video_nr=50 'card_label=Mon2Cam'
    Exec Command Splits:  [sudo,modprobe,v4l2loopback,video_nr=50,'card_label=Mon2Cam']
    Exec Result:  { status: { code: 1, success: false }, output: "" }
Exec Context: 987b2bdd-c5df-4970-9909-d2a009026178

error: Uncaught Error: Xrandr output has changed and this code needs updated
        throw new Error("Xrandr output has changed and this code needs updated");
              ^
    at getMonitorInfo (x11.ts:18:9)
    at x11.ts:39:40
    at Array.map (<anonymous>)
    at default (x11.ts:39:26)

Seems like an issue with xrandr, so here is my xrandr version:

➜  ~ xrandr --version
xrandr program version       1.5.0
Server reports RandR version 1.6
➜  ~ sudo apt show libxrandr-dev   
Package: libxrandr-dev
Version: 2:1.5.2-0ubuntu1
Priority: optional
Section: libdevel
Source: libxrandr
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 134 kB
Depends: libxrandr2 (= 2:1.5.2-0ubuntu1), libx11-dev, libxext-dev, x11proto-randr-dev (>= 1.4), libxrender-dev
Download-Size: 25.0 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
➜  ~ sudo apt show libxrandr2   
Package: libxrandr2
Version: 2:1.5.2-0ubuntu1
Priority: optional
Section: libs
Source: libxrandr
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 70.7 kB
Depends: libc6 (>= 2.14), libx11-6 (>= 2:1.6.0), libxext6, libxrender1
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Download-Size: 18.5 kB
APT-Manual-Installed: no
APT-Sources: http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
botiapa commented 3 years ago

@ShayBox Could you have a look at this?

botiapa commented 3 years ago

In the meantime, @benpm could you post the output of xrandr --listactivemonitors

ShayBox commented 3 years ago

yeah I need the output of that command

benpm commented 3 years ago

Here ya go @botiapa @ShayBox

➜  ~ xrandr --listactivemonitors
Monitors: 2
 0: +*DP-2.8 1920/527x1080/296+1920+0  DP-2.8
 1: +DP-4 1920/527x1080/296+0+0  DP-4
ShayBox commented 3 years ago

Try the latest commit, I've never seen monitor names with periods

benpm commented 3 years ago

That seems to have fixed it, thanks!