GloDroid / glodroid_manifest

Android port that aims to bring both user- and developer-friendly experience in using AOSP with a set of single-board computers (SBC), phones and other devices.
471 stars 67 forks source link

Porting to Orange Pi Plus / Plus 2 #15

Closed vikitinho closed 4 years ago

vikitinho commented 4 years ago

I'm trying to port your project to run on an Orange Pi Plus / Plus 2 and thus contribute to more users.

I created a new device dir based on the plus2e configuration files, changed the dtb kernel to the respective one for this device (sun8i-h3-orangepi-plus.dtb), did the same for the uboot configuration.

After generating the sdcard.img, android starts, but I see the TV message "Android System: There's an internal problem with your device. Contact your manufacturer for details."

Attached ttyUSB log.

Is there anyone who can and wants to help me? minicom-09042020.txt

Best Regards from Brazil

BigJacek commented 4 years ago

"fastboot device" doesn't recognize any device(s)

vikitinho commented 4 years ago

Hi!

Fastboot not work.

minicom-19062020-1.log

ubuntu@ubuntu:~$ dmesg
[13859.711875] usb 3-4: new high-speed USB device number 60 using xhci_hcd
[13859.860176] usb 3-4: New USB device found, idVendor=18d1, idProduct=4ee0
[13859.860180] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[13859.860183] usb 3-4: Product: USB download gadget
[13859.860186] usb 3-4: Manufacturer: Allwinner Technology
[13859.860189] usb 3-4: SerialNumber: 02c000819bd7bda4
ubuntu@ubuntu:~$ ./fastboot reboot
< waiting for any device >
rsglobal commented 4 years ago

4: https://drive.google.com/file/d/1DjiIPRoVMcGxxN0JPPt_Ly2Wo_xcxSko/view?usp=sharing

rsglobal commented 4 years ago

@vikitinho ,

It seems that Number 3 works for you. Try sudo ./fastboot reboot

BigJacek commented 4 years ago

@rsglobal It seems that Number 3 works similar to my as "google usb download gadget". I tried ./fastboot reboot in sudo mode but < waiting for any device > only

BigJacek commented 4 years ago

I'm starting to work on attempt 4

vikitinho commented 4 years ago
ubuntu@ubuntu:~$ sudo ./fastboot reboot
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 0.552s

I'll install and come back with more information

BigJacek commented 4 years ago

ok probably there is a problem to remap this device on VMware -> however it is visible as "google usb download gadget" but not directly on ubuntu (VMware indicator light is probably cheating on something).

@vikitinho in you the only hope

BigJacek commented 4 years ago

I'll keep track of it. Maybe something else will enlighten me.

vikitinho commented 4 years ago

After (fastboot erase misc) waiting...

minicom-19062020-4.log

ubuntu@ubuntu:~$ sudo ./flash-sd.sh 
+ ./fastboot flash gpt deploy-gpt.img
Sending 'gpt' (128 KB)                             OKAY [  0.015s]
Writing 'gpt'                                      OKAY [  0.242s]
Finished. Total time: 0.267s
+ ./fastboot flash bootloader bootloader-sd.img
Sending 'bootloader' (1920 KB)                     OKAY [  0.144s]
Writing 'bootloader'                               OKAY [  0.101s]
Finished. Total time: 0.254s
+ ./fastboot flash uboot-env env.img
Sending 'uboot-env' (256 KB)                       OKAY [  0.023s]
Writing 'uboot-env'                                OKAY [  0.028s]
Finished. Total time: 0.059s
+ ./fastboot reboot
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 0.601s
+ set +x
+ ./fastboot oem format
< waiting for any device >
                                                   OKAY [  1.273s]
Finished. Total time: 1.274s
+ ./fastboot flash bootloader bootloader-sd.img
Sending 'bootloader' (1920 KB)                     OKAY [  0.143s]
Writing 'bootloader'                               OKAY [  0.100s]
Finished. Total time: 0.254s
+ ./fastboot flash uboot-env env.img
Sending 'uboot-env' (256 KB)                       OKAY [  0.023s]
Writing 'uboot-env'                                OKAY [  0.035s]
Finished. Total time: 0.068s
+ ./fastboot flash recovery_boot boot.img
Sending 'recovery_boot' (24576 KB)                 OKAY [  1.763s]
Writing 'recovery_boot'                            OKAY [  1.992s]
Finished. Total time: 3.783s
+ ./fastboot erase misc
Erasing 'misc'                                     OKAY [  0.014s]
Finished. Total time: 0.033s
+ ./fastboot reboot-fastboot
Rebooting into fastboot                            OKAY [  0.010s]
< waiting for any device >
rsglobal commented 4 years ago

