NEW 214544
WIP: [GStreamer][GPUProcess] enable GPUProcess through envvar
https://bugs.webkit.org/show_bug.cgi?id=214544
Summary WIP: [GStreamer][GPUProcess] enable GPUProcess through envvar
Víctor M. Jáquez L.
Reported 2020-07-20 01:18:37 PDT
Created attachment 404700 [details] Patch for GPUProcess enabling This is just a RFC of how to enable GPUProcess in webkitgtk/wpe. Is this approach correct?
Attachments
Patch for GPUProcess enabling (9.06 KB, patch)
2020-07-20 01:18 PDT, Víctor M. Jáquez L.
no flags
WIP: enable GPUProcess capture devices with envvar (1.93 KB, patch)
2020-07-23 03:45 PDT, Víctor M. Jáquez L.
no flags
WIP: a mechanism to enable the GPUProcess with an envvar (5.22 KB, patch)
2020-08-05 09:26 PDT, Víctor M. Jáquez L.
no flags
Carlos Garcia Campos
Comment 1 2020-07-20 01:39:57 PDT
Comment on attachment 404700 [details] Patch for GPUProcess enabling I don't think we want to expose a setting in the API for this. Should the user decide about this and in a per web view basis?
Víctor M. Jáquez L.
Comment 2 2020-07-20 01:56:56 PDT
(In reply to Carlos Garcia Campos from comment #1) > Comment on attachment 404700 [details] > Patch for GPUProcess enabling > > I don't think we want to expose a setting in the API for this. Should the > user decide about this and in a per web view basis? As far as I understand Mac code, it is decided by the user https://github.com/WebKit/webkit/blob/master/Source/WebKitLegacy/mac/WebView/WebView.mm#L3411 And, even it is configured per web view, it looks like a global thing. Also, I wonder if I should approach to use Pipewire for capture devices in GPUProcess rather than GStreamer as it is now.
Víctor M. Jáquez L.
Comment 3 2020-07-20 02:18:08 PDT
(In reply to Víctor M. Jáquez L. from comment #2) > Also, I wonder if I should approach to use Pipewire for capture devices in > GPUProcess rather than GStreamer as it is now. Phil commented it's too early to migrate to pipewire, in his opinion, since we need a very recent xdg-desktop-portal + working pipewire 0.3 daemon on the host, and in the SDK the versions used at too old currently.
Víctor M. Jáquez L.
Comment 4 2020-07-20 02:53:01 PDT
(In reply to Carlos Garcia Campos from comment #1) > Comment on attachment 404700 [details] > Patch for GPUProcess enabling > > I don't think we want to expose a setting in the API for this. Which other mechanisms do we have for handling these optional settings?
Philippe Normand
Comment 5 2020-07-20 03:10:47 PDT
Maybe instead of a setting you could enable the GPU process only when mediastream is being enabled? Because for the time being my understanding is that this process will be used only for capture devices in WPE/GTK.
Carlos Garcia Campos
Comment 6 2020-07-20 07:37:27 PDT
Right, I need to understand what the gpu process is for to answer the question. If the gpu process will handle all media eventually, (like network process handles networking) and we want a setting because it's not complete yet, then I don't think we want to expose a setting to decide, we can use internal API in WebProcessPool and use an env var or whatever to enable/disable it. If it's something the user really has to decide, then the user need to understand what the gpu process is to, know whether to enable it or not and when. If it's a global setting, it fits better as WebKitWebContext API, not a setting.
Víctor M. Jáquez L.
Comment 7 2020-07-23 03:45:38 PDT
Created attachment 405031 [details] WIP: enable GPUProcess capture devices with envvar This is another approach, using a environment variable, but not WebProcessPool, but in WebPreferencesDefaultValues. This approach indeed enables the GPUProcess, and surprisingly, the camera stream is processed, though it does not live in the GPUProces but in the old WebProcess :( Does this approach is more acceptable?
Carlos Garcia Campos
Comment 8 2020-07-23 03:51:10 PDT
Yes, but it's not at the right place. Check the env vars in WebPreferences::platformInitializeStore() (in WebPreferencesGtk.cpp and you will have to add one for WPE) and just set the appropriate value for the preferences according to the env var.
Víctor M. Jáquez L.
Comment 9 2020-08-05 09:26:46 PDT
Created attachment 406007 [details] WIP: a mechanism to enable the GPUProcess with an envvar I think this approach is correct.
Philippe Normand
Comment 10 2020-08-06 01:11:12 PDT
Comment on attachment 406007 [details] WIP: a mechanism to enable the GPUProcess with an envvar View in context: https://bugs.webkit.org/attachment.cgi?id=406007&action=review > Source/WebKit/UIProcess/wpe/WebPreferencesWPE.cpp:33 > + bool webrtcEnableGPUProcess = (std::getenv("WEBKIT_WEBRTC_ENABLE_GPU_PROCESS") != nullptr); Perhaps check the env var contents too?
Note You need to log in before you can comment on or make changes to this bug.