[Nexus 5X] Porting Thread

1,536 views
Skip to first unread message

Preetam

unread,
Jan 12, 2017, 4:46:37 PM1/12/17
to maru-...@googlegroups.com
I forgot to follow my own advice to create a porting thread! So here it is.

Repos:
https://github.com/maruos/android_device_lge_bullhead
https://github.com/maruos/android_kernel_bullhead

The N5X is an interesting beast because it is arm64 and does not have hardware video-out capability (i.e. no SlimPort or MHL). So this is a perfect testbed for moving Maru OS to arm64 devices, as well as providing a workaround for lack of hardware video-out.

Some of the big issues I am working on to enable this port:
* arm64 LXC builds (done)
* arm64 desktop builds (done)
* wireless display support (done / out for testing)

It's also worth noting that the N5X uses a separate vendor.img partition to hold a majority (not all...) of the blobs needed to drive all the hardware, and are not distributed as part of the Nexus binary program like the N5 for example. This results in all sorts of headaches, but thankfully someone has found a way around this: https://github.com/anestisb/android-prepare-vendor.

I'll link here to early test builds for the N5X as I develop for folks to test.

If you have any questions on porting for devices similar to the N5X, feel free to ask!

Latest Build

The Nexus 5X is an official port for Maru! You can find the latest builds here: https://github.com/maruos/builds/releases.

---
edit 1/19/17: add Latest Build section
edit 10/12/17: add obsolete build header
edit 9/17/18: Update repo links and some stale info
edit 10/11/18: Add latest build link

Bart Vdpt

unread,
Jan 13, 2017, 9:58:55 AM1/13/17
to Maru OS dev
Hi 

When you get MaruOS working on the N5x, will you do also a same port for N6p? 
The N6p is also an interesting beast to run MaruOS on, i think. 


I know it's quite different hardware and there is already a N6p port busy, but i ask anyway. 
Nice that you will do arm64 + wireless display support! 

Regards and a sparkling 2017
Bart 

Op donderdag 12 januari 2017 22:46:37 UTC+1 schreef Preetam:
I forgot to follow my own advice to create a porting thread! So here it is.



The N5X is an interesting beast because it is arm64 and does not have hardware video-out capability (i.e. no SlimPort or MHL). So this is a perfect testbed for moving Maru OS to arm64 devices, as well as providing a workaround for lack of hardware video-out.

Some of the big issues I am working on to enable this port:
* arm64 LXC builds (on branch arm64-workaround)
* arm64 desktop builds (already on master)
* wireless display support (in development...)


It's also worth noting that the N5X uses a separate vendor.img partition to hold a majority (not all...) of the blobs needed to drive all the hardware, and are not distributed as part of the Nexus binary program like the N5 for example. This results in all sorts of headaches, but thankfully someone has found a way around this: https://github.com/anestisb/android-prepare-vendor.

Tyler Martin

unread,
Jan 13, 2017, 11:11:33 AM1/13/17
to Maru OS dev
This might actually lead me to unlock and root my 5X.


On Thursday, January 12, 2017 at 4:46:37 PM UTC-5, Preetam wrote:
I forgot to follow my own advice to create a porting thread! So here it is.

My development repos for reference:
The N5X is an interesting beast because it is arm64 and does not have hardware video-out capability (i.e. no SlimPort or MHL). So this is a perfect testbed for moving Maru OS to arm64 devices, as well as providing a workaround for lack of hardware video-out.

Some of the big issues I am working on to enable this port:
* arm64 LXC builds (on branch arm64-workaround)
* arm64 desktop builds (already on master)
* wireless display support (in development...)

It's also worth noting that the N5X uses a separate vendor.img partition to hold a majority (not all...) of the blobs needed to drive all the hardware, and are not distributed as part of the Nexus binary program like the N5 for example. This results in all sorts of headaches, but thankfully someone has found a way around this: https://github.com/anestisb/android-prepare-vendor.

Preetam

unread,
Jan 15, 2017, 12:32:24 PM1/15/17
to Maru OS dev
@Bart I don't have a N6P in my posession to quickly iterate on so I can't guarantee anything, but maybe I can get some builds going and let others test them. Anyway, 5X first!

@Tyler Yes, please!

Preetam

unread,
Jan 16, 2017, 9:59:27 PM1/16/17
to maru-...@googlegroups.com
OK, been running my dev build for a couple days on my 5X and it seems pretty stable. WiFi, Cellular, Cameras, Fingerprint sensor seem to all be working fine. You should be able to launch Maru Desktop just fine in the background as usual and ssh in to explore the arm64 desktop.

Known issues:
* BT sometimes doesn't start. Rebooting the phone should fix it.
* QuickSettings BT view doesn't show BT devices. You need to go to the full Settings > Bluetooth view.
* Trying to start the desktop immediately after first boot may fail. This is because the image is pre-odexed and boots so quickly that the desktop files are still copying over from system to data. Wait a few minutes after first boot before starting the desktop.
* Cursor on desktop looks glitchy. This is due to unportable buffer copy in mclient on 64-bit architecture; I have a patch I'm testing right now, just need to make sure it works on hammerhead too.
* Firefox crashes with a segmentation fault. I'm assuming there is an issue with the arm64 package. You can use an alternate browser like midori.

Warning: This update zip will flash not only system, but vendor, bootloader, and radio as well.

Download: https://drive.google.com/open?id=0B4ZyDB8ct_ywN2pBTGhrVHdHT2c
SHA-1: 5875e68819f3675bf73aa9a224f24c801e6b7c7e

Feedback, bug reports, etc. are very welcome.

Some other notes --

# Display patches

I've also included my new display patches that basically set Maru Desktop to be mirrored by default instead of the phone screen to all mirrorable displays that Android recognizes. So if you have some mirroring solution, it should theoretically be able to work with Maru Desktop. Anyone with a DisplayLink receiver, I am especially interested in hearing if this works.

I've tested this with Chromecast using Cast from my 5X and it works fairly well right now--remember, you need to install gapps before Cast works. My Chromecast always reports my display at 720p instead of 1080p (not sure why...), and if yours does too, you'll need to go to Settings > Display in Maru Desktop and manually set the resolution to 720p so you can see your entire workspace since the desktop defaults to 1080p. Another thing: here and there my Chromecast drops the connection and requires a reboot to connect to it again, but this is probably due to my network setup. Other than that, I'm pretty sure these patches are good, but let me know if you see any weird side-effects or something with your normal Android usage.

# Virtual display debugging trick to quickly see the desktop on your phone

Enable Developer Options, tap "Simulate secondary displays", and create a 1080p virtual display. Start Maru Desktop and it should show up on your virtual display! Connect BT key/mouse, and you should be able to interact with it on the virtual display! You can re-size the virtual display with pinch/zoom gesture. This is a nice side-effect of the new display patches. This is very useful if you are bringing up a new device and don't have external displays working yet.

# Automated gapps installer script -- install-gapps.sh

And one more thing--I wrote up an automated script to install gapps easily and added them to the maruos-devbox docker image. You may find it useful to install gapps quickly while developing. I've noticed that the 5X has a permission issue with Open Gapps, and you need to run a permission fixing script to get everything to work properly after flashing Open Gapps. The script can take care of this for you too. You just need curl, adb, and fastboot in your PATH. See commit for more info: https://github.com/pdsouza/maruos-devbox/commit/786c24944807f76e45c3b26099b0b907f157a2f6. This has been tested on Arch Linux and Debian.

If you are using the docker image for dev, you can just pull the latest docker image to get it:

$ docker pull pdsouza/maruos-devbox

Otherwise, you can download it directly from the repository (remember to download both install-gapps.sh and fix-open-gapps-permissions.sh in the same directory): https://github.com/pdsouza/maruos-devbox/tree/master/scripts

And you can run it like so for bullhead:

$ ./install-gapps.sh -d bullhead


Edit: added Firefox crash to known issues

bootlessxfly

unread,
Jan 16, 2017, 11:42:39 PM1/16/17
to maru-...@googlegroups.com
This is great news. I'll try to get the display patches working with the nexus 6p build after i get the desktop image working.
I can not test this on my 5x device because I gave it to my senior design group for testing. I am sending them a link to the nexus 5x build and can let you know how their flashing of maru goes.

Preetam

unread,
Jan 18, 2017, 8:37:29 PM1/18/17
to Maru OS dev
@bootlessxfly Thanks, let me know how it goes!

bootlessxfly