Thanks guys, good results. I haven't tested this kernel with sunxi boards yet, so maybe some issues caused by v5.7 migration. I'll take a look next week.

@vikitinho , I'll push my changes into next branch, so you can sync it if you want to build yourself.

rsglobal commented 4 years ago

@BigJacek , can you run sudo dmesg -w on your virtual machine and see if any logs appears when you plug OTG?

vikitinho commented 4 years ago

Thanks guys, good results. I haven't tested this kernel with sunxi boards yet, so maybe some issues caused by v5.7 migration. I'll take a look next week.

@vikitinho , I'll push my changes into next branch, so you can sync it if you want to build yourself.

Thank you! I am available to do the tests you need!

rsglobal commented 4 years ago

@vikitinho , I switched kernel back to v0.2.0 and added missing dts nodes: v5: https://drive.google.com/file/d/1PrkMEyTb1EmdrFTpwn8qQyV7KkVZLmCA/view?usp=sharing

vikitinho commented 4 years ago

I tested it, android started with the message:

"Android System: There's an internal problem with your device. Contact your manufacturer for details."

minicom-19062020-5.log

The installation was successful:

ubuntu@ubuntu:~$ sudo ./flash-sd.sh 
+ ./fastboot flash gpt deploy-gpt.img
Sending 'gpt' (128 KB)                             OKAY [  0.016s]
Writing 'gpt'                                      OKAY [  0.643s]
Finished. Total time: 0.668s
+ ./fastboot flash bootloader bootloader-sd.img
Sending 'bootloader' (1920 KB)                     OKAY [  0.146s]
Writing 'bootloader'                               OKAY [  0.107s]
Finished. Total time: 0.262s
+ ./fastboot flash uboot-env env.img
Sending 'uboot-env' (256 KB)                       OKAY [  0.025s]
Writing 'uboot-env'                                OKAY [  0.029s]
Finished. Total time: 0.062s
+ ./fastboot reboot
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 0.602s
+ set +x
+ ./fastboot oem format
< waiting for any device >
                                                   OKAY [  0.014s]
Finished. Total time: 0.014s
+ ./fastboot flash bootloader bootloader-sd.img
Sending 'bootloader' (1920 KB)                     OKAY [  0.139s]
Writing 'bootloader'                               OKAY [  0.106s]
Finished. Total time: 0.256s
+ ./fastboot flash uboot-env env.img
Sending 'uboot-env' (256 KB)                       OKAY [  0.025s]
Writing 'uboot-env'                                OKAY [  0.030s]
Finished. Total time: 0.065s
+ ./fastboot flash recovery_boot boot.img
Sending 'recovery_boot' (24576 KB)                 OKAY [  1.766s]
Writing 'recovery_boot'                            OKAY [  1.784s]
Finished. Total time: 3.577s
+ ./fastboot erase misc
Erasing 'misc'                                     OKAY [  0.014s]
Finished. Total time: 0.031s
+ ./fastboot reboot-fastboot
Rebooting into fastboot                            OKAY [  0.010s]
< waiting for any device >
Finished. Total time: 13.695s
+ ./fastboot flash boot_a boot.img
Sending 'boot_a' (24576 KB)                        OKAY [  1.863s]
Writing 'boot_a'                                   OKAY [  1.995s]
Finished. Total time: 3.916s
+ ./fastboot flash dtbo_a boot_dtbo.img
Sending 'dtbo_a' (28 KB)                           OKAY [  0.023s]
Writing 'dtbo_a'                                   OKAY [  0.047s]
Finished. Total time: 0.075s
+ ./fastboot flash super super.img
Invalid sparse file format at header magic
Sending sparse 'super' 1/2 (520320 KB)             OKAY [ 40.128s]
Writing 'super'                                    OKAY [ 42.624s]
Sending sparse 'super' 2/2 (241064 KB)             OKAY [ 18.702s]
Writing 'super'                                    OKAY [ 57.969s]
Finished. Total time: 160.360s
+ ./fastboot format:ext4 metadata
Warning: metadata type is raw, but ext4 was requested for formatting.
mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 4096 4k blocks and 4096 inodes

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

Sending 'metadata' (52 KB)                         OKAY [  0.010s]
Writing 'metadata'                                 OKAY [  0.490s]
Finished. Total time: 0.548s
+ ./fastboot format:ext4 userdata
Warning: userdata type is raw, but ext4 was requested for formatting.
mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 7428859 4k blocks and 1859584 inodes
Filesystem UUID: 94847b40-6fdb-4aa4-9d16-947de37d37f8
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

Sending 'userdata' (4420 KB)                       OKAY [  0.342s]
Writing 'userdata'                                 OKAY [  2.187s]
Finished. Total time: 2.603s
+ ./fastboot reboot
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 0.050s
ubuntu@ubuntu:~$ 

Even with the error message, the abd recognizes the card, is there a command that I can run to debug?

ubuntu@ubuntu:~$ sudo ./adb devices
List of devices attached
02c000819bd7bda4    no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]
rsglobal commented 4 years ago

@vikitinho ,

You have to use sudo because you haven't corresponding udev rules instaled.

As stated at https://developer.android.com/studio/run/device#setting-up:

Ubuntu Linux: Use apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.

So try sudo apt install adb

BigJacek commented 4 years ago

@BigJacek , can you run sudo dmesg -w on your virtual machine and see if any logs appears when you plug OTG?

I'll do the investigation later this weekend.

rsglobal commented 4 years ago
"Android System: There's an internal problem with your device. Contact your manufacturer for details."

It is known issue on all opi devices. But I still do not know what is the reason. @vikitinho , Could you also try to flash eMMC?

BigJacek commented 4 years ago

In case of attempt 3 I have the same experience working with adb/fastboot on Windows. After flashed Android on sdcard using a new deploy-sd.img device is visible by flashboot. Finally when I call fastboot reboot or reboot-bootloader (part of the script) device start to be unavailable.

BigJacek commented 4 years ago

to be detailed: fastboot oem format fastboot flash bootloader bootloader-sd.img fastboot flash uboot-env env.img fastboot flash recovery_boot boot.img fastboot erase misc

fastboot reboot ...and nothing device is unavailable/unvisible in windows

rsglobal commented 4 years ago

v3 has some bug in the kernel. Try v5 instead: https://github.com/GloDroid/glodroid_manifest/issues/15#issuecomment-646851313

BigJacek commented 4 years ago

Brief summary: I installed the lastest version of Xubuntu on my oooold PC. For testing purposes I used attempt 5 as you posted. Results:

BigJacek commented 4 years ago

my next step - try to flash eMMC

BigJacek commented 4 years ago

I will also try to do something with the network so that it is available through the Ethernet socket.

rsglobal commented 4 years ago

Please check if wifi works on v6: https://drive.google.com/file/d/1pwpRbT5QhZ7n0fxbHYJc724jQVHM-DFy/view?usp=sharing

BigJacek commented 4 years ago

Hello Roman, Checked and wifi works on v6. By the way: is it possible to add support for USB Bluetooth devices? I also tried flash eMMC but unfortunately there was a problem: adminek@ESPRIMO-Q5030:~/images$ sudo ./fastboot devices 02c00081a5d66c7f fastboot adminek@ESPRIMO-Q5030:~/images$ sudo ./flash-emmc.sh

rsglobal commented 4 years ago

Hello Jacek,

Thank you for testing. Regarding eMMC, please ensure you are booting from deploy-sd-for-emmc.img, not a deploy-sd.img

BigJacek commented 4 years ago

Brief summary: Flashing eMMC work well. It was a problem with partition on my SD card (when I fixed it the android just started up). Results:

BigJacek commented 4 years ago

Ah, one more thing: I don't know why, but it often happens that the system does not boot (remains on the android logo). Turning the power off and on again makes the system load correctly again. (sometimes you have to do it twice)

rsglobal commented 4 years ago

Ah, one more thing: I don't know why, but it often happens that the system does not boot (remains on the android logo). Turning the power off and on again makes the system load correctly again. (sometimes you have to do it twice)

Could you catch this moment and save output of $ adb shell logcat and $ adb shell dmesg?

rsglobal commented 4 years ago

Support for Orange PI Plus 2 is available in next branch and will be included into the next release.

BigJacek commented 4 years ago

Hello Roman, I'm quite busy now but I remember about logs. JaS

BigJacek commented 4 years ago

Hello, As promised, I'm sending some new information. So I decided to do the whole installation to eMMC again (step by step). Currently, after a few reboots, nothing is hanging / stopping at Android startup. Unfortunately, as I wrote before, the system works quite slowly and often freezes but as such it works. Regards, JaS