amarullz / AROMA-Installer

The World First ANDROID Touch and Customizable ROM Installer
http://www.amarullz.com/
322 stars 184 forks source link

Not being able to flash AROMA zip on treble A/B devices like OP6 or U12+ (imagine) #38

Open jeanrivera opened 6 years ago

jeanrivera commented 6 years ago

while trying to flash any AROMA GUI Installer embedded zip for example a ROM or OpenGapps, TWRP just freezes but adb commands still work it looks like a graphics rendering issue because it doesn't even get to the splash part of any zip with AROMA GUI I can provide logs if needed,

I know AROMA is an abandoned project but some of the ROM devs still use it for personal customizations on custom ROMs like Team Venom, LeeDroid, etc.... & Kernels like Elemental X

recovery (4).log

jeanrivera commented 6 years ago

not sure if anyone is following this issue at all but I just wanted to update just in case someone wants to give it a shot and fix the issue

"The problem is that your device/TWRP is using DRM graphics (hardware accelerated) instead of framebuffer (traditional SW rendering). Aroma doesn't understand how to use your graphics "driver".

Unless you can get a build of TWRP (and kernel) with classic framebuffer rendering, it can't be fixed. Not sure how likely or even possible that is."

that being said if someone want to fix AROMA and with the proper drivers instructions for this new devices that would be awesome since most kernel dev will not go back to classic framebuffer having this new drivers

aaaol commented 6 years ago

I also encountered this problem.

I don't know how to solve it.

twaik commented 6 years ago

When I tried to solved that I noted that AROMA can't output to the screen even if TWRP got SIGSTOP. But you can clear the screen if you execute the "stop recovery" comand. TWRP will be stopped but AROMA will be able to use screen.

jeanrivera commented 6 years ago

And how do I execute the stop recovery command?

twaik commented 6 years ago

run_program("stop", "recovery"); Or run_program("setprop", "ctl.stop", "recovery");

Also you shoul not forget about starting the recovery service right after the end of AI script. Use start or setprop ctl.start. Also you can reboot device without returning to recovery with "reboot -f system".

jeanrivera commented 6 years ago

@twaik what device you use for that?

twaik commented 6 years ago

@jeanrivera I don't remember. It was a long time ago. Try to run the command over ADB first.

jeanrivera commented 6 years ago

@twaik I did already, and it didn't work, I just got a black screen, this is more related to new display drivers on SD 845 devices, and aroma does not know how handle those graphics at all but thanks for the suggestions

twaik commented 6 years ago

@jeanrivera can you please try something for me?

  1. Use ADB.
  2. Stop recovery. The screen should be black after this.
  3. On the PC unpack update-binary to any folder.
  4. Push update-binary and update.zip into / via ADB.
  5. Try to start Aroma Installer update.zip manually /update-binary 1 1 /update.zip That is the comand used to start update process in recovery. And then report about what you see on screen. If that fails we can't help you. Also I can try to create TWRP based graphics output for AROMA Installer, but it will work if the binary will be built inside TWRP source with other parts of recovery for device.
jeanrivera commented 6 years ago

C:\ADB>adb push update.zip / update.zip: 1 file pushed. 29.2 MB/s (4164094 bytes in 0.136s)

C:\ADB>adb push update-binary / update-binary: 1 file pushed. 27.1 MB/s (627580 bytes in 0.022s)

C:\ADB>adb shell /update-binary 1 1 /update.zip /sbin/sh: /update-binary: Permission denied

C:\ADB>

CaptainThrowback commented 6 years ago

@jeanrivera adb shell chmod 755 /update-binary and then try that last command again

jeanrivera commented 6 years ago

this was the output on the command window but the device was on a black screen nothing visual

C:\ADB>adb push update.zip /
update.zip: 1 file pushed. 29.1 MB/s (4164094 bytes in 0.136s)

C:\ADB>adb push update-binary /
update-binary: 1 file pushed. 28.4 MB/s (627580 bytes in 0.021s)

C:\ADB>adb shell chmod 755 /update-binary

C:\ADB>adb shell /update-binary 1 1 /update.zip
aroma/s: Initializing
Starting AROMA Installer version 2.70RC2
     (c) 2013 by amarullz xda-developers
