Xpra: Ticket #2193: proxy start should not set encodings

As per #2180, the server start command includes the list of encodings that the client supports. We should leave this empty unless the client specified them explicitly on the command line (distinguishing the two is the hard part) otherwise the server may start with a more restricted set of encodings and subsequent clients won't be able to use all encodings.



Thu, 16 May 2019 14:30:53 GMT - Antoine Martin: status changed

Easy to reproduce:

The resulting server process:

/usr/bin/python3 /usr/bin/xpra start \ --chdir=/home/antoine/projects/Xpra/trunk/src --attach=no \
    --encodings=h264,vp9,vp8,mpeg4,mpeg4+mp4,h264+mp4,vp8+webm,vp9+webm,png,png/P,png/L,webp,rgb,rgb24,rgb32,jpeg,h265,mpeg1,mpeg2 \
    --video-encoders=all --csc-modules=all --video-decoders=all \
    --compressors=lz4, lzo, zlib, brotli \
    --packet-encoders=rencode, bencode, yaml --start=xterm \
    --env=XPRA_PROXY_START_UUID=a62c7b8cfd884dbdb86ad17d6b966387 \
    --daemon=yes --systemd-run=no --uid=1000 --gid=1000 --displayfd=13

Thu, 16 May 2019 15:14:41 GMT - Antoine Martin:

The start-new-session dict sent to the proxy contains:

{
'mode': 'start', 'start-env': ["#avoid .. GTK_CSD=0'], 'encoding': 'auto', \
'encodings': ['h264', 'vp9', 'vp8', 'mpeg4', 'mpeg4+mp4', 'h264+mp4', 'vp8+webm', 'vp9+webm', 'png', 'png/P', 'png/L', 'webp', 'rgb', 'rgb24', 'rgb32', 'jpeg', 'h265', 'mpeg1', 'mpeg2'], \
'min-quality': 30, 'min-speed': 30, 'compression_level': 1, 'video-scaling': 'auto', \
'title': '@title@ on @client-machine@', 'clipboard': 'yes', 'clipboard-direction': 'both', \
'input-method': 'none', 'microphone': 'off', 'speaker': 'on', 'fake-xinerama': True, \
'resize_display': True, 'keyboard-sync': True, 'cursors': True, 'bell': True, 'notifications': True, \
'xsettings': True, 'system-tray': True, 'windows': True, 'webcam': 'auto', 'html': 'auto', \
'av-sync': True, 'global-menus': True, 'forward-xdg-open': True, 'modal-windows': True, \
'bandwidth-detection': True, 'ssh-upgrade': True, 'printing': 'no', 'file-transfer': 'auto', \
'open-command': '/usr/bin/xdg-open', 'open-files': 'auto', 'open-url': 'auto', 'start-new-commands': True, \
'mmap': 'yes', 'mmap-group': 'auto', 'mdns': True, 'bind': ['auto'], 'rfb-upgrade': 5, \
'bandwidth-limit': 'auto', 'start': ['xterm'], 'chdir': '/home/antoine/projects/Xpra/trunk/src'
}
Clearly lots of things we don't need to be sending.

Thu, 16 May 2019 15:48:29 GMT - Antoine Martin:

Mostly done in r22729 (client-side fix) by only sending options when their values differ from the default config.

We still need to do something similar proxy-side:

/usr/bin/python3 /usr/bin/xpra start --chdir=/home/antoine/projects/Xpra/trunk/src \
    --attach=no --encodings=all --video-encoders=all --csc-modules=all --video-decoders=all \
    --compressors=lz4, lzo, zlib, brotli --packet-encoders=rencode, bencode, yaml \
    --start=xterm --env=XPRA_PROXY_START_UUID=8523b7547812495ebeea0c632b3d9923 \
    --daemon=yes --systemd-run=no --uid=1000 --gid=1000 --displayfd=13

Thu, 30 May 2019 16:26:51 GMT - Antoine Martin: status changed; resolution set

Fixed:

With these changes the server starts as:

/usr/bin/python3 /usr/bin/xpra start \
    --chdir=/home/antoine/projects/Xpra/trunk/src --attach=no --start=xterm \
    --env=XPRA_PROXY_START_UUID=806816fe9c8d4e39ad3b2fd95898a4f0 \
    --daemon=yes --systemd-run=no --uid=1000 --gid=1000 --displayfd=16

All the options that remain are required when starting via the proxy.


Sat, 23 Jan 2021 05:44:41 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2193