**** BEGIN LOGGING AT Mon Sep 22 03:00:00 2014 Sep 22 07:55:13 moin :) Sep 22 08:55:37 M4rtinK: ping Sep 22 09:12:09 freemangordon: pong Sep 22 09:14:18 M4rtinK: I am REing nm-navigation-provider (the one that is used for geo-tagging, etc) and I hit a tile download function which does some lat/long to tile coordinates etc transformations. I need help to grok what it is doing :) Sep 22 09:15:38 me, I will shortly be posting some great info on libisi, libisi-glib and the cellular modem interfaces :) Sep 22 09:16:19 M4rtinK: I *guess* it uses mercator coordinates, but what troubles me, is that there http://wiki.openstreetmap.org/wiki/Slippy_map_tilenamesfor example, the coordinate transfor uses cos(), which I don't see in Nokia code Sep 22 09:16:40 well, I was about to point you to that wiki :) Sep 22 09:17:23 AFAIK, the Here maps always used the web mercator Sep 22 09:17:35 here == ovi? Sep 22 09:17:40 yeah Sep 22 09:18:04 I remember checking out their tile naming scheme back then and it was fairly standard web mercator Sep 22 09:18:22 which function in nm-navigation-provider are you stuck on? Sep 22 09:18:23 well, it uses mercator, but nm-nav... seems to do some tricks to download more than one 256x256 tile per request Sep 22 09:18:37 I can take a look quick and see if I can see anything Sep 22 09:18:43 as for the tile naming algorithm, I'm sure there are more ways to do the coordinate conversions Sep 22 09:18:44 jonwil: the one that downloads tiles from ovi maps Sep 22 09:18:51 whats the address? Sep 22 09:19:14 jonwil: it is a part of a bigger "thread" function Sep 22 09:19:32 jonwil: I can give you the DB, it has everything needed Sep 22 09:19:35 yes please Sep 22 09:19:42 jonwil: just a sec Sep 22 09:19:48 also if you are just working with the binary, the compiler might have just "optimized" the cos to something it thinks is faster Sep 22 09:20:08 could be, but tan() and log() are not optimized Sep 22 09:20:15 neither is pow() Sep 22 09:21:38 BTW, these are the algorithms modRana uses for tile coordinates: https://github.com/M4rtinK/modrana/blob/master/core/tilenames.py Sep 22 09:22:06 jonwil: http://46.249.74.23/nm-nav/ Sep 22 09:22:16 jonwil: ping when ready to remove it Sep 22 09:22:55 ok, got it Sep 22 09:23:05 so which function/part do I want to be looking at? Sep 22 09:23:08 jonwil: ok to remove it? Sep 22 09:23:14 yes remove it Sep 22 09:23:51 jonwil: navigation_thread_func Sep 22 09:23:52 which bit of code is the bit you are stuck on? Sep 22 09:24:07 jonwil: case GetMapTile: Sep 22 09:24:42 M4rtinK: the point is that "GetMapTile" has parameters: Sep 22 09:24:56 lon, lat, zoom, width, height Sep 22 09:25:13 M4rtinK: I have NFC what those width and height could be used for Sep 22 09:26:18 *maybe* they download more than one tile, merge those and scale the result to fit in w/h Sep 22 09:26:24 jonwil: ^^^ Sep 22 09:27:36 jonwil: do you want .c code I have ready so far? Sep 22 09:27:43 yes that might be nice Sep 22 09:27:47 ok Sep 22 09:28:20 I cant promise anything since most of the math here is FPU and I dont know the first thing about ARM FPU :) Sep 22 09:28:51 jonwil: this is WIP, you can use qtcreator to run it on the device Sep 22 09:28:56 ok Sep 22 09:28:56 on the same place Sep 22 09:29:01 heck, even x86 FPU still gets me sometimes Sep 22 09:29:35 jonwil: VFP is easy, just lots of instructions Sep 22 09:30:50 jonwil: I think I have everything else in place besides that case. though it needs some cleanup Sep 22 09:30:56 ok Sep 22 09:32:15 jonwil: keep in mind that hexrays crashes on subC1C5 Sep 22 09:32:37 you mean sub_C15C? Sep 22 09:32:42 yep Sep 22 09:32:50 sorry :) Sep 22 09:33:09 M4rtinK: so, wanna help? Sep 22 09:33:45 HexRays isn't crashing on that function here Sep 22 09:33:56 weird Sep 22 09:34:02 what version? Sep 22 09:34:25 IDA is 6.5.140116 Sep 22 09:34:36 same here Sep 22 09:34:50 HexRays is 1.7.0.120531 Sep 22 09:35:19 is that what you have? Sep 22 09:35:23 can you pastebin the decompiled code? Sep 22 09:35:35 freemangordon: that looks like a call for getting a static map Sep 22 09:35:50 "static map"? Sep 22 09:35:52 freemangordon: or for configurable tile size Sep 22 09:35:58 http://pastebin.com/wwNUx7zU Sep 22 09:36:03 Thats what IDA gets for that function here Sep 22 09:36:10 http://wiki.openstreetmap.org/wiki/Static_map_images Sep 22 09:36:12 thanks Sep 22 09:36:35 you give it coordinates of the upper left (or some other) corner, how big it should be and at which zoomlevel Sep 22 09:36:41 and it returns an image Sep 22 09:36:55 yep, looks like that Sep 22 09:37:11 do you have some reference code? Sep 22 09:37:35 now thinking about it Sep 22 09:37:38 btw I guess the coordinates are center coordinates Sep 22 09:37:51 lat, lon might also denote the center of the image Sep 22 09:37:51 one way to attack this stuff that I have used in the past is to get the offending binary into GDB (or if it you could get it to work, the IDA remote debugger) then single step the relavent code and see what the output looks like Sep 22 09:37:59 I have done it before with other N900 things Sep 22 09:38:30 never with FPU though Sep 22 09:38:33 if they used this for example to show "mini maps" for search results or something - you want your POI in the middle & the image should fit to your viewport Sep 22 09:38:52 not really reference code Sep 22 09:39:21 M4rtinK: maybe what they do is: Sep 22 09:39:29 lon/lat is the center Sep 22 09:39:50 extend this (somehow) by using zoom,width,height Sep 22 09:40:06 download all the tiles that cover the result Sep 22 09:40:30 make one big pixmap and scale/clip it to fit width/height Sep 22 09:40:35 make sense? Sep 22 09:40:40 *makes Sep 22 09:41:07 yeah, that's how you do that Sep 22 09:41:21 and it can be either server side or you can do it locally Sep 22 09:41:38 BTW, this is what the OSM static map API does: Sep 22 09:41:40 Sep 22 09:41:59 ovi only serves 256x256 tiles iiuc Sep 22 09:42:08 just ignore the marker=* variable, but that's basically it Sep 22 09:42:26 99.9% of tile servers serve 256x256 tiles Sep 22 09:42:26 yeah, seems like Sep 22 09:42:43 its a nice round number :) Sep 22 09:43:12 there are some that serve other sizes, but not many (64x64 or 256x128 (isometric projection)) Sep 22 09:44:20 hmm, so we need to find the code that does this (in C) Sep 22 09:44:40 though I am still concerned about that missing cos() Sep 22 09:45:08 my advice is to run the code if possible Sep 22 09:45:22 and to compare results with the algorithm on OSM wiki Sep 22 09:45:39 preferably on some low zl (2-4) Sep 22 09:45:55 which exactly algo on OSM wiki? Sep 22 09:46:52 lon/lat -> tile numbers Sep 22 09:47:17 I did that, results doesn't match Sep 22 09:47:18 most likely candidate, if it takes lat/lon Sep 22 09:47:41 maybe because the algo on wiki takes upper-left, not the center Sep 22 09:48:11 and what does tha code do actually ? Sep 22 09:48:22 if just returns some numbers or calls some web service ? Sep 22 09:48:38 it download the tiles from ovi Sep 22 09:49:00 have you checked if the urls exist ? Sep 22 09:49:25 yep, it is fine Sep 22 09:49:41 http://maptile.maps.svc.ovi.com/maptiler/maptile/newest... Sep 22 09:50:16 the result is stored in /home/user/MyDocs/.map_tile_cache Sep 22 09:50:34 hmm Sep 22 09:50:39 file format is (zoom, x, y, map_options) Sep 22 09:50:50 *filename format Sep 22 09:51:07 2 chars for zoom, 6 for x,y and 2 for options Sep 22 09:51:10 I see two possibilities: the lat/lon is in center or is in a corner Sep 22 09:51:36 and it is used to fill in the viewport Sep 22 09:51:48 ok, how to calculate the corner if I have the center? Sep 22 09:52:28 (I don't want to reinvent the wheel if you know how) Sep 22 09:53:01 I am almost sure this is what they do Sep 22 09:55:15 this is how modRana does that: https://github.com/M4rtinK/modrana/blob/master/modules/mod_projection.py#L157 Sep 22 09:56:01 IIRC projection units are basically floating point tile coordinates Sep 22 09:56:16 eq 1,1 - upper left corner Sep 22 09:56:28 1.5,1.5 - middle of a tile Sep 22 09:59:43 M4rtinK: so, px1 and py1 are x/y of the upper left corner in tile coordinates? Sep 22 10:00:25 but as you work with three coordinate systems (display coordinates, projection/tile coordinates and geographic coordinates), it can get a little messy Sep 22 10:00:34 :) Sep 22 10:00:57 yep Sep 22 10:01:08 and px1 and px2 should be the lover right corner Sep 22 10:02:32 and you get px1 by moving the "pointer" half of the scaled screen width - 0.5 * self.w / self.scale, scaled for current zl Sep 22 10:02:49 then half, of the height Sep 22 10:02:50 etc. Sep 22 10:03:04 that's how you get the edges from the center Sep 22 10:04:31 oh, wrong - the scale is always the same (256) Sep 22 10:04:47 and you don't have to scale it Sep 22 10:05:00 as the tiles are always the same size Sep 22 10:05:12 and the scale is given by the zoom level Sep 22 10:05:21 hmm, I'll send a couple of dbus requests to the original binary, lets see Sep 22 10:05:38 so you might get say px=100 py=100 Sep 22 10:06:36 but it corresponds to different lat/lon on different zoomlevels Sep 22 10:07:38 anyway, got to go :) Sep 22 10:07:50 but I'll should show p in the evening :) Sep 22 10:10:25 ok Sep 22 10:10:43 good luck :) Sep 22 10:40:02 jonwil: I think I got it - they convert lat/lon to x/y and download the four adjacent tiles Sep 22 10:40:22 neat Sep 22 10:42:49 then they merge those 4 tiles into one and scale to width/height Sep 22 10:51:07 cool Sep 22 10:51:57 Is this stuff used for the main "maps" app and its data downloads or is that something different? Sep 22 10:52:11 wait main maps app uses different things Sep 22 10:52:19 some microb browser plugins do all the work IIRC Sep 22 10:53:00 I am not sure, that *might* be used by main map app as well Sep 22 10:53:20 BTW it is a bit more complicated Sep 22 10:53:37 the tiles are not four, but depend on width/height Sep 22 10:53:48 for 512x512 9 tiles are downloaded Sep 22 10:54:22 so i guess it is width/256 + 1 Sep 22 10:54:54 for number of columns and similar for rows Sep 22 10:58:25 I doubt its used by main map app as main map app stores data differently and downloads it differently (in a bunch of files with .cdt extention, some of which may contain JPEG data) Sep 22 10:59:51 jonwil: could be Sep 22 11:26:16 anyone here know anything about kernel code and specifically ioctls? Sep 22 11:27:50 hmmm wait no, thats different code Sep 22 11:48:02 jonwil: I found a working php code that does what nm-navigation... does :) Sep 22 11:48:37 great Sep 22 11:48:42 nice one Sep 22 11:48:55 I am very close to finishing my re-ing of libisi Sep 22 13:52:47 jonwil: ping Sep 22 13:52:56 pong Sep 22 13:53:33 jonwil: could you "beautify" a bit that function that fails on me (sub_C15C) Sep 22 13:54:14 like - correct variable types, mapped variables, etc Sep 22 13:58:41 jonwil: NMProviderCachedTile struct is what yuu need Sep 22 13:58:47 *you Sep 22 14:01:08 Try this to get it to not fail: Go to the function that fails and then go to edit-other-reset decompiler type information. tick all boxes except "global objects" then go into that function and see where it calls another function and decompile all of them that it calls. That should make it work Sep 22 14:01:49 jonwil: wait, maybe my hexrays is old, it is version v1.7.0.120531 Sep 22 14:02:21 nope, thats the one I have Sep 22 14:02:29 yeah Sep 22 14:02:31 ok, will try Sep 22 14:03:47 nope, didn't help Sep 22 14:04:39 damn, wierd Sep 22 14:05:09 could it be because I run IDA through wine? Sep 22 14:05:42 doubt it Sep 22 14:41:11 hi Sep 22 14:42:11 hwho can be tell me about QT4 ? Sep 22 14:43:02 hwho can tell something about QT4, the libqt4-* ? Sep 22 14:46:06 i try to install achess game from extras-devel , on my nokia n900 Sep 22 14:51:27 nobody can tell you anything if you don't ask. Sep 22 14:57:10 hehe thx u Sep 22 14:57:15 so Sep 22 14:57:41 i try to install chess game (miniature) Sep 22 14:59:25 and when i try it told me impossible , and problem from this files Sep 22 14:59:56 libQT4-* etc... Sep 22 15:00:48 how can i download library : Sep 22 15:00:52 ? Sep 22 15:03:31 CapsuL: reason of not possible? Sep 22 15:03:36 ups... Sep 22 15:07:15 Nin101 , can u help me ? Sep 22 15:10:22 CapsuL: I remember having a problem with miniature and Qt. Sep 22 15:11:40 yes , other too .. Sep 22 15:12:19 and right now it's not working for me either Sep 22 15:13:14 if u Sep 22 15:13:33 are mor information about solution... Sep 22 15:13:43 and it's not important for me, you can only play on FICS with it, not against an engine on the phone, and it lacked some features iirc. Sep 22 15:35:37 same for install whireshark aon my nokia .. impossible | Sep 22 15:51:28 CapsuL: It possibly depends on CSSU Sep 22 15:51:53 ~pkg Sep 22 15:51:54 methinks pkg is http://maemo.org/packages/ Sep 22 15:52:30 okok thx , i will ne check that Sep 22 15:59:44 CapsuL: It says on the package page that it is "aimed for MeeGo". From a quick look, it seems to need a later version of Qt than other Maemo Qt applications. Sep 22 16:01:04 ok , i am with nokia n900 naemo .. Sep 22 16:01:54 nameo?? Sep 22 16:02:08 when i download package file from website , where i put it ? Sep 22 16:03:16 maemo :) Sep 22 16:04:48 Use the application manager to install updates. Yes, I know you are on Maemo (N900) ;) Sep 22 16:04:59 CapsuL: apt-get install Sep 22 16:05:01 Thats what men use Sep 22 16:05:10 Be a man! Sep 22 16:05:15 guis are for girls Sep 22 16:05:40 Plus, HAM is so slow, that it'll make you hate life Sep 22 16:05:52 no work .. Sep 22 16:06:05 not when they do extra things, Maemo isn't Debian/Ubuntu Sep 22 16:06:13 CapsuL: What did you download from a website, a .deb file? Sep 22 16:06:26 Like what sixwheeledbeast, what can HAM do that apt-get cannot? Sep 22 16:06:36 ~hamvsfam Sep 22 16:06:40 it has been said that hamvsfam is https://mg.pov.lt/maemo-irclog/%23maemo.2013-10-28.log.html#t2013-10-28T10:44:33, or http://talk.maemo.org/showthread.php?t=93227 Sep 22 16:06:50 nothing for the moment , i will go check wich one before Sep 22 16:08:42 stryngs: see the last link - update failure recovery, domains, install scripts. Sep 22 16:09:45 apt handles conflicts properly from waht i've seen, i'll be interested to grab the aforementioned package and see what happens Sep 22 16:13:07 I think the log is more about fapman default autoremove which is quite broken in maemo Sep 22 16:13:27 you may end up with half of the system removed because deps are borked Sep 22 16:13:47 "everything comes with the meta package" Sep 22 16:14:14 * stryngs has used apt-get since day 1 and never had any issues. Sep 22 16:14:30 as long as u don't do dist-upgrade life is good Sep 22 16:14:34 at least in my case. Sep 22 16:14:40 same here but I dont autoremove, neither dist-upgrade Sep 22 16:14:48 i autoremove as well Sep 22 16:15:02 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded. Sep 22 16:15:27 * stryngs cuddles his n900 gently Sep 22 16:15:57 :) Sep 22 16:16:15 But..... I am different than most users in here. I do not use CSSU Sep 22 16:16:19 I do rock kp-52 Sep 22 16:16:22 =) Sep 22 16:16:22 Ham is for *********** Sep 22 16:16:23 apt is what i love on linux Sep 22 16:16:29 * stryngs hugs Nokiabot Sep 22 16:16:35 Preach it Sep 22 16:16:40 :-) Sep 22 16:16:55 stryngs: no cssu ? why ? Sep 22 16:16:56 * stryngs still has the original screen protector on his n900 Sep 22 16:17:07 Because it screws up permissions for progs that require root Sep 22 16:17:12 i.e. Sep 22 16:17:17 pwnphone style n900 Sep 22 16:18:09 To expand a bit, apt cannot remove 'user/hidden' category files only HAM can. Many have use apt without an issue, but it is not the recommend way to install packages in Maemo. Sep 22 16:18:29 CSSU also make no difference Sep 22 16:18:53 cssu does make differences sixwheeledbeast. Half of the programs/scripts I ran prior to cssu that had no issue, have issues with cssu Sep 22 16:18:54 In fact the latest CSSU will soo rock speedyHAM Sep 22 16:19:07 But its no worries. My n900 performs just fine Sep 22 16:19:10 No cssu need here =) Sep 22 16:19:16 Oo stryngs m a rookie but still i dint nuke via apt dpkg tar xvzf purge :) Sep 22 16:19:31 wha Nokiabot ? Sep 22 16:19:43 yeah, who needs to upgrade openssl Sep 22 16:19:47 Now.... Once I obtain a 2nd n900, i might get into figuring out why cssu jacks stuff up Sep 22 16:19:50 haha Sep 22 16:19:54 compile it yerself perhaps kerio ? Sep 22 16:19:55 I do Sep 22 16:20:04 good job Sep 22 16:20:12 Well that's up to you. If you have issues with anything in CSSU Stable then it need reporting. It is bascally compatible wih all Maemo systems. Sep 22 16:20:12 Half the packages in the repos are out of date. Most packages arent there. etc... Sep 22 16:20:34 I plan to sixwheeledbeast. Once I obtain a 2nd n900 and I don't have to walk around with a half-working pwnphone. Sep 22 16:20:40 stryngs: do you maintain your own repo ? Sep 22 16:20:43 I do Sep 22 16:21:02 but due to current licensing issues, i dont have it public anymore Sep 22 16:21:09 As well, i build .debs very unconventially Sep 22 16:21:20 It's not the "proper" way and people pitch a fit Sep 22 16:21:21 with checkinstall ? :p Sep 22 16:21:25 I stopped carring so, f em =) Sep 22 16:21:26 Nope Sep 22 16:21:29 grab source Sep 22 16:21:30 ./configure Sep 22 16:21:31 make Sep 22 16:21:34 oh, ok :) Sep 22 16:21:36 make install ~/foo Sep 22 16:21:37 I see Sep 22 16:21:38 cd foo Sep 22 16:21:39 mkdir DEBIAN Sep 22 16:21:47 echo > DEBIAN/control Sep 22 16:21:51 add what u need to control Sep 22 16:21:51 cd .. Sep 22 16:22:00 dpkg-deb -b foo . Sep 22 16:22:01 done Sep 22 16:22:05 which reminds me I still cant build some scim package Sep 22 16:22:20 taken straight from extra with maemo-sdk/sb Sep 22 16:22:22 make install DESTDIR=~/foo Sep 22 16:22:25 rather Sep 22 16:22:35 yeah, got you there Sep 22 16:22:54 like for instance Sep 22 16:23:05 somebody tell me where to grab lorcon for the n900 Sep 22 16:23:05 quick Sep 22 16:23:08 * stryngs waits Sep 22 16:23:26 * stryngs waits indefinately and then realizes he can dpkg -i it =) Sep 22 16:23:41 if yer interested in some neat debs bencoh I'm happy to share them with ya Sep 22 16:23:46 ive got about 24 Sep 22 16:23:47 or so Sep 22 16:24:47 * stryngs also builds his .debs natively and does compiling natively. No sandbox nonsense in this n900 users world. Sep 22 16:25:12 meh :D Sep 22 17:58:38 CapsuL: perhaps post a log of your error .. miniature has been working ok on my N900 Sep 22 19:39:43 M4rtinK: what do you think about http://pastebin.com/cgQHZ3EW ? Not finished yet, but the idea is clear IMO Sep 22 19:42:18 freemangordon: looks good :) Sep 22 19:43:28 BTW, any plans for supporting non Ovi/Here tile sources ? Sep 22 19:43:37 I can point to you some if needed :) Sep 22 19:43:56 I was thinking about it, this should be yeasy to be implemented Sep 22 19:44:21 but lets first have it working with ovi Sep 22 19:45:06 sure, just some ideas for the future :) Sep 22 19:45:17 yep Sep 22 19:45:37 for sure I will include osm once it works Sep 22 20:08:17 there are some really nice layers other than the default ones Sep 22 20:08:30 like transparent hill shading Sep 22 20:08:35 or public transport :) Sep 22 22:33:47 M4rtinK: any idea how to calculate edges long/lat of the resulting static map (or whatever you called it)? Sep 22 22:46:22 freemangordon: should be doable :) Sep 22 22:48:33 freemangordon: this: https://github.com/M4rtinK/modrana/blob/master/modules/mod_projection.py#L206 Sep 22 22:49:15 freemangordon: or this: https://github.com/M4rtinK/modrana/blob/master/modules/mod_projection.py#L314 Sep 22 22:49:44 thanks, will try it Sep 22 22:52:12 you're welcome :) **** ENDING LOGGING AT Tue Sep 23 03:00:00 2014