any1 / wayvnc Goto Github PK
View Code? Open in Web Editor NEWA VNC server for wlroots based Wayland compositors
License: ISC License
A VNC server for wlroots based Wayland compositors
License: ISC License
I'm trying to wrap wayvnc into a systemd unit, but it bulges for:
07:02:00 Tue Mar 17 jobs:1 root@ punraz :~# systemctl status wayvnc
● wayvnc.service - "Wayland VNC server"
Loaded: loaded (/etc/systemd/user/wayvnc.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2020-03-17 07:02:00 CET; 2s ago
Process: 6894 ExecStart=/usr/local/bin/wayvnc --config=${CNFG_FILE} (code=exited, status=1/FAILURE)
Main PID: 6894 (code=exited, status=1/FAILURE)Mar 17 07:02:00 punraz systemd[1]: Started "Wayland VNC server".
Mar 17 07:02:00 punraz wayvnc[6894]: error: XDG_RUNTIME_DIR not set in the environment.
Mar 17 07:02:00 punraz wayvnc[6894]: ERROR: Failed to initialise wayland
Mar 17 07:02:00 punraz systemd[1]: wayvnc.service: Main process exited, code=exited, status=1/FAILURE
Mar 17 07:02:00 punraz systemd[1]: wayvnc.service: Failed with result 'exit-code'.
That's the unit definition:
cat /etc/systemd/user/wayvnc.service
[Unit]
Description="Wayland VNC server"[Service]
Environment="CNFG_FILE=/usr/local/etc/wayvnc.cnfg"
ExecStart=/usr/local/bin/wayvnc --config=${CNFG_FILE}[Install]
WantedBy=multi-user.target
When I run wayvnc from unpriviliged user it works better. Unpriviliged apparently has XDG_* environment variables set.
When I transported these environment variables to the systemd unit into its Environment=, I still ran into issues.
Please advice.
Not all platforms support offscreen OpenGL rendering. It would be nice to offer software rendering too.
Despite having fedora 31 and wayland-devel 1.17.0, I consistently run into the wrong wl_seat getting bound:
wl_registry@2: error 0: invalid version for global wl_seat (16): have 5, wanted 7
ERROR: Virtual Pointer protocol not supported by compositor.
ERROR: Failed to initialise wayland
This happens both when compiling locally via the description in the readme, and when trying the wef/wayvnc copr described in another issue.
I double checked 1.17.0, the latest version available for fedora 31, and the version of wl_seat truly is 7: https://github.com/wayland-project/wayland/blob/1.17.0/protocol/wayland.xml#L1665
Not sure what is providing wl_seat 5, but as long as it is apparently available on my system wayvnc is failing.
I tried to install the port and bumped into a crash:
wayvnc
Illegal instruction (core dumped)
Build the port with debug support I get this:
lldb build/wayvnc
(lldb) target create "build/wayvnc"
Current executable set to 'build/wayvnc' (x86_64).
(lldb) r
Process 17418 launching
Process 17418 launched: '/usr/ports/net/wayvnc/work/wayvnc-0.1.2/build/wayvnc' (x86_64)
DEBUG: OpenGL ES 3.1 Mesa 18.3.2
Process 17418 stopped
* thread #1, name = 'wayvnc', stop reason = signal SIGILL: privileged instruction
frame #0: 0x00000008003e7136 libneatvnc.so.0`nvnc_open + 166
libneatvnc.so.0`nvnc_open:
-> 0x8003e7136 <+166>: vxorps %xmm0, %xmm0, %xmm0
0x8003e713a <+170>: vmovaps %xmm0, -0x40(%rbp)
0x8003e713f <+175>: movb $0x2, -0x3f(%rbp)
0x8003e7143 <+179>: movq %r15, %rdi
(lldb) bt
* thread #1, name = 'wayvnc', stop reason = signal SIGILL: privileged instruction
* frame #0: 0x00000008003e7136 libneatvnc.so.0`nvnc_open + 166
frame #1: 0x00000000002078a4 wayvnc`init_nvnc(self=0x00007fffffffe3c0, addr="127.0.0.1", port=5900) at main.c:428:15
frame #2: 0x0000000000208965 wayvnc`main(argc=1, argv=0x00007fffffffeac8) at main.c:809:6
frame #3: 0x000000000020710f wayvnc`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:76:7
(lldb) disas
libneatvnc.so.0`nvnc_open:
0x8003e7090 <+0>: pushq %rbp
0x8003e7091 <+1>: movq %rsp, %rbp
0x8003e7094 <+4>: pushq %r15
0x8003e7096 <+6>: pushq %r14
0x8003e7098 <+8>: pushq %r13
0x8003e709a <+10>: pushq %r12
0x8003e709c <+12>: pushq %rbx
0x8003e709d <+13>: subq $0x28, %rsp
0x8003e70a1 <+17>: movl %esi, %r14d
0x8003e70a4 <+20>: movq %rdi, %r15
0x8003e70a7 <+23>: movq 0x192d2(%rip), %r13
0x8003e70ae <+30>: movq (%r13), %rax
0x8003e70b2 <+34>: movq %rax, -0x30(%rbp)
0x8003e70b6 <+38>: movl $0x1, %edi
0x8003e70bb <+43>: movl $0x210, %esi ; imm = 0x210
0x8003e70c0 <+48>: callq 0x8003fe480 ; symbol stub for: calloc
0x8003e70c5 <+53>: testq %rax, %rax
0x8003e70c8 <+56>: je 0x8003e71c1 ; <+305>
0x8003e70ce <+62>: movq %rax, %r12
0x8003e70d1 <+65>: movabsq $0x434e56207461654e, %rax ; imm = 0x434E56207461654E
0x8003e70db <+75>: movq %rax, 0xc8(%r12)
0x8003e70e3 <+83>: movb $0x0, 0xd0(%r12)
0x8003e70ec <+92>: xorl %ebx, %ebx
0x8003e70ee <+94>: movl $0x2, %edi
0x8003e70f3 <+99>: movl $0x1, %esi
0x8003e70f8 <+104>: xorl %edx, %edx
0x8003e70fa <+106>: callq 0x8003fe490 ; symbol stub for: socket
0x8003e70ff <+111>: movl %eax, 0x8(%r12)
0x8003e7104 <+116>: testl %eax, %eax
0x8003e7106 <+118>: js 0x8003e71c3 ; <+307>
0x8003e710c <+124>: movl $0x1, -0x44(%rbp)
0x8003e7113 <+131>: leaq -0x44(%rbp), %rcx
0x8003e7117 <+135>: movl %eax, %edi
0x8003e7119 <+137>: movl $0xffff, %esi ; imm = 0xFFFF
0x8003e711e <+142>: movl $0x4, %edx
0x8003e7123 <+147>: movl $0x4, %r8d
0x8003e7129 <+153>: callq 0x8003fe4a0 ; symbol stub for: setsockopt
0x8003e712e <+158>: testl %eax, %eax
0x8003e7130 <+160>: js 0x8003e71b7 ; <+295>
-> 0x8003e7136 <+166>: vxorps %xmm0, %xmm0, %xmm0
0x8003e713a <+170>: vmovaps %xmm0, -0x40(%rbp)
0x8003e713f <+175>: movb $0x2, -0x3f(%rbp)
0x8003e7143 <+179>: movq %r15, %rdi
0x8003e7146 <+182>: callq 0x8003fe4b0 ; symbol stub for: __inet_addr
0x8003e714b <+187>: movl %eax, -0x3c(%rbp)
0x8003e714e <+190>: rolw $0x8, %r14w
0x8003e7153 <+195>: movw %r14w, -0x3e(%rbp)
0x8003e7158 <+200>: movl 0x8(%r12), %edi
0x8003e715d <+205>: leaq -0x40(%rbp), %rsi
0x8003e7161 <+209>: movl $0x10, %edx
0x8003e7166 <+214>: callq 0x8003fe4c0 ; symbol stub for: bind
0x8003e716b <+219>: testl %eax, %eax
0x8003e716d <+221>: js 0x8003e71b7 ; <+295>
0x8003e716f <+223>: movl 0x8(%r12), %edi
0x8003e7174 <+228>: movl $0x10, %esi
0x8003e7179 <+233>: callq 0x8003fe4d0 ; symbol stub for: listen
0x8003e717e <+238>: testl %eax, %eax
0x8003e7180 <+240>: js 0x8003e71b7 ; <+295>
0x8003e7182 <+242>: callq 0x8003fe4e0 ; symbol stub for: uv_default_loop
0x8003e7187 <+247>: movq %r12, %rbx
0x8003e718a <+250>: addq $0x10, %rbx
0x8003e718e <+254>: movl 0x8(%r12), %edx
0x8003e7193 <+259>: movq %rax, %rdi
0x8003e7196 <+262>: movq %rbx, %rsi
0x8003e7199 <+265>: callq 0x8003fe4f0 ; symbol stub for: uv_poll_init
0x8003e719e <+270>: leaq 0x4b(%rip), %rdx ; ___lldb_unnamed_symbol1$$libneatvnc.so.0
0x8003e71a5 <+277>: movq %rbx, %rdi
0x8003e71a8 <+280>: movl $0x1, %esi
0x8003e71ad <+285>: callq 0x8003fe500 ; symbol stub for: uv_poll_start
0x8003e71b2 <+290>: movq %r12, %rbx
0x8003e71b5 <+293>: jmp 0x8003e71c3 ; <+307>
0x8003e71b7 <+295>: movl 0x8(%r12), %edi
0x8003e71bc <+300>: callq 0x8003fe510 ; symbol stub for: close
0x8003e71c1 <+305>: xorl %ebx, %ebx
0x8003e71c3 <+307>: movq (%r13), %rax
0x8003e71c7 <+311>: cmpq -0x30(%rbp), %rax
0x8003e71cb <+315>: jne 0x8003e71df ; <+335>
0x8003e71cd <+317>: movq %rbx, %rax
0x8003e71d0 <+320>: addq $0x28, %rsp
0x8003e71d4 <+324>: popq %rbx
0x8003e71d5 <+325>: popq %r12
0x8003e71d7 <+327>: popq %r13
0x8003e71d9 <+329>: popq %r14
0x8003e71db <+331>: popq %r15
0x8003e71dd <+333>: popq %rbp
0x8003e71de <+334>: retq
0x8003e71df <+335>: callq 0x8003fe520 ; symbol stub for: __stack_chk_fail
Let me know if there more info I can get!
Output scaling has not been implemented. Trying to run wayvnc with scaled outputs results in errors like these:
TightVNC client: "Error in TightVNC Viewer: Error in protocol size: incorrect size of rectange".
RealVNC: "Attempting to reconnect to VNC Srever... RFB protocol error: bad rectangle: 32x32 at 1760x192 exceeds 1599x899 at 0x0"
Sometimes the bad rectangle is 64x32.
wlr-randr
:
eDP-1 "Sharp Corporation 0x148B 0x00000000 (eDP-1)"
Physical size: 290x170 mm
Enabled: no
Modes:
3840x2160 px, 59.997002 Hz (preferred)
3840x2160 px, 47.997002 Hz
When the selected output is a headless output, it should be possible to resize the output according to the client's wishes. This should be turned on using a command line flag or a config variable.
It was recently discovered that the direction of transformations was wrongly implemented in wlroots. wayvnc needs to align with recent changes.
Connecting from the same session (where wayvnc is running) regressed by #66 (630e2e6) but connecting more than once was broken even in v0.2.0
.
Same session:
$ wayvnc
DEBUG: Set nvnc buffer: 0x801223150
../subprojects/neatvnc/src/server.c:886: OOM
^C
$ wlvncc 127.0.0.1
28/09/2020 20:59:04 VNC server closed connection
Failed to connect to server
Exiting...
$ pkg install tigervnc-viewer
$ vncviewer 127.0.0.1
TigerVNC Viewer 64-bit v1.10.1
Built on: 2020-09-24 19:10
Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Mon Sep 28 20:57:23 2020
DecodeManager: Detected 8 CPU core(s)
DecodeManager: Creating 4 decoder thread(s)
CConn: Connected to host 127.0.0.1 port 5900
CConn: End of stream
Dedicated session:
$ echo "exec wayvnc" >/tmp/sway-vnc.conf
$ swaymsg 'for_window [app_id="wlroots"] floating enable'
$ sway -c /tmp/sway-vnc.conf
DEBUG: Set nvnc buffer: 0x801223150
../subprojects/neatvnc/src/server.c:928: New client connection: 0x8012e7400 (ref 1)
DEBUG: symbol=Super_L level=0 code=LWIN pressed
../subprojects/neatvnc/src/server.c:817: Client 0x8012e7400 (1) hung up
../subprojects/neatvnc/src/server.c:89: client_close(0x8012e7400): ref 0
../subprojects/neatvnc/src/server.c:886: OOM
^C
$ wlvncc 127.0.0.1
28/09/2020 21:09:06 VNC server supports protocol version 3.8 (viewer 3.8)
28/09/2020 21:09:06 We have 1 security types to read
28/09/2020 21:09:06 0) Received security type 1
28/09/2020 21:09:06 Selecting security type 1 (0/1 in the list)
28/09/2020 21:09:06 Selected Security Scheme 1
28/09/2020 21:09:06 No authentication needed
28/09/2020 21:09:06 VNC authentication succeeded
28/09/2020 21:09:06 Desktop name "WayVNC"
28/09/2020 21:09:06 Connected to VNC server, using protocol version 3.8
28/09/2020 21:09:06 VNC server default format:
28/09/2020 21:09:06 32 bits per pixel.
28/09/2020 21:09:06 Least significant byte first in each pixel.
28/09/2020 21:09:06 TRUE colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Exiting...
$ wlvncc 127.0.0.1
28/09/2020 21:09:17 VNC server closed connection
Failed to connect to server
Exiting...
Go through TODOs in wayvnc and neatvnc that cause abort()
or exit and make sure that they have error messages attached to them.
Read the name assigned to each display and select the display based on it's name rather than its id.
These build instructions left me slightly confused, since there appears to be no subprojects directory and I wasn't entirely sure about how the layout is supposed to look like:
The easiest way to satisfy the neatvnc and aml dependencies is to link to them
in the subprojects directory:
git clone https://github.com/any1/wayvnc.git
git clone https://github.com/any1/neatvnc.git
git clone https://github.com/any1/aml.git
mkdir wayvnc/subprojects
cd wayvnc/subprojects
ln -s ../../neatvnc .
ln -s ../../aml .
cd -
And it made me wonder, why aren't these subprojects already present as git submodules such that a simple git submodule init --update
would do the job? Seems like that'd be the more standardized, less surprising version that most are already familiar with
Hey, thanks for this awesome program!
I wonder if there's any way to start wayvnc in "view only"-mode and if not whether that is something relatively easy to implement?
I'm not very knowledgeable when it comes to seat mgmt in sway as I never had much need for it but I did try disabling the virtual pointer/keyboard inputs, but that didn't seem to do anything.
Please maybe release it as a rpm in a copr
https://copr.fedorainfracloud.org/coprs/
When I press compose on my local keyboard:
ERROR: Failed to look up keyboard symbol: Multi_key
For reproducing: compose can be enabled, for example, with xkb_options shift:both_capslock_cancel,compose:caps
in sway config. This maps it to Caps lock and makes both shifts pressed together act like caps lock, one cancels.
Research frame damage checking on the GPU. This has the potential to be much more efficient than checking every pixel on the CPU.
I use Gentoo compiled nearly without any X protocol in it
After starting wayvnc those both messages came up
DEBUG: OpenGL ES 3.2 Mesa 20.0.6
ERROR: Failed to initialise renderer
i don't get what is missing or what he trys to initialise. There is no log
Previously, I could unlock my sway instance remotely using wayvnc... now any attempt to send input to the wayvnc server when swaylock is enabled results in the server dying due to assert(!self->front).
So perhaps commit a6e1ba2?
Some displays may be rotated or flipped. Get the transformation from the compositor and apply to the received frames while rendering. This shall be done in a shader.
I'm encountering a segfault when starting wayvnc from within an ssh session, even with WAYLAND_DISPLAY and SWAYSOCK set. wayvnc is 0.2.0, neatvnc is 0.2.0, and aml is 0.1.0.
I expect this isn't hard to reproduce, but if it is please let me know.
I am using a special keyboard configuration in sway. If I start wayvnc, sway "forgets" the keyboard options I have set, until I reload the configuration with ctrl-c.
I also tried to set those settings manually via swaymsg and it did not work. While there was no error message, the settings were note changed
sway/config:
input type:keyboard {
xkb_layout de
xkb_variant us
xkb_options lv3:caps_switch
}
Trying to set the configuration via swaymsg:
swaymsg input type:keyboard xkb_layout de
swaymsg input type:keyboard xkb_variant us
swaymsg input type:keyboard xkb_options lv3:caps_switch
Excerpt of output of swaymsg -t get_inputs in error case
Input device: Wooting WootingOne
Type: Keyboard
Identifier: 1003:65281:Wooting_WootingOne
Product ID: 65281
Vendor ID: 1003
Active Keyboard Layout: English (US)
Libinput Send Events: enabled
Excerpt of output of swaymsg -t get_inputs after reloading config
Input device: Wooting WootingOne
Type: Keyboard
Identifier: 1003:65281:Wooting_WootingOne
Product ID: 65281
Vendor ID: 1003
Active Keyboard Layout: German (US, with German letters)
Libinput Send Events: enabled
swaymsg -t get_version
sway version 1.4
This issue is related to swaywm/sway#5120
Just out of curiosity, why did you decide to switch to pixman?
If wayvnc is started with -o and then that input is taken away (in my case, from unplugging an hdmi cable from my laptop), the wayvnc process went to 168% CPU usage on my laptop, and all the negative things that go along with that.
Is this expected behavior?
I get input with the same setup without that var, how do I launch it in headless with input? I tried libinput,headless
but that freezed my tty till I killed it, libinput,drm,headless
crashes with an error failed to parse dbus propertieschanged
.
I encountered this crash while changing the resolution of the headless output, and reloading sway:
wayvnc: ../src/main.c:538: wayvnc_process_frame: Assertion `height == nvnc_fb_get_height(self->buffer)' failed.
>>> bt full
#0 0x00007fb5da555761 in raise () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00007fb5da53f55b in abort () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2 0x00007fb5da53f42f in ?? () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#3 0x00007fb5da54e092 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#4 0x000056225c4cdfc2 in wayvnc_process_frame (self=0x7ffc930c09b0) at ../src/main.c:538
format = 875709016
width = 3000
height = 2001
is_first_frame = false
__PRETTY_FUNCTION__ = "wayvnc_process_frame"
fb = 0xbfd221187e7c06e1
#5 0x000056225c4ce26d in on_capture_done (capture=0x7ffc930c0ba0) at ../src/main.c:604
self = 0x7ffc930c09b0
#6 0x000056225c4d15b2 in screencopy_ready (data=0x7ffc930c0ba0, frame=0x56225d2371b0, sec_hi=0, sec_lo=1027256, nsec=492180596) at ../src/screencopy.c:169
self = 0x7ffc930c0ba0
delay = 0.13299800000000001
#7 0x00007fb5da417ccd in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
No symbol table info available.
#8 0x00007fb5da41725a in ?? () from /lib/x86_64-linux-gnu/libffi.so.7
No symbol table info available.
#9 0x00007fb5da7281c0 in ?? () from /lib/x86_64-linux-gnu/libwayland-client.so.0
No symbol table info available.
#10 0x00007fb5da724ad8 in ?? () from /lib/x86_64-linux-gnu/libwayland-client.so.0
No symbol table info available.
#11 0x00007fb5da72608c in wl_display_dispatch_queue_pending () from /lib/x86_64-linux-gnu/libwayland-client.so.0
No symbol table info available.
#12 0x000056225c4cd7dd in on_wayland_event (obj=0x56225d179700) at ../src/main.c:346
self = 0x7ffc930c09b0
rc = 0
__PRETTY_FUNCTION__ = "on_wayland_event"
#13 0x00007fb5da97a6fb in aml__handle_event (self=0x56225d179030, obj=0x56225d179700) at ../subprojects/aml/src/aml.c:711
No locals.
#14 0x00007fb5da97a883 in aml_dispatch (self=0x56225d179030) at ../subprojects/aml/src/aml.c:754
sig_old = {
__val = {2, 0, 0, 18446744073709551615, 140722775525728, 140419033179511, 94705590702496, 5856792624, 140722775525728, 140419033175204, 18446744070967910688, 94705590702128, 140722775525776, 140419033180041, 18446744069414584320, 94705590702128}
}
sig_new = {
__val = {18446744067267100671, 18446744073709551615 <repeats 15 times>}
}
obj = 0x56225d179700
#15 0x000056225c4ceb91 in main (argc=2, argv=0x7ffc930c0e78) at ../src/main.c:885
self = {
do_exit = false,
display = 0x56225c95e120,
registry = 0x56225c9622c0,
outputs = {
prev = 0x56225c963730,
next = 0x56225c963730
},
seats = {
prev = 0x56225c964128,
next = 0x56225c964128
},
cfg = {
enable_auth = false,
private_key_file = 0x0,
certificate_file = 0x0,
username = 0x0,
password = 0x0,
address = 0x0,
port = 0
},
xdg_output_manager = 0x56225c964790,
keyboard_manager = 0x56225c963640,
pointer_manager = 0x56225c963fa0,
pointer_manager_version = 2,
renderer = {
display = 0x56225c999b30,
context = 0x56225d07b810,
output = 0x56225c963720,
read_format = 6408,
read_type = 5121,
frame_fbo = {{
rbo = 0,
fbo = 1,
tex = 1
}, {
rbo = 0,
fbo = 2,
tex = 2
}},
frame_index = 1,
damage_fbo = {
rbo = 1,
fbo = 3,
tex = 0
},
frame_shader = {
program = 3,
u_tex0 = 1,
u_proj = 0
},
damage_shader = {
program = 6,
u_tex0 = 0,
u_tex1 = 1
}
},
selected_output = 0x56225c963720,
selected_seat = 0x56225c964120,
dmabuf_backend = {
fc = {
status = CAPTURE_STOPPED,
overlay_cursor = false,
wl_output = 0x56225c964250,
userdata = 0x7ffc930c09b0,
on_done = 0x56225c4ce1a7 <on_capture_done>,
frame_info = {
fourcc_format = 0,
width = 0,
height = 0,
stride = 0
},
damage_hint = {
x = 0,
y = 0,
width = 0,
height = 0
},
backend = {
render = 0x56225c4d0cf9 <dmabuf_capture_render>,
start = 0x56225c4d0bac <dmabuf_capture_start>,
stop = 0x56225c4d0854 <dmabuf_capture_stop>
}
},
manager = 0x56225c963500,
zwlr_frame = 0x0,
frame = {
width = 0,
height = 0,
format = 0,
n_planes = 0,
plane = {{
fd = 0,
offset = 0,
size = 0,
pitch = 0,
modifier = 0
}, {
fd = 0,
offset = 0,
size = 0,
pitch = 0,
modifier = 0
}, {
fd = 0,
offset = 0,
size = 0,
pitch = 0,
modifier = 0
}, {
fd = 0,
offset = 0,
size = 0,
pitch = 0,
modifier = 0
}}
},
render_finish_time = 0,
start_time = 0,
timer = 0x56225d17f340
},
screencopy_backend = {
frame_capture = {
status = CAPTURE_DONE,
overlay_cursor = false,
wl_output = 0x56225c964250,
userdata = 0x7ffc930c09b0,
on_done = 0x56225c4ce1a7 <on_capture_done>,
frame_info = {
fourcc_format = 875709016,
width = 3000,
height = 2000,
stride = 12000
},
damage_hint = {
x = 0,
y = 0,
width = 3000,
height = 2001
},
backend = {
render = 0x56225c4d183b <screencopy_render>,
start = 0x56225c4d170d <screencopy_start>,
stop = 0x56225c4d132d <screencopy_stop>
}
},
wl_shm = 0x56225c964700,
buffer = 0x56225d17f4b0,
pixels = 0x7fb53e10b000,
bufsize = 24000000,
manager = 0x56225c9635a0,
frame = 0x0,
last_time = 1027256499113,
start_time = 1027256366115,
timer = 0x56225d17f2b0,
delay_smoother = {
time_constant = 0.5,
last_time = 1027256499113,
last_result = 0.24489128082506439
},
delay = 0.24489128082506439,
is_immediate_copy = false
},
capture_backend = 0x7ffc930c0ba0,
pointer_backend = {
vnc = 0x0,
pointer = 0x56225c977cb0,
current_mask = (unknown: 0),
current_x = 2101,
current_y = 485,
output = 0x56225c963720
},
keyboard_backend = {
virtual_keyboard = 0x56225c964ad0,
context = 0x56225c964d30,
keymap = 0x56225c9659d0,
state = 0x56225c97a780,
lookup_table_size = 512,
lookup_table_length = 357,
lookup_table = 0x56225c992100,
key_state = {
cap = 256,
len = 3,
storage = 0x56225c9655c0
}
},
wayland_handler = 0x0,
signal_handler = 0x0,
nvnc = 0x56225d17efa0,
nvnc_display = 0x56225d17f280,
buffer = 0x56225d17f6b0,
current_damage = {
extents = {
x1 = 0,
y1 = 0,
x2 = 0,
y2 = 0
},
data = 0x7fb5da7e8b10
},
kb_layout = 0x0
}
cfg_file = 0x0
address = 0x7ffc930c25a9 "0.0.0.0"
port = 5900
output_name = 0x0
fcbackend = FRAME_CAPTURE_BACKEND_NONE
seat_name = 0x0
overlay_cursor = false
shortopts = 0x56225c4d58fa "C:c:o:k:s:rh"
longopts = {{
name = 0x56225c4d5907 "config",
has_arg = 1,
flag = 0x0,
val = 67
}, {
name = 0x56225c4d590e "frame-capturing",
has_arg = 1,
flag = 0x0,
val = 99
}, {
name = 0x56225c4d591e "output",
has_arg = 1,
flag = 0x0,
val = 111
}, {
name = 0x56225c4d5925 "keyboard",
has_arg = 1,
flag = 0x0,
val = 107
}, {
name = 0x56225c4d592e "seat",
has_arg = 1,
flag = 0x0,
val = 115
}, {
name = 0x56225c4d5933 "render-cursor",
has_arg = 0,
flag = 0x0,
val = 114
}, {
name = 0x56225c4d5941 "help",
has_arg = 0,
flag = 0x0,
val = 104
}, {
name = 0x0,
has_arg = 0,
flag = 0x0,
val = 0
}}
n_args = 1
cfg_rc = -1
out = 0x56225c963720
seat = 0x56225c964120
renderer_input_type = RENDERER_INPUT_FB
aml = 0x56225d179030
Not a huge problem, of course, since changing the resolution isn't a frequent action.
Edit: oops, just read the code and saw that that code path is clearly marked as TODO
:)
This is a redux of a previous issue, only this time, one or more of the outputs use scaling. In this case, I have a 3840x2160 primary monitor that is using 2.0 scaling so it has an effective resolution of 1920x1080, but visible resolution that is double that. The secondary monitor is 1920x1080 with a 1.0 scale.
The result of this scale and arrangement of outputs, is that the cursor seems to move vertically properly, but horizontally, it appears to span both monitors while it is moving across the one output in the VNC client. When the VNC client is on the secondary output, the cursor appears to only work on the visible output when it is on the right half of the VNC client, otherwise it clicks on the primary output.
To ensure this isn't a specific problem to the client, I've tried 4 different vnc clients, but they all exhibit the same behaviour.
When connected to a wayvnc instance, often characters are dropped from input.
And very occasionally, modifiers get stuck. Smacking the modifier again turns it off, but possibly after it's thrown all sorts of chaos around by moving windows, changing focus, deleting text, etc.
The dropped character issue is especially bad when pressing more than one letter at a time (like pressing shift-letter to get an upper-case letter.)
While it does seem to work OK for me on all things Intel. I've been told that it doesn't work for everyone and I've confirmed that it works poorly on the i.MX6 with etnaviv.
If you are reading this and have problems with the dmabuf capturing backend, please comment and tell me what graphics hardware you're using.
I think this is likely to be an essential package for sway/fedora (waypipe is an alternate perhaps).
I can do the packaging but I need some info before I start:
What release should I target? 0.1.2, head of tree (4799f5f) or are you about to make another release?
any build-time configuration options that should be included in the general case?
Of course, if another fedora packager is already working on this, please let me know to avoid duplication (there's nothing on the bugzilla so far).
I believe this may be the result of a recent commit, as I've been using WayVNC for some time, and a recent git pull and reinstall has my laptop CPU fan going nuts.
I have two copies of wayvnc running. One for each output. One is 1920x1080 and the other is 2560x1440. Just moving the mouse around in a window has WayVNC using > 100% of one CPU on an i7-8650U.
Enough mouse movement, and the mouse will actually start getting choppy in the window.
Create a new protocol for managing input device seats from wayland clients. This allows us to create a new seat from wayvnc for it to use with virtual input devices.
There are some benefits to using separate seats:
seat0
can mess with the user's selected keyboard layout.Is there a way to automatically create a virtual screen as vnc source?
The background is that I want to use my iPad as a second screen for my computer.
If I start wayvnc and the port 5900 is already in use, it dies without error (1.1) or with a general error message (master).
Expected behavior:
An error message like
Could not bind to port $portnumber
According error in strace:
setsockopt(12, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(12, {sa_family=AF_INET, sin_port=htons(5900), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
close(12) = 0
When using VNC Viewer on an iPad, the following log is generated as I connect and type a 3, a #, a 3, and another #:
DEBUG: Set nvnc buffer: 0x560a160eb5a0
ERROR: data_control_to_clipboard called with 0 length
DEBUG: symbol=3 level=0 code=AE03 pressed
DEBUG: symbol=3 level=0 code=AE03 released
DEBUG: Failed to match level on symbol: numbersign
DEBUG: symbol=numbersign level=1 code=AE03 pressed
DEBUG: Failed to match level on symbol: numbersign
DEBUG: symbol=numbersign level=1 code=AE03 released
DEBUG: symbol=3 level=0 code=AE03 pressed
DEBUG: symbol=3 level=0 code=AE03 released
DEBUG: Failed to match level on symbol: numbersign
DEBUG: symbol=numbersign level=1 code=AE03 pressed
DEBUG: Failed to match level on symbol: numbersign
DEBUG: symbol=numbersign level=1 code=AE03 released
All four end up typing a string of "3333".
This is probably related to issue #35, but now sometimes modifier keys get stuck.
In my experience, it appears to always be the floating modifier/$mod key (alt).
Sometimes, I can 'unstick' it by smashing all of the modifier keys in succession, sometimes, the only way to get it to unstick is to kill and restart wayvnc.
The output from wayvnc doesn't look any different when the modifier is stuck, it says
DEBUG: symbol=a level=0 code=AC01 pressed
DEBUG: symbol=a level=0 code=AC01 released
But it's passing ALT-A to the sway session.
Hello folks,
got an error after compiled wayvnc (and deps) on a raspberry4. Here is the details of my config:
Device: Raspberry4B 4GB
System: Archlinux on ArmV8
WM: Sway
Once the build is complete, this error is reported:
DEBUG: OpenGL ES 3.1 Mesa 20.0.7
ERROR: Failed to initialise renderer
@any1 started to guide me throught a possible resolution with no luck at this time.
Thanks anyway about your thoughts
Maybe I'm misunderstanding, and I am making some guesses here.
I upgraded my VNC client and noticed that I stopped getting my client-side cursor. It appears TightVNC made a change so as to not show the Windows cursor if the server is renderign the cursor. However, this is now the case no matter what options I pass to wayvnc
.
So for now, I'm using the older client, where I get both cursors. For some reason, the immediately responsive cursor makes the entire system feel more responsive. Is this possibly a protocol bug in wayvnc? (aka/or a bug in the -r
flag?)
Sometimes in a session specific keys are getting lost(or not being handled) e.g. 's', ':' on a German layout.
I don't think its the vnc viewer because I tried different ones so far - but I am unsure how I can debug this issue.
Regressed by 8491d6c
$ wayvnc
ERROR: Failed to load config. No such file or directory
$ wayvnc -C /dev/null
ERROR: Failed to load config. No such file or directory
$ touch ~/.config/wayvnc/config
$ wayvnc
<starts fine>
When you connect to a wayvnc instance, the graphics are sent with the correct rotation, but the mouse input goes the wrong way. (eg if your screen is rotated in portrait mode, moving the mouse left to right moves it up and down in the wayvnc controlled instance.)
strace of the crash: https://0x0.st/izms.txt
I use sway and have set my internal screen to scale with a factor of 1.5.
When I use wayvnc to capture my screen, the image is disturbed and the VNC connection crashes all the time. I can mitigate the issue by disabling scaling on the captured screen.
Is it possible to capture all available outputs?
Out of sudden, after running it for some time, on sway 1.4, ran into that error:
ERROR: Failed to initialise renderer
By recompiling without:
if (gl_load_late_extensions() < 0)
goto late_extension_failure;
in render_init
got it working again.
I'm seeing 750ms+ latency talking between 2 boxes on the same network (on the same switch).
Both powerful multi-core machines.
This is with Fedora32.
Is the TCP connection perhaps running with Nagle active?
I started it up for testing and it seems to work very well on first glance.. nice work!. Anyway, my keyboard layout switched to english and doesnt turn back after stopping wayvnc...
Version: 0.1.2+139.g 2cb9f66
❯ wayvnc -o HEADLESS-1 0.0.0.0
DEBUG: symbol=Super_L level=0 code=LWIN pressed
DEBUG: symbol=Super_L level=0 code=LWIN released
DEBUG: symbol=Super_L level=0 code=LWIN pressed
DEBUG: symbol=Super_L level=0 code=LWIN released
DEBUG: symbol=Super_L level=0 code=LWIN pressed
DEBUG: symbol=Super_L level=0 code=LWIN released
DEBUG: symbol=Super_L level=0 code=LWIN pressed
DEBUG: symbol=Super_L level=0 code=LWIN released
DEBUG: symbol=Super_L level=0 code=LWIN pressed
DEBUG: symbol=Super_L level=0 code=LWIN released
❯ swaymsg output "HEADLESS-1" resolution 3840x2160
❯ wayvnc -o HEADLESS-1 0.0.0.0
[1] 31562 abort (core dumped) wayvnc -o HEADLESS-1 0.0.0.0
❯ wayvnc -o HEADLESS-1 0.0.0.0
2560x1440
On both (2+3) the client vinage says: Connection to host WayVNC was closed.
(More to my setup see: #7)
At this point my VNC session crashed. Sway kept running and I was able to just restart wayvnc, but it would be nice if it didn't crash of course.
PID: 28857 (wayvnc)
UID: 1000 (cole)
GID: 1000 (cole)
Signal: 11 (SEGV)
Timestamp: Wed 2020-07-01 16:00:06 PDT (10min ago)
Command Line: wayvnc -o HEADLESS-1 0.0.0.0
Executable: /nix/store/ravgkjx5c1bssi4svnnbh05cz1p05508-wayvnc-4f1bca55c3bf19a58e9d892a5141fdfc5159bf01/bin/wayvnc
Control Group: /user.slice/user-1000.slice/session-8.scope
Unit: session-8.scope
Slice: user-1000.slice
Session: 8
Owner UID: 1000 (cole)
Boot ID: 7afde54d612c4eaebc38d2961d43f7ed
Machine ID: befa945b3fb44f73a9671674ee23e039
Hostname: xeep
Storage: /var/lib/systemd/coredump/core.wayvnc.1000.7afde54d612c4eaebc38d2961d43f7ed.28857.1593644406000000000000.lz4
Message: Process 28857 (wayvnc) of user 1000 dumped core.
Reading symbols from /nix/store/ravgkjx5c1bssi4svnnbh05cz1p05508-wayvnc-4f1bca55c3bf19a58e9d892a5141fdfc5159bf01/bin/wayvnc...
(No debugging symbols found in /nix/store/ravgkjx5c1bssi4svnnbh05cz1p05508-wayvnc-4f1bca55c3bf19a58e9d892a5141fdfc5159bf01/bin/wayvnc)
[New LWP 28857]
[New LWP 28864]
[New LWP 28858]
[New LWP 28859]
[New LWP 28860]
[New LWP 28861]
[New LWP 28867]
[New LWP 28869]
[New LWP 28865]
[New LWP 28866]
[New LWP 28868]
[New LWP 28863]
[New LWP 28870]
[New LWP 28862]
warning: Unexpected size of section `.reg-xstate/28857' in core file.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/bqbg6hb2jsl3kvf6jgmgfdqy06fpjrrn-glibc-2.30/lib/libthread_db.so.1".
Core was generated by `wayvnc -o HEADLESS-1 0.0.0.0'.
Program terminated with signal SIGSEGV, Segmentation fault.
warning: Unexpected size of section `.reg-xstate/28857' in core file.
#0 0x00007f90f2e44209 in wl_proxy_marshal () from /nix/store/qk4lyaah441wxakif33im54ww25lsb7d-wayland-1.18.0/lib/libwayland-client.so.0
[Current thread is 1 (Thread 0x7f90f24a3ac0 (LWP 28857))]
(gdb) bt
#0 0x00007f90f2e44209 in wl_proxy_marshal () from /nix/store/qk4lyaah441wxakif33im54ww25lsb7d-wayland-1.18.0/lib/libwayland-client.so.0
#1 0x00000000004085da in output_destroy ()
#2 0x0000000000405bce in registry_remove ()
#3 0x00007f90f2b44abd in ffi_call_unix64 () from /nix/store/gbwpr7mphpk1fyfz1dn05n2i00aspwfl-libffi-3.3/lib/../lib64/libffi.so.7
#4 0x00007f90f2b4379c in ffi_call_int () from /nix/store/gbwpr7mphpk1fyfz1dn05n2i00aspwfl-libffi-3.3/lib/../lib64/libffi.so.7
#5 0x00007f90f2e471b0 in wl_closure_invoke () from /nix/store/qk4lyaah441wxakif33im54ww25lsb7d-wayland-1.18.0/lib/libwayland-client.so.0
#6 0x00007f90f2e43ad8 in dispatch_event.isra () from /nix/store/qk4lyaah441wxakif33im54ww25lsb7d-wayland-1.18.0/lib/libwayland-client.so.0
#7 0x00007f90f2e4508c in wl_display_dispatch_queue_pending () from /nix/store/qk4lyaah441wxakif33im54ww25lsb7d-wayland-1.18.0/lib/libwayland-client.so.0
#8 0x0000000000405af8 in on_wayland_event ()
#9 0x00007f90f2e7c41a in aml_dispatch () from /nix/store/apqhrq1lkz67pqqig15p6bhb8k3cwgkx-aml-099e0c71942a0c0a42f40b9b18e616cfe20dd534/lib/libaml.so.0
#10 0x0000000000405097 in main ()
Thanks for the great project. I am using wayvnc to connect from a computer running Xorg to one running sway. This generally works well, but I have noticed one fairly significant issue.
When using certain applications, even minor animations cause the entire to be redrawn. For example, if I type this issue with a single sway window running qutebrowser, then the blinking cursor causes the entire qutebrowser window to be redrawn, and wayvnc --show-performace
reports average frame damage: 95.9%
(the other 4.1% corresponds to sway boarder and header, which are not re-drawn). If I split the screen into two windows, then the frame damage drops by half. These full-window redraws cause considerable visual issues (flashing and stuttering) and render the application essentially unusable.
This only happens for certain applications. Rendering a blinking cursor in Firefox, for example, does not cause high frame damage (in fact, it round down to 0.0%). I haven't done extensive testing with other application (I've only recently started using wayvnc) but would be happy to test any others you'd like or to provide more information about my hardware or software setup.
This isn't a breaking issue for me; avoiding applications that trigger full-window redraws is an acceptable workaround. But I thought you might want to know about the issue and I would be happy to provide any other info that would help resolve it.
I figured this ought to be its own issue. Continuing conversation from here #27.
Background: on 7ea17d0 wayvnc works and accepts connections from clients, on latest master - eg. a12ce12 - it doesn't accept connections and stracing it, it just hangs on the poll system call:
ioctl(4, DRM_IOCTL_I915_GEM_MMAP, 0x7ffdcfc0d4a0) = 0
ioctl(4, DRM_IOCTL_I915_GEM_BUSY, 0x7ffdcfc0d500) = 0
ioctl(4, DRM_IOCTL_I915_GEM_MADVISE, 0x7ffdcfc0d570) = 0
ioctl(4, DRM_IOCTL_I915_GEM_WAIT or DRM_IOCTL_RADEON_GEM_OP, 0x7ffdcfc0d580) = 0
futex(0x7fa90ef21608, FUTEX_WAKE_PRIVATE, 2147483647) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fa904859000
mprotect(0x7fa90485a000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7fa905058c30, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[21126], tls=0x7fa905059700, child_tidptr=0x7fa9050599d0) = 21126
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fa904058000
mprotect(0x7fa904059000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7fa904857c30, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[21127], tls=0x7fa904858700, child_tidptr=0x7fa9048589d0) = 21127
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fa8f185a000
mprotect(0x7fa8f185b000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7fa8f2059c30, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[21128], tls=0x7fa8f205a700, child_tidptr=0x7fa8f205a9d0) = 21128
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL, 8392704, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fa8f1059000
mprotect(0x7fa8f105a000, 8388608, PROT_READ|PROT_WRITE) = 0
clone(child_stack=0x7fa8f1858c30, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tid=[21129], tls=0x7fa8f1859700, child_tidptr=0x7fa8f18599d0) = 21129
futex(0x7ffdcfc0d7a0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0
futex(0x7fa90ef21230, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7fa90ef21228, FUTEX_WAKE_PRIVATE, 1) = 1
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
sendmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\17\0\0\0\1\0\10\0", iov_len=8}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 8
poll([{fd=6, events=POLLIN|POLLPRI}, {fd=3, events=POLLIN|POLLPRI}], 2, -1^C) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
Of course hanging on poll might be normal if it actually did accept connections...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.