I make a new way to load EGL but I need to find a way to make SwANGLE work

229 views
Skip to first unread message

Huy Minh Bùi (HMTheBoy154)

unread,
Sep 7, 2022, 3:33:29 PM9/7/22
to Android-x86
On r-x86 we can't be able to use software rendering for a while. After some checking, I realize that ro.hardware.egl can't be set to anything else during the "boot" init stage. So I make a function in init.sh and execute it on "early-init" stage instead
The problem is that currently I can only be able to switch to software rendering with HWACCEL=0 or nomodeset, I still can't be able to automatically set it when there's no supported GPU is detected.

Another thing that I want to get for Android-x86 is SwANGLE, basically use the Vulkan HAL of Swiftshader (aka vulkan.pastel) as a backend for ANGLE EGL. This seems like what cuttlefish or some other projects by Google is using nowadays. However I can't be able to use it yet. The commit above have a prop SWANGLE=1 to enable it but it still fallback to Swiftshader. I hope someone can help discover this .Here's what Google used for cuttlefish as an example.

Jordan Livesey

unread,
Sep 8, 2022, 2:19:53 AM9/8/22
to andro...@googlegroups.com, declan hughes
you can't given that android was ment for phones and tablets, also. android 9 is massively outdated and no longer officially supported by google, most apps work on at least android 10

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/52fc441c-81ea-4fad-8820-dbe8b5455812n%40googlegroups.com.

Huy Minh Bùi (HMTheBoy154)

unread,
Sep 8, 2022, 7:16:22 AM9/8/22
to Android-x86

What ?
Vào lúc 13:19:53 UTC+7 ngày Thứ Năm, 8 tháng 9, 2022, jordanl...@gmail.com đã viết:
Message has been deleted

crw

unread,
Sep 9, 2022, 12:49:09 PM9/9/22
to Android-x86
Trying to use ANGLE for software rendering on r-x86, I see a different error in logcat
09-09 07:26:25.902  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libEGL_angle.so
09-09 07:26:25.908  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libGLESv1_CM_angle.so
09-09 07:26:25.910  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libGLESv2_angle.so
09-09 07:26:25.921  1493  1493 E libEGL  : dlsym lookup of ANGLEGetDisplayPlatform in libEGL_angle failed!
09-09 07:26:25.921  1493  1493 E libEGL  : initializeAnglePlatform failed!

Huy Minh Bùi (HMTheBoy154)

unread,
Sep 9, 2022, 1:13:24 PM9/9/22
to Android-x86
Maybe your image doesn't have ANGLE libs

Vào lúc 23:49:09 UTC+7 ngày Thứ Sáu, 9 tháng 9, 2022, crw đã viết:

Mauro Rossi

unread,
Aug 18, 2023, 5:24:02 PM8/18/23
to Android-x86
Vào lúc 23:49:09 UTC+7 ngày Thứ Sáu, 9 tháng 9, 2022, crw đã viết:
Trying to use ANGLE for software rendering on r-x86, I see a different error in logcat
09-09 07:26:25.902  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libEGL_angle.so
09-09 07:26:25.908  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libGLESv1_CM_angle.so
09-09 07:26:25.910  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libGLESv2_angle.so
09-09 07:26:25.921  1493  1493 E libEGL  : dlsym lookup of ANGLEGetDisplayPlatform in libEGL_angle failed!
09-09 07:26:25.921  1493  1493 E libEGL  : initializeAnglePlatform failed!


Hello, 

the default lib{EGL,GLESv1_CM,GLESv2}_angle installation path for Android 11 is /system/${LIB}
while in Android 12 and 13 is /vendor/${LIB}/egl,

@crw are you using an Android 12 branch of external/angle to build with r-x86?

I can use SWANGLE with vulkan.intel on Android 13 and it certainly works on Android 12,
has someone succeeded to see it work on Android 11 non binderized build?


Huy Minh Bùi (HMTheBoy154)

unread,
Aug 20, 2023, 12:40:35 AM8/20/23
to Android-x86
> I can use SWANGLE with vulkan.intel on Android 13 and it certainly works on Android 12,
has someone succeeded to see it work on Android 11 non binderized build?

I can make SwANGLE working for r-x86, s-x86 and even t-x86 for a while now. Here is my fork of SwiftShader with a r-x86 branch

This is updated to a newer revision than what s-x86 is using if I remember correctly, but you can just build vulkan.pastel and lib{EGL,GLESv1_CM,GLESv2}_angle it will work
Additionally, if you want to build the old SwiftShader EGL alonngside with SwANGLE