unread,
Jun 6, 2017, 10:20:12 PM6/6/17
to Maru OS dev
@Preetam
I have been using this build on my device as my main phone for about 4 weeks now. I am happy to report that I haven't noticed any major problems. 
I have not noticed any bluetooth problems but have not tested that out fully yet.

Preetam

unread,
Jun 6, 2017, 10:52:20 PM6/6/17
to Maru OS dev
@bootlessxfly 
Thank you for testing! This is good to hear--I have been using it on my main phone as well with no major issues as well. There are sometimes glitches when changing the screen from landscape to portrait (if Maru Desktop is running, it briefly flickers on the phone screen during the rotation animation, this is the issue with the chromecast branch that I want to look into more). 

I am also doing some experimenting with N (7.1.2) on the nougat-mr2-release branch, but I need to port the chromecast branch changes over to N before I can upload a new build. I have found that N works even better than M on the 5X and that this fixes the bluetooth issues. You may find it interesting to play around with nougat-mr2-release for the 6P as well!

Lewis Candler

unread,
Aug 8, 2017, 4:27:02 AM8/8/17
to Maru OS dev
This is great!!, It is working to a point but it's a good starting platform. I will get the guys at my end to look into debugging this a little more!
Epic Bart!



On Friday, January 13, 2017 at 9:46:37 AM UTC+12, Preetam wrote:
I forgot to follow my own advice to create a porting thread! So here it is.

My development repos for reference:
The N5X is an interesting beast because it is arm64 and does not have hardware video-out capability (i.e. no SlimPort or MHL). So this is a perfect testbed for moving Maru OS to arm64 devices, as well as providing a workaround for lack of hardware video-out.

Some of the big issues I am working on to enable this port:
* arm64 LXC builds (on branch arm64-workaround)
* arm64 desktop builds (already on master)
* wireless display support (in development...)

It's also worth noting that the N5X uses a separate vendor.img partition to hold a majority (not all...) of the blobs needed to drive all the hardware, and are not distributed as part of the Nexus binary program like the N5 for example. This results in all sorts of headaches, but thankfully someone has found a way around this: https://github.com/anestisb/android-prepare-vendor.

I'll link here to early test builds for the N5X as I develop for folks to test.

If you have any questions on porting for devices similar to the N5X, feel free to ask!

Latest Build

Known issues:
* BT sometimes doesn't start. Rebooting the phone should fix it.
* QuickSettings BT view doesn't show BT devices. You need to go to the full Settings > Bluetooth view.
* Trying to start the desktop immediately after first boot may fail. This is because the image is pre-odexed and boots so quickly that the desktop files are still copying over from system to data. Wait a few minutes after first boot before starting the desktop.
* Cursor on desktop looks glitchy. This is due to unportable buffer copy in mclient on 64-bit architecture; I have a patch I'm testing right now, just need to make sure it works on hammerhead too.
* Firefox crashes with a segmentation fault. I'm assuming there is an issue with the arm64 package. You can use an alternate browser like midori.

Warning: This update zip will flash not only system, but vendor, bootloader, and radio as well.

Downloadhttps://drive.google.com/open?id=0B4ZyDB8ct_ywN2pBTGhrVHdHT2c
SHA-1: 5875e68819f3675bf73aa9a224f24c801e6b7c7e


Bart Vdpt

unread,
Aug 30, 2017, 3:22:21 AM8/30/17
to Maru OS dev
Epic Bart?
I am simple a tester, the epic has to go to the dev's. ;-)

Angelo Scotto

unread,
Aug 30, 2017, 4:15:06 AM8/30/17
to Maru OS dev
I was thinking to get a refurbished 5x to use MaruOS (great project btw),

I was wondering, has anyone tested if it works with Miracast and if it works specifically with Windows 10 Connect App (that should be miracast based) ?
This would be useful in those cases where I've a Windows 10 PC and I want to use it as dumb terminal for MaruOS (as at work when I want to use Maru a bit instead of company pc without having to mess with connections and dock)

Thank you,
Angelo

Preetam

unread,
Sep 2, 2017, 1:51:50 PM9/2/17
to Maru OS dev
Hi Angelo, I do not have a Windows machine or Miracast adapter to check the Windows 10 Connect App. I do know that Maru OS on the 5X works with Chromecast however! I also believe our 6P dev (bootlessxfly) has had success with DisplayLink, but I haven't heard of anyone testing Miracast yet.

KnaeckeKami

