Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RenderScript support in FxOS/B2GOS and webapps?

38 views
Skip to first unread message

emeric....@gmail.com

unread,
Jan 21, 2017, 6:43:35 AM1/21/17
to mozilla-...@lists.mozilla.org
Hi,

Does FxOS/B2GOS support and take advantages of RenderScript [1]? Or is there any webapp taking advantages of it, such as Youtube?

I'm asking this because there are RenderScript blobs for Adreno GPU in system/vendor/lib directory of Flame v18D base image. And while these blobs are correctly copied to private builds by extract_files.sh script, the open bits they rely upon aren't. These are:
- system/lib/libbcc.so
- system/lib/libbcc.sha1.so
- system/lib/libbcinfo.so
- system/lib/libclcore.bc
- system/lib/libclcore_debug.bc
- system/lib/libclcore_neon.bc
- system/lib/libcompiler_rt.so
- system/lib/libLLVM.so
- system/lib/libRS.so
- system/lib/libRScpp.so
- system/lib/libRSCpuRef.so
- system/lib/libRSDriver.so

Rather than simply adding them to extract_files.sh script, I've tried to rebuild these binaries. This involves LLVM/Clang and related projects. For KK-based image, this requires adding the following CAF projects to flame-kk.xml manifest:
- platform/external/clang
- platform/external/compiler-rt
- platform/external/llvm
- platform/frameworks/compile/libbcc
- platform/frameworks/compile/slang
- platform/frameworks/rs
- platform/prebuilts/clang/linux-x86/arm/3.3

Build first failed in compiler-rt with:

target asm: libcompiler_rt <= external/compiler-rt/lib/arm/aeabi_dcmp.S
arm-linux-androideabi-gcc: error: unrecognized command line option '-integrated-as'

Looking at B2G/external/compiler-rt/Android.mk, it's noteworthy that the addition of -integrated-as flag to LOCAL_CFLAGS is commented, but not for LOCAL_ASFLAGS. I initially thought that I was using the wrong linker, as LOCAL_ASFLAGS comment above talks about MC assembler. There's indeed platform/frameworks/compile/mclinker project in CAF, but adding it to device manifest didn't help. In the end, I've simply commented the addition of -integrated-as flag for LOCAL_ASFLAGS, as for LOCAL_CFLAGS.

But build is now failing because of multiple warnings treated as errors in B2G/frameworks/rs projects. Hence my question: is it worth the headache or is simply RenderScript not supported on FxOS/B2GOS?

Émeric


[1] https://developer.android.com/guide/topics/renderscript/compute.html

Fabrice Desré

unread,
Jan 21, 2017, 1:11:11 PM1/21/17
to emeric....@gmail.com, mozilla-...@lists.mozilla.org
Hi Emeric,

No, b2g doesn't use or expose RenderScript at all.

Fabrice
> _______________________________________________
> dev-fxos mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-fxos
>


--
Fabrice Desré
Connected Devices
Mozilla Corporation

emeric....@gmail.com

unread,
Jan 22, 2017, 12:30:19 PM1/22/17
to mozilla-...@lists.mozilla.org
Hi Fabrice,

Le samedi 21 janvier 2017 19:11:11 UTC+1, Fabrice Desré a écrit :
> Hi Emeric,
>
> No, b2g doesn't use or expose RenderScript at all.
>
> Fabrice

Great, this will ease process then :-)

Émeric

emeric....@gmail.com

unread,
Jan 25, 2017, 9:21:15 AM1/25/17
to mozilla-...@lists.mozilla.org
Le samedi 21 janvier 2017 19:11:11 UTC+1, Fabrice Desré a écrit :
>
> No, b2g doesn't use or expose RenderScript at all.

Again Fabrice ;-)

I can't put my hands on it right now, but I've read in a RenderScript introductory slideshow that Google's Youtube player was making use of it. Is Google's Youtube player in Marketplace a different beast?

As a followup, I've opened a more general, related, question [1].

Émeric


[1] https://groups.google.com/forum/#!topic/mozilla.dev.fxos/qncJ_ki315I

emeric....@gmail.com

unread,
Feb 6, 2017, 5:33:49 AM2/6/17
to mozilla-...@lists.mozilla.org
Hi,

Just FYI, even though RenderScript isn't exposed in B2G OS, it's nevertheless required to build libhwui.so [1]. But building of libhwui.so was removed, as no package depends on it [2]. Well, that's not true for manufacturer's image, as libandroid_runtime.so has a dependency on libhwui.so. Quite interestingly, nightly builds don't build libwhui.so and don't have libandroid_runtime.so depends on it.

Looking at the source deeper, libhwui.so comes from platform/framework/base repository when USE_OPENGL_RENDERER is true in device/board configuration. Which isn't the case in nightly builds. Besides building libhwui.so, I don't know the exact impacts of setting USE_OPENGL_RENDERER to true for other components. It seems to enable the hardware-accelerated OpenGL back-end of libskia.so [3]. Now, is this last one used by B2G OS? According to [4], yes, both by Firefox _and_ Firefox OS. But only Gonk developers know the definitive answer there ;-)

All in all, in order to build RenderScript and co, which was my initial concern, you'll have to rely on CAF platform/build instead of B2G one as it has removed dependency on LLVM/Clang long time ago [5]. No more tweak or adjustment is then necessary and everything is building fine.

Émeric


[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1150345
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1150904
[3] https://en.wikipedia.org/wiki/Skia_Graphics_Engine
[4] https://skia.org/
[5] https://github.com/mozilla-b2g/platform_build/commit/dc95bfa4b0b7c28fb4a608b42336f55cf7f3b76e
0 new messages