UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Problem porting to Moto E 2015 4G (surnia)

    Scheduled Pinned Locked Moved Porting
    surniamoto e
    15 Posts 2 Posters 4.4k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • N Offline
        Nic264
        last edited by

        I don't see anything related to Unity in top, here is my output.

        The tests are there too, they all crash… test_egl and test_glesv2 complain that they couldn't open framebuffer HAL, test_hwcomposer makes my screen go blank.
        I can set my screen brightness back up through /sys/class/leds/wled:backlight/brightness and EGL_PLATFORM=hwcomposer test_hwcomposer makes my screen flicker and my dmesg go mad with this repeated a lot:

        [  417.696026] mdss_mdp_get_img: error on ion_import_fd
        [  417.696052] mdss_mdp_data_get: failed to get buf p=0 flags=0
        [  417.696068] get_user_node: error getting buffer info
        [  417.696092] mdss_mdp_wb_queue: memory not registered
        [  417.696896] mdss_mdp_wb_kickoff: unable to get writeback buf ctl=1
        [  417.698026] mdss_wb_check_params: Invalid resolutions
        [  417.698633] mdss_mdp_overlay_req_check: invalid vertical destination: y=0, h=960
        

        I don't know what to do… Try another libhybris maybe? But I thought the libhybris problem was caused by Android 6.

        flohackF 1 Reply Last reply Reply Quote 0
        • flohackF Offline
          flohack @Nic264
          last edited by

          @Nic264 Hi!

          Ok that does not sound good. Lets see the following:

          • dmesg output redirected to a file
          • /system/bin/logcat - what does it show?
          • lcx-monitor -n android

          BR Florian

          My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

          1 Reply Last reply Reply Quote 1
          • N Offline
            Nic264
            last edited by

            Hi, I'm back

            Here is my logcat, during test_egl or test_gles and test_hwcomposer.
            Here is my complete dmesg (I didn't know how to dump it to a file so I added log_buf_len=4M to my cmdline).
            And lxc-monitor -n android does nothing (until I Ctrl+C).
            lxc-console -n android tells me I'm "Connected to tty 1" and how to exit but nothing else (until I exit).

            I also tried to access the fb devices directly (they both do exist, why two of them?):

            root@ubuntu-phablet:/# cat /dev/fb0
            cat: /dev/fb0: No such device
            root@ubuntu-phablet:/# cat /dev/fb1
            cat: /dev/fb1: No such device
            

            First one does nothing.
            Second one makes my screen flicker and appends some lines to my dmesg.

            And another strange thing: /sys/class/graphics/fb1/modes reads U:1280x720p-14 while my screen is 960x540… (fb0/modes is coherent)

            I hope this makes sense to you…

            flohackF 1 Reply Last reply Reply Quote 0
            • flohackF Offline
              flohack @Nic264
              last edited by

              @Nic264 Ah Cool I take a look πŸ™‚
              One thing, I messed up the lxc cmd, it should be lxc-info -n android

              BR Florian

              My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

              N 1 Reply Last reply Reply Quote 0
              • N Offline
                Nic264 @flohack
                last edited by

                @Flohack This was already in my random commands (OP), but here it is:

                root@ubuntu-phablet:/# lxc-info -n android
                Name:           android
                State:          RUNNING
                PID:            591
                IP:             192.168.2.15
                CPU use:        3.44 seconds
                
                flohackF 1 Reply Last reply Reply Quote 1
                • flohackF Offline
                  flohack @Nic264
                  last edited by

                  @Nic264 Ok so the good thing is, the LXC container is running. What I currently do not like from dmesg is this:

                  [   47.167516] initrd: mounting system.img (user mode)
                  [   47.192790] init (308) used greatest stack depth: 5248 bytes left
                  [   47.205913] initrd: mounting device image as ro
                  ...
                  [   47.267907] initrd: device is unknown
                  

                  Device is unknown means that somehow initrd does not detect the device correctly. This needs to be fixed. But tbh I forgot the logic there, need to take a look again.
                  Also, did you already dump the udev rules? See https://developer.ubuntu.com/en/phone/devices/porting-new-device/ and also this page can be helpful to understand whats going on at the beginning: https://wiki.ubuntu.com/Touch/ContainerArchitecture - udev rules need to be placed inside the image (mount - o remount,rw /)

                  That said, its normal to have exactly these issues at the beginning. Every device is different, so its hard to tell you exactly whats going on.

                  You can try to enable debug (but it might break the boot since it dumps too much udev debug into the logs xD), for this add "debug" to the kernel cmdline. But read this first: https://wiki.ubports.com/wiki/When-the-Bootloader-Decides-to-Override-your-Command-Line - probably you need to patch the kernel for this.

                  Did you BTW update the kernel config with the script from here: https://github.com/janimo/phablet-porting-scripts/blob/master/kernel/check-config, and also you need to patch apparmor3 inside (but this is not needed now)

                  My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                  N 1 Reply Last reply Reply Quote 0
                  • N Offline
                    Nic264 @flohack
                    last edited by

                    @Flohack
                    After reading the initrd code, device is determined by reading ro.product.device in the build.prop, but in my case it is set in ro.cm.device, I'll correct this and rebuild.
                    I didn't dump the udev rules for now, going to do this now too.

                    I updated the kernel config with that script then had to patch a couple of problems in regard of uid_t becoming kuid_t etc… I already managed to change my kernel cmdline and I don't think what my bootloader appends can cause any problem: (does it?)

                    androidboot.emmc=true
                    androidboot.serialno=TA36406M0E
                    androidboot.baseband=msm
                    androidboot.mode=charger
                    androidboot.device=surnia
                    androidboot.hwrev=0x8300
                    androidboot.radio=0x4
                    androidboot.powerup_reason=0x00000100
                    androidboot.bootreason=charger
                    androidboot.write_protect=0
                    msm_poweroff.download_mode=0
                    androidboot.fsg-id=
                    androidboot.secure_hardware=1
                    androidboot.cid=0x7
                    androidboot.wifimacaddr=E8:91:20:79:04:53,E8:91:20:79:04:54
                    mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_mot_boe_450_qhd_video_v3
                    androidboot.bootloader=0x8020
                    androidboot.carrier=retfr
                    androidboot.hardware.sku=XT1524
                    androidboot.bl_state=2
                    

                    Thanks for you help πŸ™‚

                    1 Reply Last reply Reply Quote 0
                    • N Offline
                      Nic264
                      last edited by

                      OK so the property ro.product.device used by Ubuntu's init to determine the device was set by Android's init too late (this is an unified device tree). It is now fixed (hardcoded in my system.prop).

                      [   19.324825] initrd: device is surnia_umts
                      ...
                      [   28.163553] init: Found radio id: 0x4 setting build properties for surnia_umts device
                      

                      I have dumped my udev rules and placed them in /etc/udev/rules.d/70-surnia_umts.rules. I haven't noticed any change so far (except for udev complaining about unknown users and groups).

                      You were right, the debug boot option broke the boot, causing a boot loop πŸ˜• I'll check in the console-ramoops when I have the time.

                      Will I really need to patch AppArmor? I already run Linux 3.10.49…

                      flohackF 1 Reply Last reply Reply Quote 1
                      • flohackF Offline
                        flohack @Nic264
                        last edited by

                        @Nic264 HI,
                        well basically you are on a good path. You seem to have the knowledge and the motivation to analyze the things in detail πŸ™‚
                        Basically I did not expect that the issue with the fb device goes away just by adding udev rules and setting the device id. It was just part of the procedure. Kernel config might have helped, and its not bad to have it in place already.
                        The kernel cmdline seems fine, if it reacts on debug you dont need the patch. however, remember that the bootloader cmdline might get appended to yours and will overwrite settings if they appear twice.
                        For AppArmor: Yes 3.10 might indeed contain already the correct apparmor version. Which was actually the original Android version for this device?

                        BR

                        My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                        N 1 Reply Last reply Reply Quote 0
                        • N Offline
                          Nic264 @flohack
                          last edited by

                          @Flohack Hi,
                          I don't really have the required knowledge, but I'm learning πŸ˜›

                          This is the mess debug gives me, this line fills my buffer:

                          [ growing time ] systemd-udevd[237]: maximum number (16) of children reached
                          

                          Original android version was 5.0.2, upgraded to 5.1.1 then 6.0 by Motorola then 7.1 by the CM/LineageOS team.

                          I updated my initrd in order to use a F2FS data partition so I don't have to reformat every time I switch back to Lineage (this is my only phone), would that be a problem?

                          I'm trying to build libhybris right now (on the device since cross-compiling gives me trouble)…

                          flohackF 1 Reply Last reply Reply Quote 0
                          • flohackF Offline
                            flohack @Nic264
                            last edited by

                            @Nic264 Hi,

                            yes debug fills up the log with udev messages, but I think this is a good sign, seems udev is really busy creating all necessary entries πŸ˜‰ - you can switch it off again, it has no better use now.

                            Ok so basically on what CM versions did you base your device Kernel and vendor tree?

                            BR

                            My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                            1 Reply Last reply Reply Quote 0
                            • N Offline
                              Nic264
                              last edited by

                              @Flohack Hi, sorry for the lengthy follow-up, I've been busy with competitive exams…

                              I am sorry to say that I won't be able to try and port this anymore: probably because of a power surge, my phone USB port is dead and I can't transmit anymore data to the phone…

                              Thanks for the help, I'll try to contribute some other way (but after the oral part of my exams).

                              flohackF 1 Reply Last reply Reply Quote 1
                              • flohackF Offline
                                flohack @Nic264
                                last edited by

                                @Nic264 Hi,

                                no problem. If you got any meaningful changes or improvements in the code, consider forking the repos and pushing your changes into those new repos.

                                BR

                                My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post