supechicken / waydroid-androidtv-build

Waydroid Android TV 11/13 build based on LineageOS 18.1/20
GNU General Public License v3.0
50 stars 0 forks source link

ATV 13 - android.hardware.drm / MESA failing #8

Open rijnhard opened 1 month ago

rijnhard commented 1 month ago

So just tried the ATV 13 image.

Hardware DRM errors

It seems in android 13 there some substantial changes in how hardware is handled. Either way this results in blank screens in most apps, including youtube and even drminfo.

This was at least working with the ATV 11 image (with software rendering because VAAPI with AMDGPU was not working.)

10-03 19:19:16.274  2402  2688 W HidlServiceManagement: Waited one second for android.hardware.drm@1.0::IDrmFactory/clearkey
10-03 19:19:16.274    19    19 I hwservicemanager: Since android.hardware.drm@1.0::IDrmFactory/clearkey is not registered, trying to start it as a lazy HAL.
10-03 19:19:16.275  2402  2688 I HidlServiceManagement: getService: Trying again for android.hardware.drm@1.0::IDrmFactory/clearkey...
10-03 19:19:16.479     0     0 E init    : Control message: Could not find 'android.hardware.drm@1.0::IDrmFactory/clearkey' for ctl.interface_start from pid: 19 (/system/bin/hwservicemanager)
10-03 19:19:16.275    19  9714 W libc    : Unable to set property "ctl.interface_start" to "android.hardware.drm@1.0::IDrmFactory/clearkey": error code: 0x20
10-03 19:19:16.275    19  9714 I hwservicemanager: Tried to start android.hardware.drm@1.0::IDrmFactory/clearkey as a lazy service, but was unable to. Usually this happens when a service is not installed, but if the service is intended to be used as a lazy service, then it may be configured incorrectly.
...
10-03 19:30:51.849  2118  2136 W MESA    : Using gralloc header from libdrm/android/gralloc_handle.h.  This is not recommended for new distributions.  Initializing a fallback gralloc as a helper:
10-03 19:30:51.850  2118  2136 I MESA    : Using fallback gralloc implementation
10-03 19:30:51.851  2118  2136 W EGL-MAIN: failed to get driver name for fd -1
10-03 19:30:51.851  2118  2136 W EGL-MAIN: MESA-LOADER: failed to retrieve device information
10-03 19:30:51.851  2118  2136 W EGL-MAIN: failed to get driver name for fd -1

Thats a very unhappy Mesa, probably because it doesn't have the AMD drivers.

supechicken commented 1 month ago

The VAAPI driver for AMD GPUs is included already iirc (check if /vendor/lib64/dri/radeonsi_drv_video.so exists in waydroid shell)

About the errors, all of those looks fine (can be ignored?) and no fatal error are reported. (I am not knowledgeable on this)

Btw did you get GApps working with A13 (stuff like logging in with Google account)? Just curious because Youtube will not work without a working GApps installation.

rijnhard commented 1 month ago

The VAAPI driver for AMD GPUs is included already iirc (check if /vendor/lib64/dri/radeonsi_drv_video.so exists in waydroid shell)

About the errors, all of those looks fine (can be ignored?) and no fatal error are reported. (I am not knowledgeable on this)

Yup the file is there...

I think you're right it might be a waydroid mesa thing,the vaapi drivers in mesa are notoriously unstable. So something tells me just updating Mesa may make a big difference. (note: they have been making a few changes to the android build in the mesa repo lately too)

Btw did you get GApps working with A13 (stuff like logging in with Google account)? Just curious because Youtube will not work without a working GApps installation.

TBH I'm not exactly sure how to check, I kinda just copied everything from the gapps/system you shared into overlay/system, pretty much like before.

EDIT: My account was logged in (from the previous install) and showing

Side note: I only realised like 20min ago that you were the one that made all the vappi PR's to waydroid, so thank you for that :sweat_smile:

supechicken commented 1 month ago

TBH I'm not exactly sure how to check, I kinda just copied everything from the gapps/system you shared into overlay/system, pretty much like before.

I am asking it because when I was trying to reproduce that error, I am not able to get GApps working (login prompt keeps crashing and Youtube app just stucks on the loading screen)

Side note: I only realised like 20min ago that you were the one that made all the vappi PR's to waydroid, so thank you for that 😅

Huh? I am not the author of those PRs, all I did is just merging those changes into my fork :D

rijnhard commented 1 month ago

So technically I was already logged in from the previous build.

I'll nuke the login and try from scratch and see if I can confirm 100%, but the gapps build does look a little strange by comparison.

Also I should stop fiddling with waydroid at 11pm lol.

Also may give building a new mesa a shot and see how that goes (no promises on this one though).

rijnhard commented 1 month ago

I'm thinking of taking a different approach.

Building mesa and trying to carry over the android patches is not something I feel confident in doing.

And for my use case (waydroid) VirGL may be better suited and there is some ongoing work in waydroid around that.

https://github.com/waydroid/waydroid/issues/564#issuecomment-2125756378

So for now I'm watching, but mesa versions is definitely a cause for concern.

supechicken commented 1 month ago

Building mesa and trying to carry over the android patches is not something I feel confident in doing.

I attempted it last week but failed to build due to a new build dependency introduced on Mesa 24.1 (which doesn't exist on AOSP source and have no idea how to deal with it)

VirGL would be a workaround at this moment, but the performance loss is not good

rijnhard commented 1 month ago

Honestly I think there is only a big performance loss because of the outdated mesa. It should be performant, it's a really thin layer.

What was the dependency? I know a lot of things changed with 24.2 especially around dri2 where they basically axed a ton of it and hid it behind a new build option.

Side note: Google is also contributing to the build env images used to build mesa for Android (more specifically for GFXStream) so I think we are just a bit early in that process and things should simplify in the not too distant future.

The problem is, what do we do now lol

supechicken commented 1 month ago

What was the dependency? I know a lot of things changed with 24.2 especially around dri2 where they basically axed a ton of it and hid it behind a new build option.

In Mesa 24.1, a new dependency called libclc (already included in AOSP's source tree but not being compiled with Android.bp) is added and required for building the iris driver. It should be easy to solve but I don't know how to compile it with the AOSP build tool.

Side note: Google is also contributing to the build env images used to build mesa for Android (more specifically for GFXStream) so I think we are just a bit early in that process and things should simplify in the not too distant future.

The Mesa fork from the AOSP source tree is heavily modified. Also, the new Android.bp infrastructure is implemented on that fork, which makes compiling x86 drivers more difficult.

supechicken commented 4 weeks ago

Great news: Waydroid devs updated their Mesa version to 24.2 recently, with intel-clc prebuilt binary added to the tree

Might generate a new ATV11 build with latest Mesa within this week...

rijnhard commented 4 weeks ago

SWEEEEEEET!

I've been side tracked with amdgpu bugs, so haven't been able to get to this.

Thanks for the update, now that I have some stability I'll be able to test again probably next weekend

On Sat, 26 Oct 2024, 20:42 SupeChicken666, @.***> wrote:

Great news: Waydroid devs updated the Mesa version to 24.2 recently, with intel-clc prebuilt binary added to the tree https://github.com/waydroid/android_prebuilts_intel-clc

Might generate a new ATV11 build with latest Mesa within this week...

— Reply to this email directly, view it on GitHub https://github.com/supechicken/waydroid-androidtv-build/issues/8#issuecomment-2439689912, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAXP2EZWTP6H6VEB6W364LZ5PPBBAVCNFSM6AAAAABPKIYXA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZZGY4DSOJRGI . You are receiving this because you authored the thread.Message ID: @.***>