View: 20634|Reply: 9

PiZeroDroid - Custom Android 4.4.2 ROM for Orange Pi Zero

[Copy link]

1

threads

18

posts

434

credits

Intermediate member

Rank: 3Rank: 3

credits
434
Published in 2017-4-24 22:49:43 | Show all floors |Read mode
Edited by robi217 at 2017-5-21 15:33

Hello!

In this thread, I would like to share my custom-made rom, which I call PiZeroDroid. It is created especially for Orange Pi Zero (H2+ 512MB RAM model).
This image still has many problems, and some of them seems to be impossible (at least for me) to fix :/


----- [IMPORTANT!] -----
You shouldn't use this image anymore! H3Droid's Android image actually works much better on this board, with updated kernel (3.4.113), proper sys-config (no more heating, needs only heatsink), working audio and much better stability and performance. Starting from H3Droid version 1.2.5, Wi-Fi works automatically, you don't have to do anything (the first startup can take a bit longer time, but don't worry).

Wi-Fi also works, but it's a bit tricky to enable it for the first time (as of v1.2.2, may work out-the-box on later versions):
1. Use ADB/SSH/Terminal Emulator (if device is rooted) to reach the Android system's shell.
2. Type in "su" to get root access.
3. Type in the following command: "insmod /system/vendor/modules/xradio_wlan.ko"
4. If you get no error, it means that the WiFi kernel was loaded succesfully. You can check yourself using the "dmesg" commands which should print out the XR819's successful loading process.
5. Return to your device, open Settings and switch off Ethernet connection.
6. Switch on and off Wi-Fi connection quickly. Keep doing this until the system hangs, crashes and reboots itself.
7. After rebooting, Wi-Fi should work and you can connect to networks.
You only have to go through this process only once. After this, you can turn on/off Wi-Fi and connect to networks anytime you want.
Anyway, the Wi-Fi connection seems to be stable and fast, but Wi-Fi direct (Miracast) doesn't work!


For download links and more information, please check H3Droid's webpage.
Official forum thread for H3Droid can be found here.

Also don't forget to have a look at my recent post about my experience with H3Droid(I also included some tips to get the system working especially for Orange Pi Zero).
You shouldn't read the post mentioned before anymore, since it contains outdated information

Thank you very much guys and a big thanks for the H3Droid team
----- [IMPORTANT!] -----

Requirements:
- Orange Pi Zero board (512MB model only - 256MB RAM is too small for smooth operation)
- Heatsink or active cooling (fan) - VERY IMPORTANT FOR SMOOTH PERFORMANCE!
- 4GB+ good quality microSD card (recommended to use Class 10 or UHC-1)
- Windows PC with external SD card reader and CloneDisk software (for installing the image)
- Good quality microUSB cable (5V/2.1A) or GPIO power source
- Video output cable (Composite) soldered on pin or using extension board (if using extension board, please make sure to use a good power supply, because you can run into problems otherwise!)
- USB wired/wireless mouse (or Bluetooth mouse using USB dongle) for controlling the UI - keyboard is optional

Features (v0.2 BETA - 2017-05-07) - New changes and important information are highlighted with bold:
- Android 4.4.2 ROM based on official Orange Pi image (sun8iw7p1_android_dolphin-p2_uart0)
- Onboard Wi-Fi works well (stable connection)
- Debloated and clean system, with Chinese apps removed (Idle RAM usage around 200MB)
- Fully rooted system using SuperSU
- Ability to flash custom .zip files using FlashFire
- Google apps included (Google Framework, Google Chrome, Google Play Store and YouTube app)
- English language UI (system can be changed to other languages)
- Nova Launcher as home screen
- H/W video decoding with MX Player app (custom codec pack with AC-3 support included) or built-in TvdPlayer app - Works with H.264, other formats not tested!- Kodi 16.1 included - Works, but see "Known issues" for more info! (NEW in v0.2)
- Fully working YouTube app with H/W decoding
- Change analog video output (PAL/NTSC mode) and change overscanning value
- USB device support (auto-mount of USB storage devices - NEW in v0.2)
- Bluetooth support (needs external USB bluetooth adapter!)
- Additional 192MB Swap (from v0.2, also changed swappiness to 10 for better I/O performance) for smooth and stable performance (see Swapper app for details and settings)
- CPU clock is 1200MHz (from v0.2, with interactive governor), can be under- or overclocked
- Changed SD read ahead value to 2048KB (recommended for most cards) - Changed deadline back to cfw, because deadline looked less stable (from v0.2)!
- Built-in ad blocking with AdAway (automatic updates)
- Extension board support: Every USB port working, video output via TRRS jack, IR receiver should work but needs additional configuration
- Other installed apps: AIDA64, CCleaner, Greenify, Kernel Adiutor, MiracastReceiver, Quick Reboot, Root app uninstaller, Total Commander, etc.

Known issues (as of v0.2):
- Audio output doesn't work (it looks like there is some problem with the kernel/system or maybe sys-config) - Affects Onboard Audio, External USB sound card audio, Bluetooth audio (using USB dongle).
I know that missing audio output is a very big issue, but sadly I don't know how to fix it. I've tried several H3 and H2 Android images for sound support, but none of them had working audio. If you need audio output very much, you should use Armbian or RetrOrangePi instead of Android, which are way more stable and faster than this Android image
- Minor stability problems - Under heavy load apps can force close (or don't even open), system can hang or storage can become read-only (Not enough power maybe?) - If you have any of these problems, reboot your device as a fix/workaround.
- CPU overvolting issue (broken dvfs, needs new sys-config), resulting in more power consumption and fast heating - Use a heatsink and/or active cooling as a workaround, with a good power supply.
- Kodi doesn't support H/W acceleration for decoding - SD videos playing fine, HD videos stuttering - Stock Kodi app (installed by me) doesn't support Allwinner's CedarX engine (due to license problems), and modified apps (zidoo-kodi) couldn't start.
- Aspect ratio is forced to 16:9 - You can change the internal resolution in sys-config to get 4:3 aspect ratio, but it seems to be a bit difficult
Most of these issues come from the official image used as source, so it's very hard to fix them!

How to install?

1. Download CloneDisk software and extract it (http://www.pcadvisor.co.uk/download/backup-recovery/clonedisk-22-3329736/)
2. Put a 4GB or higher microSD card in your computer using a card reader.
3. Download image file (see link below) and extract the .7z archive (use 7-zip or WinRAR)
4. Start CloneDisk software using clonedisk.exe (run as administrator!)
5. Select your SD card (select the entire Physical Disk, not only a partition of it!)
6. Click Restore from Image button, select RAW format and press OK.
7. Wait for the flash to complete, and eject your device. You're ready to go.

Optional step for cards higher than 4GB: To use your full card space, you have to extend the size of Ext4 partition to fit the full empty space of your card. You can do this with GParted (needs Linux system) or any compatible partition manager software.

Download link:
Google Drive link (primary) - v0.2 BETA - 2017-05-07 (Download size: 1.30GB)

Previous version:
Google Drive link (primary) - v0.1 BETA - 2017-04-24 (Download size: 1.30GB)
SHA1 key of .img file (android442modded_opizero_robi217.img): C0CE6E8654DCB4DD27693F3F360C43E11384C16F


Thank you, and feel free to ask questions if you have any.





0

threads

45

posts

633

credits

Senior member

Rank: 4

credits
633
Published in 2017-4-25 03:02:45 | Show all floors
Change analog video output (PAL/NTSC mode) and change overscanning value


Do you have any idea how is this implemented in Android? Is there are similar way to fix overscanning for Linux?

1

threads

18

posts

434

credits

Intermediate member

Rank: 3Rank: 3

credits
434
 Author| Published in 2017-4-25 03:14:08 | Show all floors
RagnerBG replied at 2017-4-25 03:02
Do you have any idea how is this implemented in Android? Is there are similar way to fix overscann ...

Sorry, but I don't know. This feature is also present in the official Android ROM that I used as source, and it worked perfectly, so i didn't touch that part.

0

threads

45

posts

633

credits

Senior member

Rank: 4

credits
633
Published in 2017-4-25 03:38:53 | Show all floors
Yea, i know it's working in official Android for Opi, but now i understand from your post, that it's working for Analog video out, where is the real problem. I thought it's for HDMI only. Anyway, this is offtopic here, sorry for that.

1

threads

18

posts

434

credits

Intermediate member

Rank: 3Rank: 3

credits
434
 Author| Published in 2017-5-7 19:45:59 | Show all floors
Version v0.2 RELEASED (2017-05-07):
You can find the changes and the new download link in my original (first) post.

Thank you.

3

threads

54

posts

1386

credits

Gold member

Rank: 6Rank: 6

credits
1386
Published in 2017-5-8 03:56:12 | Show all floors
Hello @robi217

I would like to invite you to join us in the H3Droid project and maybe we could help each other?  We have a few guys who are working with Android 4.4.4 used in our image and we are always looking for some help to better the project.  Maybe we could include your image under our project and/or help with hosting your images as well?  Anyhow, if you are interested please drop into #H3Droid on Freenode and come chat with us, we would be love to meet you!

Thanks for giving back to the community!

Cheers!

1

threads

18

posts

434

credits

Intermediate member

Rank: 3Rank: 3

credits
434
 Author| Published in 2017-5-8 20:47:34 | Show all floors
TheLinuxBug replied at 2017-5-8 03:56
Hello @robi217

I would like to invite you to join us in the H3Droid project and maybe we could hel ...

Hello!

For first, thank you very much for your invitation, but sadly, I don't have enough time for participating in your project, because I spend most of my free time studying for my final exams at school. To tell you the truth, I actually don't have much knowledge about using Linux and doing configuration, so I don't think that I could help you so much in the project. However, I've spent some hours with testing your H3Droid Android image on my Orange Pi Zero board, and I would like to share my experiences with you below:

For first, I used a Lubuntu-based virtual machine (with VirtualBox) on my Windows PC to install the image. The installation process was quite simple, but I think that you should include the auto-unmount of partitions (or a command to format the whole disk and remove all partitions before actually starting the setup process) in your script, because If i don't do that manually, I will only get a couple of errors and nothing done.
So, after removing the partitions manually, I succesfully managed to install the H3Droid system on my 4GB SD Card (it's a noname card, which is also a bit slow, but perfect for testing because it shows how things can/can't work in the worst-case ). I've found out that if you skip configuring both the u-boot and the fex configuration, it will result in an unbootable system, or just a recovery console showing up, with nothing to do.

After some attempts, I found out the best working configuration for this board:
For u-boot, you need to apply u-boot-sunxi-with-spl.bin (However, according to the linux-sunxi wiki, the u-boot for OPi One would work better with this board, but it was not included in your image)
For fex file, go on with orangepizero.bin


After burning the image, I ejected the drive in the Linux VM, and put in my Orange Pi Zero for the first boot. After 10 seconds of blank screen (with a little flickering), the boot animation appeared to me.
Now, I waited for the system to boot up and do the automatic configuration (extending the SD card partition). I waited more than 20 minutes, but it did nothing (the red LED was flashing very quickly for the first 2 minutes, then it only flashed twice in 10-15 seconds). After waiting such a long time, I did a reboot.
After reboot, the booting process succesfully completed in under 1 minute, and I found myself on the Android "desktop".So, it looks like the system couldn't reboot after doing the automatic first-boot configuration by itself, you have to wait a little (10-20 minutes) and reboot your device manually. Actually, the same thing happens with the first-time setup on RetrOrangePi (it finishes configuration succesfully, but it won't reboot until you won't force it manually by cutting the power), that's why I thought that it's the same case now.

So, the system was ready to go. I tried turning on Wi-Fi for the first time. Sadly, I realized that Wi-Fi is broken in this image (however, I found some XR819 files in the system partition, so it should work - but it didn't). No problem, I went on with a wired Ethernet connection, which works fine for my board. The next thing that I tried was audio playback, which didn't work on any of the Android images I've tried before. I was quite surprised, because audio works fine on this board. Not only audio through external USB sound card, but the onboard audio via extension board as well. So, I'm very happy with your image at the moment

I also tried to do everyday tasks on your system, and realized that the performance is quite good and the system is very stable (even with my slow and small SD card). I didn't run benchmarks yet, but I think that this image works much better than my own image created from the official source. However, if you could fix the Wi-Fi for this board, it would be very nice. And you should also include a Windows installer, because it would make the installing process much easier for newbies like me

Anyway, thank you very much for your work, and again, I am very sorry that I can't take part in your project. However, if you need help with testing, I can help you anytime you want

1

threads

18

posts

434

credits

Intermediate member

Rank: 3Rank: 3

credits
434
 Author| Published in 2017-5-8 21:29:11 | Show all floors
Edited by robi217 at 2017-5-8 21:46
TheLinuxBug replied at 2017-5-8 03:56
Hello @robi217

I would like to invite you to join us in the H3Droid project and maybe we could hel ...

I also read that you had problems with implementing root access on your system.
Actually I'm not an expert at this area, but I just wanted to let you know that I could easily root the system using KingoRoot's PC application (over USB debugging mode).
I don't know how does it work exactly, but it semms like that the root is working in real, because Root Checker showed positive results (I didn't try other apps yet).
Of course I don't like KingoUser (most people agree with me), but replacing KingoRoot with SuperSU is actually very easy, you can find guides on XDA about that

I also saw that you have problems with support of USB Bluetooth adapters. After browsing the system files in your image and other H3-based images I found that the official Orange Pi image I used before has a special application installed in /system/app folder called USBBT.apk (which I think means USB Bluetooth). I don't know if installing this application (and configuring it somehow) could help to fix this problem, but it's worth trying (I will try to install it, but sadly I don't know what could I do with them apart from installing it as a normal application )


This thread contains more resources

You need to Log in to download or view,No account?    Register

x

3

threads

54

posts

1386

credits

Gold member

Rank: 6Rank: 6

credits
1386
Published in 2017-5-8 22:17:23 | Show all floors
Edited by TheLinuxBug at 2017-5-9 02:59

@robi217

If you could come on IRC maybe we can set you up so you can test out our 'untested' images and you could provide some feedback there?

We are currently looking for some people we can send out e-mail updates to to test new 'untested' images out before we release them, if you have time to do that, that would be awesome!

We have a 1.2.3 version in Alpha currently that fixes some things, it may even address your WiFi issue.  Just drop by the IRC channel and I will get you access to the new image!

BTW Thanks for all your feedback, I will mention however, some of the issues you did mention I believe are documented in our F.A.Q. but you are not the first to gloss over it.

Cheers!

1

threads

18

posts

434

credits

Intermediate member

Rank: 3Rank: 3

credits
434
 Author| Published in 2017-5-10 15:01:28 | Show all floors
I've included a smaller tutorial in my first post to get Wi-Fi connection working. It's a one-time process, and maybe fixed in later versions (You have to do this trick if using v1.2.2 and v1.2.3-ALPHA).

Thank you guys on H3Droid's IRC channel for the help
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list