[Xperia Z3 Compact] Porting Thread

794 views
Skip to first unread message

Stefan

unread,
Sep 2, 2016, 3:42:09 AM9/2/16
to Maru OS dev
Hello,

I decided to port Maru OS to Xperia Z3 Compact and so far I've managed to compile it, but after I flash it, I get stuck in an infinite bootloop.

This is the error output in the logcat:
E/tadif   (  274): Failed to connect to tad.
E/macaddrsetup(  274): failed to open misc ta: 1
E/BootAnimation(  302): couldn't find audio_conf.txt

I'd appreciate If you could point me in the right direction.

Thanks,
Stefan

Stefan

unread,
Sep 2, 2016, 5:46:53 AM9/2/16
to Maru OS dev
I managed to boot it. I don't know what went wrong, but after flashing some other images and reflashing this one, it magically booted.

Anyway, I still didn't receive my MHL cable, but I'll report back as soon as I have it.

Preetam

unread,
Sep 2, 2016, 6:10:20 PM9/2/16
to Maru OS dev
Hi Stefan,

Awesome! Were you able to compile the kernel with the extra options required for Maru OS?

Looking forward to your report when you get that MHL cable; you will be the first one to try out Maru OS on MHL!

Best,
Preetam

Stefan

unread,
Sep 3, 2016, 4:53:01 AM9/3/16
to Maru OS dev
Nope, I didn't recompile kernel. But I will do that today. 

Stefan

unread,
Sep 3, 2016, 7:38:11 AM9/3/16
to Maru OS dev
Ok, so I managed to recompile the kernel and rebuild the boot image with it. It boots.

Anyway, I have a few issues that I noticed: SIM and SD cards are not getting detected. This issue was present before I recompiled the kernel. I will look into this while waiting for my MHL cable

Cheers,
Stefan

Preetam

unread,
Sep 3, 2016, 10:00:15 PM9/3/16
to Maru OS dev
Nice work!

Stefan

unread,
Sep 12, 2016, 5:44:55 PM9/12/16
to Maru OS dev
Hey,

I finally received my adapter and MaruOS doesn't seem to work. But more importantly, I'm not sure how to debug it. After I tried to connect the phone to the monitor and it failed to connect, I wanted to connect it to the PC, see the logcat and figure out what went wrong. But after connecting phone to the monitor, my connection to the PC stops working. The device doesn't show up in adb devices nor does it let me have regular MTP connection. If I reboot the device, adb starts working again, but I'm not sure what to look for in log and I'm not even sure if log is reset or not.

Could you give me some pointers?

Thanks,
Stefan

Preetam

unread,
Sep 12, 2016, 7:33:09 PM9/12/16
to Maru OS dev
Hi Stefan,

Thanks for working on this port! Let's debug this thing.

First, what does Settings > Desktop > Dashboard show when you plug your phone in to the monitor?

Second, I am not sure why adb is not working after connecting to a monitor. I am able to connect to a monitor, disconnect, connect to PC and adb/logcat still works.

But you can get around this with adb tcpip if you are on a local network:

Wireless adb/logcat on local network with adb tcpip

Connect your device to your PC and start adb in tcpip mode:

$ adb tcpip 5555
$ adb connect
<device-ip-address>:5555

Note you can find your device's IP address easily from Settings > WiFi > Advanced.

Then disconnect your device and you should be able to adb shell in like usual:

$ adb shell

So now you can watch live while you plug your device into the monitor for interesting logs. I suggest grep'ing for "hdmi" or "desktop" or "perspective" if there is too much noise in the logs.

Here are the common points of failure:
  • HDMI display is not connected properly (could be monitor or cable)
  • Desktop container fails to start (could be incorrect kernel build, messed up container runtime filesystem, permission issue, etc.)
We want to make sure that your monitor is registering itself properly as an external HDMI display, and that PerspectiveService is triggering the start of the desktop container. If that's good, then we can look at why the container fails to start.

I can take a quick look at your logs after you plug in your device to the monitor if you send me a bug report, instructions here: https://github.com/maruos/maruos/wiki/Bug-Reports. I should be able to quickly see where the failure is to determine the next steps.

