Building WebRTC for ARM Linux without X11

756 views
Skip to first unread message

Nithyesh Sankar

unread,
Sep 27, 2017, 11:51:25 AM9/27/17
to discuss-webrtc
Hi,

I have written a native WebRTC application which uses only datachannel. I am able to compile and run this application on an ARM device with X11. Now I have to deploy the application on an ARM device without X11. So when i run the gn command I include the following arguments

--args='target_os="android" target_cpu="arm" rtc_use_gtk=false use_x11=false rtc_include_tests=true rtc_include_internal_video_render=false rtc_include_pulse_audio=false'


The library gets built successfully. But when I compile any application using the library, I get undefined reference errors as follows

~/..../libwebrtc.a(audio_device_alsa_linux.o): In function `webrtc::AudioDeviceLinuxALSA::Init()':
../../webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc:(.text._ZN6webrtc20AudioDeviceLinuxALSA4InitEv+0x28): undefined reference to `
XOpenDisplay'
~/..../libwebrtc.a(audio_device_alsa_linux.o): In function `webrtc::AudioDeviceLinuxALSA::Terminate()'
:
../../webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc:(.text._ZN6webrtc20AudioDeviceLinuxALSA9TerminateEv+0x6a): undefined reference to `XCloseDisplay'
~/..../libwebrtc.a(audio_device_alsa_linux.o): In function `
webrtc::AudioDeviceLinuxALSA::RecThreadProcess()':
../../webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc:(.text._ZN6webrtc20AudioDeviceLinuxALSA16RecThreadProcessEv+0x1ce): undefined reference to `XQueryKeymap'

~/..../libwebrtc.a(audio_device_alsa_linux.o): In function `webrtc::AudioDeviceLinuxALSA::KeyPressed() const':
../../webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc:(.text._ZNK6webrtc20AudioDeviceLinuxALSA10KeyPressedEv+0x1c): undefined reference to `
XQueryKeymap'
~/..../libwebrtc.a(audio_device_pulse_linux.o): In function `webrtc::AudioDeviceLinuxPulse::Init()'
:
../../webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc:(.text._ZN6webrtc21AudioDeviceLinuxPulse4InitEv+0x24): undefined reference to `XOpenDisplay'
~/..../libwebrtc.a(audio_device_pulse_linux.o): In function `
webrtc::AudioDeviceLinuxPulse::Terminate()':
../../webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc:(.text._ZN6webrtc21AudioDeviceLinuxPulse9TerminateEv+0xcc): undefined reference to `XCloseDisplay'

~/..../libwebrtc.a(audio_device_pulse_linux.o): In function `webrtc::AudioDeviceLinuxPulse::ProcessRecordedData(signed char*, unsigned int, unsigned int)':
../../webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc:(.text._ZN6webrtc21AudioDeviceLinuxPulse19ProcessRecordedDataEPajj+0x66): undefined reference to `
XQueryKeymap'
~/..../libwebrtc.a(audio_device_pulse_linux.o): In function `webrtc::AudioDeviceLinuxPulse::KeyPressed() const'
:
../../webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc:(.text._ZNK6webrtc21AudioDeviceLinuxPulse10KeyPressedEv+0x1c): undefined reference to `XQueryKeymap'

I am not sure why X libraries would be after applying the use_x11 argument. Am I missing some flag? Could someone help me out with what I am doing wrong?

Henrik Kjellander

unread,
Oct 2, 2017, 8:31:35 AM10/2/17
to discuss-webrtc
We're not supporting setting the GN variable 'use_x11' at the moment, so I'm surprised you can even run gn with that command line. When I try on HEAD I get this error (on Linux):

$ gn gen out/nox11 --args='target_os="android" target_cpu="arm" rtc_use_gtk=false use_x11=false rtc_include_tests=true rtc_include_internal_video_render=false rtc_include_pulse_audio=false'
ERROR at the command-line "--args":1:64: Build argument has no effect.
target_os="android" target_cpu="arm" rtc_use_gtk=false use_x11=false rtc_include_tests=true rtc_include_internal_video_render=false rtc_include_pulse_audio=false
                                                               ^----
Did you mean "use_cxx11"?

The variable "use_x11" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

To view all possible args, run "gn args --list <builddir>"
Done. Made 3315 targets from 190 files in 558ms

However, I think it brings up a good point though, and I filed https://bugs.chromium.org/p/webrtc/issues/detail?id=8319 to get it fixed properly.
The workaround is to set use_ozone=true instead. See the bug for more info.


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/550fede9-608b-45ed-9f4e-0e03ceb54f90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages