Android 10 on the XA2 Ultra!

Okay, so I’ve been playing around some more with the SODP material and AOSP 10. That’s right, they decided to stop naming Android versions after deserts and just give them numbers. Seems lame to me, but, oh well.

Either way, I did a build of Android 10 with the SODP material, and it is interesting. I’m also using the new 4.14 kernel as well, which is great to keep progressing with newer kernels.

Unfortunately, it’s not quite ready for release yet, it has random crashes and many issues at present, so perhaps I’ll go back and build Android 10 with the 4.9 kernel instead.

Linux – keep it simple.

Fix for MTP/PTP crashes on the XA2 Ultra!

One of the prevailing issues with the SODP build of AOSP was that every time I hooked up my phone to the computer to transfer files, it would cause the phone to crash and reboot. Obviously that is not very productive. I was a bit stumped and decided to join the unofficial SODP telegram group and ask if the developers there had ever seen this issue.

Sure enough, they had. Not only that, but they pointed me to a bug-tacker tool that allowed me to search issues they’ve seen before! It was a huge help! In there, I found a post by a user who had similar problems with another SODP phone. More importantly, there was a helpful response from a developer who pointed out what the issue was, and how to fix it!

It appears that the problem is the buffer size for the file transfer. All one has to do to fix it was make a simple change to the buffer size in

drivers/usb/gadget/function/f_mtp.c

Once you make the edits, then MTP works. He put together a patch, if you don’t want to hand edit them. Here it is:

diff --git a/drivers/usb/gadget/function/f_mtp.c b/drivers/usb/gadget/function/f_mtp.c
index 7692b9d86633..ddf5faedc3c6 100644
--- a/drivers/usb/gadget/function/f_mtp.c
+++ b/drivers/usb/gadget/function/f_mtp.c
@@ -42,8 +42,8 @@
 
 #include "../configfs.h"
 
-#define MTP_RX_BUFFER_INIT_SIZE    1048576
-#define MTP_TX_BUFFER_INIT_SIZE    1048576
+#define MTP_RX_BUFFER_INIT_SIZE    16384
+#define MTP_TX_BUFFER_INIT_SIZE    16384
 #define MTP_BULK_BUFFER_SIZE       16384
 #define INTR_BUFFER_SIZE           28
 #define MAX_INST_NAME_LEN          40

It’s great to have that working properly now! It’s also great to work with a team of really helpful developers, for a change.

Linux – keep it simple.

Google Apps on the SODP AOSP for the XA2 Ultra?

As you know, I’ve gone Google App-less, or “gappless”. But, for better or worse, not all of my ROM users have done the same. Typically, when you build a custom ROM, you build it without things like ROOT or GAPPS, and leave it to the ROM user to decide what they would like to install. In the case of installing GAPPS, they typically use TWRP to flash an opengapps zip file that installs all the desired Google Apps.

This is useful, because there are lots of Google Apps, and users may want some of them, but not all of them. Thus, when you install your zip from opengapps, you choose how many Google Apps you would like, pico, nano, mini, stock, full, etc., the bigger the tag, the more Google Apps you get.

Unfortunately, my SODP based AOSP ROM has an issue with Gapps. As I said, I don’t use Gapps anymore, but my users reported that they could not install Gapps. So I tried installing it myself to see what the issue was. Sure enough, it would install properly, but when you booted into the phone, the Gapps were not there! It was as if they never installed. I’d like to take credit for the Gapps resistant ROM, but it was purely unintentional.

So, this may seem counter productive, but I’ve release a build with built in Gapps as well. Since the end user can’t install it themselves, you can actually follow opengapps guide to build your ROM with Gapps included in the build. While I don’t like using Gapps anymore, I certainly want others to have the freedom to do so. The only difficult thing was figuring out which level of Gapps to include. In the end I decided with “stock”, which is less that full or all, and more than pico, nano, and mini. I figure that if you want Gapps, you probably want the standard, or stock amount of programs.