Best,
Preetam

Stefan

unread,
Sep 13, 2016, 5:59:20 PM9/13/16
to Maru OS dev
Hey,

Thanks a lot for the tips! They worked.

When I connect phone to the monitor, dashboard says that it failed to connect. I tried filing a bug report, but I never got the "Bug report captured" notification. I tried twice and waited probably more than half an hour each time. But I can offer you a logcat at the moment of connecting. It seems to me that the monitor is well connected, but you take a better look.

Here's logcat:

D/qdexternal(  268): readCEUnderscanInfo: Scan Info string: 0, 0, 0
D/qdexternal(  268):  length = 8
D/qdexternal(  268): ExtDisplay setting xres = 1920, yres = 1080
D/qdhwcomposer(  268): handle_uevent sending hotplug: connected = 1
D/qdhwcomposer(  268): hwc_getDisplayAttributes disp = 1, width = 1920
D/qdhwcomposer(  268): hwc_getDisplayAttributes disp = 1, height = 1080
I/DisplayManagerService(  709): Display device added: DisplayDeviceInfo{"HDMI Screen": uniqueId="local:1", 1920 x 1080, 30.0 fps, supportedRefreshRates [30.0], density 320, 320.0 x 320.0 dpi, appVsyncOff 0, presDeadline 34333333, touch EXTERNAL, rotation 0, type HDMI, state UNKNOWN, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, FLAG_PRESENTATION, FLAG_DEFAULT_EXTERNAL_DISPLAY}
D/SurfaceFlinger(  268): Set power mode=2, type=1 flinger=0xb6482000
D/qdhwcomposer(  268): hwc_blank: Unblanking display: 1
D/qdhwcomposer(  268): hwc_blank: Done unblanking display: 1
I/DisplayManagerService(  709): Display device changed: DisplayDeviceInfo{"HDMI Screen": uniqueId="local:1", 1920 x 1080, 30.0 fps, supportedRefreshRates [30.0], density 320, 320.0 x 320.0 dpi, appVsyncOff 0, presDeadline 34333333, touch EXTERNAL, rotation 0, type HDMI, state ON, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, FLAG_PRESENTATION, FLAG_DEFAULT_EXTERNAL_DISPLAY}
V/ActivityManager(  709): Display added displayId=1
V/ActivityManager(  709): Display changed displayId=1
I/PerspectiveService(  709): HDMI display added, scheduling desktop start...
D/MDesktopSettings( 1413): onHdmiDisplayAdded
D/PerspectiveService(  709): mDesktopState: STOPPED -> STARTING
I/ValidateNoPeople(  709): skipping global notification
E/PerspectiveService(  709): nativeStart failed
D/PerspectiveService(  709): mDesktopState: STARTING -> STOPPED
I/InputReader(  709): Reconfiguring input devices.  changes=0x00000004
V/ActivityManager(  709): Display changed displayId=1
D/MDesktopSettings( 1413): onPerspectiveStateChanged: STARTING
D/MDesktopSettings( 1413): onPerspectiveStateChanged: STOPPED
E/WifiStateMachine(  709): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=4.70 rxSuccessRate=3.86 targetRoamBSSID=any RSSI=-33
I/PowerManagerService(  709): Nap time (uid 1000)...
I/DreamManagerService(  709): Entering dreamland.
I/PowerManagerService(  709): Dreaming...
I/DreamController(  709): Starting dream: name=ComponentInfo{com.android.deskclock/com.android.deskclock.Screensaver}, isTest=false, canDoze=false, userId=0
V/KeyguardServiceDelegate(  709): onScreenTurnedOn(showListener = com.android.internal.policy.impl.PhoneWindowManager$2@1f74a94e)
D/audio_hw_primary(  280): adev_set_parameters: enter: screen_state=on
E/WifiStateMachine(  709): cancelDelayedScan -> 21
E/native  (  709): do suspend false
V/KeyguardServiceDelegate(  709): **** SHOWN CALLED ****
D/OpenGLRenderer( 2028): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/Atlas   ( 2028): Validating map...
D/NfcService( 1361): Discovery configuration equal, not updating.
I/Adreno-EGL( 2028): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.01.00.042.030_msm8974_LA.BF.1.1.1_RB1__release_AU ()
I/Adreno-EGL( 2028): OpenGL ES Shader Compiler Version: E031.25.03.06
I/Adreno-EGL( 2028): Build Date: 07/13/15 Mon
I/Adreno-EGL( 2028): Local Branch: mybranch11906725
I/Adreno-EGL( 2028): Remote Branch: quic/LA.BF.1.1.1_rb1.26
I/Adreno-EGL( 2028): Local Patches: NONE
I/Adreno-EGL( 2028): Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.01.00.042.030 + 6151be1 + a1e0343 + 002d7d6 + 7d0e3f7 +  NOTHING
I/OpenGLRenderer( 2028): Initialized EGL, version 1.4
D/OpenGLRenderer( 2028): Enabling debug mode 0
E/WifiStateMachine(  709): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=2.73 rxSuccessRate=2.24 targetRoamBSSID=any RSSI=-34
W/InputMethodManagerService(  709): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@2bfcc6f1 (uid=1000 pid=1413)
W/art     (  709): Long monitor contention event with owner method=void com.android.server.wm.WindowAnimator$1.run() from WindowAnimator.java:124 waiters=1 for 104ms
W/art     (  709): Long monitor contention event with owner method=void com.android.server.wm.WindowAnimator$1.run() from WindowAnimator.java:124 waiters=0 for 112ms
E/QMI_FW  (  278): QMUXD: WARNING qmi_qmux_if_pwr_up_init failed! rc=-1
E/WifiStateMachine(  709): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=0.73 rxSuccessRate=0.32 targetRoamBSSID=any RSSI=-33
E/WifiStateMachine(  709): WifiStateMachine L2Connected CMD_START_SCAN source -2 20, 23 -> obsolete
E/WifiStateMachine(  709): WifiStateMachine CMD_START_SCAN source -2 txSuccessRate=0.73 rxSuccessRate=0.32 targetRoamBSSID=any RSSI=-33

Preetam

unread,
Sep 13, 2016, 8:49:36 PM9/13/16
to Maru OS dev
Yay, we have some logs!


I/PerspectiveService(  709): HDMI display added, scheduling desktop start...
D/MDesktopSettings( 1413): onHdmiDisplayAdded
D/PerspectiveService(  709): mDesktopState: STOPPED -> STARTING
I/ValidateNoPeople(  709): skipping global notification
E/PerspectiveService(  709): nativeStart failed
D/PerspectiveService(  709): mDesktopState: STARTING -> STOPPED

So it looks like the HDMI monitor was connected successfully over MHL, and Maru responded by trying to start the desktop...but it failed.

To figure out why the desktop couldn't start, can you run the following from a root adb shell:

root# lxc-start -n jessie

This will go ahead and start up the desktop container, while giving you a text login shell so you can diagnose where its failing in the startup process. Let me know what the output is, I'm guessing you'll see a bunch of errors.

Best,
Preetam


Stefan

unread,
Sep 13, 2016, 9:46:54 PM9/13/16
to Maru OS dev
This is what I get:
lxc-start: /var/maru/external/lxc/src/lxc/lxc_start.c: main: 296 Executing '/sbin/init' with no configuration file may crash the host

Preetam

unread,
Sep 14, 2016, 7:16:32 PM9/14/16
to Maru OS dev
lxc-start: /var/maru/external/lxc/src/lxc/lxc_start.c: main: 296 Executing '/sbin/init' with no configuration file may crash the host

Sounds like the container directories aren't set up right...

What is the content of your /data/maru/containers/jessie directory? You should have the following:

root@hammerhead:/data/maru/containers/jessie # ls -al
-rw-r--r-- root     root         1489 1971-07-16 05:16 config
-rw-r--r-- root     root           22 1971-07-16 05:17 fstab

-rw-rw-rw- root     root         1874 1971-07-16 05:17 jessie.log
drwxr-xr-x root     root              1971-07-16 05:17 rootfs

The ones in bold are the important ones. If you are missing "config", you get the lxc-start error you got.

jason bender

unread,
Sep 14, 2016, 11:38:12 PM9/14/16
to Preetam, Maru OS dev
or if you are executing lxc-start as a user other than root
if you want to do that see: Using unprivileged LXC at:

Regards,
Jason Bender
Ocean Shores Tech
Call Toll Free:  877-771-0260
Texts & Local Calls: 425-270-8646
Fax #: 206-338-3635




--
You received this message because you are subscribed to the Google Groups "Maru OS dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maru-os-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maru-os-dev/2824454e-4e76-48fd-b790-d15111907083%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stefan

unread,
Sep 15, 2016, 1:21:27 AM9/15/16
to Maru OS dev
I'm actually missing a whole jessie folder. As the matter of fact, I have nothing in /data/maru/containers either.

Stefan

unread,
Sep 15, 2016, 3:25:20 AM9/15/16
to Maru OS dev
When is /data/maru/containers supposed to be populated?

I will throw some info out here, but don't actually know if it's going to be useful:
  - /system/maru/containers/jessie is populated (but it contains jessie-rootfs.tar.gz, instead of rootfs directory)
  - out/target/product/aries/data/maru/containers (on a build machine) is empty (assuming this is used for creating an image)

Preetam

unread,
Sep 15, 2016, 10:37:21 AM9/15/16
to Maru OS dev
  - /system/maru/containers/jessie is populated (but it contains jessie-rootfs.tar.gz, instead of rootfs directory)
  - out/target/product/aries/data/maru/containers (on a build machine) is empty (assuming this is used for creating an image)

Everything you said looks good. Only /system/maru should be there in the final build image.

/data/maru is populated from /system/maru during device boot with the /system/bin/mcprepare script. So it sounds like mcprepare is failing somehow...

Can you check the logs with logcat | grep mcprepare when you boot up your device?

You can also just run mcprepare directly from a root console and see what happens.

Stefan

unread,
Sep 15, 2016, 2:47:46 PM9/15/16
to Maru OS dev
I tried grepping logcat after boot, but that didn't yield anything. So I guess there's one issue with that.

On the other hand, I successfully ran the script from shell and it copied files to /data. Then I proceeded to try and connect it to HDMI and it failed similarly to previous times. After that, I went on and tried lxc-start -n jessie and that failed with the attached log. It's --logpriority=DEBUG log.

So, two problems here:
 - Why is mcprepare not executed?
 - Why is container failing to start?

Waiting for further directions. :)
logfile.txt

Preetam

unread,
Sep 15, 2016, 4:08:24 PM9/15/16
to Maru OS dev
Thanks for the logs!

 lxc-start 1473964808.940 ERROR    lxc_namespace - /var/maru/external/lxc/src/lxc/namespace.c:lxc_clone:67 - failed to clone (0x2c020000): Invalid argument
 lxc-start 1473964808.940 ERROR    lxc_start - /var/maru/external/lxc/src/lxc/start.c:lxc_spawn:894 - Invalid argument - failed to fork into a new namespace

Looks like the kernel doesn't have namespaces enabled?

Please ensure that your kernel is compiled with the following options:

CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_DEVTMPFS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y

More info on the wiki: https://github.com/maruos/maruos/wiki/Kernel.

Once you get the kernel compiled right we should get past the clone error.

As for why mcprepare is not automatically copying the files...perhaps it hasn't been included in your device's init.blah.rc file? You will need to include it at the top, here is how it works on hammerhead in init.hammerhead.rc: https://github.com/maruos/android_device_lge_hammerhead/blob/master/init.hammerhead.rc#L21

Stefan

unread,
Sep 15, 2016, 8:42:05 PM9/15/16
to Maru OS dev
Okay, thanks for guidelines. I didn't build kernel properly, indeed. I didn't actually know that wiki page existed, so I just took a look at the modifications you made to your defconfig and copied them to mine. Anyway, I was missing *_NS items, but after adding them, kernel fails to build. The problematic one is CONFIG_USER_NS. I'll try to figure it out during weekend.

And mcprepare is not being called for a reason. I don't have init.*.rc files at all. They weren't provided with vanilla build and your files didn't have copyright notice with your name, so I didn't even pay attention to those files. I'll see what can I do about that.

Further tips are always welcome.

Thanks,
Stefan

Stefan

unread,
Sep 15, 2016, 8:53:02 PM9/15/16
to Maru OS dev
I found some .rc files in common directory for all sony devices. I'm guessing that's what I need to change.

Preetam

unread,
Sep 16, 2016, 5:12:01 PM9/16/16
to Maru OS dev
Also a heads up that you can get away without CONFIG_USER_NS if that's preventing the kernel from compiling -- Maru OS doesn't explicitly make use of user namespaces right now. It's just usually selected by default with CONFIG_NAMESPACES. The rest of the CONFIG_NS_* options are required though.

And thanks for letting me know I missed the copyright header on that file, I've updated it.

George

unread,
Oct 20, 2016, 2:07:32 PM10/20/16
to maru-...@googlegroups.com
Just wanna know what the current state of this port is and how much it takes to finish it.
Maybe I will get this phone in a few weeks so I can help testing.

Stefan

unread,
Oct 25, 2016, 8:03:56 PM10/25/16
to Maru OS dev
I haven't been working on this for quite some time. I have some other engagements. The last thing that I've done is built kernel with all the required flags, but didn't manage to start the container.

Preetam

unread,
Oct 26, 2016, 10:26:16 PM10/26/16
to Maru OS dev
If you get a chance to upload any relevant logs when the container start fails, I'm happy to take a look. It's usually something small like the container filesystem path not being structured correctly, a missing library, permission issue, etc.

One thing to try really quickly is to do a userdebug build and start the container directly from a root shell:

root@hammerhead# lxc-start -n jessie

You should immediately see some error logs that will help diagnose the problem.

CJ Payton

unread,
Nov 3, 2016, 2:15:44 PM11/3/16
to Maru OS dev
Any Plans to port it to the LeEco Le Pro 3? Snapdragon 821 Processor, 4GB of DDR4 Ram, 64GB storage all for 299 off contract. :-) Or One Plus 1,2,3?

Preetam

unread,
Dec 1, 2016, 5:16:47 PM12/1/16
to Maru OS dev
Hey guys, Noel has a test build for the Xperia Z3 Compact if you're interested: https://groups.google.com/forum/#!topic/maru-os-dev/s5miAGjwpDQ

He's looking for someone with the device to test out how the desktop runs on his build. Please give it a run and let him know how it goes!

oliver schirmer

unread,
Dec 4, 2017, 12:39:36 PM12/4/17
to Maru OS dev
Hey,
Is is the port in development? I'd love to use the Z3 as a laptop.

Greetings,
Oliver

Kayahan KRoBot

unread,
May 18, 2019, 4:18:08 AM5/18/19
to Maru OS dev
Are there any update about youre Port?

Am Freitag, 2. September 2016 09:42:09 UTC+2 schrieb Stefan:
Hello,

I decided to port Maru OS to Xperia Z3 Compact and so far I've managed to compile it, but after I flash it, I get stuck in an infinite bootloop.

This is the error output in the logcat:
E/tadif   (  274): Failed to connect to tad.
E/macaddrsetup(  274): failed to open misc ta: 1
E/BootAnimation(  302): couldn't find audio_conf.txt

I'd appreciate If you could point me in the right direction.

Thanks,
Stefan

Preetam D'Souza

unread,
May 18, 2019, 2:35:52 PM5/18/19
to Maru OS dev
Our dev @NoelMacwan is working on Xperia devices. I'll get in touch with him to see how progress is going on this port.

Noel Macwan

unread,
May 20, 2019, 11:31:04 AM5/20/19
to Maru OS dev
Hey Stefan!

Good to see your contribution.
Probably year back I had got successful build for Xperia Z3 Compact and few of high-end Xperia devices.
As per discussion with Preetam, we will be sharing (soon) test builds for all presently available high-end Xperia devices.

Cheers,
Noel Macwan
Reply all
Reply to author
Forward
0 new messages