ui_print
ui_print Starting AROMA Installer version 2.70RC2
ui_print
ui_print (c) 2013 by amarullz xda-developers
ui_print
ui_print
aroma/s: Mute Parent
aroma/s: Saving Arguments
aroma/s: Open Archive
aroma/s: Initializing Resource
aroma/s: Opening Freetype
aroma/s: INDR Input Device: STM VL53L0 proximity sensor (event4) - Class : 0
aroma/s:   VKN : 0, CALIB : (0,0,0,0)
aroma/s: INDR Input Device: snt8100fsr (event7) - Class : 6
aroma/s:   VKN : 0, CALIB : (0,1080,0,2560)
aroma/s: INDR Input Device: snt8100fsr (event2) - Class : 6
aroma/s:   VKN : 0, CALIB : (0,1080,0,2560)
aroma/s: INDR Input Device: qpnp_pon (event0) - Class : 1
aroma/s:   VKN : 0, CALIB : (0,0,0,0)
aroma/s: INDR Input Device: gpio-keys (event6) - Class : 1
aroma/s:   VKN : 0, CALIB : (0,0,0,0)
aroma/s: INDR Input Device: qwerty (event1) - Class : 1
aroma/s:   VKN : 0, CALIB : (0,0,0,0)
aroma/s: INDR Input Device: AK8789_HALL_SENSOR (event3) - Class : 1
aroma/s:   VKN : 0, CALIB : (0,0,0,0)
aroma/s: INDR Input Device: synaptics_dsx_touchscreen (event5) - Class : 7
aroma/s:   VKN : 0, CALIB : (0,1439,0,2879)
aroma/s: Starting Interface
aroma/s: aroma-config was UTF-8
aroma/s: # INCLUDE SCRIPT (language_select.edify)
aroma/s:   + language_select.edify was UTF-8
aroma/s: (2) Freetype fonts loaded as Font Family
aroma/s: (2) Freetype fonts loaded as Font Family
CaptainThrowback commented 6 years ago

I assume nothing on the device, then?

jeanrivera commented 6 years ago

I assume nothing on the device, then?

nothing in the device correct

twaik commented 6 years ago

Looks like the only way to start Aroma on the device is to build it over TWRP sources with some patches...

jeanrivera commented 6 years ago

Looks like the only way to start Aroma on the device is to build it over TWRP sources with some patches...

are you able to help with that?

twaik commented 6 years ago

@jeanrivera maybe. First thing I need is link to TWRP source used for the build and its version. If TWRP is build from source for the device, of course.

twaik commented 6 years ago

I have some work here, but I think I'll help you in a few days. And you should know that the Aroma build will be suitable only on that device model. I don't even know if it work on CWM.

jeanrivera commented 6 years ago

@jeanrivera maybe. First thing I need is link to TWRP source used for the build and its version. If TWRP is build from source for the device, of course.

https://github.com/CaptainThrowback/android_device_htc_ime

is that the correct source @CaptainThrowback

jeanrivera commented 6 years ago

I have some work here, but I think I'll help you in a few days. And you should know that the Aroma build will be suitable only on that device model. I don't even know if it work on CWM.

there is no rush with that I have been trying to figure this out for months, practically since the release of the device and TWRP for it

jeanrivera commented 6 years ago

@twaik let me now if you need anything else from my end to makes things easier on your side

twaik commented 6 years ago

@jeanrivera Can you please try to build that on you device tree? https://github.com/twaik/AROMA-Installer/

jeanrivera commented 6 years ago

I have asked @CaptainThrowback to do it since I have no idea how to build stuff I'll let you know the outcome, he did mentioned this: Captain_Throwback [4:56 PM] it has to be built in the 5.1 tree, unless he's updated the tree to actually build with 8.1 it definitely fails on 5.1

I'll try it on 8.1

Jeanrivera [4:56 PM] I see his tree has a few commits amarullz does not have

Captain_Throwback [4:56 PM] but AROMA doesn't build 64-bit, as far as I know

Jeanrivera [5:01 PM] ok if you try and it doesn't work I'll still thank you a lot for trying

Captain_Throwback [5:02 PM] I only see one new patch in the source and it looks specific to this problem so I believe 64-bit will still be an issue just building it with the updated TWRP tree and his changes should fix the issue, presumably but since it doesn't build in 5.1, there's probably some code tweaks needed

CaptainThrowback commented 6 years ago

@twaik

I tried building your source in the android-5.1 minimal Omni tree (which uses TWRP's android-9.0 branch) but I'm getting errors. AROMA has to be built for arm, so I have to use an older tree (either 5.1 or 6.0) for it to actually compile. It does not, however, compile, with your updates, at least not in android-5.1:

In file included from external/aroma-installer/src/libs/aroma_graph.cpp:33:0:
bootable/recovery/minui/include/minui/minui.h:221:45: error: declaration of C function 'int ev_init(ev_callback, void*)' conflicts with
 int ev_init(ev_callback input_cb, void *data);
                                             ^
In file included from external/aroma-installer/src/libs/aroma_graph.cpp:30:0:
external/aroma-installer/src/libs/../aroma.h:712:9: error: previous declaration 'int ev_init()' here
 int     ev_init(void);
         ^
external/aroma-installer/src/libs/aroma_graph.cpp:34:8: error: 'GRSurface' does not name a type
 static GRSurface* aroma_surface;
        ^
external/aroma-installer/src/libs/aroma_graph.cpp: In function 'unsigned char ag_init()':
external/aroma-installer/src/libs/aroma_graph.cpp:319:3: error: 'aroma_surface' was not declared in this scope
   aroma_surface->width = gr_fb_width();
   ^
external/aroma-installer/src/libs/aroma_graph.cpp: In function 'void ag_refreshrate()':
external/aroma-installer/src/libs/aroma_graph.cpp:1085:11: error: 'aroma_surface' was not declared in this scope
   gr_blit(aroma_surface, 0, 0, aroma_surface->width, aroma_surface->height, 0, 0);
           ^
build/core/binary.mk:620: recipe for target '/data/Android/build/omni/android-5.1/out/target/product/m8/obj/EXECUTABLES/aroma_installer_intermediates/src/libs/aroma_graph.o' failed
make: *** [/data/Android/build/omni/android-5.1/out/target/product/m8/obj/EXECUTABLES/aroma_installer_intermediates/src/libs/aroma_graph.o] Error 1
make: *** Waiting for unfinished jobs....
twaik commented 6 years ago

I used libminui's api in the patch. That should work on both TWRP and CWM, but it still will be device specific build. It should work on any recovery version.

CaptainThrowback commented 6 years ago

@twaik How is the build device-specific?

twaik commented 6 years ago

That means that the binary built with my source will be suitable only for the device it was build for. New commit is available. You can ask firmware maintainer to build it.

CaptainThrowback commented 6 years ago

@twaik I think you misunderstood my very vague question. I mean I looked at the code, and I don't see how it's device-specific. There's no way to lunch for the device that we need to use the binary with and build, because the AROMA source doesn't support 64-bit nor the 8.1 Android tree. The only way to get it to build is to use an older tree, like I previously stated. So if you're saying I have to build for the device we want to use the binary on, that's not currently possible.

At any rate, I'm still getting build errors:

external/aroma-installer/src/libs/aroma_minui.cpp:8:8: error: 'GRSurface' does not name a type
 static GRSurface* aroma_surface;
        ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'void aroma_minui_init()':
external/aroma-installer/src/libs/aroma_minui.cpp:11:2: error: 'aroma_surface' was not declared in this scope
  aroma_surface->width = gr_fb_width();
  ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'int aroma_minui_get_fb_width()':
external/aroma-installer/src/libs/aroma_minui.cpp:19:9: error: 'aroma_surface' was not declared in this scope
  return aroma_surface->width;
         ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'int aroma_minui_get_fb_height()':
external/aroma-installer/src/libs/aroma_minui.cpp:23:9: error: 'aroma_surface' was not declared in this scope
  return aroma_surface->height;
         ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'void* aroma_minui_get_data()':
external/aroma-installer/src/libs/aroma_minui.cpp:27:9: error: 'aroma_surface' was not declared in this scope
  return aroma_surface->data;
         ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'void aroma_minui_flip()':
external/aroma-installer/src/libs/aroma_minui.cpp:31:10: error: 'aroma_surface' was not declared in this scope
  gr_blit(aroma_surface, 0, 0, aroma_surface->width, aroma_surface->height, 0, 0);
          ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'int aroma_minui_get_fb_width()':
external/aroma-installer/src/libs/aroma_minui.cpp:20:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'int aroma_minui_get_fb_height()':
external/aroma-installer/src/libs/aroma_minui.cpp:24:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
external/aroma-installer/src/libs/aroma_minui.cpp: In function 'void* aroma_minui_get_data()':
external/aroma-installer/src/libs/aroma_minui.cpp:28:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: some warnings being treated as errors
build/core/binary.mk:620: recipe for target '/data/Android/build/omni/android-5.1/out/target/product/m8/obj/EXECUTABLES/aroma_installer_intermediates/src/libs/aroma_minui.o' failed
make: *** [/data/Android/build/omni/android-5.1/out/target/product/m8/obj/EXECUTABLES/aroma_installer_intermediates/src/libs/aroma_minui.o] Error 1
make: *** Waiting for unfinished jobs....
twaik commented 6 years ago

@CaptainThrowback that is device specific because it is built with libminui. libminui uses libdrm of the target device. I didn't try to build the x64 version. But I used the 8.1 tree's twrp source for build. What is the exact reason Aroma can not be built over 8.1 tree?

twaik commented 6 years ago

Can you give me comands needed to clone the device tree and to initialize build environment? Including lunch/breakfast comand. I need to build the source using the TWRP version used on the device.

CaptainThrowback commented 6 years ago

I'm using the minimal Omni android-8.1 device tree, shallow clone, from here:

This repo init command: repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-8.1

And then to build: cd <source-dir>; export ALLOW_MISSING_DEPENDENCIES=true; . build/envsetup.sh; lunch omni_ime-eng; mka aroma_installer

CaptainThrowback commented 6 years ago

@twaik Here is the plethora of errors when trying to build for the U12+ in the 8.1 Android tree: https://del.dog/yacimugala.makefile

twaik commented 6 years ago

@CaptainThrowback I disabled NEON support for 64bit build. You can try to build it again.

CaptainThrowback commented 6 years ago

Yes, your latest changes build successfully. Now @jeanrivera needs to test it in TWRP.

jeanrivera commented 6 years ago

still black screen

recovery.log

twaik commented 6 years ago

@CaptainThrowback did you send him new update.zip?

jeanrivera commented 6 years ago

aroma-2.70RC2.zip this is the zip I am using for testing

jeanrivera commented 6 years ago

I just replaced the update-binary with the file he send to me after renaming from aroma_installer to update-binary

twaik commented 6 years ago

@jeanrivera Can you try to stop recovery first? https://github.com/amarullz/AROMA-Installer/issues/38#issuecomment-423348745

twaik commented 6 years ago

@jeanrivera any updates?

jeanrivera commented 6 years ago

black screen but i did noticed the screen blinked for less than split a second output:

`C:\ADB>adb push aroma-2.70RC2.zip /
aroma-2.70RC2.zip: 1 file pushed. 28.4 MB/s (4432139 bytes in 0.149s)

C:\ADB>adb push update-binary /
update-binary: 1 file pushed. 28.6 MB/s (1409360 bytes in 0.047s)

C:\ADB>adb shell chmod 755 /update-binary

C:\ADB>adb shell stop recovery

C:\ADB>adb shell /update-binary 1 1 /aroma-2.70RC2.zip
aroma/s: Initializing
Starting AROMA Installer version 2.70RC2
     (c) 2013 by amarullz xda-developers
ui_print
ui_print Starting AROMA Installer version 2.70RC2
ui_print
ui_print (c) 2013 by amarullz xda-developers
ui_print
ui_print
aroma/s: Mute Parent
aroma/s: Saving Arguments
aroma/s: Open Archive
aroma/s: Initializing Resource
Unknown format 875713089
Unknown format 875713089
Using drm graphics.

`

jeanrivera commented 6 years ago

@jeanrivera any updates?

yes i just replied

twaik commented 6 years ago

In your recovery.log both drmModeSetCrtc and drmModePageFlip failed with error -13: Access denied. I thought it was because TWRP was DRM master but now it should not interrupt the output. Maybe that's mistake in my patches... Looks like we need help of TWRP's developers here.

twaik commented 6 years ago

Another way to use AROMA in TWRP is to build TWRP and kernel without DRM support, only with classic framebuffer rendering.

jeanrivera commented 6 years ago

Another way to use AROMA in TWRP is to build TWRP and kernel without DRM support, only with classic framebuffer rendering.

I am pretty sure that was a point of discussion already, but since there is no recovery partition on Treble A/B devices TWRP is part of the boot.img, building with classic framebuffer would make TWRP really slow or something like that the devs mentioned or at leas that was what I understood out of the conversation, I am just a guinea pig trying everything devs throw at me regarding aroma possible solutions but I do not build anything I just test and provide logs

twaik commented 6 years ago

Maybe that's my mistake in the AROMA&minui source... I need somebody to check it out. Your screen blinked so maybe image updated but I didn't noticed the mistake in my code...

jeanrivera commented 6 years ago

@twaik I guess there is no more to test for now right? I understand that you are busy on another projects, if you come up with something else let me know and thanks for the time you spend on trying to fix an issue for a device you don't even own yourself, I really appreciate that.

twaik commented 6 years ago

I have an idea what should be done but that needs an additional interface inside TWRP which provides drawing surface to updater binary via Unix socket. I dont think TWRP developers will add it to the project.

CaptainThrowback commented 6 years ago

@twaik

Submit a patch for it to TWRP Gerrit and see if it gets approved. Either way, if the patch is created, it'll be possible to build an unofficial TWRP for the affected devices with the possibility of a working AROMA interface. That itself might convince the TWRP team to add it, provided it's coded properly and doesn't negatively impact anything else.

jeanrivera commented 6 years ago

@twaik & @CaptainThrowback I could try to use an unofficial TWRP build on my U12+ built by either of you with suggested patches and make sure it doesn't affect any other functionality in a negative way before submitting the patch, I'll gladly help testing this before submission and provide feedback and logs as needed. Thanks again to both of you on trying to resolve an issue on a device none of of you have, I understand how difficult it could be trying to fix something blindly, and depend on someone else for testing,