The only downside, is it makes my build almost three times the size! Believe me, it took three times longer to upload too! I think next go around, I’ll probably use mini for the Gapps level, to save myself some uploading bandwidth. I of course, still release my own builds without Gapps, for those so inclined.

Linux – keep it simple.

Fixing Camera issues with SODP/AOSP on the XA2 Ultra

c

Well, last post I was telling you how I started using the SODP material to build AOSP on the XA2 Ultra, and how well it worked. However, there were a few issues. One notable issue was with the camera preview, and how it would look green. The pictures themselves would be fine, but the display would look green while taking them. That obviously would not do.

One thing I came to realize is that the manifest I was using downloaded the 4.9 kernel source, but also a pre-built 4.9 kernel to be used during the build. Once it was deemed stable, they start using the pre-built kernel instead of building them from source while you build Android. This saves time and resources, but isn’t (in my opinion) a good idea.

So, I decided to build the kernel from source myself, instead of using the pre-built one. Long story short, I simply had to delete the kernel/sony/4.9/common-kernel/ folder and all of it’s contents to force the build process to also build the kernel from the already available source code.

Once I did that, not only did it build the 4.9 kernel from source, but, to God be the glory, it also fixed the green camera display issue! So, it looks like some code or another was updated somewhere along the line and the older pre-built kernel did not interact well with that code, or did not take advantage of it…. Either way, I’m quite pleased to have the kernel built from source and the camera working properly!

Linux – keep it simple.

AOSP with the SODP on XA2 Ultra!

Alright! Well, the first build of AOSP using the SODP on the XA2 Ultra are out! For those who are caught in acronym paralysis, that is the Android Open Source Project built using the Sony Open Devices Project. I used the SODP material to build my first AOSP ROM with it. And, I like it.

There are, however, a few issues. So far, the camera sometimes turns green when displaying the preview, but the pictures come out normal. Also, MTP/PTP (connecting to your computer to transfer files) causes the phone to crash at times. This is a bit of a problem. The FM radio does not work, and the gallery app can’t play back videos.

Originally, I thought the videos were not recording properly, but I found installing any other app to view/playback videos worked just fine. Just the built in app doesn’t have the ability to play back videos.

Well, that is very interesting, no I need to figure out how to fix this. On the plus side, I did use the newer 4.9 kernel, as opposed to the original 4.4 kernel, so that is an exciting step in the right direction! You can check out my builds on XDA if you’d like.

Linux – keep it simple.

Sony Open Device Project and the Xperia XA2 Ultra….

Now that I’ve built a few ROMs for the XA2 Ultra (AOKP and Resurrection Remix), I’ve turned my attention to the Sony Open Devices Project. The SODP, as it is abbreviated, is an effort to make custom ROMs for various Sony devices that are as open source as possible. This includes reducing the amount of vendor blobs (binary large objects) by replacing them with open source code wherever possible.

While the phones in this program are not 100% vendor blob free, they are dramatically reduced and continue progressing as time goes on and developers continue their work. It’s a great idea with several volunteer and professional staff members (courtesy of Sony), and I am all for it. Here is their statement from their web page linked above:

For some of the Xperia™ devices, we provide Android™ Open Source Project (AOSP) device configurations on GitHub. This means that the software will be open for you as a developer to use and contribute to. This is a way for us to support the open Android community, and it is also a tool for us to facilitate and verify contributions to AOSP.

That said, I’ve started progressing in that direction. I’m not skilled enough to do the helpful work of breaking down blobs and coding an open source alternative, but I’m jumping in by using their material as a base for my ROMs that I build.

One of the greatest advantages I see in using this material is the newer kernels. The XA2 Ultra comes with kernel version 4.4. However, the SODP includes kernels 4.9 and 4.14! Using a newer kernel brings better performance and enhanced security, which is always a plus!

It will be interesting to see what comes of this, how functional the ROMs are, and where I can go from here….

Linux – Keep it simple.