unread,
Oct 11, 2017, 7:50:18 PM10/11/17
to Maru OS dev
Anyone still working on this? I flashed the zip and can see the MaruOS Bootscreen, but after that my 5X just shows a black screen and vibrates every couple of seconds...

Preetam

unread,
Oct 12, 2017, 7:44:14 PM10/12/17
to Maru OS dev
The build above is obsolete--sorry about that. I've updated the post to prevent confusion. I'm working on getting the 5X running on N since it fixes a lot of issues with the old build on M and will post a fresh build when ready.

That being said, I have verification that it worked decently well and I was running it myself for a while, you definitely shouldn't be hanging like that. From what you describe it sounds like the Android framework is failing to start up properly...

May I ask how you installed it? 

Hopefully you took a backup in TWRP to get back quickly for now. You can hold Volume Up + Volume Down + Power to get into recovery to restore your backup.

KnaeckeKami

unread,
Oct 13, 2017, 5:13:04 AM10/13/17
to maru-...@googlegroups.com
Thanks for the update.

No worries, of course I have a proper backup, and I don't use the 5X as my main device.
I downloaded the build and flashed it via TWRP 3.1.1-0 -> Install -> maru_bullhead_ota[...].zip.

Fastboot shows that SELinux is enabled, might this be the cause?
I also have an European model, I don't know if there are multiple versions of the 5X that might require different vendors or radios.

Preetam

unread,
Oct 15, 2017, 2:16:22 PM10/15/17
to Maru OS dev
Hmmm...that's how I installed too, weird. 

SELinux should be ok. I don't see any different factory images from Google for different models of 5X so I would assume vendors and radio images are the same. I'll have to look into it more.

KnaeckeKami

unread,
Oct 16, 2017, 4:29:37 AM10/16/17
to Maru OS dev
I got it to work by completely wiping my device with TWRP and installing the image again. So if anyone is running into similar issues, you can try that.
I was using the Android 8 Developer Image before, if you want to look into why this happened.

Preetam

unread,
Jul 31, 2018, 10:09:36 PM7/31/18
to Maru OS dev
Well, it's been awhile without updates here but I have some good news...

Here is Maru running on the Nexus 5X (Android 8.1 / Lineage OS 15.1) with desktop streaming over Chromecast! Only 720p at the moment but I think this is probably a limitation with my Chromecast device (see my prev post for more details). Perhaps other wireless dongles will allow full 1080p.

I am working on getting some builds going for this and will post them here for testing soon.
Maru-on-the-Nexus5X.jpg

Torrey wright

unread,
Aug 15, 2018, 8:38:42 PM8/15/18
to Maru OS dev
My 5x bootlooped today. I found a work around on the web, but I was looking forward to trying a port out at some point. 
Is it reasonably possible to get these ports working on my device?
If so would it even be worthwhile, seeing as - as far as I understand - I've lost some of my cpu cores? Or would it just end up being too slow to use?

Preetam

unread,
Aug 16, 2018, 8:28:53 PM8/16/18
to Maru OS dev
@Torreh I should have some builds up this weekend for you to try. Maru desktop used to be limited to one CPU and it still was usable. Def worth trying I think!

Torreh

unread,
Aug 16, 2018, 8:41:35 PM8/16/18
to Maru OS dev
That's good to hear!
One more thing: Since the USB connection isn't used by the display, could I just connect a keyboard/mouse up via USB OTG?

Georgian Chituc

unread,
Aug 17, 2018, 12:06:44 AM8/17/18
to Maru OS dev
yes , of course, just try it

Preetam

unread,
Aug 17, 2018, 4:14:30 PM8/17/18
to Maru OS dev
On Thursday, August 16, 2018 at 8:41:35 PM UTC-4, Torreh wrote:
One more thing: Since the USB connection isn't used by the display, could I just connect a keyboard/mouse up via USB OTG?

It should work but I think there is a known bug where your USB-OTG mouse and keyboard events will also show up on the Android side (e.g. clicking your mouse will click on both Android and Maru Desktop). Maru was initially designed to only work with BT access before the virtual / wireless display stuff was developed and it hasn't been updated yet. It should be good enough to play around with but may be slightly annoying until we fix the duplicate events.

Georgian Chituc

