Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbol XOpenDisplay lookup error #281

Closed
webarchymeta opened this issue Jul 29, 2016 · 36 comments
Closed

symbol XOpenDisplay lookup error #281

webarchymeta opened this issue Jul 29, 2016 · 36 comments

Comments

@webarchymeta
Copy link

webarchymeta commented Jul 29, 2016

machine: ubuntu 14.04
node: v5.12.0
wrtc: v0.0.61

I installed node-webrtc from source. The installation was successful. But when the test or samples were run I got:

node: symbol lookup error: [local-path]/build/wrtc/v0.0.61/Release/node-v47-linux-x64/wrtc.node: undefined symbol: XOpenDisplay

What can I do to correct this?

@manuguerra
Copy link
Contributor

manuguerra commented Aug 23, 2016

I'm having the same issue with the precompiled libwebrtc for x86_64, but it works for OSX. I tried building the library myself using the build-webrtc module, got the same error for both x86_64 and ia32. I I think there may be a linking problem somewhere in the libwebrtc building steps for Linux.

@TngCiemniak
Copy link

Having the same issue as webarchymeta. On ubuntu as well as on debian 8.5

@manuguerra
Copy link
Contributor

manuguerra commented Aug 24, 2016

I got it working today; It seems both pulse and video render include X11, thus the reference to XOpenDisplay. So I built libwebrtc (using the build-webrtc module) adding include_pulse_audio=0 and include_internal_video_render=0 in jakelib/environment.js.

@markandrus
Copy link
Member

markandrus commented Aug 24, 2016

Nice find @manuguerra. I wonder if something like #287 would improve upon this. I wonder if we could also override whatever relies on the internal video renderer.

@manuguerra
Copy link
Contributor

manuguerra commented Aug 25, 2016

Thanks, @markandrus! I'll try your changes to use fake audio device, as I'm having a libasound issue with my 32 build on an embedded system. It believe it should also help to fix the XOpenDisplay issue, as it does not depend on X11.
Is there something similar to the video renderer? Btw, I noticed that it was removed from newer branches (starting from branch 52) . In the meantime, just using include_internal_video_render=0 seems to be working for me.

@manuguerra
Copy link
Contributor

manuguerra commented Aug 25, 2016

Just an update, I tried #287 and it fixed the issue when alsa is missing from the system; now my 32 bit build seems to be running fine. Thanks, @markandrus!
I did have an issue when running the debug build, it breaks an assert. But the release build looks fine so far.

[more updates] it seems the fake audio device uses too much CPU. In my tests, each connection is using 3 times as much CPU as when using alsa.

@markandrus
Copy link
Member

Thanks @manuguerra. Mind opening an issue with the assert? It may make sense for me to start building debug (x64) libwebrtc.a releases for OS X, Linux, and Windows (I cannot commit to 32-bit builds personally right now).

@manuguerra
Copy link
Contributor

Sure thing, @markandrus. I'll build a debug version next week and will try again with and without #287 and will let you know. If I see the assert error with the current release, I'll open an issue. If not, I'll add add a comment to your PR with the details.

@RaggarDK
Copy link

Sorry for the inconvenient newbie question, but I am unsure as to how I make this work.
I cloned the build-webrtc rep from source, changed the environment.js with your suggestions and ran:
npm run build-webrtc
jake build-webrtc (Jake needed a global install from npm).

Now, on my VM this took close to 6 hours(mainly the download), and left me a little clueless.
I don't really see a lot of files created other than libwebrtc.a.
What am I supposed to do with this file? I don't see a folder anywhere containing the usual wrtc module within the build-webrtc directory.
What am I missing?

@manuguerra
Copy link
Contributor

Hi @RaggarDK, now that you have libwebrtc.a, you can use it, along with the headers (see the copy-webrtc-headers command of build-webrtc) to build node-webrtc. You can clone the project, adding those files in the third-party folder as expected by the build script, and run npm install --build-from-source.

@jlison
Copy link

jlison commented Aug 30, 2016

Hi @manuguerra ! Thank you for sharing your findings. I was also able to obtain the aforementioned libwebrtc.a file; nevertheless, I cannot seem to be able to get node-webrtc.
I ran the following commands in the root of build-webrtc without any errors:

  1. npm run build-webrtc => Obtained libwebrtc.a
  2. npm run copy-webrtc-headers
  3. npm install --build-from-source

