Search:
01:21:52 | kido | I think I digged as far as one possibly can on the bluetooth/uart/dma/wakelock/battery issue. I ended up reading the broadcom's and qualcomm's respective IPs datasheets and it appears I don't get correct "host wake" IRQs from the BT controller because brcm_patchram_plus doesn't provide a full low power mode initialization sequence. once again this part is implemented in the android's userspace with the |
01:21:53 | kido | lpm_param structure of this file http://crypto.nknu.edu.tw/AOSP/Android6/hardware/broadcom/libbt/src/hardware.c sent with hw_lpm_enable(turn_on) |
01:23:32 | kido | basically we can continue using brcm_patchram_plus without --enable_lpm, the BT chip will never enter sleep mode, the host wake IRQ line will never be asserted, the msm_serial_hs_dma wakelock will never be released and the CPU will never enter sleep mode |
01:24:34 | kido | or we can try to reproduce more code from libbt-vendor inside brcm_patchram_plus and see if we can configure the BT chip correctly so that the host wake IRQ is correctly asserted and nitrous/bluesleep can work accordingly |
01:28:28 | kido | one very last alternative I would have had in mind comes from the qualcomm's doc https://developer.qualcomm.com/qfile/28819/lm80-p0436-5_peripherals_programming_guide.pdf and would have been to use "in band sleep" instead of "out of band sleep" but it means we would loose every first byte of an RX transaction, they seem to be guessing it from TI's HCILL protocol but on asteroid with BLE we can not predict |
01:28:30 | kido | the lost byte so it's unsable |
01:28:36 | kido | unusable* |
01:30:49 | kido | more references on the IRQ in http://www.cypress.com/file/298081/download with BT_HOST_WAKE |
01:49:45 | kido | one very last alternative would be to integrate bluedroid instead of bluez but it'd be a lot of work |
01:52:44 | kido | at this point the wisest decision is to classify the issue, document the problem properly, give up on the current asteroid-btsyncd, asteroidossync asteroid-weather, asteroid-music, dory, anthias and move everything to wifi |
02:02:35 | kido | actually only a few parts of asteroidossync and asteroid-btsyncd will need to be rewritten (they were buggy and needed to be rewritten anyway) and dory and anthias will still be able to fallback to BT PAN (the battery problem will still be there but at least they will be kind of supported)... Now, time to drink and forget this horrible bt stack |
02:04:04 | Korak | lol, sorry that didn't go so well for you |
02:04:20 | kido | :) |
02:04:30 | Korak | does sound like you have pretty well beatten that issue to death |
02:06:26 | Korak | and so I take it this issue is with bluetooth on all watches? |
02:06:27 | kido | well, ble was a bad decision on so many levels. everything is buggy and patched from the kernel stack to the user apps with everything in between |
02:06:52 | kido | no it's only a problem on qu |
02:07:05 | kido | smartwatches with qualcomm soc and broadcomm bt |
02:07:45 | Korak | ah, ok |
02:07:46 | kido | but it's pretty much every android wear watch |
02:08:21 | kido | sony sw3 has a broadcom soc so the problem shouldn't be there but it also has wifi so let's use it instead |
02:09:15 | Korak | so useing wifi to do ad-hoc network and send notifications that way? |
02:10:31 | kido | yarp, I still need to think about it as I just gave up on bt and I'm not extremely proficient with network |
02:10:53 | kido | any suggestion (and help) is welcome |
02:11:19 | kido | I have to admit my motivation is pretty low right now... :| |
02:11:28 | Korak | Yeah, I will let you know if I have any ideas, not really sure what I think of that currently |
02:11:50 | Korak | Well, don't let it get you down. |
02:12:33 | Korak | Asteroid is a great system so far. Bound to be a bump or two along the way. |
02:13:26 | Korak | and Hey, document it all out like you planned, that will give someone a head start, who knows, might have someone come along willing to write a custom bluetooth for it. |
02:14:40 | kido | actually I feel bad for having spent months working in a wrong direction and now the dory users won't get proper support because of an incorrect decision |
02:15:20 | kido | but yes I assume I don't have much choice |
02:15:29 | Korak | Nah, doing stuff like this sometimes you go down the wrong path, |
02:15:51 | Korak | And, you did learn a lot doing it |
02:15:56 | Korak | so it wasn't a waste |
02:16:09 | kido | well, enough for today, I need to get some sleep now :) |
02:16:19 | Korak | Yep, me too |
02:16:42 | Korak | you get some sleep, things always look better after good night sleep |
07:59:23 | locusf | Wow thats some epic digging |
14:34:12 | kido | holy guacamole!! |
14:34:31 | kido | ladies and gentlemen: result of more than 100 hours of work |
14:34:33 | kido | - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, |
14:34:35 | kido | + 0x01, 0x0A, 0x0A, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, |
14:34:44 | kido | and battery life is saved |
14:36:18 | SylvieLorxu | Damn... |
14:36:25 | SylvieLorxu | That fixed the suspending issues? |
14:37:10 | kido | yes, I still need to check everything in depth but the interrupts are correct now and the bt's clock goes off now |
14:37:38 | daduke | congrats, that's awesome! |
14:38:44 | kido | can't believe it, I had just given up and I woke up with this in mind :) |
14:38:45 | SylvieLorxu | How the hell did you even find this out |
14:39:00 | kido | I'll document it properly |
14:41:32 | danialbehzadi | kido: Miracle! :D |
14:42:08 | kido | :D |
14:44:29 | kido | yes I can confirm it fully works, watch suspends and I can connect from my phone |
14:44:40 | kido | let's patch it properly now |
15:22:06 | AsteroidBot | [brcm-patchram-plus] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDiEk |
15:22:06 | AsteroidBot | Florent Revest: Support per-device Low Power Mode configuration (https://git.io/vDiEI) |
15:23:49 | AsteroidBot | [meta-asteroid] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDiE0 |
15:23:49 | AsteroidBot | Florent Revest: brcm-patchram-plus: Bump SRCREV (https://git.io/vDiEE) |
15:29:53 | bencord0 | W. T. F |
15:36:04 | AsteroidBot | [meta-anthias-hybris] FlorentRevest pushed 2 commit(s) to master: https://git.io/vDizW |
15:36:05 | AsteroidBot | Florent Revest: brcm-patchram-plus: Select anthias' Low Power Mode configuration (https://git.io/vDizl) |
15:36:05 | AsteroidBot | Florent Revest: brcm-patchram-plus: Enable LPM (https://git.io/vDiz8) |
15:36:25 | AsteroidBot | [meta-dory-hybris] FlorentRevest pushed 2 commit(s) to master: https://git.io/vDizE |
15:36:25 | AsteroidBot | Florent Revest: brcm-patchram-plus: Select dory's Low Power Mode configuration (https://git.io/vDizu) |
15:36:25 | AsteroidBot | Florent Revest: brcm-patchram-plus: Enable LPM (https://git.io/vDizz) |
15:36:45 | AsteroidBot | [meta-bass-hybris] FlorentRevest pushed 2 commit(s) to master: https://git.io/vDizV |
15:36:45 | AsteroidBot | Florent Revest: brcm-patchram-plus: Select bass' Low Power Mode configuration (https://git.io/vDizw) |
15:36:45 | AsteroidBot | Florent Revest: brcm-patchram-plus: Enable LPM (https://git.io/vDizr) |
15:37:05 | AsteroidBot | [meta-sparrow-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDizP |
15:37:05 | AsteroidBot | Florent Revest: brcm-patchram-plus: Select sparrow's Low Power Mode configuration (https://git.io/vDizX) |
15:37:22 | AsteroidBot | [meta-tetra-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDiz9 |
15:37:22 | AsteroidBot | Florent Revest: brcm-patchram-plus: Select tetra's Low Power Mode configuration (https://git.io/vDizH) |
15:40:07 | AsteroidBot | [meta-sturgeon-hybris] FlorentRevest pushed 2 commit(s) to master: https://git.io/vDigt |
15:40:08 | AsteroidBot | Florent Revest: brcm-patchram-plus: Select sturgeon' Low Power Mode configuration (https://git.io/vDigq) |
15:40:08 | AsteroidBot | Florent Revest: brcm-patchram-plus: Enable LPM (https://git.io/vDigm) |
15:44:01 | AsteroidBot | [meta-dory-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDig9 |
15:44:02 | AsteroidBot | Florent Revest: README-system-dir: Adds an instruction for the execution permission of /system/bin/* which could oth (https://git.io/vDigH) |
16:23:10 | Korak | WOOT!! |
16:23:24 | Korak | Way to go kido |
16:24:48 | Korak | I am exctied to build that and give it a go. I have been running a build with bluetooth broken, been enjoying the batterylife but missing my notifications |
16:25:48 | Stskeeps | kido: congrats |
16:26:01 | kido | :) |
16:26:11 | kido | Korak: hold on, there is still a kernel patch coming |
16:30:32 | Korak | Cool, I can't do a build till later today anyways. |
16:31:11 | Korak | Stuck at work with this whimpy MacBook. Building will have to wait till I get home :) |
17:08:49 | AsteroidBot | [meta-bass-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDiHe |
17:08:50 | AsteroidBot | Florent Revest: linux-bass: Patches the bluesleep driver to use kernel's HCI events (https://git.io/vDiHf) |
17:09:50 | AsteroidBot | [meta-dory-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDiHE |
17:09:50 | AsteroidBot | Florent Revest: linux-dory: Patches the bluesleep driver to use kernel's HCI events (https://git.io/vDiHu) |
17:09:57 | kido | now it should be fine |
17:11:39 | Korak | awesome, I am excited to try that out, will have to kick off a build soon as I get to my desktop. |
17:11:50 | kido | cool, keep me updated |
17:12:59 | Korak | Will do, I have also been reading up on things and studying the app code, from what I understand so far it does look like some pretty big changes need to be made |
17:13:16 | kido | definitely |
17:14:10 | Korak | plan on playing with some of that and will let you know if I come up with anything useful |
17:17:34 | kido | sure, keep me updated |
17:17:53 | Korak | Sense my girlfriend is about to go back to school I am probably going to find myself with lots of time sitting in a library soon |
17:18:01 | kido | :) |
17:18:14 | Korak | she really needs to get a license :) |
17:24:14 | sigma110_ | kido: congrats.. thanks for all your hard work. Super excited to try this out on bass |
17:25:05 | SylvieLorxu | I hope someone else will make a dory build, the only device I can build on is an old x200 and that's not pleasant lol |
17:25:37 | Korak | SylvieLorxu: I have a Dory and will be making a build this evening |
17:26:12 | SylvieLorxu | Nice |
17:26:21 | kido | sigma110_: you're welcome, the harder the problem, the more rewarding the solution is :) |
17:55:10 | TheAppleMan | w00t! |
19:12:05 | nielstho | SylvieLorxu, Korak I almost finished building the image (dory) |
19:12:22 | nielstho | i will post an link when finished |
19:12:47 | nielstho | it's at 97% at the moment |
19:15:41 | SylvieLorxu | Nice :) |
19:16:08 | kido | I lost 5% in two hours with bluetooth on on bass |
19:17:27 | kido | 2% in two hours with bluetooth off on dory but this should be checked again |
19:28:56 | Korak | sweet |
19:30:40 | Korak | We should setup a place for nightly builds sometime. |
19:31:09 | nielstho | indeed. it's uploading at the moment |
19:31:56 | kido | Korak: ping Nokius |
19:32:16 | kido | he already has one but it's broken for some reason |
19:33:28 | nielstho | http://nielstholenaar.nl/asteroid-dory.tar.gz |
19:33:44 | nielstho | 036cd327b3aeb76cbc400db735eef7619cc3bde6 asteroid-dory.tar.gz |
19:33:53 | nielstho | sha1checksum |
19:39:06 | Korak | Woot |
19:39:40 | Korak | now to see if my cheap knockoff charge cradle will handle me pushing this :) |
19:45:35 | Ebedorian | hello |
19:45:39 | Ebedorian | I have a question |
19:45:57 | Ebedorian | I'd like to port the asteroidOS to this watch |
19:46:16 | Ebedorian | https://www.amazon.com/gp/product/B01C3YF9OW/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1 |
19:46:34 | Ebedorian | I'm open to suggestions and advice |
19:47:00 | Ebedorian | I'm not a programmer, just a beginner linux enthusiast looking for a challenging project since I am currently unemployed |
19:47:39 | Korak | That one will be a challenge. |
19:48:16 | Ebedorian | Hmmm, it is because it's Chinese manufactured or because it doesn't run linux |
19:48:36 | Korak | It is using a Mediatek SoC |
19:48:50 | Ebedorian | oh ok |
19:49:10 | Ebedorian | Well, I guess I have to start somewhere, and this seems like the best place to start |
19:49:11 | Korak | The Chinese manufaturers have nasty habit of not releasing the source code |
19:51:00 | Ebedorian | Ok, so what about doing a whipe and starting from the ground up? Not possible either I guess? |
19:52:30 | SylvieLorxu | Thanks nielstho |
19:52:48 | Korak | Asteroid uses drivers and parts from android |
19:52:52 | nielstho | SylvieLorxu: yw |
19:53:59 | Korak | I have found this though https://android.googlesource.com/kernel/mediatek/ |
19:54:33 | Korak | mediatek did realease some stuff, so might be able to find tha things you need in there |
19:55:29 | Korak | https://asteroidos.org/wiki/porting-guide/ |
19:55:42 | Ebedorian | Thanks, much appreciated |
19:56:14 | Korak | Your welcome, and good luck with it |
19:56:17 | atx | There was also some RE work done on Mediatek in https://www.bunniestudios.com/blog/?p=4297 |
19:56:22 | atx | Not sure how relevant it is though |
19:56:59 | Korak | It would certainly be interesting to have Asteroid running on these watches as they are cheap and easy to get. |
19:57:46 | Ebedorian | Yeah, that's why I wanted to try it. But because I haven't programmed anything in over 15 years, I don't even know where to begin. |
19:58:17 | Korak | I had thought about trying it myself, but I know I have a lot of other things I should work on and learn about first |
19:59:23 | Ebedorian | Given the trend with Raspberry Pi, I think mobile platform + open source + cheap hardware = next big thing |
19:59:45 | dunx | it was called android :( |
19:59:59 | dunx | cheap hardware and open source, but not freedom :( |
20:00:04 | Ebedorian | lol |
20:00:10 | Ebedorian | LOL |
20:00:32 | Korak | I really hope open systems can make a breakthrough into more mainstream but still a long ways to go |
20:01:00 | Korak | after all, many schools are just going crazy with these "awseome chromebooks!" |
20:02:11 | Korak | I think most people are happy being blissfully ignorant and using closed systems |
20:03:34 | Korak | I was for many years, but then noticed the trend especially last few years that more and more systems are being built to put the company first and screw the end user. |
20:04:34 | Korak | Windows 10 home is pretty much "Windows 10 beta tester edition" |
20:05:58 | Ebedorian | So you're saying there |
20:06:25 | Ebedorian | there's no point to DIY projects using the tools available? |
20:07:36 | Ebedorian | I mean, the android SDK is free, tons of code is available on the internet. I mean in spite of the closed systems, we have the tools to make anything that we want without having to depend on closed systems, if you don't want to. |
20:08:28 | Korak | Ebedorian: I think the issue is that more and more Google is trying to close the system. It keeps pulling things into the closed areas. |
20:09:26 | Korak | Like encuraging people to talk with google play for GPS data instead of talking to the GPS chip. By doing that suddenly you remove play store and you have broken a ton of apps. |
20:12:05 | Korak | And I for one have found google to be WAY beyond what I consider ok in terms of their snooping. Making note of the routs I use to drive around town, pushing ads based on my location, scanning e-mails to tailor ads..... It is beyond creepy when you start looking into how much they gather about you. |
20:13:37 | Korak | Actually big part of why I hang out here, I wanted a smart watch but refused to have google breathing down my neck. |
20:37:11 | Ebedorian | Oh, not I understand. I'm not even aware of how much they snoop, how do you check that? |
20:37:19 | Ebedorian | *now |
20:38:56 | dunx | we can get rid of google but not qualcomm or intel or mediatek though |
20:50:45 | Korak | https://privacy.google.com/take-control.html has a lot of it. |
20:52:40 | daduke | kido: I just compiled and installed your breakthrough build, but I cannot turn on BT... reboot doesn't fix it. Used to work with a ~3day old build |
20:52:47 | Korak | I just noticed when google now came out it sarted telling me my "estimated drive home" time, not only did it do that but it caculated it using the weird backroad way I normally took to get home, I then later noticed when going to pick up prescriptions I kept having my phone ding and when I looked at it there would be a notification for "Why don't you download the CVS app" |
20:54:57 | Korak | daduke: you on Dory? |
20:54:59 | kido | hi Ebedorian |
20:55:11 | daduke | Korak: yes (sorry forgot to add) |
20:55:39 | kido | Ebedorian: porting asteroid to this kind of watch won't be possible, they are only able of running "Nucleus" not a complete Linux system |
20:57:27 | kido | daduke: try to systemd mask patchram and after reboot run /usr/bin/brcm_patchram_plus -d --enable_lpm --enable_hci --no2bytes --patchram /vendor/firmware/BCM20715A1.hcd /dev/ttyHS99 |
20:58:00 | kido | daduke: at some point it will stop outputting things and "hciconfig" will show you a hci0 device |
20:58:24 | daduke | kido: I do this via adb shell? |
20:58:30 | kido | I think this service is started too early |
20:58:41 | kido | yes |
20:59:18 | kido | to check if the patches work run dmesg | grep CLOCK and you should see some HSUART CLOCK OFF from time to time |
21:00:18 | daduke | need to find the systemd service first... |
21:01:45 | daduke | /lib/systemd/system/patchram.service probably |
21:04:27 | daduke | stuck after Done setting line discpline now... |
21:07:13 | kido | yes tha'ts what's supposed to happen |
21:10:34 | daduke | ^-C then, but hciconfig shows no hci0 |
21:11:46 | kido | ok this is weird, what does rfkill list says ? |
21:21:03 | daduke | 0: brcm_Bluetooth_rfkill: Bluetooth, Soft blocked: no, Hard blocked: no |
21:23:38 | daduke | just rebooted and tried again, same |
21:33:08 | TheAppleMan | isn't patchram supposed to stay running in the background? |
21:33:12 | daduke | flashed Asteroid again and tried from scratch, now brcm_patchram_plus loops in 'writing 01 03 0c 00' forever |
21:35:38 | kido | TheAppleMan: yes, it is |
21:38:05 | TheAppleMan | ^C should be killing it |
21:38:26 | kido | I didn't even noticed this part |
21:38:31 | kido | notice* |
21:39:03 | kido | daduke: when I was saying it was what's supposed to happen I meant that hciconfig should stay blocked |
21:40:00 | daduke | kido: oh right. well now I have to get back to that state first.. |
21:41:35 | kido | staying blocked on 'writing 01 03 0c 00' is also something that happens from time to time and I have truely no idea how to fix it |
21:43:07 | daduke | 2 reboots later I can flash again |
21:43:25 | daduke | ok so ^-Z instead of -C |
21:44:01 | daduke | hci0 check |
21:44:33 | daduke | Bluetooth on check, thanks guys |
21:45:05 | kido | good :) the fact that patchram is ran at a wrong time is also a problem but a different one |
21:45:23 | daduke | the Android app crashes tho, but I guess that's known |
21:45:43 | kido | when you tap on the notification? |
21:46:00 | daduke | upon connect |
21:46:24 | kido | do you have logcat somewhere? |
21:46:27 | daduke | hasn't been working for some days now |
21:47:06 | daduke | I do not, but I can install it |
21:49:40 | kido | I can confirm again on a fresh dory build that everything works by starting brcm-patchram-plus manually |
21:49:56 | kido | for some reasons I don't need to start brcm-patchram-plus manually on bass |
21:50:30 | TheAppleMan | did i do something special? :S |
21:50:32 | kido | but I think I will spend some days far from bluetooth-related problems |
21:50:47 | daduke | kido: ok I'll give you a break |
21:51:04 | daduke | well deserved |
21:51:50 | kido | TheAppleMan: well, dory has After=dev-ttyHS99.device and bass doesn't, but I would have thought that this line solved the problem instead of causing it |
21:52:03 | kido | I'll try to remove it from dory's service and see if the service starts later in the boot process |
21:52:08 | kido | daduke: :) |
21:54:45 | kido | it looks like removing this line solves the problem, I really don't get why |
21:56:07 | kido | this chip really doesn't make any sense... but one more problem solved (apparently) |
21:57:10 | AsteroidBot | [meta-dory-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDP69 |
21:57:10 | AsteroidBot | Florent Revest: patchram: Don't start service right after /dev/ttyHS99 which seems to solve some race condition lead (https://git.io/vDP6H) |
21:58:01 | AsteroidBot | [meta-anthias-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDP6N |
21:58:01 | AsteroidBot | Florent Revest: patchram: Don't start service right after /dev/ttyHS0 which seems to solve some race condition leadi (https://git.io/vDP6A) |
21:58:30 | AsteroidBot | [meta-sturgeon-hybris] FlorentRevest pushed 1 commit(s) to master: https://git.io/vDP6p |
21:58:30 | AsteroidBot | Florent Revest: patchram: Don't start service right after /dev/ttyHS99 which seems to solve some race condition lead (https://git.io/vDP6h) |
23:10:59 | Korak | I am having good luck with the new build so far. Only issues I have had playing around I think are with the phone app doing silly things. |
23:20:00 | Korak | Just found out that you should really dissconnect your watch before playing with fdroid. That thing spams notifications like crazy. |
23:33:02 | kido | good :) |