udevbe / greenfield

HTML5 Wayland compositor :seedling:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can build and run, but not connect to compositor

nigelredding opened this issue · comments

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 typescript@4.9.3 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

The environment variable WAYLAND_DISPLAY is to tell clients to which compositor to connect to. The compositor proxy from your logs outputs: "Listening on: WAYLAND_DISPLAY=\"wayland-1\", so you probably already have a wayland compositor running (probably the default Ubuntu gnome wayland session).

So for clients to find the compositor proxy, you need to do eg. export WAYLAND_DISPLAY=wayland-1 in a terminal first, and then start a client from that same terminal.

@nigelredding Did you manage to fix the issue?