Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

late subsystem initialization #4315

Open
totaam opened this issue Aug 3, 2024 · 2 comments
Open

late subsystem initialization #4315

totaam opened this issue Aug 3, 2024 · 2 comments
Labels
client enhancement New feature or request

Comments

@totaam
Copy link
Collaborator

totaam commented Aug 3, 2024

There's only so much we can do when trying to start the client faster (#2347).
Some things take time if you want to do them properly, ie: codecs testing and validation, especially gstreamer.
Others require disk I/O, ie: loading menu icons, etc
These delays are more noticeable now that the pyqt6 client connects instantly (albeit without any features!): #4314

It should be possible to delay some of these things and update the server once we have the results (ie: list of codecs).
Other things we can just start later (ie: audio)
Some things can run in parallel with connecting to the server and are only really needed later (ie: opengl probing is only needed when we show a window, and not all windows)

@totaam totaam added enhancement New feature or request client labels Aug 3, 2024
@totaam
Copy link
Collaborator Author

totaam commented Aug 5, 2024

Log sample showing where most of the time is being spent:

2024-08-03 16:59:02,077 debug enabled for ['xpra.codecs.loader', 'codec', 'loader']
2024-08-03 16:59:02,384 window icon overlay: /usr/share/xpra/icons/xpra.png
splash: handle_stdin_line('0:Xpra Client v6.2.0\n')
2024-08-03 16:59:02,537 overlay_image=<PIL.PngImagePlugin.PngImageFile image mode=RGBA size=48x48 at 0x7FD2E4D673E0>
2024-08-03 16:59:02,544 query_audio() command=['/usr/bin/python3.12', '/usr/bin/xpra', '--windows=no', '_audio_query'], env={'XPRA_OPE
2024-08-03 16:59:02,662 debug enabled for ['xpra.codecs.loader', 'codec', 'loader']
2024-08-03 16:59:02,783 query_audio() process returned 0 
2024-08-03 16:59:02,815 init: <class 'xpra.client.mixins.encodings.Encodings'>
2024-08-03 16:59:02,891 codec module csc_cython.converter is installed
2024-08-03 16:59:02,961 decoder: gstreamer (5, 0), <function init_module at 0x7fd2dc1bf1a0>, <function cleanup_module at 0x7fd2dc1bf240>
2024-08-03 16:59:03,201 VideoHelper.init() done
2024-08-03 16:59:03,219 query_xkbmap() query_struct={'rules': 'evdev', 'model': 'pc105+inet', 'layout': 'gb,gb', 'variant': '', 'layouts': '[]', 'variants': '[]'}
2024-08-03 16:59:03,294 update() modifier_map={'shift': 1, 'lock': 2, 'control': 4, 'mod1': 8, 'mod2': 16, 'mod3': 32, 'mod4': 64, 'mod5': 128, 'scroll': 0, 'num': 0, 'meta': 0, 'super': 0, 'hyper': 0, 'alt': 0}, old hash=None, new hash=gb,gb/2f14a8292473a0aa3d41afbdba2b5218af3e31a95d3d77fefebcfd4d8bdf26e0
2024-08-03 16:59:03,294 init_opengl(force:native)
2024-08-03 16:59:03,579 OpenGL: enabled=True, texture-size-limit=16384, max-window-size=(32767, 32767)
2024-08-03 16:59:03,647 video_decodings=('h264', 'vp8', 'vp9', 'av1')
2024-08-03 16:59:03,650 send_hello() packet
2024-08-03 16:59:03,862 processing hello from server: typedict({'digest': ('xor', 'hmac+sha512', 'hmac ..  'encoding': 'auto', 'auto_refresh_delay': 156})
2024-08-03 16:59:04,104 setup_window() position=(0, 0), set_initial_position=True, OR=False, decorated=True
  • query_audio should be made asynchronous: audio can wait until after the hello
  • encodings: trickier, but we can update the list of encodings after the window has been mapped

@totaam
Copy link
Collaborator Author

totaam commented Nov 25, 2024

Worth tying this with #1942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant