Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[device-port] [angler] Huawei/Google Nexus 6P #56

Open
8 of 16 tasks
win8linux opened this issue Feb 6, 2018 · 50 comments
Open
8 of 16 tasks

[device-port] [angler] Huawei/Google Nexus 6P #56

win8linux opened this issue Feb 6, 2018 · 50 comments
Labels

Comments

@win8linux
Copy link

win8linux commented Feb 6, 2018

Tree: halium-7.1

  • Create manifest - angler
  • Boot image and system image build successfully
  • Device boots into rootfs, usb: Manufacturer: GNU/Linux Device appears in dmesg on host.
  • LXC container starts and does not crash
  • libhybris tests
    • test_gps
    • test_hwcomposer
    • test_lights
    • test_vibrator
    • test_wifi
    • test_sensors
    • test_audio
    • test_camera
    • test_input
    • test_nfc
    • test_recorder

CONFIG_VT must not be set in the kernel config, otherwise mka hybris-boot fails with this.

The file Android.mk must be modified as such since Halium doesn't use any .apk or .jar files. It is not enough to only comment out the source file lines, but all relevant module lines.

@lnjX lnjX added the Ports label Feb 11, 2018
@jrb
Copy link

jrb commented Mar 6, 2018

It looks like CONFIG_VT=y can be set if CONFIG_VGA_CONSOLE=n is also set.

@jrb
Copy link

jrb commented Mar 6, 2018

Unfortunately I don't seem to be able to build the system image:

https://gist.github.com/jrb/ed7c767a433ce01d2f7e1dee0c36c3f0

@jbruechert
Copy link
Member

That error seems to be a general problem introduced when updating Halium to the latest AOSP / LOS 7 revision.

@bhush9
Copy link
Member

bhush9 commented Mar 6, 2018

and... that issue is fixed in android and android_build repo. So if you repo sync it will work again.

@jrb
Copy link

jrb commented Mar 7, 2018

after fumling around a bit,

CONFIG_ANDROID_PARANOID_NETWORK=n
CONFIG_DUMMY=n
CONFIG_TTY=y
CONFIG_HW_CONSOLE=y
CONFIG_VT=y
CONFIG_VGA_CONSOLE=n
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_IKCONFIG=y

has a kernel that builds and boots to rootfs:

[77475.201804] usb 2-2: Manufacturer: GNU/Linux Device
[77475.201808] usb 2-2: SerialNumber: GNU/Linux Device on rndis0 10.15.19.82

android container comes up:

root@localhost:~# systemctl status lxc@android
● lxc@android.service - LXC Container: android
   Loaded: loaded (/lib/systemd/system/lxc@.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-03-07 04:39:15 UTC; 11min ago
     Docs: man:lxc-start
           man:lxc
 Main PID: 1162 (lxc-start)
   Memory: 3.2M
      CPU: 424ms
   CGroup: /system.slice/system-lxc.slice/lxc@android.service
           └─1162 /usr/bin/lxc-start -F -n android

Mar 07 04:39:15 localhost.localdomain systemd[1]: Started LXC Container: android.
Mar 07 04:39:16 localhost.localdomain lxc-start[1162]: 7492 blocks

Working tests:

  • test_lights
  • test_vibrator
  • Wifi works correctly nmcli d w c ${ESSID} password ${PASSPHRASE}. (test_wifi doesn't seem to accomplish anything meaningful)

@jrb
Copy link

jrb commented Mar 7, 2018

Now the failures:

test_gps fails with library "liblbs_core.so" not found

root@localhost:~# test_gps 
*** setup signal handler
*** get gps interface
*** device info
 id = gps
 name = loc_api GPS Module
 author = Qualcomm USA, Inc.
*** init gps interface
 ** Creating thread: 'Loc_hal_worker' (start=0xed930bcd, arg=0x3f08e8)
 ** After thread_create: 'Loc_hal_worker', error=0 (start=0xed930bcd, arg=0x3f08e8)
 **** Thread wrapper start (start=0xed930bcd, arg=0x3f08e8) ****
library "liblbs_core.so" not found
*** setting positioning mode
*** start gps track
*** gps tracking started
*** tracking.... 
^C*** cleanup

test_hwcomposer:

root@localhost:~# EGL_PLATFORM=hwcomposer test_hwcomposer
cannot locate symbol "atrace_end_body" referenced by "/vendor/lib/hw/gralloc.msm8994.so"...
test_hwcomposer: test_hwcomposer.cpp:171: int main(int, char**): Assertion `err == 0' failed.
Aborted

test_sensors:

root@localhost:~# test_sensors 
library "android.frameworks.schedulerservice@1.0.so" not found
test_sensors: test_sensors.c:74: main: Assertion `hwmod != NULL' failed.
Aborted

test_audio

root@localhost:~# test_audio 
cannot locate symbol "error_log_create" referenced by "/vendor/lib/hw/audio.primary.msm8994.so"...
Failed to get hw module id: audio name: primary, trying alternative.test_audio: test_audio.c:52: main: Assertion `hwmod != NULL' failed.
Aborted

test_camera

root@localhost:~# test_camera 
library "libcamera_compat_layer.so" not found
dlsym failed: library handle is null
Segmentation fault

test_input

library "libis_compat_layer.so" not found
dlsym failed: library handle is null
Segmentation fault

test_nfc

root@localhost:~# test_nfc 
Starting test_nfc.
Finding NFC hardware module.
test_nfc: test_nfc.c:156: testNfc: Assertion `hwModule != NULL' failed.
Aborted

test_recorder

root@localhost:~# test_recorder 
Test application for video recording using the camera
Recording start with volume up button. And stops with volume down.
The result is stored to /root/test_video.avi

library "libcamera_compat_layer.so" not found
dlsym failed: library handle is null
Segmentation fault

@bhush9
Copy link
Member

bhush9 commented Mar 7, 2018

For test_hwcomposer correct environment variable is EGL_PLATFORM and not GL_PLATFORM

@jrb
Copy link

jrb commented Mar 7, 2018

Identical result, so I've updated the original comment.

@bhush9
Copy link
Member

bhush9 commented Mar 7, 2018

Can you tell me which version of android you had installed earlier?

@jrb
Copy link

jrb commented Mar 7, 2018

The latest (8.0?). I've now downgraded to 7.1.2 (n2g48c), and the following tests fail differently:
test_hwcomposer

root@localhost:~# EGL_PLATFORM=hwcomposer test_hwcomposer
cannot locate symbol "android_create_namespace" referenced by "/system/lib/libgui.so"...
test_hwcomposer: test_hwcomposer.cpp:179: int main(int, char**): Assertion `err == 0' failed.
Aborted

test_audio

root@localhost:~# test_audio 
test_audio: test_audio.c:54: main: Assertion `audio_hw_device_open(hwmod, &audiohw) == 0' failed.
Aborted

test_sensors now successfully returns 23 sensors.

@bhush9
Copy link
Member

bhush9 commented Mar 7, 2018

Right, halium, as branch name suggests have a build for only android 7,

Since wifi is working, can you add http://repo.halium.org/generic/ debian repository, and apt update/apt upgrade?

Steps:

add-apt-repository 'deb http://repo.halium.org/generic/ xenial main'
apt update && apt upgrade

And then retry the test_hwcomposer?

Thanks

@jrb
Copy link

jrb commented Mar 7, 2018

Should have mentioned in the previous post; already tested that and saw the same result both before/after dist-upgrade and reboot.

@bhush9
Copy link
Member

bhush9 commented Mar 7, 2018

Can you provide the strace of test_hwcomposer with above steps followed? (Please use pastebin/gist)

@Lasky206
Copy link

Are you guys still working on this? I really want to get Ubuntu touch on my device. I'm not very experienced with this stuff but maybe I can help out.

drgroovestarr pushed a commit to drgroovestarr/kernel_huawei_angler that referenced this issue Feb 7, 2019
drgroovestarr added a commit to drgroovestarr/kernel_huawei_angler that referenced this issue Feb 9, 2019
drgroovestarr pushed a commit to drgroovestarr/kernel_huawei_angler that referenced this issue Feb 10, 2019
drgroovestarr pushed a commit to drgroovestarr/kernel_huawei_angler that referenced this issue Feb 11, 2019
drgroovestarr pushed a commit to drgroovestarr/kernel_huawei_angler that referenced this issue Feb 12, 2019
drgroovestarr pushed a commit to drgroovestarr/kernel_huawei_angler that referenced this issue Feb 12, 2019
drgroovestarr pushed a commit to drgroovestarr/kernel_huawei_angler that referenced this issue Feb 12, 2019
@testingweb624
Copy link

Hi, does we have any working Nexus 6p port ? plz

@drgroovestarr
Copy link

I have reached the exact same point as jrb above, and achieved the same results for the libhybris tests. My next step was to add the halium debian repository and apt update/upgrade. Once I do this (I've tried a few times for consistency) the device will bootloop and I am only able to pull any logs by immediately rebooting into TWRP. Any help would be greatly appreciated, here is the gist of /sys/fs/pstore: https://gist.github.com/drgroovestarr/e313be0265d18eed94eae7711ff5f97c

@Flohack74
Copy link

Ok me and another guy from the porting group on Telegram strongly think about joining you here. Basically I got an 6P in front of me, and I will try to follow the steps you have taken so far.

@testingweb624
Copy link

testingweb624 commented Mar 8, 2019 via email

@Flohack74
Copy link

@jrb I followed up to the point that the container is running, I can confirm this. Also WiFi works (expected), but test_lights e.g. and all others throws floating point exception. Which rootfs did you use? @bhush9 anything to do for an arm64 device here?

@Flohack74
Copy link

Pinging @liamolua into the conversation...

@jrb
Copy link

jrb commented Mar 9, 2019

@Flohack74 my 6p took a ride in a taxi without me, so I haven't done anything on this since shortly after my last comment.

I believe I was using whatever the current Halium reference rootfs was at the time. I recall it was either ubuntu or debian based, and was severely out of date -- an apt-get dist-upgrade would pull down a ton of updated packages.

@drgroovestarr
Copy link

@jrb @Flohack74 happy to help out with whatever I can, I have a 6p here... test_lights worked for me I just get stuck when trying to update the rootfs

@Flohack74
Copy link

hmm can you paste a dmesg part, I get 99% CPU load with being unable to initialize hardware RNG. And ofc those floating point excepts. @drgroovestarr can you send me you manifest plz

@drgroovestarr
Copy link

@Flohack74 here is my manifest https://github.com/drgroovestarr/local_manifests/blob/halium/device.xml I have essentially just follwed the docs and and info found in this thread, all of the device/kernel changes I used are on my github. Glad to have another set of eyes to have a look at it!

@jbruechert
Copy link
Member

@drgroovestarr Can you please submit your manifest to https://github.com/halium/halium-devices?

@drgroovestarr
Copy link

@jbbgameich done, I also have some updated udev rules submitted for pull to https://github.com/Halium/lxc-android

@jbruechert
Copy link
Member

@drgroovestarr I requested one change to your PR, it's otherwise fine and can be merged.

@phillipwalters
Copy link

I'm having some difficulty getting halium running on the 6p. I used @drgroovestarr's repos for the kernel and device directories, but I'm getting a boot loop. I checked the kernel log, and there's a kernel panic:

Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100

This is followed by a dump of some data from each CPU core.

Full logs here. Any suggestions?

@drgroovestarr
Copy link

drgroovestarr commented Mar 19, 2019

@phillipwalters wish I could help out more. I was able to get it booting using the rootfs listed in the docs, however if I try to update by adding the newer halium repos (listed above) I too get a bootloop. It's great to see more people getting involved, maybe between your dump and mine (above) we can find the answer.

@Flohack74
Copy link

@phillipwalters @drgroovestarr can you plz try my manifest, it should actually boot well:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <project path="device/huawei/angler" name="Flohack74/android_device_huawei_angler" remote="hal" />

    <project path="kernel/huawei/angler" name="Flohack74/android_kernel_huawei_angler" remote="hal" />

    <project path="vendor/huawei" name="proprietary_vendor_huawei" remote="them" />
</manifest>

@drgroovestarr
Copy link

@Flohack74 are you using the rootfs listed in the docs? Just making sure. Im not in front of my PC, but will check this out later. I didn't have a problem booting with my repos, just updating to try and see if that would help to pass more of the tests as described.

@Flohack74
Copy link

@drgroovestarr I am using the Halium reference rootfs, yes.

@phillipwalters
Copy link

@Flohack74 That worked for me. I wiped userdata on the phone and used fastboot and adb from Android Studio rather than the Ubuntu repos. None of the tests seem to be working for me, though. Most of them throw a floating point exception. test_egl doesn't, but it seg faults.

@Flohack74
Copy link

@phillipwalters yes thats clear if it is a mismatch between 32 and 64 bits. The Halium reference rootfs is only 32 bit capable it seems. You would have to use arm64 build of UT for example.

@phillipwalters
Copy link

We should be able to recompile the tests to 32 bits, right?

@Flohack74
Copy link

Its not the tests alone, its the whole libhybris thingie. I have little insights whats missing, please bring this up in the Halium channel.

@Flohack74
Copy link

I have now somewhat started to try Ubuntu Touch rootfs. However, currently I cannot get out of Halium rescue boot due to the following error probably:

[    5.805972] Begin: Running /scripts/nfs-bottom ... done.
[    5.806235] Begin: Running /scripts/init-bottom ... done.
[    5.815818] run-init: opening console: No such device
[    5.815972] Target filesystem doesn't have requested /sbin/init.
[    5.816570] run-init: opening console: No such device
[    5.817244] run-init: opening console: No such device
[    5.817971] run-init: opening console: No such device
[    5.818779] run-init: opening console: No such device
[    5.819525] run-init: opening console: No such device
[    5.820757] No init found. Try passing init= bootarg.

This is new for me on Halium. @bhush9 whats the thing with the console= again? My bootloader forces console=NULL

@Flohack74
Copy link

@ALL: whoever is trying to port Nexus 6P should keep in mind that it was affected by a sever hardware bug with the second set of CPUs on the SoC. It is advisable to set boot_cpus=0-3 maxcpus=4 in the kernel command line to switch off potential faulty cores.
This affects also Nexus 5X btw.
Meanwhile my reference rootfs looks better. I can run a few tests but the LXC wont start. It complains about lxc-start: cgroups/cgfsng.c: create_path_for_hierarchy: 1332 Failed to handle cgroupfs v1 cpuset controller.
I strongly believe that I miss the point with a kernel flag or 2.

@Flohack74
Copy link

@ALL: There is a bug in lxc which prevents container start with systemd and disabled CPUs. So this prevents Halium reference rootfs to start properly, while Ubunt Touch with upstart would work probably. This needs probably lxc later than 3.2.1, or a backport of lxc/lxc@36f7018 and lxc/lxc#3109

@Flohack74
Copy link

Flohack74 commented Nov 18, 2019

Update: Due to crashing kernel with lxc startup (Note: lxc is fine, just some Android service kills the kernel) I decided to compile LineageOS from scratch, just with my added CPU disable cmdline. LineageOS works fine, so I am thinking about taking again LineageOS sources instead the ones from @win8linux as I did so far before, to rule out any tainting.

@win8linux
Copy link
Author

win8linux commented Nov 18, 2019

Update: Due to crashing kernel with lxc startup (Note: lxc is fine, just some Android service kills the kernel) I decided to compile LineageOS from scratch, just with my added CPU disable cmdline. LineageOS works fine, so I am thinking about taking again LineageOS sources instead the ones from @win8linux as I did so far before, to rule out any tainting.

Yes, I would recommend pulling sources from LOS since mine are quite old already.

@Flohack74
Copy link

Nearly 1 year later: Finally got GUI!!!
grafik

@phillipwalters
Copy link

Nice! Any special steps you had to take? How is it?

@Flohack74
Copy link

A lot of special steps. But now its snappy, boot time is awesome, sound works, vibrator, rotation and wifi works. Modem does not load firmware, and lot of other stuff not working now. But its a start.

@testingweb624
Copy link

testingweb624 commented Jan 13, 2020 via email

@Flohack74
Copy link

Thanks, you are welcome. Any alpha testers here who can spare the device for testing it a bit?

@Flohack74
Copy link

@kodaxx
Copy link

kodaxx commented Jan 15, 2020

I have a device to spare that I can load onto for testing

@Jaeder42
Copy link

I can test as well

@Flohack74
Copy link

@Jaeder42 Ok, just follow the link above. If you wait until tomorrow afternoon you also get the new kernel with Bluetooth enabled :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests