How to enable webrtc trace on android

2,073 views
Skip to first unread message

tao siping

unread,
Jun 18, 2014, 2:14:45 PM6/18/14
to chromi...@chromium.org
Hi,

In webrtc standalone test app, I can dump the trace to a file on sdcard. Is it possible to do the same thing by chromium? I only need the webrtc trace actually. I tried to create a file on sdcard by fopen to collect trace, but failed, looks like there is some security limitation in chromium.

Best Regards,
Siping

Primiano Tucci

unread,
Jun 18, 2014, 3:11:52 PM6/18/14
to sipin...@gmail.com, Chromium-dev

I have no idea how webrtc tracing works, but on Android you have two major things preventing you to just fopen  a file from the renderer : Unix permissions and selinux. 
if you know where the trace will be saved (hopefully somewhere in /sdcard) make sure the dir is world writable and disable selinux (adb root; adb shell "echo 0 > /sys/fs/selinux/enforce"). 
clearly this is just for local development and not for production.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Henrik Andreasson

unread,
Jun 18, 2014, 3:31:39 PM6/18/14
to Primiano Tucci, sipin...@gmail.com, Chromium-dev
Siping, can you please specify your question more. What exactly are you building here? Where do you try fopen? Are you looking for a way to get logs in Chrome for Android tied to a WebRTC client? What type of logs do you need? Can you root your device?

tao siping

unread,
Jun 18, 2014, 3:51:11 PM6/18/14
to Henrik Andreasson, Primiano Tucci, Chromium-dev
Sure.
In webrtc, previously, I can use WEBRTC_TRACE macro to dump some traces to a text file on sdcard by calling SetTraceFilter function. At least, it works well with the webrtc standalone test app (its name is WebRTCDemoxxx.apk).
My question is, can I do the same thing with chromium? I want to know the behavior of chromium to chromium video call (of course, by webrtc video engine), so I'd like to collect some traces of webrtc video engine when the call is established.

Best Regards,
Siping

Henrik Andreasson

unread,
Jun 19, 2014, 7:08:45 AM6/19/14
to tao siping, Primiano Tucci, Chromium-dev
Chromium logging from LOG(INFO) etc is directed to the android logcat logging facility. You can filter the messages, e.g. view chromium verbose logging, everything else at warning level with:

adb logcat chromium:V *:W

I don't think there is a way for you to get the native logs (VLOGS) from WebRTC in Chrome since you would have to create a file in a write-protected folder to set up command-line flags to filter log outputs.
However, if you are on a rooted device, command-line flags with log filters can be added like so:

adb shell 'echo "chrome <flags>" > /data/local/chrome-command-line'

The exact filter syntax can be found in the discuss-webrtc forum; see e.g. https://groups.google.com/forum/#!searchin/discuss-webrtc/vmodule/discuss-webrtc/YTILJJwRCMI/wmukZEK_ZUcJ.

I would start out with a desktop platform first (Linux, Mac or Windows) and ensure that logging in Chrome for WebRTC works first (http://www.chromium.org/for-testers/enable-logging). Then I would try to repeat the same steps on Android given that the device is rooted. If it is not, all you have on Android is the default logcat outputs mentioned above.

Please note that it is not possible to use fopen in Chrome due to the sandbox model which does not allow these types of file operations in any render process.

tao siping

unread,
Jun 19, 2014, 11:34:39 AM6/19/14
to Henrik Andreasson, Primiano Tucci, Chromium-dev
Thanks! Very clear.

Best Regards,
Siping
Reply all
Reply to author
Forward
0 new messages