GithubHelp home page GithubHelp logo

udevbe / greenfield Goto Github PK

View Code? Open in Web Editor NEW
880.0 19.0 27.0 25.9 MB

HTML5 Wayland compositor :seedling:

License: GNU Affero General Public License v3.0

JavaScript 4.65% Shell 1.45% Dockerfile 0.07% C 39.02% CMake 0.29% TypeScript 50.97% HTML 0.03% Python 3.51% CSS 0.01%
greenfield wayland html5 browser javascript remote-desktop browser-wayland-compositor

greenfield's Introduction

greenfield's People

Contributors

dependabot[bot] avatar edwardbetts avatar jarrodcolburn avatar jschueller avatar zubnix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

greenfield's Issues

Missing dependency for compositor-proxy in Dockerfile

The dockerfile for compositor-proxy refused to build until I added libgl1-mesa-dev to the dependencies. The error it gave was:

CMake Error at /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
  CMakeLists.txt:22 (pkg_check_modules)

-- Configuring incomplete, errors occurred!
See also "/app/build/CMakeFiles/CMakeOutput.log".
error Command failed with exit code 1.

Unable to build on ArchLinux

Hi udevbe,

I'm getting a build error trying to build the proxy part of Greenfield.

Seems that libwayland-server.so is somehow missing. After copying libwayland-server.so from /usr/lib to the specified path below, it builds, but when a Wayland client connects, a SIGSEGV is received.

I can provide ssh of my test server for you if you would like to investigate further.

[root@Wayland-test compositor-proxy]# yarn build:native
yarn run v1.22.17
$ cmake-js
[
  '/usr/bin/node',
  '/root/greenfield/compositor-proxy/node_modules/.bin/cmake-js'
]
info TOOL Using Unix Makefiles generator.
info CMD CONFIGURE
info RUN [
info RUN   'cmake',
info RUN   '/root/greenfield/compositor-proxy',
info RUN   '--no-warn-unused-cli',
info RUN   '-G',
info RUN   'Unix Makefiles',
info RUN   '-DCMAKE_JS_VERSION=6.2.1',
info RUN   '-DCMAKE_BUILD_TYPE=Release',
info RUN   '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/root/greenfield/compositor-proxy/build/Release',
info RUN   '-DCMAKE_JS_INC=/root/.cmake-js/node-x64/v17.2.0/include/node;/root/greenfield/compositor-proxy/node_modules/nan',
info RUN   '-DCMAKE_JS_SRC=',
info RUN   '-DNODE_RUNTIME=node',
info RUN   '-DNODE_RUNTIMEVERSION=17.2.0',
info RUN   '-DNODE_ARCH=x64'
info RUN ]
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found GLIB2: /usr/lib/libglib-2.0.so
-- Found GStreamer: GSTREAMER_INCLUDE_DIRS;GSTREAMER_LIBRARIES;GSTREAMER_VERSION;GSTREAMER_BASE_INCLUDE_DIRS;GSTREAMER_BASE_LIBRARIES;GSTREAMER_GSTREAMER-APP_INCLUDE_DIRS;GSTREAMER_GSTREAMER-APP_LIBRARIES;GSTREAMER_GSTREAMER-VIDEO_INCLUDE_DIRS;GSTREAMER_GSTREAMER-VIDEO_LIBRARIES (found version "1.18.5")
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /root/greenfield/compositor-proxy/build
info CMD BUILD
info RUN [
info RUN   'cmake',
info RUN   '--build',
info RUN   '/root/greenfield/compositor-proxy/build',
info RUN   '--config',
info RUN   'Release'
info RUN ]
[ 25%] Building C object CMakeFiles/app-endpoint-encoding.dir/native/src/node_encoder.c.o
[ 50%] Building C object CMakeFiles/app-endpoint-encoding.dir/native/src/gst_encoder.c.o
[ 75%] Building C object CMakeFiles/app-endpoint-encoding.dir/native/src/gst_main_loop.c.o
make[2]: *** No rule to make target '../node_modules/westfield-endpoint/src/libwayland-server.so', needed by '../dist/encoding/app-endpoint-encoding.node'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/app-endpoint-encoding.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
ERR! OMG Process terminated: 2
error Command failed with exit code 1.

Proxying/Security

Can the compose-module demo be proxied? Once it's opened using https, the websockets upgrade fails as it's not encrypted (wss). How should one go about proxying the demo? I tried also proxying the compositor-proxy as well, but it doesn't seem to work and doesn't give any meaningful information as to why.

linux remote application failure?

Maybe I did something wrong, but when trying to run a locally installed app after going through the getting started I was seeing:

yarn workspace @gfld/compositor-proxy-cli start
{time:"2023-11-12T02:08:03.847Z",name:"main",msg:"Starting compositor proxy with args: {
applications: {
'/gtk4-demo': { name: 'GTK Demo', executable: 'gtk4-demo', args: [], env: {} },
'/kwrite': { name: 'KWrite', executable: 'kwrite', args: [Array], env: {} },
'/calc': { name: 'Calc', executable: 'qalculate-gtk', args: [], env: {} },
'/kitty': { name: 'Kitty', executable: 'kitty', args: [], env: {} },
'/xterm': { name: 'XTerm', executable: 'xterm', args: [], env: {} }
},
help: false,
'bind-ip': '0.0.0.0',
'bind-port': '8081',
'allow-origin': 'http://localhost:8080',
'base-url': 'ws://localhost:8081',
'render-device': '/dev/dri/renderD128',
encoder: 'x264',
'basic-auth': undefined
}"}
{time:"2023-11-12T02:08:03.852Z",name:"main",msg:"Compositor proxy started. Listening on 0.0.0.0:8081"}
{time:"2023-11-12T02:08:09.249Z",name:"main",msg:"No proxy session exists for this compositor, spawning a new one."}
{
"type": "dependency",
"path": "file:///var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/SessionProcess.ts"
}
{time:"2023-11-12T02:08:09.506Z",name:"main",msg:" name: TypeError message: Cannot read properties of undefined (reading 'replySerial')"}
{time:"2023-11-12T02:08:09.507Z",name:"main",msg:"error object stack: "}
{time:"2023-11-12T02:08:09.510Z",name:"main",msg:"TypeError: Cannot read properties of undefined (reading 'replySerial')
at ChildProcess.replyListener (/var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/main-controller.ts:86:38)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)"}
{
"type": "dependency",
"path": "/var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/SessionProcess.ts"
}
{time:"2023-11-12T02:08:09.511Z",name:"main",msg:" name: TypeError message: Cannot read properties of undefined (reading 'replySerial')"}
{time:"2023-11-12T02:08:09.511Z",name:"main",msg:"error object stack: "}
{time:"2023-11-12T02:08:09.512Z",name:"main",msg:"TypeError: Cannot read properties of undefined (reading 'replySerial')
at ChildProcess.replyListener (/var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/main-controller.ts:86:38)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)"}
{
"type": "dependency",
"path": "/var/home/jpeeler/src/greenfield/packages/compositor-proxy/dist/index.js"
}
{time:"2023-11-12T02:08:09.512Z",name:"main",msg:" name: TypeError message: Cannot read properties of undefined (reading 'replySerial')"}
{time:"2023-11-12T02:08:09.512Z",name:"main",msg:"error object stack: "}
{time:"2023-11-12T02:08:09.513Z",name:"main",msg:"TypeError: Cannot read properties of undefined (reading 'replySerial')
at ChildProcess.replyListener (/var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/main-controller.ts:86:38)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)"}
{
"type": "dependency",
"path": "/var/home/jpeeler/src/greenfield/packages/compositor-proxy/dist/Logger.js"
}
{time:"2023-11-12T02:08:09.513Z",name:"main",msg:" name: TypeError message: Cannot read properties of undefined (reading 'replySerial')"}
{time:"2023-11-12T02:08:09.513Z",name:"main",msg:"error object stack: "}
{time:"2023-11-12T02:08:09.514Z",name:"main",msg:"TypeError: Cannot read properties of undefined (reading 'replySerial')
at ChildProcess.replyListener (/var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/main-controller.ts:86:38)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at emit (node:internal/child_process:951:14)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
at runNextTicks (node:internal/process/task_queues:64:3)
at process.processImmediate (node:internal/timers:449:9)"}
{
"type": "dependency",
"path": "/var/home/jpeeler/src/greenfield/packages/compositor-proxy/dist/SurfaceBufferEncoding.js"
}

{time:"2023-11-12T02:08:09.584Z",name:"main",msg:" name: TypeError message: Cannot read properties of undefined (reading 'replySerial')"}
{time:"2023-11-12T02:08:09.584Z",name:"main",msg:"error object stack: "}
{time:"2023-11-12T02:08:09.585Z",name:"main",msg:"TypeError: Cannot read properties of undefined (reading 'replySerial')
at ChildProcess.replyListener (/var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/main-controller.ts:86:38)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)"}
{
"type": "dependency",
"path": "/var/home/jpeeler/src/greenfield/libs/xtsb/dist/main/auth.js"
}
{time:"2023-11-12T02:08:09.586Z",name:"main",msg:" name: TypeError message: Cannot read properties of undefined (reading 'replySerial')"}
{time:"2023-11-12T02:08:09.586Z",name:"main",msg:"error object stack: "}
{time:"2023-11-12T02:08:09.586Z",name:"main",msg:"TypeError: Cannot read properties of undefined (reading 'replySerial')
at ChildProcess.replyListener (/var/home/jpeeler/src/greenfield/packages/compositor-proxy-cli/src/main-controller.ts:86:38)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:488:12)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)"}
Supported EGL client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
Using EGL device /dev/dri/renderD128

Using EGL 1.5

Supported EGL display extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_IMG_context_priority EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display

Supported EGL device extensions: EGL_EXT_device_drm EGL_EXT_device_drm_render_node

EGL vendor: Mesa Project

EGL DMA-BUF format modifiers supported
amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
Obtained high priority context
Using EGL_PLATFORM_DEVICE_EXT
{time:"2023-11-12T02:08:09.613Z",name:"native-compositor-session",msg:"Listening on: WAYLAND_DISPLAY="wayland-0"."}
unlinking stale lock file /tmp/.X1-lock
xserver listening on display :1
{time:"2023-11-12T02:08:09.615Z",name:"compositor-proxy-session",msg:"Session created."}
{time:"2023-11-12T02:08:09.615Z",name:"session-process",msg:"Session started."}
{time:"2023-11-12T02:08:09.615Z",name:"session-process",msg:"Launching application Calc"}
{time:"2023-11-12T02:08:09.622Z",name:"qalculate-gtk",msg:"child process error: spawn qalculate-gtk ENOENT."}
{
"type": "launchAppFailed",
"payload": {
"replySerial": 0,
"message": "spawn qalculate-gtk ENOENT"
}
}

full-log.txt

Unrelated, I'm being that guy that reports multiple issues in one bug. It's "yarn workspace @gfld/compositor-shell run start" (not just shell). And the ffmpeg shallow clone doesn't permit a branch change to master in build_wasm.sh.

docker-compose not working

I tried using the updated docker-compose file in compositor-proxy and I get this error in the logs while nothing happens onscreen:
gstgl_gbm_utils.c:489:gst_gl_gbm_find_and_open_drm_node: Cannot open device node "/dev/dri/card0": Permission denied (13) 0:01:44.661486208 1 0x54ab000 ERROR gldisplay gstgldisplay_gbm.c:394:gst_gl_display_gbm_new: could not find or open DRM device 0:01:44.661815392 1 0x7f9a5c251680 FIXME default gstutils.c:3981:gst_pad_create_stream_id_internal:<src:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id 0:01:44.666003528 1 0x7f9a5c2515e0 WARN glwindow gstglwindow.c:293:gst_gl_window_new: Could not create window. user specified gbm, creating dummy window {"level":30,"time":1648673918415,"pid":1,"hostname":"462ef0848770","name":"native-compositor-session","msg":"New websocket connected."}
I have double-checked that the compositor-proxy is defined as privileged=true in the compose-file. What could be wrong?

[Build] Missing header (gstgldisplay_egl_device.h)

Attempting to build (yarn build:native) the compositor-proxy fails with the following trace:

FAILED: CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o
/usr/bin/cc -Dproxy_encoding_EXPORTS -I../node_modules/westfield-proxy/dist/include -isystem /usr/include/gstreamer-1.0 -isystem /usr/lib/x86_64-linux-gnu/gstreamer-1.0/include -isystem /usr/include/libdrm -isystem /usr/include/orc-0.4 -isystem /usr/include/graphene-1.0 -isystem /usr/lib/x86_64-linux-gnu/graphene-1.0/include -isystem /usr/include/glib-2.0 -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -O3 -DNDEBUG -fPIC   -mfpmath=sse -msse -msse2 -pthread -std=gnu99 -MD -MT CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o -MF CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o.d -o CMakeFiles/proxy-encoding.dir/native/src/gst_encoder.c.o   -c ../native/src/gst_encoder.c
../native/src/gst_encoder.c:9:10: fatal error: gst/gl/egl/gstgldisplay_egl_device.h: No such file or directory
    9 | #include <gst/gl/egl/gstgldisplay_egl_device.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
error Command failed with exit code 1.

OS: WSL2 (Ubuntu 20.04.5 LTS)

I hooked into vcpkg and it didn't find any missing packages, so this must be some sort of version mismatch?

i try get working "wayland of Xwayland" app in browser

@Zubnix i try get working "wayland of Xwayland" app in browser on top of docker, i try demo-site https://greenfield-preview.web.app/ and try run GTK3 demo to get error
Remote GTK3 Demo failed to launch. Remote connection failed.

Ok, i try run docker demo, get 502 error, then try make my own docker demo image.
For now i stuck on
error: XDG_RUNTIME_DIR not set in the environment
I think it need some X11 server part.
WebGL and WebSHM work fine.

I think be a good for starters make simple docker demo "How to launch xterm/xeyes in browser" to help understand how greenfield may be implemented in infrastructure.

Sorry if i wrong understand propose of greenfield.

Originally posted by @upya4ko in #55 (comment)

Trying to launch greenfield browser on Windows machine

Followed the readme with downloading repository and running following command from root.

pushd compositor-module && yarn install && yarn build && yarn link && popd && pushd compositor-demo && yarn install && yarn link greenfield-compositor && yarn star
and got following errors

greenfield

I am trying to launch greenfield on windows machine and connect with Linux docker image with wayland apps.
I am new to wayland so please share your thoughts if the Greenfield compositor can be launched on windows or not?

Persistent Application Session

Currently when a user exits the compositor, all applications are destroyed. In theory it should be possible to persist all application/client related state to a database. This allows for resuming applications on login after the previous compositor has been destroyed (by ie browser exit). Another use case would be to detach a running application from one compositor and transfer it to another user's compositor in real-time.

How to have multiple Greenfield sessions on a single page?

Is it possible to have a single page that has multiple Greenfield instances running on it? It seems like it's possible if each instance has its own session ID. However with the code currently being restructured and the documentation (https://greenfield.app/pages/components/) not being complete, I can't quite figure out how to have multiple instances of the Greenfield running, each with their own session ID. What would you recommend for this?

Can build and run, but not connect to compositor

I am on Ubuntu 22.04.1 LTS, and I am running wayland. I have WAYLAND_DISPLAY=wayland-0 set in my environment (it was preset, I didn't have to add it). I've been able to build the compositor module and compositor proxy using the instructions, but when run both and navigate to localhost:8080 and click either of the buttons, nothing happens. Just a blank white screen with the two buttons.

I also see this in the logs, which looks relevant.. but setting WAYLAND_DISPLAY to anything other than wayland-0 does not seem to fix it (I tried WAYLAND_DISPLAY=wayland-1 yarn start but that didn't help).

output of compositor proxy

(sv) nigel@nigel-KLVD-WXX9:~/Personal/builds/greenfield/compositor-proxy  (master) $ yarn start
yarn run v1.22.19
$ COMPOSITOR_SESSION_ID=test123 ts-node ./src/index.ts
Reading configuration from: /home/nigel/Personal/builds/greenfield/compositor-proxy/src/config.yaml
{"level":30,"time":1670712825416,"pid":985754,"hostname":"nigel-KLVD-WXX9","name":"main","msg":"Starting compositor proxy..."}
unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor is running
Supported EGL client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_MESA_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
Using EGL device /dev/dri/renderD128

Using EGL 1.5

Supported EGL display extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_IMG_context_priority EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display 

Supported EGL device extensions: EGL_EXT_device_drm EGL_EXT_device_drm_render_node

EGL vendor: Mesa Project

Supported DMA-BUF formats: AB4H XB4H AR30 XR30 AB30 AR24 AB24 XR24 XB24 AR15 RG16 R8   R16  GR88 GR32 YUV9 YU11 YU12 YU16 YU24 YVU9 YV11 YV12 YV16 YV24 NV12 P010 P012 P016 NV16 AYUV XYUV Y410 Y412 Y416 YUYV UYVY Y210 Y212 Y216 

EGL DMA-BUF format modifiers supported

Obtained high priority context
Using EGL_PLATFORM_DEVICE_EXT
using target device: 226:128
{"level":30,"time":1670712825437,"pid":985754,"hostname":"nigel-KLVD-WXX9","name":"native-compositor-session","msg":"Listening on: WAYLAND_DISPLAY=\"wayland-1\"."}
unlinking stale lock file /tmp/.X2-lock
xserver listening on display :2
{"level":30,"time":1670712825437,"pid":985754,"hostname":"nigel-KLVD-WXX9","name":"compositor-proxy-session","msg":"Session created."}
{"level":30,"time":1670712825439,"pid":985754,"hostname":"nigel-KLVD-WXX9","name":"main","msg":"Compositor proxy started. Listening on 0.0.0.0:8081"}
{"level":30,"time":1670712864425,"pid":985754,"hostname":"nigel-KLVD-WXX9","name":"native-compositor-session","msg":"New websocket connected."}
{"level":30,"time":1670712865079,"pid":985754,"hostname":"nigel-KLVD-WXX9","name":"native-compositor-session","msg":"New websocket connected."}

output of compositor module

(sv) nigel@nigel-KLVD-WXX9:~/Personal/builds/greenfield/compositor-module  (master) $ yarn start
yarn run v1.22.19
$ webpack serve --config demo-compositor/webpack.config.js
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.2.67:8080/
<i> [webpack-dev-server] Content not from webpack is served from './dist' directory
ts-loader: Using [email protected] and /home/nigel/Personal/builds/greenfield/compositor-module/demo-compositor/tsconfig.json
assets by path ../types/src/ 129 KiB 101 assets
assets by path *.js 8.23 MiB
  asset app.bundle.js 7.96 MiB [emitted] (name: app) 1 related asset
  asset vendors-node_modules_tinyh264_es_index_js.bundle.js 187 KiB [emitted] (id hint: vendors) 1 related asset
  asset src_remotestreaming_H264NALDecoder_worker_ts-_e6700.bundle.js 44.8 KiB [emitted] 1 related asset
  asset src_remotestreaming_H264NALDecoder_worker_ts-_e6701.bundle.js 44.8 KiB [emitted] 1 related asset
asset index.html 252 bytes [emitted]
asset ../types/demo-compositor/src/index.d.ts 11 bytes [emitted]
runtime modules 81.6 KiB 41 modules
modules by path ./src/ 7.12 MiB
  modules by path ./src/*.ts 879 KiB 37 modules
  modules by path ./src/render/*.ts 194 KiB 13 modules
  modules by path ./src/assets/*.png 20.5 KiB 12 modules
  modules by path ./src/xwayland/*.ts 530 KiB 10 modules
  modules by path ./src/remotestreaming/*.ts 139 KiB 9 modules
  modules by path ./src/api/ 84.8 KiB 9 modules
  modules by path ./src/browser/*.ts 83.1 KiB 9 modules
  modules by path ./src/math/*.ts 58.6 KiB 5 modules
  modules by path ./src/lib/ 5.18 MiB 3 modules
modules by path ./node_modules/ 704 KiB 48 modules
./demo-compositor/src/index.ts 11.2 KiB [built] [code generated]
webpack 5.75.0 compiled successfully in 9060 ms

One canvas per app

I thought I saw this somewhere before the huge change in documentation but is there a way to launch every application into its own canvas?

My use case is a DOM based web desktop where I'd like to be able to launch a Wayland application by spawning a "window"/surface that contains a canvas with only one Wayland application maximized to the borders of said DOM-based "window".

BUG. No default nrmlvo entry found.

When I try to run the greenfield demo, I get the following error (in the browser console, Keyboard.ts:46 from compositor-module/src):
Uncaught (in promise) Error: BUG. No default nrmlvo entry found.

langTokens are ["en", "US"]
The nrmlvoEntries Variable is an empty list (buildNrmlvoEntries returns an empty list as well) and therefore nrmlvoEntry is undefined.

The file /usr/local/share/X11/xkb/rules/evdev.lst does not exist on my system.

Thanks for any help in advance!

Error: Cannot find module 'app-endpoint-native

Hello,

I'm trying to get the demo running on ubuntu 18.04 host, firefox 83, as told in the README.

First I tried to fix the server build with fix from #51 and this patch:

--- a/app-endpoint-server/package.json
+++ b/app-endpoint-server/package.json
@@ -17,13 +17,13 @@
     "start": "node index.js"
   },
   "dependencies": {
-    "app-endpoint-native": "link:../app-endpoint-native",
+    "app-endpoint-native": "file:../app-endpoint-native",
     "epoll": "^4.0.0",
     "json5": "^2.1.3",
     "pino": "^6.8.0",
     "pino-pretty": "^4.1.0",
     "websocket-stream": "^5.5.2",
-    "westfield-endpoint": "link:../../westfield/server/node/endpoint",
+    "westfield-endpoint": "^0.3.2",
     "ws": "^7.4.1"

(seems the "link" keyword is not accepted by npm anymore, and I dont have westfield-endpoint package, trying the npm one)

then I follow the procedure to run the gt3 demo and get the following trace from the server:

Starting local_app-endpoint-server_1 ... 
Starting local_app-endpoint-server_1
Starting local_nginx_1 ... 
Starting local_nginx_1
Starting local_xdummy_1 ... 
Starting local_app-endpoint-server_1 ... done
Attaching to local_xdummy_1, local_nginx_1, local_app-endpoint-server_1
xdummy_1               | libudev: udev_has_devtmpfs: name_to_handle_at on /dev: Operation not permitted
nginx_1                | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_1                | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
xdummy_1               | 
xdummy_1               | X.Org X Server 1.16.4
nginx_1                | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
xdummy_1               | Release Date: 2014-12-20
nginx_1                | 10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
xdummy_1               | X Protocol Version 11, Revision 0
xdummy_1               | Build Operating System: Linux 4.9.0-4-amd64 x86_64 Debian
nginx_1                | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
xdummy_1               | Current Operating System: Linux ef1a8293ccf7 5.4.0-56-generic #62~18.04.1-Ubuntu SMP Tue Nov 24 10:07:50 UTC 2020 x86_64
xdummy_1               | Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-56-generic root=UUID=7765602d-adb4-4b91-b769-46d886c76334 ro quiet splash vt.handoff=1
nginx_1                | /docker-entrypoint.sh: Configuration complete; ready for start up
xdummy_1               | Build Date: 14 October 2017  10:41:31AM
xdummy_1               | xorg-server 2:1.16.4-1+deb8u2 (http://www.debian.org/support) 
xdummy_1               | Current version of pixman: 0.32.6
xdummy_1               |        Before reporting problems, check http://wiki.x.org
xdummy_1               |        to make sure that you have the latest version.
xdummy_1               | Markers: (--) probed, (**) from config file, (==) default setting,
xdummy_1               |        (++) from command line, (!!) notice, (II) informational,
xdummy_1               |        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
xdummy_1               | (++) Log file: "./xdummy.log", Time: Mon Dec 14 17:43:36 2020
xdummy_1               | (++) Using config file: "/etc/X11/xorg.conf"
xdummy_1               | (==) Using system config directory "/usr/share/X11/xorg.conf.d"
app-endpoint-server_1  | 
app-endpoint-server_1  | > [email protected] start /app/app-endpoint-server
app-endpoint-server_1  | > node index.js
app-endpoint-server_1  | 
app-endpoint-server_1  | {"level":30,"time":1607967818589,"pid":18,"hostname":"1152a378e0f2","name":"app-endpoint-server","msg":"Listening on 0.0.0.0:8081."}
nginx_1                | 2020/12/14 17:44:43 [error] 21#21: *1 upstream prematurely closed connection while reading response header from upstream, client: 172.19.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://172.19.0.3:8081/", host: "localhost"
nginx_1                | 172.19.0.1 - - [14/Dec/2020:17:44:43 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0"
app-endpoint-server_1  | {"level":30,"time":1607968009095,"pid":18,"hostname":"1152a378e0f2","name":"app-endpoint-server","msg":"Received web socket upgrade request with compositor session id: 1f69cd08-4410-435a-98c6-64e97bb12755. Delegating to a session child process."}
app-endpoint-server_1  | {"level":30,"time":1607968009096,"pid":18,"hostname":"1152a378e0f2","name":"app-endpoint-server","msg":"Creating new session child process."}
app-endpoint-server_1  | internal/modules/cjs/loader.js:638
app-endpoint-server_1  |     throw err;
app-endpoint-server_1  |     ^
app-endpoint-server_1  | 
app-endpoint-server_1  | Error: Cannot find module 'app-endpoint-native'
app-endpoint-server_1  |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
app-endpoint-server_1  |     at Function.Module._load (internal/modules/cjs/loader.js:562:25)
app-endpoint-server_1  |     at Module.require (internal/modules/cjs/loader.js:692:17)
app-endpoint-server_1  |     at require (internal/modules/cjs/helpers.js:25:18)
app-endpoint-server_1  |     at Object.<anonymous> (/app/app-endpoint-server/src/encoding/X264OpaqueEncoder.js:27:27)
app-endpoint-server_1  |     at Module._compile (internal/modules/cjs/loader.js:778:30)
app-endpoint-server_1  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
app-endpoint-server_1  |     at Module.load (internal/modules/cjs/loader.js:653:32)
app-endpoint-server_1  |     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
app-endpoint-server_1  |     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
app-endpoint-server_1  | {"level":30,"time":1607968009272,"pid":18,"hostname":"1152a378e0f2","name":"app-endpoint-server","msg":"Session child [25] exit."}

Broadway Support

GDK is the underlying rendering library behind GTK. It provides multiple backends including X11, Wayland, Quartz (macOS) and GDI (Windows). But there's also another one called Broadway that is of interest here - Broadway renders to a browser. Instead of a canvas or WebGL, Broadway uses the standard DOM.

To try it, run

gtk4-broadwayd :5
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk4-demo

And then open http://127.0.0.1:8085 in your web browser. It works quite well, but it can be a bit buggy at times.

My point is - It would be nice to have a broadway server integrated into Greenfield as it could offer better performance than going through Wayland.

Rewrite app-endpoint-server in a native language

Currently the app-endpoint-server implementation uses nodejs. This is and was fine for prototyping and just getting things working quickly. It is however a bit of a PITA to setup and has some not to be underestimated performance penalties.

Ideally we want to a native language that can output a single static binary easily, and can inter-operate with C libraries seamingly. It needs to provide a C function pointer from a function implemented in the source language (this is required for use with libwayland). There is also the requirement to easily operate with gstreamer.

Candidates like Rust or Go come to mind, however good old C is fine as well.

Problems compiling greenfield

Hi,
I have some problems compiling greenfield. Thank you in advance.
Procedure:

cd /tmp
sudo apt-get install -y libffi-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev webpack
npm install -g cmake-js
git clone https://github.com/udevbe/greenfield.git
cd greenfield/compositor/
npm install .

Error:

[67] ./web/src/style/greenfield.css 1.08 KiB {0} [built]
[73] ./web/src/index.js + 59 modules 490 KiB {0} [built]
     | ./web/src/index.js 3.77 KiB [built]
     | ./web/src/Session.js 4.05 KiB [built]
     | ./web/src/lib/libpixman-1.js 32.2 KiB [built]
     | ./web/src/Compositor.js 3.61 KiB [built]
     | ./web/src/lib/libxkbcommon.js 35.2 KiB [built]
     | ./web/src/Shell.js 3.51 KiB [built]
     | ./web/src/Seat.js 9.97 KiB [built]
     | ./web/src/DataDeviceManager.js 3.76 KiB [built]
     | ./web/src/Output.js 4.81 KiB [built]
     | ./web/src/Subcompositor.js 4.86 KiB [built]
     | ./web/src/XdgWmBase.js 8.22 KiB [built]
     | ./web/src/desktopshell/DesktopUserShell.js 2.56 KiB [built]
     | ./web/src/webshm/WebShm.js 3.55 KiB [built]
     | ./web/src/WebAppSocket.js 3.77 KiB [built]
     | ./web/src/WebAppLauncher.js 2.5 KiB [built]
     |     + 45 hidden modules
    + 59 hidden modules

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  libpixman-1.wasm (326 KiB)

WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

ERROR in [copy-webpack-plugin] unable to locate '/tmp/greenfield/compositor/web/public/clients' at '/tmp/greenfield/compositor/web/public/clients'
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [2] (webpack)/buildin/global.js 472 bytes {0} [built]
    [3] (webpack)/buildin/module.js 497 bytes {0} [built]
        + 2 hidden modules
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prepare: `npm run prepare:web:generate && webpack --config web/build.config/webpack.config.prod.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2019-05-03T16_28_17_382Z-debug.log

Launching apps

I am trying to launch apps by simply installing them and launching them from the alacritty terminal. They all fail (tried to launch another alacritty, pcmanfm etc) with messages like cannot open display, connection refused or no compositor listening. What should be the workflow for installing and launching apps? What about Xwayland? Also can I have one of the buttons start an Xwayland session (I can see the xterm container is configured as such on the docker-compose, can I have them launch seperately rather than both launching at the same time?). Ideally I would want to install a wayland app launcher like rofi and have it launch other apps.

Use WebTransport instead of WebSocket

Compositor-proxy currently uses WebSockets to communicate application [video] frame data. This has well known drawbacks for use in real-time communication as it's essentially a TCP connection. Instead we should use WebTransport which offers UDP semantics which is far better suited for real-time communication.

Initial preparing work has already been completed by switching to the uwebsocketjs library which will eventually support WebTransport

XWayland support

Adding XWayland support would allow running large number of applications that do not have a Wayland port. For this we need to implement an X window manager in the Greenfield compositor. It will be required to compile a modified XCB/Xlib to WebAssembly in order to maximize code reuse.

browser vs app context menu

another small issue that appears with apps that have a context menu (on right click) is that the browser context menu interferes as it appears on top of the app menu:
Screenshot_20210115_104015
apparently it can be disabled at the browser level (eg firefox), but maybe the html framework used here has a way of disabling the browser menu

WebRTC/ORTC?

Hi, I was wondering how you utilize WebRTC/ORTC? are you streaming composited screen image to browser thru WebRTC/ORTC?

Cannot GET /

Sorry I don't really know much about node applications, so this might be a dumb question. I'm trying to run this remotely, but my connection to port 8080 is always answered with Cannot GET / (even if, for instance, I curl localhost:8080). Is there an index page that I should be getting but I'm not? I tried looking for /index.js and a few others, but no luck.

Use Flutter-Web as web app widget toolkit

Currently Flutter Web uses CSS Houdini as it's paint back-end. For it to be able to run as a Greenfield web-app, we need to implement a custom renderer that can output to an array buffer or offscreen webgl canvas. The best candidate for this is CanvasKit which implements Skia in WebAssembly. The big advantage of this approach being that all mentioned drawing apis are based on the Canvas2D api + we get offscreen webgl acceleration for free.

Error starting weston-terminal

I installed weston on Fedora 28, and updated the path in app-entries. Here's what I get:

Child 12809 launching /usr/bin/weston-terminal.
Wayland client connected.
Wayland client closed.
{ Error: Command failed: /usr/bin/weston-terminal
weston-terminal: clients/window.c:5152: window_create_internal: Assertion `custom || display->xdg_shell || display->ivi_application' failed.

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:557:12)
  killed: false,
  code: null,
  signal: 'SIGABRT',
  cmd: '/usr/bin/weston-terminal',
  stdout: '',
  stderr: 'weston-terminal: clients/window.c:5152: window_create_internal: Assertion `custom || display->xdg_shell || display->ivi_application\' failed.\n' } 'Error: Command failed: /usr/bin/weston-terminal\nweston-terminal: clients/window.c:5152: window_create_internal: Assertion `custom || display->xdg_shell || display->ivi_application\' failed.\n\n    at ChildProcess.exithandler (child_process.js:275:12)\n    at emitTwo (events.js:126:13)\n    at ChildProcess.emit (events.js:214:7)\n    at maybeClose (internal/child_process.js:925:16)\n    at Socket.stream.socket.on (internal/child_process.js:346:11)\n    at emitOne (events.js:116:13)\n    at Socket.emit (events.js:211:7)\n    at Pipe._handle.close [as _onclose] (net.js:557:12)'

Is this read only on the web

Take for example a rich text widget.
Your only rendering images to the frontend so there is no real text box on the front end.
But you know the co-ordinates of where the textbox is so you just need to capture the mouse and keyboard event in the browser and pipe them back to the server where they are fed into the running desktop app causing the screen to change and so be fed up to the web client in the video stream.

Or have I gotten this totally wrong ?
Maybe your rendering real DOM objects ?

Gstreamer variables missing (compositor-module)

I am trying to create a Dockerfile for the compositor-module (it worked before), now there are a lot of new dependencies, I added most of them but I still get a gstreamer variables error. What is supposed to set these variables? This occurs during building:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/app/GSTREAMER_CONFIG_INCLUDE_DIRS
   used as include directory in directory /app
/app/GSTREAMER_INCLUDE_DIRS
   used as include directory in directory /app
GSTREAMER_APP_LIBRARIES (ADVANCED)
    linked by target "app-endpoint-encoding" in directory /app
GSTREAMER_CONFIG_LIBRARIES (ADVANCED)
    linked by target "app-endpoint-encoding" in directory /app
GSTREAMER_LIBRARIES (ADVANCED)
    linked by target "app-endpoint-encoding" in directory /app
GSTREAMER_VIDEO_LIBRARIES (ADVANCED)
    linked by target "app-endpoint-encoding" in directory /app

Clipboard works only within remote enviroment

Copy and paste works properly within remote apps but doesn't propagate to the thin client system (can't copy to and from outside the browser tab). Consider this a feature request if it's not a bug as it would be very useful for productivity.

Reverse proxy support?

I'm trying to put greenfield behind a reverse proxy (don't want to advertise both 8080 and 8081) but running into issues with the compositor-proxy URL in the demo module's index.ts.

Here's my NGINX config:

server {
   listen 80;
   location / {
      proxy_pass http://127.0.0.1:8080;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
   }
   location ~ ^/compositorProxy(.*)$ {
      proxy_http_version 1.1;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_pass http://127.0.0.1:8081/$1;
   }
}

Then in compositor-module/demo-compositor/index.ts:

...
  connect8081Button.onclick = () => {
    const compositorProxyURL = new URL('ws://localhost/compositorProxy')
    compositorProxyURL.searchParams.append('compositorSessionId', compositorSessionId)
    compositorProxyConnector.connectTo(compositorProxyURL)
  }
...

And I get this in the compositor proxy log:

{"level":50,"time":1646594472149,"pid":73,"hostname":"cae4075f6b94","name":"main","msg":"Bad or missing compositorSessionId query parameter."}

qt app freezes

Hello,

I'm trying to run a qt app through greenfield instead of the demo gtk app unfortunately it seems to freeze after a few actions.
As it runs fine via weston it seems to indicate a problem with greenfield.

However i dont know how I could debug this.
I tried to set the DEBUG env var in the app-endpoint-server container with no success.

Can't resolve './api'

When I yarn build:

Compiled with problems:

ERROR in ./src/WebFS.ts 17:0-48

Module not found: Error: Can't resolve './api' in '/path/to/greenfield/compositor-module/src'


ERROR in ./src/RemoteSocket.ts (/path/to/greenfield/compositor-module/src/RemoteSocket.ts) 21:40-47

[tsl] ERROR in /path/to/greenfield/compositor-module/src/RemoteSocket.ts(21,41)
      TS2307: Cannot find module './api' or its corresponding type declarations.


ERROR in ./src/WebFS.ts (/path/to/greenfield/compositor-module/src/WebFS.ts) 18:40-47

[tsl] ERROR in /path/to/greenfield/compositor-module/src/WebFS.ts(18,41)
      TS2307: Cannot find module './api' or its corresponding type declarations.

[Build] WSL2

I'd like to use this issue to track my process in getting Greenfield to work under Windows 11/WSL2.

According to microsoft/WSL#938 (comment), this apparently worked before.

RN, after disabling WSLg with the following command (to be updated with a snippet that will automatically pull the Windows username. As soon as I've figured out how to properly get the Windows username from Powershell or cmd without additional characters), Greenfield proxy reports that no dev/dri interface can be found.

echo $'[wsl2]\nguiApplications=false' > /mnt/c/Users/[Windows User]/.wslconfig

compositor-module fails to build

I'm getting some kind of issue when trying to build compositor-module:

$ yarn generate:webfs
$ openapi-generator-cli generate
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.DefaultGenerator - Generating with dryRun=false
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: typescript-fetch (client)
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.DefaultGenerator - Generator 'typescript-fetch' is considered stable.
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.c.l.AbstractTypeScriptClientCodegen - Hint: Environment variable 'TS_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export TS_POST_PROCESS_FILE="/usr/local/bin/prettier --write"' (Linux/Mac)
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.c.l.AbstractTypeScriptClientCodegen - Note: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/models/WebFD.ts
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/apis/WebfsApi.ts
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/index.ts
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/runtime.ts
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/apis/index.ts
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/models/index.ts
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - Skipped /app/src/api/.openapi-generator-ignore (Skipped by supportingFiles options supplied by user.)
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/.openapi-generator/VERSION
[[webfs] ./compositor-proxy-api.yaml] [main] INFO  o.o.codegen.TemplateManager - writing file /app/src/api/.openapi-generator/FILES
[[webfs] ./compositor-proxy-api.yaml] ################################################################################
[[webfs] ./compositor-proxy-api.yaml] # Thanks for using OpenAPI Generator.                                          #
[[webfs] ./compositor-proxy-api.yaml] # Please consider donation to help us maintain this project ?                 #
[[webfs] ./compositor-proxy-api.yaml] # https://opencollective.com/openapi_generator/donate                          #
################################################################################
[[webfs] ./compositor-proxy-api.yaml] java -jar "/app/node_modules/@openapitools/openapi-generator-cli/versions/5.4.0.jar" generate --input-spec="/app/compositor-proxy-api.yaml" --additional-properties="typescriptThreePlus=true,supportsES6=true,npmVersion=16.0.0" --output="src/api" --generator-name="typescript-fetch" exited with code 0
[webfs] ./compositor-proxy-api.yaml
node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts(414,6): error TS2300: Duplicate identifier 'VideoColorPrimaries'.
node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts(415,6): error TS2300: Duplicate identifier 'VideoMatrixCoefficients'.
node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts(417,6): error TS2300: Duplicate identifier 'VideoTransferCharacteristics'.
node_modules/typescript/lib/lib.dom.d.ts(18316,6): error TS2300: Duplicate identifier 'VideoColorPrimaries'.
node_modules/typescript/lib/lib.dom.d.ts(18318,6): error TS2300: Duplicate identifier 'VideoMatrixCoefficients'.
node_modules/typescript/lib/lib.dom.d.ts(18319,6): error TS2300: Duplicate identifier 'VideoTransferCharacteristics'.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn install && yarn generate && yarn build' returned a non-zero code: 2
ERROR: Service 'compositor-module' failed to build : Build failed

It used to work before, I am using docker to make a compositor-module image with the following Dockerfile:

FROM node:16-buster-slim

RUN apt-get update && apt-get dist-upgrade -y \
    && apt-get install default-jre -y \
    && apt-get autoremove -y \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY [".", "./"]

WORKDIR /app
RUN yarn install && yarn generate && yarn build
CMD ["yarn", "demo"]

/dev/dri/renderD128 permission denied. (with aside)

I first had an error log much longer than this .I installed the Nvidia drivers, composed down and back up to see this. I’m weary of changing permissions of my device. But i do find it odd that the other image logs aren’t showing up in the log.

Attaching to compositor-proxy_compositor-proxy_1, compositor-proxy_alacritty_1, compositor-proxy_xterm_1, compositor-proxy_glxgears_1, compositor-proxy_gtk4-demo_1, compositor-proxy_gtk3-demo_1
alacritty_1         | thread 'main' panicked at 'Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: LibraryOpenError(OpenError { kind: Library, detail: "opening library failed (Error loading shared library libXrandr.so.2.2.0: No such file or directory); opening library failed (Error loading shared library libXrandr.so.2: No such file or directory); opening library failed (Error loading shared library libXrandr.so: No such file or directory)" })', /home/buildozer/aports/community/alacritty/src/cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:619:9
alacritty_1         | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
compositor-proxy_1  | Reading configuration from: /app/dist/config.yaml
compositor-proxy_1  | 
compositor-proxy_1  | (node:1): GStreamer-WARNING **: 13:24:22.786: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though.
compositor-proxy_1  | {"level":30,"time":1670160262800,"pid":1,"hostname":"809d8eba39bf","name":"main","msg":"Starting compositor proxy..."}
compositor-proxy_1  | Can't open device path: /dev/dri/renderD128: Permission denied
compositor-proxy_1  | Can't initialize EGL, wl_dmabuf and wl_drm disabled.{"level":30,"time":1670160262805,"pid":1,"hostname":"809d8eba39bf","name":"native-compositor-session","msg":"Listening on: WAYLAND_DISPLAY=\"wayland-0\"."}
compositor-proxy_1  | xserver listening on display :1
compositor-proxy_1  | {"level":30,"time":1670160262806,"pid":1,"hostname":"809d8eba39bf","name":"compositor-proxy-session","msg":"Session created."}
compositor-proxy_1  | {"level":30,"time":1670160262810,"pid":1,"hostname":"809d8eba39bf","name":"main","msg":"Compositor proxy started. Listening on 0.0.0.0:8081"}
compositor-proxy_1  | {"level":30,"time":1670160262966,"pid":1,"hostname":"809d8eba39bf","name":"native-compositor-session","msg":"New Wayland connection."}
compositor-proxy_1  | Spawned Xwayland server, pid 53
compositor-proxy_1  | (WW) Option "-listen" for file descriptors is deprecated
compositor-proxy_1  | Please use "-listenfd" instead.
compositor-proxy_1  | libEGL warning: failed to open /dev/dri/renderD128: Permission denied
compositor-proxy_1  | 
compositor-proxy_1  | libEGL warning: failed to open /dev/dri/renderD128: Permission denied
compositor-proxy_1  | 
compositor-proxy_1  | {"level":30,"time":1670160263456,"pid":1,"hostname":"809d8eba39bf","name":"native-compositor-session","msg":"New Wayland connection."}
compositor-proxy_1  | {"level":30,"time":1670160263458,"pid":1,"hostname":"809d8eba39bf","name":"native-compositor-session","msg":"New Wayland connection."}
compositor-proxy_1  | {"level":30,"time":1670160263852,"pid":1,"hostname":"809d8eba39bf","name":"native-compositor-session","msg":"New Wayland connection."} 

** also also **
I’ve been building a GTK / broadwayd proxy server which led me to this project . Though I have not yet mounted GPU into my containers I also get EGL failures ( on different machines ) . I wonder what I’m missing here.

Shortcut paint feedback loop

Currently the proxy waits for confirmation from the browser before it starts encoding the next frame. This hard couples the frame update with what is effectively the input latency. We can shortcut this feedback on the proxy to drastically speed up frame repaints, which will easily double (or tripple) the max FPS.

hardware acceleration

Currently the native compositor-proxy does not expose any hardware acceleration to clients. This means clients are force to communicate their content using RAM shared memory which is generally slow, especially if we're to upload them to the GPU for video encoding.

TODO:

  • Expose hardware acceleration capabilities to clients
  • Use shared client EGL Images and feed them directly to the GPU video encoder without copies.

westfield-endpoint-generator: not found

It's a fresh install of Debian 9. Having problems on install now...

Looks like westfield isn't found or something:

frink@dev:~/Work/greenfield/app-endpoint-server$ npm install
[email protected] prepare /home/rg/Work/greenfield/app-endpoint-server
mkdir -p src/protocol/ && npm run prepare:generate:wayland && npm run prepare:generate:xdgshell
[email protected] prepare:generate:wayland /home/rg/Work/greenfield/app-endpoint-server
westfield-endpoint-generator ../protocol/wayland.xml -o src/protocol
sh: 1: westfield-endpoint-generator: not found

Originally posted by @frink in #8 (comment)

No working terminal emulator/video acceleration

I noticed that the demo xterm is running via software rendering so I tried installing a wayland native terminal emulator but could not get one working. I tried several different distros and different terminal emulators (alacritty, kitty, konsole, gnome-terminal) and they all failed in different ways. I have the following questions:

  1. Does the project support only software rendering or is it just for apps running in Xwayland?
  2. What would be the best approach to have a remote desktop wayland session? Install an app launcher and start individual apps that way or is a full blown desktop session supported somehow? What would a recommendation be for a distro and terminal emulator that has good native wayland support and would work nicely with greenfield?

Unable to launch Qt apps on Ubuntu 20.04

Hi,

I'm trying to get Qt apps like konsole or kate to work under Greenfield. Currently, app shows up in browser for a second, but crashes immediately.

me@me-server ~ [1]> konsole -platform wayland
Using Wayland-EGL
Using the 'xdg-shell' shell integration
listener function for opcode 5 of wl_pointer is NULL
fish: “konsole -platform wayland” terminated by signal SIGABRT (Abort)

Opening the URL simply presents "Upgrade required"

I am running my own instance using docker, proxied by traefik using the following configuration in compose:

version: '3.8'
services:
  compositor-proxy:
    build:
      context: .
      dockerfile: ./Dockerfile
    privileged: true
    volumes:
      - xdg-runtime-dir:/xdg-runtime-dir
      - x11-unix:/tmp/.X11-unix
      - ${PWD}/src/config.yaml:/app/config.yaml
    ports:
      - 8081:8081
    environment:
      GST_GL_WINDOW: gbm
      COMPOSITOR_SESSION_ID: test123
      DEBUG: 1
      GST_DEBUG: 3
      XDG_RUNTIME_DIR: /xdg-runtime-dir
      XAUTHORITY: /tmp/.X11-unix/Xauthority
  gtk3-demo:
    pid: 'service:compositor-proxy'
    build:
      context: example-apps/gtk3-demo
      dockerfile: Dockerfile
    volumes:
      - xdg-runtime-dir:/xdg-runtime-dir
    environment:
      XDG_RUNTIME_DIR: /xdg-runtime-dir
    restart: always
  xterm:
    pid: 'service:compositor-proxy'
    build:
      context: example-apps/xterm
      dockerfile: Dockerfile
    privileged: false
    volumes:
      - xdg-runtime-dir:/xdg-runtime-dir
      - x11-unix:/tmp/.X11-unix
    environment:
      XAUTHORITY: /tmp/.X11-unix/Xauthority
      XDG_RUNTIME_DIR: /xdg-runtime-dir
      DISPLAY: ':1'
    restart: always
volumes:
  xdg-runtime-dir:
    driver_opts:
      type: tmpfs
      device: tmpfs
  x11-unix:
    driver_opts:
      type: tmpfs
      device: tmpfs

When I open the service in a browser, it simply gives a string "update required". Unrelated, I couldn't understand where to install additional GUI apps to be used by the compositor, is that supposed to be a separate container?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.