Android OS Forum banner

Playing in W-never-never-lan today.... *so far fixed my wireless issues*

4304 Views 20 Replies 12 Participants Last post by  blackadept
*EDIT* So far its staying persistant. MAC and all other wireless settings have not changed since this. Also, performance increased slightely, tho this could just be attributed to the ridding of errors rather than an increase to the normalized wifi performance level. Still testing this with different calibration values tho. Also I have been messing with different ini values, hexedits on the nvs and firmware, jar edits, disassemling the proprietary libs/modules, and trying to implement open source/freshly compiled/optimized code. Far from over, but for now atleast it has fixed my wireless issues. Also note I left the init.mapphone_cdma.rc alone after manually executing it (it will automatically revert itself) and also placed the nvs_map.bin in both /pds/wifi and /system/etc/wifi for the time being. *EDIT*

So first couple things.... I am no cvpcs, jt1134, Rev, Razor, Framework, Droidxchat,r2, bmc, sensei, really do I need to go on? lol That said, I am not a complete idiot when it comes to linux and android. I have been modifying and tweaking for a long time on multiple platforms. So please don't think this wall of eye destroying text is going to change the world and/or drop-kick platypuses (platypusi? I think I prefer that version). Just one tired persons rambling on his trip thru tiwlan today (as well as gps too, since well why not), and I'll leave all the other adventures and projects for another day. So just be prepared for a wall of text ....

Ok, so today I noticed something about the wireless.... its more convoluted then an MC Escher painting. Proc's, modules, drivers, init, everything going against each other. Now I knew that the X is a mess in ways due to the locked boot loader, but I wondered if I could maybe do something to simplify the process the same as I did the GPS. Now the gps seemed to share some of the same issues. Proc's and confs being plain or libs conteracting, etc. The end result was lock times that took forever, sometimes 30 secs+....real PITA at times. Well that one was easy actually, well sort of, I looked at other platforms and realized the lto and xtra files were not being used or even downloaded by the X. It was straight .conf baby, so we had to look into that... So I reworked and rewrote the gps.conf, retraced the file layout, changed the supl, changed the host, added new servers, most of the same tweaks you all probably have done. Got me the same result as you I'm guessing..... my lock time for gps is now roughly 1 sec with a max of 3 secs, within that time its viewing and receiving from 9/9-12/12 sattelites, with the link lowest at 24, also accuracy increased from 36ft downb to 20-24 ft. Hmm not, bad, just some manual tweaking.... AND that is without fulling porting over the LTO Xtra functionality.... thats just straight conf/libs/supl/ and hint of gps aid data that is working atm,

So the wireless, well not so much. Between the wpa_supplicant misbehaving or straight up eating itself, 252532523 different modules/drivers/confs/ blah blah all trying to do the same thing, well nothing was really happening I found. I mean, yeah, I had internet, could connect to wireless networks, there was no real issue...yet. See, the problem that I noticed wasn't on a fresh install it was after the same build had been running for awhile. So got me wondering, what would do that. Well biggest would be the driver and module I figured. So, today I decided to look thru logs and dmesg lsmod all the fun crap. Noticed a big issue, the driver wasn't actually working correctly! It was trying to, tryin hard, but failed to initialize properly every time. This failure would cause some of the issues I had been noticing such as MAC yahtzee, inconsistent speeds, connectivity issues, etc. So I decided to force the issue based on what the phone and logs were telling me was happening.

Well first off it was not calibrating, well that ain't cool.... not calibrating means no firmware updates, files missing, errors compiling ontop of errors, and just well no beuno. Problem is this: The calibration of the driver/interface yields you an nvs_map.bin. The nvs in turn completes the wlan_loader's needs to update firmware. All of each play a part in the module/driver/interface properly initializing. Well it wasn't, and it didn' I forced it. Manually calibrated via console:

# wlan_cu -itiwlan0 -b

/ w p 1 l 2 f 2

/ t r h 0 7

/ t b b 375 128 0

/ t b t 1 0 0 0 0 0 0 0



And just like so, bam, freshly calibrated and nvs_map.bin was created. Moved it /system/etc/wifi/ (mv nvs_map.bin /system/etc/wifi) double checked my permissions. Next step: Firmware.

For that we look to the init scripts and a service named wlan_loader located in the /system/bin. The loader is called for in the init.mapphone_cdma.rc file, which is weird as its usually in the straight init.rc..... whatever.

When I tried to manually use the service I would continue to get errors regarding driver initialization, so I checked the format and saw it listed as :

service wlan_loader /system/bin/wlan_loader \
-f /system/etc/wifi/fw_wlan1271.bin -i /system/etc/wifi/tiwlan.ini \
-e /pds/wifi/nvs_map.bin

Seemed odd order and o hey.....the nvs is.....wait why there?! So I changed it up to something a bit more familiar as well as double checking myself as to the order via interwebz. Changed it to:

service wlan_loader /system/bin/wlan_loader \
-e /system/etc/wifi/nvs_map.bin \
-f /system/etc/wifi/fw_wl1271.bin \
-i /system/etc/wifi/tiwlan.ini

with this I manually re-proc'd the init.mapphone via root explorer. Didn't work completely awesometastically as it created a mess and mostly didn't work, and why would it.... supposed to be on boot, not after. But one key thing was as I had turned off wifi, it DID reproc that setup. So I turned wifi back on and it kicks off. Fully starts, it checks its firmware, it updates and upgrades its firmware, module kicks in with kernel, nvs creates proper MAC, and its working awesome..... until reboot. Change doesn't stay persistent. So I took the chance and made some changes to tthe tiwlan.ini I had wanted to.... redid the procedure....same effect. Gold. Until reboot, where it reverts. Which is where I am at currently, trying to make it persistant. Been mucking around other sources affecting it as well, but didn't really go to crazy trying to figure it out tonight....its late lol.

What I am thinking, and going to try first, is from ground up. The wlan is originally made during system image creation via a few different files:

-libs/kos/sos etc......

-the file is what sets a lot of the values and actually enables the wl1271 in a way. As well as the wl1271 board.

-the init.rc is well....the init.rc lol. We already saw how its affected. However, being made this way from CREATION might make it more stable as well as persistant I am wondering.....

-WLAN well..... ummm yeah, need I go there? Its a lil important to how the build works :wink2:
dhcpcd, wpa_supplicant, wlan_loader,..... etc etc

-As well as a few others.....bluetooth setup affects it, as well as the OMAP setup, stuff like that.

So that's where I got with it today.... got it fully functioning, sans bugs, calibrated, updated, zooming around like a fat kid chasing after a cupcake..... but can't get it to stay persistant.....persistently lmao.

Now, there are other easier routes to take then a full rrebuild from source. But some of the other stuff I have been working on really would work better if mixed in from scratch. Webkit and skia optimizing and tweaking for internet, this stuff, fully trying to work in LTO/Xtra compat, launcher tweaks, I/O optimizing, SQLite modification, etc etc..... Hence, the jump all the way in the pool for a swim as opposed to playing around with init scripts or symlinks. So theres that, and for those that made it all the way to the end, im kinda impressed, thats A LOT of text ... and didn't talk about any of the other projects really.... sorry, lol, im tired lmao, if curious about anything please feel free to ask whenever however, I don't mind. I'll post periodically about where everything is at if folks want it, otherwise I'll keep the text-luge away lol.
See less See more
  • Like
Reactions: 5
1 - 1 of 21 Posts
Excellent write-up. Most of it was absolutely beyond me, but I still like this kind of thing. So the nvs_map.bin is created from scratch from the first set of commands, which is obviously essential for those with the MAC address probelm, but what is the purpose of all of the firmware stuff? Is there any advantage for those of us not currently affected by the MAC bug? I like to get everything as streamlined and speed bump-free as possible.

Also, you mentioned work that you did on the GPS. Again, are there any improvements to be gained by other users by implementing your process?
1 - 1 of 21 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.