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

    Porting Ubuntu Touch (@UBPorts) to karin (Sony Xperia Z4 Tablet SGP771) and karin_windy (Sony Xperia Z4 Tablet SGP712)

    Scheduled Pinned Locked Moved Porting
    14 Posts 7 Posters 3.1k Views 4 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.
      • G Offline
        Guf
        last edited by Guf

        I've been working on porting Ubuntu Touch on karin and karin_windy, a high end Sony Xperia Tablet Z4-serie got out on market in late 2015 with Android 6, so suitable to work with Halium-7.1.
        See the HAL port specific details: https://github.com/Halium/projectmanagement/issues/44 created by Andreas Pokorny.

        The device is equipped with:

        Dimensions: 10,1" IPS 2560x1600 (299 PPI)
        RAM: 3GB,
        ROM: 32 GB,
        Qualcomm(c): MSM8994 
        Snapdragon(c): 810
        CPU: Octa-core Cortex-A53 & Cortex-A57 4 x 2.0 Ghz + 4 x 1.5 Ghz
        Architecture: arm64
        GPU: Adreno 430
        SIM:  Nano-SIM (4G LTE)
        Bluetooth:  4.1 with A2DP + aptX 
        Wi-fi:  802.11 a/b/g/n/ac, Dual-band, Wi-Fi Direct, DLNA, Hotspot
        Sensors: Accelerometer, Gyroscope, Proximity sensor, Light sensor, GPS
        Camera: (front) 5.1 MP F/2.4, No flash, (rear) 8.1 MP F/2.0, LED flash
        Battery: Non-removable Li-Ion 6000 mAh 
        

        as its specs are available in this page.

        Already successfully tested to boot from systempart, as required by Ubuntu Touch OTA: ready to be a community device.

        Nowadays the device has reached an interesting level of support, as the following features works well:

        Kernel 3.10.84-perf+ (arm64)
        Graphical User Interface: works with unity8/lomiri (8.20+ubports) and mir (0.31.2+0) for 64 bits libraries,
        Wifi: works, 
        Audio: works (audio and video playback),
        GPS: works
        Sensors (HAL, rotation, ...): work,
        Buttons: work Power, Volume up and down buttons
        Printscreen: works by pressing at the same time Volume+ and Volume- during 2-3 seconds
        Notification: works,
        Vibration: works,
        Cameras: main and selfie cameras both work with @peat_psuwit's gst-droid and nemo-qtmultimedia-plugins
        LED: works
        Apparmor: works
        Convergence: works with MHL cable (even though in poor resolution)
        Bluetooth: works (update 2020-11-14)
        

        What does not work yet:
        [ ] Data connection: GSM/4G/SMS, Sim is not detected yet
        [ ] Hotspot (tethering with linked devices)

        Sources (devices):
        Kitakami (common part of platform): https://github.com/ubports/android_device_sony_kitakami-common
        Karin: https://github.com/ubports/android_device_sony_karin
        Karin_windy: https://github.com/ubports/android_device_sony_karin_windy

        Sources (kernel):
        Kitakami (common): https://github.com/ubports/android_kernel_sony_msm8994

        Sources (devices) from LineageOS:
        Karin: https://github.com/LineageOS/android_device_sony_karin
        Karin_windy: https://github.com/LineageOS/android_device_sony_karin_windy

        Available images:
        System: system.img
        Halium-boot: halium-boot.img (old)
        Recovery (only to be tested when it will be a community device): recovery.img
        Otherwise TWRP: TWRP-3.1.1-lineageos-karin-20170520.img

        Important note for UT rootfs to work
        You can download you latest nightly built rootfs here.
        If you can't access to ssh, in TWRP you need to execute the following commands:

        $ mount /data/rootfs.img /mnt
        $ echo manual | tee /mnt/etc/init/rsyslog.override
        $ umount /mnt
        $ sync
        

        To bootstrap from system partition, in TWRP, you need to:

        $ mount -o loop /data/rootfs.img /system
        $ cp /data/system.img /system/var/lib/lxc/android/system.img
        $ umount /system
        $ dd if=/data/rootfs.img of=/dev/block/mmcblk0p44
        $ sync
        

        To manually enable bluetooth to work (update of Nov 14th 2020), you need to:

        • if you bootstrap from systempart, then flash the following halium-boot, more commonly if you install your system with halium-install, flash this halium-boot,
          both enable HCIUART and HCIUART_H4,
        • execute the following commands:
        root@ubuntu-phablet:~# hciattach -p -t 30 /dev/ttyHS0 bcm43xx 115200 flow
        bcm43xx_init
        Cannot open directory '/etc/firmware': No such file or directory
        Patch not found, continue anyway
        Set Controller UART speed to 115200 bit/s
        Device setup complete
        4669
        root@ubuntu-phablet:~# hciconfig -a
        hci0:	Type: Primary  Bus: UART
        	BD Address: B6:balblablabla:97  ACL MTU: 1021:8  SCO MTU: 64:1
        	UP RUNNING PSCAN 
        	RX bytes:745 acl:0 sco:0 events:50 errors:0
        	TX bytes:3943 acl:0 sco:0 commands:50 errors:0
        	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        	Link policy: RSWITCH SNIFF 
        	Link mode: MASTER 
        	Name: 'ubuntu-phablet'
        	Class: 0x3c011c
        	Service Classes: Rendering, Capturing, Object Transfer, Audio
        	Device Class: Computer, Unknown (reserved) minor device class
        	HCI Version: 4.1 (0x7)  Revision: 0x2000
        	LMP Version: 4.1 (0x7)  Subversion: 0x230f
        	Manufacturer: Broadcom Corporation (15)
        root@ubuntu-phablet:~#
        
        1 Reply Last reply Reply Quote 4
        • I Offline
          ignne
          last edited by

          Thanks for the detailed writeup, although I prefer booting from an .img instead of the partition. This way I can just reflash boot and have my Android back šŸ˜„

          By the way, I saw that you are struggling with the bluetooth as well. Did you make any progress there (assuming that karin has the same bcrm43... as suzuran)? I believe (might be totally wrong) that Bluedroid is located pretty deep in the kernel, and you cannot really get access from the outside (meaning that this is a kernel issue). I never found what to (back)port from other devices to make it work, though.

          Xperia Z5 Compact (suzuran)
          Oneplus 6

          G 2 Replies Last reply Reply Quote 0
          • G Offline
            Guf @ignne
            last edited by Guf

            @ignne I read somewhere that karin's chipset works as rome one so that it can be backported, as experienced by some xiaomi porters. I need to find some time to apply patches and try to backport for better compatibility with blue 5.x or later

            1 Reply Last reply Reply Quote 0
            • M Offline
              masa
              last edited by

              My install for karin (SGP771) was succesful with these instructions. Thank you.

              Based on the feature list above, Anbox is supposed to work. What is needed to achieve this? The device is not officially supported and the image does not seem to work for that purpose as such:

              phablet@ubuntu-phablet:~$ anbox-tool install
              Anbox kernel is not installed! Please flash this first!
              

              Also, how can I update to the OTA-13 release?

              stanwoodS G 2 Replies Last reply Reply Quote 0
              • stanwoodS Offline
                stanwood @masa
                last edited by

                @masa I guess that you first have to flash the image as described in the first green box here: http://docs.ubports.com/en/latest/userguide/dailyuse/anbox.html
                Than you can install anbox tool & APKs
                Read carefully the previous guide. Installing Anbox is only recommended for experienced users.

                Redmi Note 9S Stable
                If God has a computer, it must be a GNU/Linux

                1 Reply Last reply Reply Quote 0
                • M Offline
                  masa
                  last edited by

                  Thanks @stanwood. But what would be the variable CODENAME in the green box you mentioned? I mean is an anbox image available for this device as supposed in the documentation you linked?

                  KenedaK G 2 Replies Last reply Reply Quote 0
                  • KenedaK Offline
                    Keneda @masa
                    last edited by Keneda

                    @masa
                    I guess your device codename is "karin"...

                    But in the "Supported devices" for daily use from stanwood given link, there is not your device (nor mine, wich is MX4 a.k.a. "arale").

                    It is not listed here : https://cdimage.ubports.com/anbox-images/

                    2015-2023 : Meizu MX4 ā˜ ļøāš°ļøāœļø
                    2023-2024 : Nexus 5 ā˜ ļøāš°ļøāœļø
                    2024-***** : FPOS Fairphone 5 waiting UT for freedom šŸ˜‰
                    šŸ‡²šŸ‡«šŸ‡¬šŸ‡§

                    G 1 Reply Last reply Reply Quote 0
                    • G Offline
                      Guf @masa
                      last edited by

                      @masa I worked for me with the following instructions:

                      sudo apt install anbox-ubuntu-touch
                      mkdir anbox-data
                      wget -q --show-progress -O /home/phablet/anbox-data/android.img http://cdimage.ubports.com/anbox-images/android-armhf-64binder.img
                      touch /home/phablet/anbox-data/.enable
                      mkdir anbox-data/data
                      sudo chmod -R o+wrx /home/phablet/anbox-data/data
                      sudo start -q anbox-container
                      start -q anbox-session
                      

                      at this point, you need to reboot twice!
                      Respect the official instruction, it seems to work for me the wget command without using sudo

                      1 Reply Last reply Reply Quote 0
                      • G Offline
                        Guf @Keneda
                        last edited by

                        @Keneda Don't worry about that: information might not be up-to-date

                        1 Reply Last reply Reply Quote 0
                        • G Offline
                          Guf @masa
                          last edited by Guf

                          @masa This list if for legacy and official supported device, rather than community ones (like karin is supposed to become soon).
                          Anyway it is not supported on kernel yet: anbox porting on karin is on going

                          1 Reply Last reply Reply Quote 1
                          • G Offline
                            Guf @ignne
                            last edited by

                            @ignne yesterday, I got bluetooth work on my BCM43 devices. At the moment, manually:

                            root@ubuntu-phablet:~# chmod 0660 /sys/class/rfkill/rfkill0/state && chmod 0660 /sys/class/rfkill/rfkill0/type && chgrp dialout /sys/class/rfkill/rfkill0/state && chgrp dialout /sys/class/rfkill/rfkill0/type && rfkill unblock bluetooth
                            root@ubuntu-phablet:~# hciattach -p -t 30 /dev/ttyHS0 bcm43xx 115200 flow
                            bcm43xx_init
                            Cannot open directory '/etc/firmware': No such file or directory
                            Patch not found, continue anyway
                            Set Controller UART speed to 115200 bit/s
                            Device setup complete
                            4669
                            root@ubuntu-phablet:~# hciconfig -a
                            hci0:	Type: Primary  Bus: UART
                            	BD Address: B6:balblablabla:97  ACL MTU: 1021:8  SCO MTU: 64:1
                            	UP RUNNING PSCAN 
                            	RX bytes:745 acl:0 sco:0 events:50 errors:0
                            	TX bytes:3943 acl:0 sco:0 commands:50 errors:0
                            	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
                            	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
                            	Link policy: RSWITCH SNIFF 
                            	Link mode: MASTER 
                            	Name: 'ubuntu-phablet'
                            	Class: 0x3c011c
                            	Service Classes: Rendering, Capturing, Object Transfer, Audio
                            	Device Class: Computer, Unknown (reserved) minor device class
                            	HCI Version: 4.1 (0x7)  Revision: 0x2000
                            	LMP Version: 4.1 (0x7)  Subversion: 0x230f
                            	Manufacturer: Broadcom Corporation (15)
                            
                            root@ubuntu-phablet:~#
                            1 Reply Last reply Reply Quote 0
                            • Z Offline
                              z4Tab
                              last edited by z4Tab

                              Install / Preparatory steps xperia Z4 Tab

                              sorry for asking my question in this thread. But there are probably still too few xperia Z4-Tab users, so that I cannot get any answers in the support thread.

                              I am not successful in Preparatory steps 8 & 9. I can load and save the FIle SW_binaries_for_Xperia_AOSP_M_MR1_3.10_v13_legacy.zip but after unpacking I cannot find the file: SW_binaries_for_Xperia_AOSP_M_MR1_3.10_v13_legacy.img but a complete directory tree.😧
                              How can I generate the img file from it? Is the link in the instructions really correct?

                              I would really like to install UT on my tablet (and also test it), but unfortunately I already fail in preparatory steps 8 & 9. Please help me, because I assume that you have successfully install UT on your Z4-tablets.

                              Hope for Your help ...

                              P.S. Thanks for porting this tablet, because I'm a ubuntu user for over ten years....

                              G 1 Reply Last reply Reply Quote 1
                              • G Offline
                                Guf @z4Tab
                                last edited by

                                @z4tab actually I never performed these preparatory steps, so I can't help you out. My suggestion is to unlock bootloader and install twrp, then from there (recovery mode) try to activate adb sideload from twrp menu on device and on pc's terminal execute adb sideload name_of_binaries.zip.
                                If you want to risk to go directly on installing UT, first try to install it on datapart (the /data partition) with halium-install. Remember to use the proper halium-boot.img.
                                When you will be more familiarised with UT and recovery also in systempart (/system partition).

                                1 Reply Last reply Reply Quote 0
                                • LakotaubpL Offline
                                  Lakotaubp
                                  last edited by

                                  Please continue over at https://forums.ubports.com/category/84/sony-xperia-z4-tablet-sgp771-sgp712 Thank you.

                                  1 Reply Last reply Reply Quote 0
                                  • X xys9000 referenced this topic on
                                  • X xys9000 referenced this topic on
                                  • First post
                                    Last post