Has anyone gotten web entities to work on linux?


#1

Using the stable build equivalent to 5211 in UbuntuStudio Wiley, I can’t see web entities similar to that reported for mac at Can’t see web entities on a Mac .

Has anyone gotten it to work with a specific Qt version. I compiled the interface with Qt 5.5.1 from @Coal’s post at Compiling Interface on UbuntuStudio 15.10 .

It’s one of the things in the “home” demo that does not work in UbuntuStudio. The other thing that does not work are the light and fan switches.


#2

They are disabled on Linux. Before they were disabled, they crashed interface anytime they became visible. It will take someone with better Qt chops than mine to fix it.

in file libraries/entities-renderer/src/RenderableWebEntity.cpp in function RenderableWebEntityItem::render is this:

if (!_webSurface) {
    #if defined(Q_OS_LINUX)
        // these don't seem to work on Linux
        return;
    #else
        if (!buildWebSurface(static_cast<EntityTreeRenderer*>(args->_renderer))) {
        return;
    }
    #endif
}

I would expect the fan and lights to work.


#3

Me neither… but strangely from only one of my Ubuntu machines.

Are you able to see any other kinds of “offscreen” web views?

(like the Ctrl+b browser or Edit mode’s tabbed Tool Window?)

If you want to run a quick experiment here is a webview test gist that loads four different kinds side-by-side. It can be started as a client script using Ctrl+Shift+o and this URL:

https://rawgit.com/humbletim/877adedf5caa8e689b8a3d7c2fc34a14/raw/0c0bfdc1bc74a19026830da32c667b505870be4e/test-webviews.js

On my "working’ Ubuntu machine w/Intel HD on-board graphics and Mesa:

(the red and blue channels get reversed, but I think that might be a Mesa quirk)

On my “better” Ubuntu machine w/older but dedicated Radeon:

(the OverlayWebWindow and Web Entity views are actually there, just rendered invisibly)

Since this seems to affect stock Qt/QML WebEngineViews too (which to my knowledge have not been Linux #ifdef-disabled anywhere), it might be some kind of upstream bug in Qt or Chromium.


#4

Thanks for the reply @sethalves and @humbletim.

I did the test-webviews.js and I got the following. Web Entity does not display but it is there as an invisible entity.

Then I reenabled web entity rendering in ~hifi/libraries/entities-renderer/src/RenderableWebEntity.cpp by commenting out the following:

if (!_webSurface) {
    //#if defined(Q_OS_LINUX)
    // these don't seem to work on Linux
    //return;
    //#else
    if (!buildWebSurface(static_cast<EntityTreeRenderer*>(args->_renderer))) {
        return;
    }
    //#endif
}

I recompiled another interface and repeated the test-webviews.js and web entity is displayed without experiencing any crashing of the interface:


My linux box has the following UbuntuStudio version and Nvidia gpu:

Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily

Nvidia Driver Version: 367.35 (xorg-edgers ppa)
GPU: GeForce GTX 980 Ti

I’m not getting any crash. Is it possible that upstream bugs had been resolved?
And would it be possible for others with Linux boxes to test if web entities will display in their boxes?


#5

And I got the switches to work by reloading scripts and/or triggering the reset robot swiper.


#6

Great! I haven’t tried in a while. I’ll make a PR to back-out the disabling of web-entities on Linux.


#7

… yesterday I discovered the crash wasn’t a segfault – in my case OGLplus reports an uncaught exception and then deliberately terminates the process.

I still think the PR to back-out the #ifdef is a good idea though.

And then if for some reason certain machines are still affected, what seems to work just as well as the #ifdef is absorbing the non-fatal exception at runtime:

try {
    _webSurface->create(currentContext);
} catch(/*oglplus::Error*/ const std::exception& err) {
    qWarning() << "RenderableWebEntityItem::buildWebSurface error: " << err.what();
    return false;
}

(not suggesting this yet – just mentioning as a possible fallback strategy)


#8

Just started over with a fresh Ubuntu 16.04.1 install and a dev rebuild of Interface (including the change for re-enabling web entities).

Webviews worked fine for a while… but then a day or so later started crashing 100% of the time, though only with SSL websites:

* thread #89: tid = 21547, 0x0000000000000000, name = 'NSS SSL ThreadW', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)

It seems Chromium/QtWebEngine has some kind of a sensitive library dependency somewhere – because all I think I did between working/nonworking was apt-get install additional software.

Anyway, the interwebs seem to suggest Qt5.6 somehow resolves this issue. And for now one effective workaround seems to be manually preloading libnss3.so:

env LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libnss3.so ./interface/interface