2016-07-02 00:01:49 @kido Lrs121: this USB gadget Kconfig turns me mad ! it works if you provide a full defconfig like this one: http://hastebin.com/xalofijubu and also this patch: http://hastebin.com/hiwohuyofa.vhdl 2016-07-02 00:02:31 @kido but gosh why does it remove some config options when using a small defconfig, and we meet the same problem with every 3.10 kernel we use 2016-07-02 00:02:48 @kido that's why I spent two hours on this, I would have liked to find a clean definitive answer 2016-07-02 00:04:23 Lrs121 Thats strange. if it doesnt work with a stripped defconfig, i have to wonder why google ships them like that. 2016-07-02 00:04:42 @kido no it's not google's fault 2016-07-02 00:05:43 @kido anyway, you can use that for now until I find a proper solution 2016-07-02 00:05:53 @kido if I ever find one 2016-07-02 00:06:40 Lrs121 alright i get the patch and new defconfig pushed into git 2016-07-02 00:07:25 @kido it seems to come from here http://www.crashcourse.ca/wiki/index.php/OE_Kernel_Build_Tasks#do_kernel_configme 2016-07-02 00:10:43 @kido if you check your log.do_configure you can see that OE blindly accepts a shitload of config values 2016-07-02 00:11:30 @kido and some of them seem to disable CONFIG_USB_G_ANDROID as a side effect 2016-07-02 00:17:29 @kido that's why I said to locusf that he should enable this option https://github.com/locusf/meta-athias-hybris/blob/master/recipes-kernel/linux/linux-anthias.bb#L19 but in the end this is of no use 2016-07-02 00:18:08 @kido we've no choice but using full defconfigs on recalcitrant platforms 2016-07-02 00:21:47 Lrs121 that sounds like a pain to deal with 2016-07-02 00:23:50 @kido it is but we always have the same problem 2016-07-02 00:24:29 @kido and it is still stopping locusf from using his watch so it kinda pisses me off 2016-07-02 00:26:30 Lrs121 the kernel build is preventing it or is packing the boot image the problem 2016-07-02 00:28:38 @kido no this is the android's composite usb gadget driver 2016-07-02 00:32:34 Lrs121 ah ok 2016-07-02 01:56:51 @kido Lrs121: so how far does the build go ? ;) 2016-07-02 02:08:16 Lrs121 still running, im starting with a clean build 2016-07-02 02:08:43 Lrs121 i think i have yet to reach the kernel 2016-07-02 02:47:23 Lrs121 Its made it much further. made it to compile kernel modules and still going where before itd hang at do compile 2016-07-02 03:54:27 Lrs121 We have a successful build for the zenwatch 2 larger aka sparrow. havent tested the boot yet but its next 2016-07-02 09:41:53 @kido Lrs121: great ! so we need to test this now :) 2016-07-02 11:43:57 locusf wohoo 2016-07-02 12:01:10 @kido :) 2016-07-02 12:01:46 @kido how are you locusf ? was the sfos event nice ? 2016-07-02 12:10:13 locusf yeah it was great 2016-07-02 12:10:20 locusf also my first vacation day 2016-07-02 12:10:24 locusf 15h of sleep 2016-07-02 12:11:31 locusf I've been pretty spent the last month or so 2016-07-02 12:12:53 @kido ohoh nice ! I did the same thing but for my first day of work ahah... I guess that we just take strange sleep cycles in holidays :) 2016-07-02 12:13:50 @kido are you doing anything special for those holidays ? 2016-07-02 12:44:16 locusf not really 2016-07-02 12:44:23 locusf just resting 2016-07-02 12:44:30 locusf thats all I need so far 2016-07-02 12:45:25 @kido pretty important :) 2016-07-02 13:10:01 @kido by the way, I updated Qt to 5.6, if anyone wants to rebuild asteroid you will need to git pull your meta-qt5 and meta-smartphone layers 2016-07-02 13:11:58 locusf ok 2016-07-02 19:18:22 Lrs121 Morning all. Well its morning for me 2016-07-02 19:18:50 @kido ah? :) 2016-07-02 19:18:59 @kido good morning then 2016-07-02 19:31:36 Lrs121 I have tested the build. there was a some success, however it stops at the splash screen 2016-07-02 19:32:45 @kido good :) 2016-07-02 19:32:49 @kido do you have adb? 2016-07-02 19:35:13 Lrs121 unfortunately no, i believe im in a similar situation as locusf with adb 2016-07-02 19:35:23 @kido :( 2016-07-02 19:35:44 @kido so yes, you are at the same point now 2016-07-02 19:38:13 @kido we have no choice but debugging what's going on between adbd and the kernel's gadget features 2016-07-02 19:38:30 @kido but debugging without shell is painful 2016-07-02 19:40:18 Lrs121 well im open to learning new things 2016-07-02 19:44:20 @kido sure but I don't know where things can go wrong 2016-07-02 19:44:51 Lrs121 would getting non volatile logs be a good start? 2016-07-02 19:46:05 @kido that can help yes, but we will need to output more things to those logs by adding commands in the ramdisk's init script 2016-07-02 19:46:47 Lrs121 ah fun 2016-07-02 19:48:54 @kido mhhh I just noticed that USB_G_ANDROID is also disabled on the g watch's .config ... 2016-07-02 19:51:39 Lrs121 and adb is functional with the g watch? 2016-07-02 19:54:39 @kido yes 2016-07-02 19:59:44 @kido mhh no, I'm wrong OE just wiped dory's source by sparrow and I was looking at the sparrow's defconfig 2016-07-02 20:00:12 Lrs121 ah ok 2016-07-02 20:27:31 @kido http://hastebin.com/remiqeluzo <- diff config-dory config-sparrow 2016-07-02 20:33:13 @kido the defconfig seems ok, something must be wrong elsewhere 2016-07-02 20:33:33 @kido Lrs121: do you have the android's boot.img somewhere ? 2016-07-02 20:36:41 Lrs121 http://lrsservers.ddns.net/download/devices/asus/sparrow/boot.emmc.win 2016-07-02 20:36:59 Lrs121 its a twrp backup but it can be unpacked normally 2016-07-02 20:37:35 @kido alright, thank you 2016-07-02 20:38:08 Lrs121 youre welcome 2016-07-02 20:44:55 @kido init.usb.configfs.rc this is interesting 2016-07-02 20:45:03 @kido locusf didn't have that 2016-07-02 20:46:39 @kido but configfs seems to be disabled at line 13 of init.usb.rc 2016-07-02 20:46:51 @kido so functionfs should be used instead 2016-07-02 20:48:50 @kido selinux seems to be disabled so it shouldn't be a problem neither 2016-07-02 21:07:24 Lrs121 the fact that selinux is disabled is the only thing i understand of that 2016-07-02 21:08:11 @kido well, when you boot up your device the kernel is loaded first and it setup all the devices according to its devicetree and available modules 2016-07-02 21:08:36 @kido it *seems* that your kernel config is correct so the kernel should setup the USB's OTG mode correctly 2016-07-02 21:09:05 Lrs121 oh ok 2016-07-02 21:09:06 @kido as soon as the kernel is up and running it loads the ramdisk which contains an init script setting up different kind of things from user space 2016-07-02 21:09:52 @kido so in your android boot.img you have a ramdisk with a /init binary which does all kind of actions according to the /init*.rc files 2016-07-02 21:10:28 @kido and for example this init loads configure usb and starts adbd, the adb daemon 2016-07-02 21:11:38 @kido so if you extract your boot.emmc.win and then if you extract the ramdisk.cpio.gz, there are a couple of interesting files in there: init.rc, init.usb.rc, init.asus.usb.rc and init.usb.configs.rc 2016-07-02 21:12:11 @kido the main parts being the lines 16-32 from init.usb.rc 2016-07-02 21:12:58 @kido in asteroid we don't use android's init system in favor of a simple bash script 2016-07-02 21:13:34 @kido you can notice that this script tries to mimic android's usb setting up procedure here https://github.com/Lrs121/meta-sparrow-hybris/blob/master/recipes-core/initrdscripts/initramfs-boot-android/init.sh#L28 2016-07-02 21:14:18 @kido and if we have enable_adb in the kernel's command line we start adbd here https://github.com/Lrs121/meta-sparrow-hybris/blob/master/recipes-core/initrdscripts/initramfs-boot-android/init.sh#L50 2016-07-02 21:15:04 @kido if we don't have it, it is loaded by usb_moded which is loaded by systemd when mounting the rootfs here https://github.com/AsteroidOS/meta-dory-hybris/blob/master/recipes-core/initrdscripts/initramfs-boot-android/init.sh#L114 2016-07-02 21:15:36 @kido so there are two adbd daemons in asteroid, one in the ramdisk to debug early boot stages and one in the rootfs to develop comfortably 2016-07-02 21:16:39 Lrs121 so if i drop enable_adb=1 into the cmd_line of the img_info it should attempt to bring up adb during ramdisk? 2016-07-02 21:16:55 @kido if the usb device is setup correctly (both by the kernel and the init script), adbd should be able to do its job correctly and your host computer should show you a new device in "dmesg -w" 2016-07-02 21:17:14 @kido and then be usable by the adb command from your computer 2016-07-02 21:17:18 @kido but it doesn't seem to be the case 2016-07-02 21:17:43 @kido yep if you add this line it will start adbd in the ramdisk *and stop there* so you won't get splashscreen anymore since psplash is ran in the rootfs 2016-07-02 21:18:01 @kido but this is actually quite handy, it is helpful for debugging what's going on in the early stages of your boot process 2016-07-02 21:19:44 @kido it won't try to mount any partition or whatever, only /proc /sys/ /dev/ /dev/pts and /dev/usb-ffs should have been setup and you should get a system "fresh out of the kernel" 2016-07-02 21:21:21 @kido if you want to add any other setting up command, just add them in your init.sh, re-run bitbake linux-sparrow and it will pack you a new boot.img containing your ramdisk 2016-07-02 21:25:02 @kido there are a couple of handy things to know here if you want to know what's actually going on in your ramdisk. if you enable CONFIG_TTY_PRINTK in your kernel (not done yet) you will get a nice /dev/ttyprintk device. you can then redirect the output of commands to this file and they will appear in the kernel's dmesg. if you manage to get persistent logs you will get the output of those commands 2016-07-02 21:26:04 @kido if you use CONFIG_ANDROID_RAM_CONSOLE in both android and asteroid you can also access previous boot's logs from android 2016-07-02 21:27:20 @kido this is how I worked in the early days of asteroid but that would be cool if porters don't have to mess with this method anymore 2016-07-02 21:33:00 @kido so basically the procedure to debug usb now is as follow: 1) make sure the kernel has everything that is needed to setup the usb device (it *should* be the case but we might be missing something...) <- once again you might be able to get some info about this if you get persistent logs 2) make sure that our init.sh does the same initialisation procedure as android's init*.rc config files <- for example I 2016-07-02 21:33:00 @kido noticed that asus plays with the permissions of /sys/devices/platform/msm_hsusb/gadget/wakeup ... the permissions by themselves shouldn't be important but /sys/devices/platform/msm_hsusb/gadget/ might be an interesting place to look at 2016-07-02 21:34:06 @kido 3) get info on what's going on with commands output redirections to /dev/ttyprintk 2016-07-02 21:34:58 @kido if you have any question, as usual, you know you can always ask it... ;) 2016-07-02 21:35:52 @kido and if this problem gets solved, two devices should get unlocked in a row so this is super exciting! :) good luck and have fun Lrs121! 2016-07-02 21:54:30 @kido for example you should check /sys/class/dual_role_usb/otg_default/power_role (can be sink or source) and /sys/class/dual_role_usb/otg_default/data_role (can be host or device) and /sys/class/dual_role_usb/otg_default/mode (can be dfp or ufp) the values that are used in android are probably correct so you can make sure the same are used in asteroid 2016-07-02 22:11:51 Lrs121 is that within android 2016-07-02 22:11:55 @kido Lrs121: you could also try to boot init.sh with the android's kernel (I'm not sure if selinux will complain but well... you can try) and enable_adb. it might work and lead us into a direction 2016-07-02 22:12:13 @kido you should have those files both in android and asteroid as they are virtual files exposed by the kernel 2016-07-02 22:14:14 @kido actually, trying the android's kernel with the asteroid's ramdisk can be a really good way to know if the problem is in kernel space or user space 2016-07-02 22:15:00 @kido and if you use enable_adb=1 you also also use selinux=0 so it shouldn't be a problem, it should work 2016-07-02 22:15:16 @kido s/also also/can also/ 2016-07-02 22:21:20 Lrs121 i dont see a dual_role_usb folder in android under /sys/class 2016-07-02 23:07:28 @kido alright then it might not be setup, but as long as it is not used by android it shouldn't have to be used by asteroid ;) 2016-07-02 23:20:21 Lrs121 ok