browsertime icon indicating copy to clipboard operation
browsertime copied to clipboard

browsertime visual metrics don't work with wayland

Open julienw opened this issue 2 years ago • 7 comments

Feature/improvement

I'm using wayland on my Linux, and it looks like that browsertime uses x11grab (which is x11-based) to capture the video of the app. Probably we need another way to do that with wayland.

I know Gnome has some built-in capability to do that, but I don't know if we can tap into this, or even if that would be a good idea to be tightly coupled with Gnome.

julienw avatar Apr 05 '22 16:04 julienw

Or maybe that's another issue?

Here is my full output:

[2022-04-05 18:24:35] INFO: Running tests using Chrome - 3 iteration(s)
[2022-04-05 18:24:35] INFO: Testing url https://profiler.firefox.com iteration 1
[2022-04-05 18:24:35] ERROR: Error: Command failed with exit code 1: ffmpeg -hide_banner -video_size 1366x768 -f x11grab -framerate 30 -probesize 10M -y -draw_mouse 0 -i :99.0+0,0 -codec:v libx264rgb -threads 0 -crf 0 -preset ultrafast -vf pad=ceil(iw/2)*2:ceil(ih/2)*2 /home/julien/travail/git/browsertime/browsertime-results/profiler.firefox.com/2022-04-05T182435+0200/x11-tmp.mp4
[x11grab @ 0x56153eb024c0] Cannot open display :99.0+0,0, error 1.
:99.0+0,0: Input/output error
[x11grab @ 0x56153eb024c0] Cannot open display :99.0+0,0, error 1.
:99.0+0,0: Input/output error
    at makeError (/home/julien/travail/git/browsertime/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/home/julien/travail/git/browsertime/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Measure._startVideo (/home/julien/travail/git/browsertime/lib/core/engine/command/measure.js:86:7)
    at async Measure.start (/home/julien/travail/git/browsertime/lib/core/engine/command/measure.js:199:7)
    at async /home/julien/travail/git/browsertime/lib/core/engine/run.js:9:9
    at async Iteration.run (/home/julien/travail/git/browsertime/lib/core/engine/iteration.js:221:9)
    at async Engine.runByScript (/home/julien/travail/git/browsertime/lib/core/engine/index.js:266:20)
    at async run (/home/julien/travail/git/browsertime/bin/browsertime.js:71:22)
[2022-04-05 18:24:35] ERROR: Error: Command failed with exit code 1: ffmpeg -hide_banner -video_size 1366x768 -f x11grab -framerate 30 -probesize 10M -y -draw_mouse 0 -i :99.0+0,0 -codec:v libx264rgb -threads 0 -crf 0 -preset ultrafast -vf pad=ceil(iw/2)*2:ceil(ih/2)*2 /home/julien/travail/git/browsertime/browsertime-results/profiler.firefox.com/2022-04-05T182435+0200/x11-tmp.mp4
[x11grab @ 0x56153eb024c0] Cannot open display :99.0+0,0, error 1.
:99.0+0,0: Input/output error
[x11grab @ 0x56153eb024c0] Cannot open display :99.0+0,0, error 1.
:99.0+0,0: Input/output error
    at makeError (/home/julien/travail/git/browsertime/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/home/julien/travail/git/browsertime/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Measure._startVideo (/home/julien/travail/git/browsertime/lib/core/engine/command/measure.js:86:7)
    at async Measure.start (/home/julien/travail/git/browsertime/lib/core/engine/command/measure.js:199:7)
    at async /home/julien/travail/git/browsertime/lib/core/engine/run.js:9:9
    at async Iteration.run (/home/julien/travail/git/browsertime/lib/core/engine/iteration.js:221:9)
    at async Engine.runByScript (/home/julien/travail/git/browsertime/lib/core/engine/index.js:266:20)
    at async run (/home/julien/travail/git/browsertime/bin/browsertime.js:71:22)
[2022-04-05 18:24:35] ERROR: No data to collect

With the command:

bin/browsertime.js  https://profiler.firefox.com --visualMetrics

julienw avatar Apr 05 '22 16:04 julienw

I am assuming the DISPLAY environment variable is :0 for you?

bdekoz avatar Jun 09 '22 17:06 bdekoz

@soulgalore have you ever tried browsertime with wayland before?

gmierz avatar Jan 10 '23 16:01 gmierz

@gmierz no.

soulgalore avatar Jan 11 '23 07:01 soulgalore

wayland users can use wr-recorder instead.

bdekoz avatar Oct 09 '23 21:10 bdekoz

I think for this to happen we need to be able to setup a GitHub action that can run the tests. If someone could help me set that up then we can have a go with wr-recorder so we can continue to verify that it works.

soulgalore avatar Dec 17 '23 06:12 soulgalore

I believe we also need to implement the equivalent of xvfb.js? Some leads in https://unix.stackexchange.com/questions/653672/virtual-wayland-display-server-possible, it looks like wayland's default compositor weston can easily work headless.

julienw avatar Dec 18 '23 10:12 julienw