unread,
Aug 17, 2018, 4:24:48 PM8/17/18
to Maru OS dev
My los 14.1 patches include code that , if maru desktop is started before you to attach a USB or Bluetooth keyboard/mouse , it will not show in android . If maru desktop is not started when you attach the mouse it will show in android

Preetam

unread,
Aug 20, 2018, 4:52:16 PM8/20/18
to Maru OS dev
On Friday, August 17, 2018 at 4:24:48 PM UTC-4, Georgian Chituc wrote:
My los 14.1 patches include code that , if maru desktop is started before you to attach a USB or Bluetooth keyboard/mouse , it will not show in android . If maru desktop is not started when you attach the mouse it will show in android

Oh ok cool. Can you send a PR for this? Would be great to merge it to the main project.

Georgian Chituc

unread,
Aug 20, 2018, 5:49:53 PM8/20/18
to Maru OS dev
Oke , I did a PR for this . The things are simple , it just search if mclient is running and if is running it do not add mouse and keyboard to android , just to linux . If mclient is not running (Desktop not started ) it add mouse and keyboard to Android .  Code is not complicated ,and I just managed to depend on his logic cause when I do not start Dekstop I 'm still able to use the mouse and keyboard inside Android :D 
Message has been deleted

Preetam

unread,
Oct 11, 2018, 3:39:48 PM10/11/18
to Maru OS dev
On Monday, August 20, 2018 at 5:49:53 PM UTC-4, Georgian Chituc wrote:
Oke , I did a PR for this . The things are simple , it just search if mclient is running and if is running it do not add mouse and keyboard to android , just to linux . If mclient is not running (Desktop not started ) it add mouse and keyboard to Android .  Code is not complicated ,and I just managed to depend on his logic cause when I do not start Dekstop I 'm still able to use the mouse and keyboard inside Android :D 

Sorry for taking so long on reviewing this PR! I need to test this and I will get back to you.

Georgian Chituc

unread,
Oct 11, 2018, 7:52:36 PM10/11/18
to Maru OS dev
Oke , great !
It have to work fine it works for cm 13 ,los 14.1 ,15.1 no problema.
Thank you!

Georgian Chituc

unread,
Oct 11, 2018, 7:54:59 PM10/11/18
to Maru OS dev
If desktop is already started when you attach mouse or keyboard ,they are not visible to android . If desktop is not started they are avaible to android

Preetam

unread,
Oct 15, 2018, 10:28:40 AM10/15/18
to Maru OS dev
Just a heads-up that the 5X is now an officially supported device on Maru 0.6! I've updated my first post with links to the official builds.

Owen Noble

unread,
Jan 30, 2020, 4:15:20 PM1/30/20
to Maru OS dev
My MaruOS for N5x has become unresponsive to touch. So I need some idea to how to fix the problem.


On Thursday, January 12, 2017 at 2:46:37 PM UTC-7, Preetam D'Souza wrote:
I forgot to follow my own advice to create a porting thread! So here it is.



The N5X is an interesting beast because it is arm64 and does not have hardware video-out capability (i.e. no SlimPort or MHL). So this is a perfect testbed for moving Maru OS to arm64 devices, as well as providing a workaround for lack of hardware video-out.

Some of the big issues I am working on to enable this port:
* arm64 LXC builds (done)
* arm64 desktop builds (done)
* wireless display support (done / out for testing)


It's also worth noting that the N5X uses a separate vendor.img partition to hold a majority (not all...) of the blobs needed to drive all the hardware, and are not distributed as part of the Nexus binary program like the N5 for example. This results in all sorts of headaches, but thankfully someone has found a way around this: https://github.com/anestisb/android-prepare-vendor.

I'll link here to early test builds for the N5X as I develop for folks to test.

If you have any questions on porting for devices similar to the N5X, feel free to ask!

Latest Build

The Nexus 5X is an official port for Maru! You can find the latest builds here: https://github.com/maruos/builds/releases.

---
edit 1/19/17: add Latest Build section
edit 10/12/17: add obsolete build header
edit 9/17/18: Update repo links and some stale info
edit 10/11/18: Add latest build link

Preetam D'Souza

unread,
Feb 2, 2020, 9:19:24 AM2/2/20
to Maru OS dev
This sounds like a hardware issue? I saw the message you left on my personal website and you said you dropped your device?

If it is a hardware issue, there is unfortunately nothing we can do to help you with that.
Reply all
Reply to author
Forward
0 new messages