After running the last command, I do not see any new files in the root of my directory. I am trying to get a copy of node-webrtc so I can update wrtc.node in the build folder of the npm module node-wrtc in order to avoid the node: symbol lookup error that started this thread:

node: symbol lookup error: [local-path]/build/wrtc/v0.0.61/Release/node-v47-linux-x64/wrtc.node: undefined symbol: XOpenDisplay

This is what my third_party folder looks like:
third party folder build-webrtc

Any chance that you could point me in the right direction? My apologies in advance if I'm asking something that is very obvious, but I have spent quite a few hours trying to fix this issue without success.

@manuguerra
Copy link
Contributor

No worries, @jlison! The problem is that you should run npm install --build-from-source from the node-webrtc project folder, not from build-webrtc (which is used to build libwebrtc only).

So, you must copy the include and lib folders that you got from build-webrtc into the following folder:

<node-webrtc>/third_party/webrtc/

And then you run your step 3, but from the node-webrtc project. The build being successful, you'll find the resulting node.wrtc binary in the build/Release folder.

@RaggarDK
Copy link

Awesome.
Connection established between my browser and my node server. Just what I needed.
Thank you for taking your time to help us ;)

@jlison
Copy link

jlison commented Aug 31, 2016

@manuguerra ! It worked! Thank you so much! I owe you a beer. I will try to find the time to document the building process in the wiki for people that are not as familiar with the module (like myself). By the way, great project. My most sincere token of appreciation to the 'js-platform' team and markandrus for maintaining it.

@manuguerra
Copy link
Contributor

That's great, @RaggarDK and @jlison! I'm glad it worked for you!

@jlison
Copy link

jlison commented Sep 12, 2016

I was finally able to dedicate some time to document how to build wrtc.node from source. I expanded a little bit the Building section in the project's Wiki, and I added some screenshots to make the building process easier to follow. Feel free to correct any mistakes that you may see. Thanks again to everyone for your help!

@markandrus
Copy link
Member

Great work @jlison 👍

@manuguerra
Copy link
Contributor

Awesome, thanks @jlison!

@victorb
Copy link

victorb commented Dec 13, 2016

Had the very same issue on Ubuntu 16.04.1 LTS so tried following the instructions for building in the wiki, that @jlison wrote up after following @manuguerra's instructions. When trying to run the binary in the end, I end up with seg fault segmentation fault (core dumped) ./build/Release/wrtc.node

Details:

$ npm version                    
{ wrtc: '0.0.62',
  npm: '4.0.2',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '57.1',
  modules: '48',
  node: '6.9.0',
  openssl: '1.0.2j',
  uv: '1.9.1',
  v8: '5.1.281.84',
  zlib: '1.2.8' }

node-webrtc commit f5d13d137a08d93b6bec48c82ef792f5df5b08b2

build-webrtc commit 8ad587bdde711aa15cd7b10f8ed4d8cb3fbd009a

Am I doing something fatally wrong or could something be broken currently?

Edit: Replacing node_modules/wrtc/build/wrtc/v0.0.61/Release/node-v48-linux-x64/wrtc.node with the artifact from node-webrtc did fix the issue though node-webrtc/build/Release/wrtc.node. Running the binary directly was why I got the seg fault

@Zubnix
Copy link

Zubnix commented Jun 5, 2017

am I correct to state that this bug is still not fixed (and as such node-webrtc on linux is effectively broken), and everything in this thread is just a hack/workaround?

@markandrus
Copy link
Member

markandrus commented Jun 6, 2017 via email

@Zubnix
Copy link

Zubnix commented Jun 6, 2017

I use gentoo with a running X server and alsa and whatnot. So a missing lib on my part doesn't seem to be the problem.

I rather suspect that during build time a link error is ignored
or
there is a build time transitive link dependency that shouldn't really be there (what is actually depending on that libX11 symbol anyway, and why?)

That's the only thing I can come up with why it works on some distros while it fails for others.
If I use LD_PRELOAD to make sure it does find libX11, the error seems to go away, however in firefox I get: " InvalidSessionDescriptionError: Description has no media sections" but that seems to be an unrelated(?) issue.

Some more general info about the link problem here: http://www.kaizou.org/2015/01/linux-libraries/

@webarchymeta
Copy link
Author

I would say that is only partially solved and is an issue to be resolved. The out of box package still does not work on some linux systems (i.e ubuntu series). It would be better to include the include_pulse_audio=0 and include_internal_video_render=0 bits into the build process of the current package itself since the current library has nothing to do with them. It could reduce the size of the lib as well ...

@roccomuso
Copy link

I'm having the same issue on Ubuntu with Node v6.8.0

@nazar-pc
Copy link
Contributor

I'm wondering why do I see this issue when I only use data channels?
Can this issue be fixed at all? It has been opened for almost a year now.

@Zubnix
Copy link

Zubnix commented Jun 19, 2017

@nazar-pc The issue is with the linking options when compiling native code. It includes code that expects the symbol, yet the X11 library is not properly linked. There are basically 2 solutions to this: Fix the code that expect the X11 library so it doesn't depend on libx11 (preferred solution), or fix the build so it properly links.

@nazar-pc
Copy link
Contributor

Is there anyone planning to work on this in reasonably close future? I'm going to build it myself, but it take a lot of space on disk and quite a lot of time.

@HefnySco
Copy link

HefnySco commented Aug 9, 2017

I compiled using include_internal_video_render=0 to avoid the XOpenDisplay problem.
now when I call getUserMedia I get video track readState = ended. Does this has to do with the settings ?

@nazar-pc
Copy link
Contributor

Is anyone working on this? It is open for quite a long time and I'm unfortunately not capable of solving this myself.

@Zubnix
Copy link

Zubnix commented Nov 14, 2017

I don't think so.

However there is this good news:
https://groups.google.com/forum/?__s=obdrvn8g53z98ugdgkuz#!msg/discuss-webrtc/qDtSDxoNSII/69b6fAkxAQAJ

Build WebRTC with DataChannel only
webrtc::CreateModularPeerConnectionFactory() is available and it can be used to build WebRTC with DataChannel support only. It accepts MediaEngineInterface, CallFactoryInterface and RtcEventLogFactoryInterface as arguments. If the application knows it won't use certain modules, it can pass in null pointers for specific modules and omit the corresponding modules from its build. See an example of usage in webrtc:7613.

To build WebRTC with DataChannel support only:

// Create a peerconnection factory without media support.
CreateModularPeerConnectionFactory(network_thread,
worker_thread,
signaling_thread,
nullptr /MediaEngineInterface/,
nullptr /CallFactoryInterface/,
nullptr /*RtcEventLogFactoryInterface/);
// For native C++, depend on "peerconnection" without media instead of "libjingle_peerconnection"
deps = [ "pc:peerconnection" ]

// For ObjC wrapper, depend on the no_media version of PeerconnectionFactory.
deps = [ "peerconnectionfactory_no_media_factory" ]

// For Android wrapper, depend on the datachannel only version target.
deps = [
libjingle_peerconnection_datachannelonly_so
]

@nazar-pc
Copy link
Contributor

For the time being I think it would be nice and quite easy for maintainers to publish DataChannel-only version of this project until this issue is resolved.

@markandrus
Copy link
Member

I had to make some changes to support Node 9 (#333). This ended up being a good opportunity to try tackling

  • Upgrading WebRTC (to M57)
  • Using a different provider for static libs (libwebrtc)
  • Working around the XOpenDisplay issue

Hopefully 0.0.63 fixes these things. I'm planning to publish it in the next couple days if the builds are green.

Best,
Mark

@webarchymeta
Copy link
Author

There is also memory leak issue (in binary data transfer mode) (see #304) that is pending. It would be nice if it could be resolved ...

@Zubnix
Copy link

Zubnix commented Nov 21, 2017

or a segfault if you use just a simple read only property of a closed datachannel see #236

@markandrus
Copy link
Member

v0.0.63 is out, which should hopefully fix this (at least it looked fixed when I checked the Travis-CI logs). Once I updated to using libwebrtc's static libraries, I saw the XOpenDisplay error. Then, when I switched to using FakeAudioDeviceModule it seemed to go away.

Thanks @webarchymeta, will look at that next.

Thanks, too, @Zubnix.

Please re-open this issue if the problem persists.

Best,
Mark

@Zubnix
Copy link

Zubnix commented Nov 22, 2017

Thanks a lot @markandrus for your effort! ❤️

I will test and see if anything pops up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests