server icon indicating copy to clipboard operation
server copied to clipboard

CEF Upgrade

Open Julusian opened this issue 4 years ago • 27 comments

Description

CEF often has breaking bugs which block us from upgrading to certain versions. The purpose of this issue is to track those bugs so that we know why we can't use a version and what to verify is fixed when we do upgrade.

CEF 117

Current version in master

Julusian avatar Sep 20 '19 19:09 Julusian

in the version 77??

Jgaleas7 avatar Oct 06 '19 00:10 Jgaleas7

I think shared texture still not back in 77

sirfnomi avatar Oct 06 '19 12:10 sirfnomi

Hi Julusian, Is CasparCG updating with 73 till new Viz gets shared texture ?

sirfnomi avatar Oct 06 '19 12:10 sirfnomi

Yes, my intention is for #1217 to update to CEF73. Hopefully that will happen sometime this month

Julusian avatar Oct 06 '19 14:10 Julusian

Thanks. yeah hopefully!!

sirfnomi avatar Oct 06 '19 20:10 sirfnomi

any update?

Jgaleas7 avatar Nov 20 '19 00:11 Jgaleas7

@Jgaleas7 master is now updated to CEF71, with shared texture support

Julusian avatar Nov 22 '19 12:11 Julusian

@Julusian master is now updated to CEF71, with shared texture support

I'm sure the builds has stoped to work due to this. I can try to fix it this weekend or on Monday morning.

dotarmin avatar Nov 22 '19 13:11 dotarmin

@Julusian master is now updated to CEF71, with shared texture support

I'm sure the builds has stoped to work due to this. I can try to fix it this weekend or on Monday morning.

That explains why I couldn't see a build! Wasn't sure how long they took following the commit

grahamspr86 avatar Nov 22 '19 14:11 grahamspr86

That explains why I couldn't see a build! Wasn't sure how long they took following the commit

I just noticed it, I can maybe even try to fix it tonight if I'm free. It takes around 7 minutes for a build to finish.

dotarmin avatar Nov 22 '19 14:11 dotarmin

@dotarmin It compiles in vs fine, so I guess it will be something with the packaging? The files needed to be copied from CEF has changed in this version so that could be it, but its hard to say without seeing the build output

Julusian avatar Nov 22 '19 14:11 Julusian

The files needed to be copied from CEF has changed in this version so that could be it

Exactly what it is. I have an idea about having a repo with build-scripts that checks out and build the server OR we put back the build scripts into this repo to make it "self living", then on checkout we can use the scripts available within the repo it-self.

Input?

dotarmin avatar Nov 22 '19 14:11 dotarmin

I think that a script which simply creates a built zip in this repo would make sense. Especially as the script now will need to be a little different for 2.2 and 2.3. Versioning of it will get complicated if it lives elsewhere. Under tools/windows/ is a good place for it, as we already have linux ones next to that

Julusian avatar Nov 22 '19 14:11 Julusian

Under tools/windows/ is a good place for it, as we already have linux ones next to that

Great @Julusian, I can try fix this later or this weekend. Otherwise I can do it next week. The scripts will be similar to the once we had before in v2.1.x, slightly modified.

Thanks!

dotarmin avatar Nov 22 '19 14:11 dotarmin

@Julusian @dotarmin - You may have already seen this, but looks like OBS finally got a newer CEF package to work with shared texture support - maybe a path forward for updating CasparCG: https://github.com/obsproject/obs-studio/discussions/3853#discussioncomment-1710556

krushd avatar Dec 29 '21 18:12 krushd

@krushd @Julusian @dotarmin - I've migrated to CEF version 97 on master branch and looks like its working but i cannot be sure its ok;

  • play 1-1 [html] get.webgl.org displays and says your browser supports webgl
  • no gpu memory leak on repeating play html template commands
  • pixijs examples plays well

but;

  • onacceleratedpaint never invoked, only onpaint function invoked as if gpu enabled false in config. (i ve disabled shared_texture_enabled check block )
  • there is a console log says "0220/014656.393:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE"

mryvz avatar Feb 19 '22 23:02 mryvz

What changes did you do to the HTML module?

Every CEF upgrade has involved refactoring of the HTML module, this big of a jump in version might even require significant refactoring. But it sounds promising that you got it working.

You should get some hints by checking what modifications obs-browser did when they upgraded CEF. If you are running on Win you might want to see if adding a win10 manifest helps (https://github.com/nrkno/sofie-casparcg-server/pull/41/commits/4f432eb69c794c070af0828c05349cd6070bdeba)

hreinnbeck avatar Feb 19 '22 23:02 hreinnbeck

@hreinnbeck Not Much only basic things,

Updated branch, (Should i make a pull requrest?) https://github.com/mryvz/server/tree/cef-update-v97

html_producer.cpp

  • OnBeforePopup method has an extra argument so just changed overrided mehod to new form,
  • OnProcessMessageReceived method has an extra argument so just changed override method to new form.
  • CefBrowser::SendProcessMessage method no more exist replaced all to CefBrowser::GetMainFrame::SendProcessMessage
  • CefWindowInfo.width and CefWindowInfo.height no more , replaced to CefWindowInfo.bounds.width and CefWindowInfo.bounds.height
  • CefBrowserHost::CreateBrowser has an extra argument , just passed nullptr

html.cpp

  • OnProcessMessageReceived method has an extra argument so just changed override method to new form.
  • CefBrowser::SendProcessMessage method no more exist replaced all to CefBrowser::GetMainFrame::SendProcessMessage

mryvz avatar Feb 19 '22 23:02 mryvz

I dont know how I missed these comments..

@mryvz thats because shared_texture support is still broken in CEF (since 76). There is an unmerged PR waiting since soon after it broke to reimplement it.

I have been playing with upgrading to 95, using the custom builds that OBS use, and it looks to be working well

Julusian avatar Apr 22 '22 14:04 Julusian

Any word on upgrading to latest CEF? It's kinda painful in some cases to not be able to use more recent javascript standards like module imports.

pbelbin avatar Aug 13 '22 17:08 pbelbin

I'm waiting for it too, hope it gets updated soon

sirfnomi avatar Aug 14 '22 13:08 sirfnomi

#1427

Julusian avatar Aug 14 '22 15:08 Julusian

master is now on CEF v95

OBS are putting a considerable effort into keeping their version of CEF updated (they jumped to 103 between me opening #1427 and merging it), so hopefully we can keep reusing their work for future updates

Julusian avatar Sep 13 '22 11:09 Julusian

@Julusian I'm curious if the requestor of the OnAcceleratedPaint2 change is using it for a specific edge case that wouldn't impact Caspar (or OBS for that matter)? Tracing the thread back to https://github.com/obsproject/cef/commit/1cc2af87cf6bbdac9e1dbccb5efdfd1934c63062 - it seems like a new request, not something that was in and then removed in 5060 (which sounds like it will be the last version for a little while)). I got 103 to compile into Caspar - running some limited tests now.

krushd avatar Sep 13 '22 15:09 krushd

@krushd it may well work, all I tried was updating CEF, got no frames and gave up https://github.com/CasparCG/server/commit/ad5a317bf62b3f551cd43058d035243d09d9e05d 95 is new enough for my client, so I couldnt justify spending much time to try and get 103 working

Julusian avatar Sep 13 '22 15:09 Julusian

@Julusian Same here (95 does everything I need) - got 103 to compile - but not getting anything real to play out other than chrome;//version.

I'll play around a little bit and post any updates here if I find anything,

krushd avatar Sep 13 '22 15:09 krushd

@krushd Upon getting black, my assumption (I may have set breakpoints too?) was that it wasnt calling OnAcceleratedPaint2. Presumably because it was reusing the d3d texture, which matches up perfectly with that linked PR.

For OBS, that doesnt matter as they directly pass the texture handle to their compositor. But we are buffering frames, and do a copy of the texture onto our own opengl texture as part of OnAcceleratedPaint2. So if its not called, we don't get a new frame.

If you do get it working, then I will happily merge it. As long as I don't have to compile CEF to apply that patch..

Julusian avatar Sep 13 '22 15:09 Julusian