If you want the same revision but on s-x86

Also, a small note : SwANGLE is SwiftShader Vulkan + ANGLE EGL. If you load vulkan.intel or any other Vulkan drivers then you just use ANGLE EGL, not SwANGLE. 

Vào lúc 04:24:02 UTC+7 ngày Thứ Bảy, 19 tháng 8, 2023, issor...@gmail.com đã viết:

Huy Minh Bùi (HMTheBoy154)

unread,
Aug 20, 2023, 12:43:07 AM8/20/23
to Android-x86
Forgot that you also need these commit on system/linkerconfig too :

r-x86

s-x86

t-x86
Vào lúc 04:24:02 UTC+7 ngày Thứ Bảy, 19 tháng 8, 2023, issor...@gmail.com đã viết:
Vào lúc 23:49:09 UTC+7 ngày Thứ Sáu, 9 tháng 9, 2022, crw đã viết:

Mauro Rossi

unread,
Oct 3, 2023, 3:22:37 PM10/3/23
to Android-x86
Hello,

On Sunday, August 20, 2023 at 6:43:07 AM UTC+2 buin...@gmail.com wrote:
Forgot that you also need these commit on system/linkerconfig too :

r-x86

I've applied the patch, thanks
 
Vào lúc 04:24:02 UTC+7 ngày Thứ Bảy, 19 tháng 8, 2023, issor...@gmail.com đã viết:
Vào lúc 23:49:09 UTC+7 ngày Thứ Sáu, 9 tháng 9, 2022, crw đã viết:
09-09 07:26:25.902  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libEGL_angle.so
09-09 07:26:25.908  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libGLESv1_CM_angle.so
09-09 07:26:25.910  1493  1493 D libEGL  : loaded /vendor/lib64/egl/libGLESv2_angle.so
09-09 07:26:25.921  1493  1493 E libEGL  : dlsym lookup of ANGLEGetDisplayPlatform in libEGL_angle failed!
09-09 07:26:25.921  1493  1493 E libEGL  : initializeAnglePlatform failed!

I'm still getting the dlsym lookup error and I found our that the error message is incorrect because the code is checking availability of symbol  ANGLEGetDisplayPlatform in libGLESv2_angle.so and not in libEGL_angle


readelf -Ws out/target/product/x86_64/system/vendor/lib64/egl/libEGL_angle.so  | grep ANGLEGetDisplayPlatform
[nothing]

readelf -Ws out/target/product/x86_64/system/vendor/lib64/egl/libGLESv2_angle.so  | grep ANGLEGetDisplayPlatform
 13563: 000000000078a8f0  1079 FUNC    GLOBAL DEFAULT   15 ANGLEGetDisplayPlatform

So  ANGLEGetDisplayPlatform symbol is provided by libGLESv2_angle.so, but egl_angle_platform.cpp in frameworks/native is not detecting it correctly,

how is this possible?

Michael Goffioul

unread,
Oct 3, 2023, 3:57:42 PM10/3/23
to andro...@googlegroups.com
The dynamic linker in Android is an obscure and tricky beast...

Looking at more recent history of the above file, maybe it's related to this fix, which you're probably missing:
https://cs.android.com/android/_/android/platform/frameworks/native/+/b4d93521892c7075a39db3d78fee58b6ffebc96e

It's a long shot, but worth a try.

Michael.

Huy Minh Bùi (HMTheBoy154)

unread,
Oct 3, 2023, 5:25:25 PM10/3/23
to Android-x86
I forgot to tell you that on r-x86, you need an additional set of patches on frameworks/native to work. I get these from android11-gsi branch

cd frameworks/native
git fetch BR-x86
git cherry-pick 8eaf603ef4b019c7f5d9be470d81a1ecdd8c78be^..7917d763887d1313b3ee7c4550735d4a59f810f7

This will cherry-pick all the required commits from 8eaf603ef4b019c7f5d9be470d81a1ecdd8c78be to 7917d763887d1313b3ee7c4550735d4a59f810f7

Vào lúc 02:22:37 UTC+7 ngày Thứ Tư, 4 tháng 10, 2023, issor...@gmail.com đã viết:

Huy Minh Bùi (HMTheBoy154)

unread,
Oct 3, 2023, 5:33:16 PM10/3/23
to Android-x86
Also, here's my ANGLE fork for r-x86, I forgot to post it here

Vào lúc 02:22:37 UTC+7 ngày Thứ Tư, 4 tháng 10, 2023, issor...@gmail.com đã viết:
Hello,
Reply all
Reply to author
Forward
0 new messages