Android with Wifi Thread - Cooler wifi - Tilt, TyTN II, MDA Vario III Windows Mobile ROM De

Update:
handsets are becoming very hot when wifi is used, you can make them use less power by using the rootfs.img provided, changes where made to tiwlan.ini during testing which keeps the wifi on active even when not in use, this version has reverted the changes and now power saving can be used once more.
http://drop.io/coolerwifikaiser
Aims:
Wakelocks?
Looks like this thread has served its purpose

Wow, are you actually doing all of these commands through the phone? >_<
I really want to see wifi rollin on android too, can't wait to load the ol' Tilt up with it.

the '-f' option
Hi,
a short question, you wrote...
Code:
'wpa_supplicant -f -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf &'
...and I've allready seen this in different ohter posts, but I don't know what the '-f' option effects.
I allready browsed the manpages an this option ins't listed. I just tried the command without this statement and it also worked (but did not create the output '-Dtiwlan0' to '/data/local/tmp'). But wlan also doesn't work...

For Polaris users who might need this info:
First things first, make sure wlan works in Windows Mobile. This seems to be the procedure for getting the wlan into do something in Android. It seems to be very similar to the wifi tethering guides on the G1.
Custom Kernel
We need a kernel, the kernel config produced by make vogue_defconfig ARCH=arm leaves the wireless extensions disabled, so this might the cause of the missing mac address in ifconfig. Current attempts to produce a kernel with these extensions have caused the settings dialogues and ifconfig to hang, Ctrl+C does not force an exit. I'll continue to investigate this.
Tiwlan kernel module
I've found another version of the tiwlan driver, other than the one that is currently in git master which loads the firmware and gives the ok - OK
Download Update: This driver skipped checks, ignore it
so lets see if we can merge this with the newer driver to get a working one.
Initial Variables
Code:
setprop wifi.interface tiwlan0
WLan Commands
Modprobe Method:
Code:
mkdir -p /lib/modules/`uname -r`
cp /sdcard/wlan.ko /lib/modules/`uname -r`/
Insmod Method:
Code:
insmod /sdcard/wlan.ko
Tiwlan0 Mac address: No
Required Output: TIWLAN: Driver loaded
WLAN_Loader
Code:
wlan_loader -f /sdcard/Fw1251r1c.bin -e /proc/calibration -i /sdcard/tiwlan.ini
Tiwlan0 Mac address: No
Required Output: Set property wlan.driver.status = ok - Ok
ifconfig -a might need to show a mac address at this point, i'm still not sure when ifconfig -a gets the mac address info
Code:
wpa_supplicant -ddK -Dtiwlan0 -itiwlan0 -c/sdcard/wpa_supplicant.conf &
ifconfig -a must show a mac address or the next step will error out, you can assign one using the following command, just change it to mac address you see in windows. However simply assigning one with this command might not be enough, it could be the sign of a bigger problem.
Code:
ifconfig tiwlan0 hw ether 00:00:00:00:00:00
Code:
ifconfig tiwlan0 192.168.1.100 netmask 255.255.255.0
ifconfig tiwlan0 up
Log Collecting:
Dmesg - Its a ring buffer so as new info is added old info will be removed, you need to run the command right after insmod or modprobe to see if it worked ok.
Code:
[B]dmesg|grep -i wlan[/B]
TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
TIWLAN: Driver initialized (rc 0)
TIWLAN: 1251 PG [B]1.1[/B]
TIWLAN: Driver loaded
If i'm right The kaiser has 1.1. the G1 has 1.2, its a reference to the chip used.
Logcat
You can run logcat at the start to keep a log of everything the machine has done since android has started. If you run it like this it will keep logging to the file as you run other commands so when you boot back to WM and sync you can open the file in an editor like Notepad++ and see what happened. This is the first thing i run when i get to the root shell
Code:
logcat -f /sdcard/debuglog.txt &
After running the wlan_loader you can run this to check it worked ok:
Code:
[B]grep -i 'wlan' /sdcard/debuglog.txt[/B]
D/wlan_loader( 395): adapter tiwlan0, eeprom /proc/calibration, init /sdcard/tiwlan.ini, firmware /sdcard/Fw1251r1c.bin
D/wlan_loader( 395): Configuring adapter
D/wlan_loader( 395): Adapter configuration rc = 0
D/wlan_loader( 395): Starting configMge
D/wlan_loader( 395): ConfigMge start rc = 0
D/wlan_loader( 395): Driver configured
D/wlan_loader( 395): Firmware loaded and running OK
D/wlan_loader( 395): Set property wlan.driver.status = ok - Ok
i did once end up with the ok - Ok but it was hit and miss, and i've ended up with all sorts from ok - Fail to fail - Ok to fail - Fail but ifconfig has never shown a mac address on its own
Email to...
The terminal emulator in android should have an option in the menu to email everything you've seen to an email address, use that to keep logs of the entire session. Better terminal has this feature, but it stopped working, try
Files
Fw1251r1c.bin
The firmware filenames of the G1 and the Kaiser have the same name. So we should get a list of good kaiser firmware to rule firmware issues out as soon as possible. If you can connect in windows mobile to a wpa secured AP then the Fw1251r1c.bin in the windows folder on the rom should be the one you are using in Android.
File, Size in bytes, MD5SUM, Source
Fw1251r1c.bin, 185388, ebf5c2036d37bc56b4d41ddcbda4311e, 6.1 WWE ROM shifu, Download
tiwlan.ini
Lets get a good tiwlan.ini file, so we know if its causing issues.
Values:
Comming Soon...
wpa_supplicant.conf
Code:
ctrl_interface=tiwlan0
ap_scan=1
eapol_version=1
fast_reauth=1
eapol_version=1
update_config=1
network={
ssid="WIFISSID"
...
priority=1
}
-------------------------------------------------------------------------------------
Quick Scripts:
Its hard to type long commands on the keyboard so here are some scripts to help:
Code:
[B]/sdcard/cmd1[/B]
#!/bin/sh
echo 'Setting Variables...'
setprop wifi.interface tiwlan0
echo 'Variables Set!'
echo 'Logging to /sdcard/debuglog.txt...'
pkill logcat
logcat -f /sdcard/debuglog.txt &
echo 'Logger Started!'
echo 'Copying WLan Module...'
mkdir -p /lib/modules/`uname -r`
cp /system/lib/modules/wlan.ko /lib/modules/`uname -r`/
echo 'Module Coppied!'
echo 'Loading Module...'
modprobe wlan
lsmod
echo 'Module Loaded!'
#
Code:
[B]/sdcard/cmd2[/B]
#!/bin/sh
echo 'Running Loader...'
wlan_loader -f /sdcard/Fw1251r1c.bin -e /sdcard/calibration -i /sdcard/tiwlan.ini
echo 'Loder Completed'
echo 'Ifconfig Output'
ifconfig -a
dmesg|grep -i wlan
cat /sdcard/debuglog.txt... |grep -i wlan
#
Output:
$ su
~ # cd /sdcard/
/sdcard # ./cmd1
Setting Variables...
Variables Set!
Logging to /sdcard/debuglog.txt...
Logger Started!
Copying WLan Module...
Module Coppied!
Loading Module...
wlan 584168 0 - Live 0xbf000000
Module Loaded!
/sdcard # ./cmd2
Running Loader...
Loder Completed
Ifconfig Output
tiwlan0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[ 96.701234] TIWLAN: Driver loading
[ 97.593872] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
[ 97.599251] TIWLAN: Driver initialized (rc 0)
[ 97.599511] TIWLAN: 1251 PG 1.1
[ 97.599547] TIWLAN: Driver loaded
D/wlan_loader( 518): adapter tiwlan0, eeprom /sdcard/calibration, init /system/etc/wifi/tiwlan.ini, firmware /sdcard/Fw1251r1c.bin
D/wlan_loader( 518): Configuring adapter
D/wlan_loader( 518): Adapter configuration rc = 0
D/wlan_loader( 518): Starting configMge
D/wlan_loader( 518): ConfigMge start rc = 0
D/wlan_loader( 518): Driver configured
D/wlan_loader( 518): Firmware loaded and running OK
D/wlan_loader( 518): Set property wlan.driver.status = ok - Ok

thanks,
how did you manage that configMge doesn't fail on start? I still get 'rc = -1'. Did you build a new 'wlan.ko' with the Kernelsource from git (Vogue/Kaiser)? And what firmware are you using (the original or the extracted?)
maybe you can post your files for testing...

toasty_ said:
thanks,
how did you manage that configMge doesn't fail on start? I still get 'rc = -1'. Did you build a new 'wlan.ko' with the Kernelsource from git (Vogue/Kaiser)? And what firmware are you using (the original or the extracted?)
maybe you can post your files for testing...
Click to expand...
Click to collapse
Its either the variable being set or modprobe being used that does the trick, so try those, i'm in the middle of compiling a newer kernel to see if it works better

Thx for the short Tutorial and the scripts. Unfortunately I still get the message:
Code:
'ConfigMge start rc = -1'
I think the reason is the (my) wlan.ko module - it shows following message/warning while loading (insmod and modprobe)
Code:
wlan: version magic '2.6.25-00818-gf668526 preempt mod_unload ARMv6 ' should be '2.6.25-00832-g42c5da5 preempt mod_unload ARMv6'
but its loaded...
especialy lsmod gives me another value for the second number (think the allocated memory):
Code:
wlan 583852 0 - Live 0xbf000000
I use the firmware from '3.34.shifuv11F WWE':
Size: 185388 byte
MD5: ebf5c2036d37bc56b4d41ddcbda4311e
dmesg:
Code:
[ 114.718730] TIWLAN: Driver loading
[ 115.079288] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
[ 115.084840] TIWLAN: Driver initialized (rc 0)
[ 115.084952] TIWLAN: Driver loaded
[ 122.852419] TIWLAN: TIWLAN: Failed to start config manager
logcat:
Code:
D/wlan_loader( 444): adapter tiwlan0, eeprom /proc/calibration, init /sdcard/wlan/tiwlan.ini, firmware /sdcard/wlan/Fw1251r1c.bin
D/wlan_loader( 444): Configuring adapter
D/wlan_loader( 444): Adapter configuration rc = 0
D/wlan_loader( 444): Starting configMge
D/wlan_loader( 444): ConfigMge start rc = -1
D/wlan_loader( 444): Driver configuration failed (-1)
E/wlan_loader( 444): init_driver() failed
D/wlan_loader( 444): Set property wlan.driver.status = failed - Ok
can you tell me what wlan.ko you are using - maybe a link...

Upon further investigation it turns out that a specific version of the firmware and a compatible wlan.ko are needed to get it to work, i'm rolling up a fresh system.img to test now, i'll post it if it works

http://forum.xda-developers.com/showthread.php?p=4231219

toasty_ said:
Thx for the short Tutorial and the scripts. Unfortunately I still get the message:
Code:
'ConfigMge start rc = -1'
I think the reason is the (my) wlan.ko module - it shows following message/warning while loading (insmod and modprobe)
Code:
wlan: version magic '2.6.25-00818-gf668526 preempt mod_unload ARMv6 ' should be '2.6.25-00832-g42c5da5 preempt mod_unload ARMv6'
but its loaded...
especialy lsmod gives me another value for the second number (think the allocated memory):
Code:
wlan 583852 0 - Live 0xbf000000
I use the firmware from '3.34.shifuv11F WWE':
Size: 185388 byte
MD5: ebf5c2036d37bc56b4d41ddcbda4311e
dmesg:
Code:
[ 114.718730] TIWLAN: Driver loading
[ 115.079288] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
[ 115.084840] TIWLAN: Driver initialized (rc 0)
[ 115.084952] TIWLAN: Driver loaded
[ 122.852419] TIWLAN: TIWLAN: Failed to start config manager
logcat:
Code:
D/wlan_loader( 444): adapter tiwlan0, eeprom /proc/calibration, init /sdcard/wlan/tiwlan.ini, firmware /sdcard/wlan/Fw1251r1c.bin
D/wlan_loader( 444): Configuring adapter
D/wlan_loader( 444): Adapter configuration rc = 0
D/wlan_loader( 444): Starting configMge
D/wlan_loader( 444): ConfigMge start rc = -1
D/wlan_loader( 444): Driver configuration failed (-1)
E/wlan_loader( 444): init_driver() failed
D/wlan_loader( 444): Set property wlan.driver.status = failed - Ok
can you tell me what wlan.ko you are using - maybe a link...
Click to expand...
Click to collapse
So you'll have to compile a custom kernel, then a custom wlan.ko before you try this. I have also uploaded the wifi firmware, a link is in the first post

Custom Kernel:
I use the Kernelsources from git ("git.linuxtogo.org", vogue branch). I also tried to build the 'wlan.ko' from Android-source (I set 'KERNEL_DIR' to the Folder of my Kernel source). If I run make I get some errors because of missing include-files.
//Edit: just made symlink to arm-msm
If I'm home on weekend I try to build a new wlan.ko for my kernel. Is there anything, that needs to be patched for kernel 2.6.25?
btw. I found this page http://www.johandekoning.nl/index.php, there are some information about wlan and firmware loading issues (for the G1, but nearly the same problemes)

I didn't do anything special to get a wlan.ko, just compiled it as normal:
Code:
KERNEL_DIR=/Android/kernel make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Current status from error log:
Code:
D/wlan_loader( 406): adapter tiwlan0, eeprom /proc/calibration, init /system/etc/wifi/tiwlan.ini, firmware /system/etc/wifi/Fw1251r1c.bin
D/wlan_loader( 406): Configuring adapter
D/wlan_loader( 406): Adapter configuration rc = 0
D/wlan_loader( 406): Starting configMge
D/wlan_loader( 406): ConfigMge start rc = 0
D/wlan_loader( 406): Driver configured
D/wlan_loader( 406): Firmware loaded and running OK
D/wlan_loader( 406): Set property wlan.driver.status = ok - Ok
D/dalvikvm( 161): GC freed 11747 objects / 572968 bytes in 363ms
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2]
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1]
D/SettingsWifiEnabler( 390): Received wifi state changed from Enabling to Enabled
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2]
V/WifiMonitor( 161): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1]
[B]D/WifiHW ( 161): 'DRIVER RSSI' command timed out.[/B]
[B]D/WifiHW ( 161): 'DRIVER LINKSPEED' command timed out.[/B]
[B]D/WifiHW ( 161): 'DRIVER MACADDR' command timed out.[/B]
V/WifiStateTracker( 161): Connection to supplicant established, state=INACTIVE
[B]D/WifiHW ( 161): 'DRIVER RXFILTER-ADD 0' command timed out.[/B]
[B]D/WifiHW ( 161): 'DRIVER BTCOEXSCAN-STOP' command timed out.[/B]
V/WifiStateTracker( 161): Changing supplicant state: INACTIVE ==> SCANNING
I/WindowManager( 161): Setting rotation to 1, animFlags=1
I/WindowManager( 161): Config changed: { scale=1.0 imsi=0/0 locale=en touch=3 key=2/1/1 nav=1 orien=2 }
[B]D/WifiHW ( 161): 'DRIVER SCAN-PASSIVE' command timed out.[/B]
V/WifiStateTracker( 161): Changing supplicant state: SCANNING ==> INACTIVE
V/WifiStateTracker( 161): Changing supplicant state: INACTIVE ==> SCANNING
V/WifiStateTracker( 161): Changing supplicant state: SCANNING ==> INACTIVE
W/WindowManager( 161): Window freeze timeout expired.
W/WindowManager( 161): Force clearing orientation change: Window{43120508 StatusBar paused=false}
[B]D/WifiHW ( 161): 'SCAN_RESULTS' command timed out.[/B]
D/StatusBar( 161): updateResources
I/WindowManager( 161): Config changed: { scale=1.0 imsi=0/0 locale=en touch=3 key=2/1/2 nav=1 orien=2 }
D/dalvikvm( 161): GC freed 5792 objects / 384744 bytes in 220ms
D/StatusBar( 161): updateResources
[B]D/WifiHW ( 161): 'LIST_NETWORKS' command timed out.[/B]
W/SurfaceFlinger( 161): timeout expired mFreezeDisplay=1, mFreezeCount=1
W/WindowManager( 161): App freeze timeout expired.
W/WindowManager( 161): Force clearing freeze: AppWindowToken{43358af8 token=HistoryRecord{43358808 {com.android.settings/com.android.settings.wifi.WifiSettings}}}
D/WifiHW ( 161): 'STATUS' command timed out.
D/dalvikvm( 161): GC freed 946 objects / 43184 bytes in 188ms
D/dalvikvm( 317): GC freed 356 objects / 32824 bytes in 105ms
D/WifiHW ( 161): 'DRIVER RSSI' command timed out.
W/WindowManager( 161): Key dispatching timed out sending to com.android.settings/com.android.settings.wifi.WifiSettings
W/WindowManager( 161): Dispatch state: null
W/WindowManager( 161): Current state: {{null to Window{4335b828 com.android.settings/com.android.settings.wifi.WifiSettings paused=false} @ 1247587631205 lw=Window{4335b828 com.android.settings/com.android.settings.wifi.WifiSettings paused=false} [email protected] fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4335b828 com.android.settings/com.android.settings.wifi.WifiSettings paused=false}}}
I/ActivityManager( 161): ANR (application not responding) in process: com.android.settings
I/ActivityManager( 161): Annotation: keyDispatchingTimedOut
I/ActivityManager( 161): CPU usage:
I/ActivityManager( 161): Load: 5.21 / 3.21 / 1.36
I/ActivityManager( 161): CPU usage from 9963ms to 28ms ago:
I/ActivityManager( 161): system_server: 8% = 7% user + 0% kernel
I/ActivityManager( 161): com.android.alarmclock: 1% = 1% user + 0% kernel
I/ActivityManager( 161): com.android.phone: 0% = 0% user + 0% kernel
I/ActivityManager( 161): loop0: 0% = 0% user + 0% kernel
I/ActivityManager( 161): rild: 0% = 0% user + 0% kernel
I/ActivityManager( 161): android.process.acore: 0% = 0% user + 0% kernel
I/ActivityManager( 161): com.android.inputmethod.latin: 0% = 0% user + 0% kernel
I/ActivityManager( 161): android.process.media: 0% = 0% user + 0% kernel
I/ActivityManager( 161): TOTAL: 8% = 7% user + 1% kernel + 0% irq

toasty_ said:
Custom Kernel:
I use the Kernelsources from git ("git.linuxtogo.org", vogue branch). I also tried to build the 'wlan.ko' from Android-source (I set 'KERNEL_DIR' to the Folder of my Kernel source). If I run make I get some errors because of missing include-files.
If I'm home on weekend I try to build a new wlan.ko for my kernel. Is there anything, that needs to be patched for kernel 2.6.25?
btw. I found this page http://www.johandekoning.nl/index.php, there are some information about wlan and firmware loading issues (for the G1, but nearly the same problemes)
Click to expand...
Click to collapse
Sorry, my mistake, i did in fact have a different driver version. I have uploaded it, check the first post. This driver does not seem to work and will need to be modified.

thanks for the files, where did you get them? Compiling worked without any failure (just had to create a symlink to 'arch-msm'
it seem as if the firmware is loaded (on my phone it only works with the fw of the G1). I think it is realiy loaded because you get 'failed - OK' if you try to load it a 2nd time.
by the way have you extraced wlan-eeprom ('/proc/calibration') http://projects.linuxtogo.org/tracker/index.php?func=detail&aid=32&group_id=37&atid=273

toasty_ said:
thanks for the files, where did you get them? Compiling worked without any failure (just had to create a symlink to 'arch-msm'
it seem as if the firmware is loaded (on my phone it only works with the fw of the G1). I think it is realiy loaded because you get 'failed - OK' if you try to load it a 2nd time.
by the way have you extraced wlan-eeprom ('/proc/calibration') http://projects.linuxtogo.org/tracker/index.php?func=detail&aid=32&group_id=37&atid=273
Click to expand...
Click to collapse
Yes, i have extracted my eeprom file and i have found my mac address in there 3 times, which seems strange. I found the area which has the same start as the carlibration of a G1 (found here) and extracted a chunk to get the same size file. I tried it but it doesn't seem to make a difference. Maybe the data is read after the point at which we are having errors?

So I've played a bit around with the files. At the moment the driver is loaded and the firmware is accepted. But the wlan adapter still doesn't get a Mac.
Btw. if you take a look at the eeprom-file you find the MAC from Offset 0x5C to 0x61 in reverse order. Would be interesting the G1 eeprom-file looks like. Maybe somebody can 'cat /proc/calibration > /sdcard/calibration.bin'.
//***OK nearly the same as you said - should write faster***//
OK, yes found the offset in my file, but the its a bit different
Code:
G1:
02 11 56 06 1C 06 01 16 60 03 07 01 09 56 12 00 00 00 01 0D 56 40
Kaiser:
02 11 56 06 1C 06 [COLOR="Red"]00[/COLOR] 16 60 03 [COLOR="Red"]02[/COLOR] 01 09 56 12 00 00 00 01 0D 56 40

Ah, i made a mistake, still need to find where the contents of calibration are in the rom dump

Ok in romdump there are some more Offsets (0x243E5C8, 0x2500040, 0x2500840, 0x2520040 from full rom-dump) that have nearly the same byte order
But only in 0x2500840 and 0x2500040 my MAC is included --> I've checked with 'diff' both extracted Offsets (752 Byte) and they are same

toasty_ said:
So I've played a bit around with the files. At the moment the driver is loaded and the firmware is accepted. But the wlan adapter still doesn't get a Mac.
Btw. if you take a look at the eeprom-file you find the MAC from Offset 0x5C to 0x61 in reverse order. Would be interesting the G1 eeprom-file looks like. Maybe somebody can 'cat /proc/calibration > /sdcard/calibration.bin'.
//***OK nearly the same as you said - should write faster***//
OK, yes found the offset in my file, but the its a bit different
Code:
G1:
02 11 56 06 1C 06 01 16 60 03 07 01 09 56 12 00 00 00 01 0D 56 40
Kaiser:
02 11 56 06 1C 06 [COLOR="Red"]00[/COLOR] 16 60 03 [COLOR="Red"]02[/COLOR] 01 09 56 12 00 00 00 01 0D 56 40
Click to expand...
Click to collapse
Ok i found the correct location, I searched for 021156061c in the eeprom dump and found it. I haven't had a chance to test this yet. Also another interesting thing to note is that both the kaiser' and G1's mac address started with 00:18 :41

Newbie16 said:
Ok i found the correct location, I searched for 021156061c in the eeprom dump and found it. I haven't had a chance to test this yet. Also another interesting thing to note is that both the kaiser' and G1's mac address started with 00:18 :41
Click to expand...
Click to collapse
yap, my does it too...

Related

compcache - working on emulator

I've seen a few people trying compcache and failing horribly, but it seems to work for me.
Build instructions, still raw, not tested on actual device only on emulator (left my phone at work...). I've only tested for a few minutes, but I've seen none of the "horrible crashing the second I swapon" I've seen reported elsewhere.
NOTE THAT /data IS A DUMB PLACE TO PUT KERNEL MODULES, but it's on the emulator for me so I couldn't care less, and that location was rw to begin with
Code:
cd ~/compcache
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- KERNEL_BUILD_PATH=/home/neuron/android-kernel/new/goldfish
emulator -avd CupcakeVM01 -kernel arch/arm/boot/zImage show-kernel -shell
#In compcache directory:
adb push sub-projects/allocators/xvmalloc-kmod/xvmalloc.ko /data
adb push ramzswap.ko /data
#In kernel directory:
adb push lib/lzo/lzo_compress.ko /data
adb push lib/lzo/lzo_decompress.ko /data
#Download and push busybox:
http://benno.id.au/blog/2007/11/14/android-busybox
adb push busybox /data
adb shell
insmod xvmalloc.ko
insmod lzo_decompress.ko
insmod lzo_compress.ko
insmod ramzswap.ko
chmod 744 /data/busybox
cat /proc/devices
- mknod with same block device id
/data/busybox mknod /dev/ramzswap0 b 254 0
#missing priority, wont be needed unless you have swapper too
/data/busybox swapon /dev/ramzswap0
# cat /proc/swaps
Filename Type Size Used Priority
/dev/ramzswap0 partition 23540 204 -1
# cat /proc/ramzswap
DiskSize: 23544 kB
NumReads: 12
NumWrites: 42
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 3
GoodCompress: 97 %
NoCompress: 2 %
PagesStored: 39
PagesUsed: 8
OrigDataSize: 156 kB
ComprDataSize: 28 kB
MemUsedTotal: 32 kB
I just built this (with some tips from cyanogen) for the compcache author, so he could have a way of reproducing the problem locally to solve it, but I cant seem to find any problem .
I've tested opening a ton of apps, switching between em, and suspending the phone.
Tested on :
cupcake 1.5 emulator
kernel goldfish 2.6.27
latest compcache (not svn)
armv5 compiler
Very basic quick copy&paste info on kernel choice:
Code:
mkdir ~/android-kernel
cd ~/android-kernel
wget http://www.codesourcery.com/sgpp/lite/arm/portal/package3696/public/arm-none-linux-gnueabi/arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -O arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
tar xjf arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
export PATH=~/android-kernel/arm-2008q3/bin:$PATH
> >> git clone git://android.git.kernel.org/kernel/common kernel-common
> >> cd kernel-common
> >> git branch goldfish origin/android-goldfish-2.6.27
> >> git checkout goldfish
make goldfish_defconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
- enable loadable modules + lzo
make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
make modules ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Well thats a big WTF. I can 100% confirm that it does not work on a regular G1, on neither the 2.6.27 nor the 2.6.29 kernel. Guess the compcache author needs to get himself a G1
Could be an issue with one of the kernel modules that isn't on the emulator I suppose.
On a bright note I can throw in that GoodCompress stays fairly high when swapping between normal android apps, so when we do get it working it's gonna be good
//edit, cyanogen can you send me your kernel .config and any custom patches? And what kernel tree/compiler are you on?
It could be compiler related.
nurre said:
Could be an issue with one of the kernel modules that isn't on the emulator I suppose.
On a bright note I can throw in that GoodCompress stays fairly high when swapping between normal android apps, so when we do get it working it's gonna be good
//edit, cyanogen can you send me your kernel .config and any custom patches? And what kernel tree/compiler are you on?
It could be compiler related.
Click to expand...
Click to collapse
I use the CodeSourcery toolchain to compile kernels. Right now I'm using the android-msm-2.6.29 branch from Android GIT (with all the new camera stuff reverted because it's broken). The only patches I have applied are the Synaptics multitouch patch and the mtd6 enabler patch. I'm attaching the config from my running device.
Thanks, if I dont toy with this tonight I will do tomorrow
On a side note, doing free -m on a 94mb memory device and seeing 120mb used and free memory available is nice
this would be a revolutionary hack for our devices if we can get this to work, I may go ahead and try compiling it when im free today
I would love to see this working. An additional 20megs or so of free RAM would make a huge difference.
defconoi said:
this would be a revolutionary hack for our devices if we can get this to work, I may go ahead and try compiling it when im free today
Click to expand...
Click to collapse
The question is when not if
//edit, hell if we cant get it to work for long enough I'll start a donate poll for "buy the compcache developer a rooted G1"
http://code.google.com/p/compcache/issues/detail?id=33
reported upstream, now waiting for more info (until I get impatient and start trying myself )
Someone using cyan 3.5 try this if your feeling adventurous. This is sortof a todo list for myself of **** to try. First commands did work for me however, no reboots.
insmod xvmalloc.ko
insmod ramzswap.ko disksize_kb=100
/data/busybox free
cat /proc/swaps
cat /proc/ramzswap
All reports ok, catting ramzswap actually shows GoodCompress 84%, so it is in use.
Things worth testing:
- higher disksize_kb
- if higher disksize_kb fails, try freeing memory before inserting the module and enabling swap (can use a combination of ps and kill to find the memory hoggers).
- echo 100 > /proc/sys/vm/swappiness
//edit, to be specific I'm running cyan 3.5.1 without squashfs.
ok so I couldn't leave this alone, it works with higher swap size as well, but I got a crash after torturing it for a while. Gonna look into it more tomorrow.
Code:
<4>[ 316.945526] send sigkill to 568 (app_process), adj 14, size 4436
<4>[ 324.601165] select 612 (app_process), adj 15, size 4411, to kill
<4>[ 324.601196] send sigkill to 612 (app_process), adj 15, size 4411
<6>[ 346.488891] binder: release 134:323 transaction 6478 in, still active
<6>[ 346.489135] binder: send failed reply for transaction 6478 to 194:505
<6>[ 346.744750] binder: 194 invalid dec strong, ref 1079 desc 17 s 0 w 1
<6>[ 346.754028] binder: 423 invalid dec strong, ref 8585 desc 17 s 0 w 1
<6>[ 346.760559] binder: 585 invalid dec strong, ref 9347 desc 17 s 0 w 1
<6>[ 348.089965] request_suspend_state: wakeup (0->0) at 341189074786 (2009-06-28 19:54:03.283935557 UTC)
<3>[ 348.092315] init: untracked pid 371 exited
<3>[ 348.093719] init: untracked pid 383 exited
<3>[ 348.094207] init: untracked pid 390 exited
<3>[ 348.094635] init: untracked pid 414 exited
<3>[ 348.133636] init: untracked pid 190 exited
<3>[ 348.133911] init: untracked pid 273 exited
<3>[ 348.134277] init: untracked pid 621 exited
<3>[ 348.140106] init: untracked pid 266 exited
<3>[ 348.140563] init: untracked pid 352 exited
<3>[ 348.160003] init: untracked pid 194 exited
<3>[ 348.160461] init: untracked pid 423 exited
<3>[ 348.160705] init: untracked pid 585 exited
<6>[ 381.844940] request_suspend_state: wakeup (0->0) at 374944049146 (2009-06-28 19:54:37.038909917 UTC)
<6>[ 384.697967] binder: release 112:127 transaction 10775 in, still active
<6>[ 384.698333] binder: send failed reply for transaction 10775 to 645:653
<6>[ 385.784729] htc-acoustic: open
<6>[ 385.845764] htc-acoustic: mmap
<6>[ 385.846740] htc-acoustic: ioctl
<6>[ 385.846954] htc-acoustic: ioctl: ACOUSTIC_ARM11_DONE called 678.
<6>[ 385.849548] htc-acoustic: ioctl: ONCRPC_ACOUSTIC_INIT_PROC success.
<6>[ 385.849792] htc-acoustic: release
<6>[ 385.890563] snd_set_device 1 1 1
<6>[ 385.901885] snd_set_volume 0 0 5
<6>[ 385.903289] snd_set_volume 1 0 5
<6>[ 385.912017] snd_set_volume 3 0 5
<6>[ 385.913360] snd_set_volume 2 0 5
<6>[ 386.833923] snd_set_volume 256 0 5
Doesn't seem to work for me. Running cyan 3.5.1 nosquash
Do you need to include these modules?
lzo_decompress.ko
lzo_compress.ko
Code:
# lsmod
lsmod
ramzswap 9648 0 - Live 0xbf007000
xvmalloc 5192 1 ramzswap, Live 0xbf000000
# busybox free
busybox free
total used free shared buffers
Mem: 97848 96272 1576 0 260
Swap: 0 0 0
Total: 97848 96272 1576
# cat /proc/swaps
cat /proc/swaps
Filename Type Size Used Priority
# cat /proc/ramzswap
cat /proc/ramzswap
DiskSize: 100 kB
NumReads: 0
NumWrites: 0
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 0
GoodCompress: 0 %
NoCompress: 0 %
PagesStored: 0
PagesUsed: 0
OrigDataSize: 0 kB
ComprDataSize: 0 kB
MemUsedTotal: 0 kB
#
nurre said:
Someone using cyan 3.5 try this if your feeling adventurous. This is sortof a todo list for myself of **** to try. First commands did work for me however, no reboots.
insmod xvmalloc.ko
insmod ramzswap.ko disksize_kb=100
/data/busybox free
cat /proc/swaps
cat /proc/ramzswap
All reports ok, catting ramzswap actually shows GoodCompress 84%, so it is in use.
Things worth testing:
- higher disksize_kb
- if higher disksize_kb fails, try freeing memory before inserting the module and enabling swap (can use a combination of ps and kill to find the memory hoggers).
- echo 100 > /proc/sys/vm/swappiness
//edit, to be specific I'm running cyan 3.5.1 without squashfs.
Click to expand...
Click to collapse
slightly carried away there and forgot you actually need the swapon instructions as well:
Code:
cat /proc/devices
- mknod with same block device id
busybox mknod /dev/ramzswap0 b 253 0
sync; sync
busybox swapon /dev/ramzswap0
adb logcat info of the device failing would save me some time debugging this
Got it working. I tried with a 16meg ramzswap and it worked for a while then I get crashing apps left and right and finally the phone reboots.
I'm not sure if its related to compcache or not because I experienced the same issue using a regular swapfile on the ext2/3 partition. It took a while for it to crash though. With compcache I can get it to crash in about 10min.
If I used a swap partition, I didn't see any crashes.
Dave
nurre said:
slightly carried away there and forgot you actually need the swapon instructions as well:
Code:
cat /proc/devices
- mknod with same block device id
busybox mknod /dev/ramzswap0 b 253 0
sync; sync
busybox swapon /dev/ramzswap0
adb logcat info of the device failing would save me some time debugging this
Click to expand...
Click to collapse
nurre said:
slightly carried away there and forgot you actually need the swapon instructions as well:
Code:
cat /proc/devices
- mknod with same block device id
busybox mknod /dev/ramzswap0 b 253 0
sync; sync
busybox swapon /dev/ramzswap0
adb logcat info of the device failing would save me some time debugging this
Click to expand...
Click to collapse
Attached you'll find a logcat of 3.5.2 cm build with compcache and apps crashing, hope this helps.
The author has a posted a new version, and it works on android!
I've been testing it and it works. Go try it out.
http://code.google.com/p/compcache/issues/detail?id=33
http://compcache.googlecode.com/issues/attachment?aid=-8516568331917785992&name=arm_test1.tbz2
these modules are compiled for cyanogen's .29 kernel.
copy xvmalloc.ko and ramzswap.ko to /system/sd
Add these lines to your userinit.sh
make sure to disable the sdcard swap..
insmod /system/sd/xvmalloc.ko;
insmod /system/sd/ramzswap.ko;
busybox mknod /dev/ramzswap0 b 253 0;
echo 60 > /proc/sys/vm/swappiness;
swapon /dev/ramzswap0;
What exactly is compcache?
Testing. So far so good! Using cyan 3.6.4.1...
persiansown said:
What exactly is compcache?
Click to expand...
Click to collapse
It uses part of your RAM as a swapfile by using compression, which effectively increases the size of you RAM.
The thinking is that compressing/decompressing from RAM is still faster than swapping to a flash device.
I'm eager to try this out on jachero, but the kernel is slightly different than cyanogen's so these modules don't work. daproy or somebody else has to recompile these modules for that kernel.
But its working pretty well on cy's image. The browser will stay in memory if I load up other apps, and I can't really see a big degradation in performance.

[Q] Problems booting kernel

Hi, hopefully this is the correct place to post this.
I´m developing a device on a beagleboard and have some problems starting the kernel.
I´m using yaffs2 as root filesystem and the version of the kernel is 2.6.29.
We have the latest yaffs2 code compiled into the kernel, not from googles kernel but from yaffs git sources.
We come so far as it has finished uncompressing the kernel and tried booting it but after that it freezes without no output what so ever.
The uBoot enviroment is as following:
OMAP3_Kajsa # printenv
bootdelay=10
baudrate=115200
loadaddr=0x82000000
usbtty=cdc_acm
console=ttyS0,115200n8
loadbootscript=fatload mmc 0 ${loadaddr} boot.scr
bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
loaduimage=fatload mmc 0 ${loadaddr} uImage
netmask=255.255.255.0
gatewayip=192.168.0.99
dieid#=1d5a0004000000000403643203019007
ethact=smc911x-0
ethaddr=00:11:22:33:44:55
ipaddr=10.0.0.2
serverip=10.0.0.1
echo=Booting from nand ...
nandargs=console=ttyS0,115200n8 root=/dev/mtdblock4 opamfb.mode=lcd vram=32M omapfb.vram=0:8M rdinit=/init rootwait rootfstype=yaffs2
nandboot=echo Booting from NAND...; nand read ${loadaddr} 280000 400000; bootm ${loadaddr}
bootfile=uMulti-2
bootargs=console=ttyS0,115200n8 root=/dev/mtdblock4 rw opamfb.mode=lcd vram=32M omapfb.vram=0:8M init=/init rootwait rootfstype=yaffs2
stdin=serial
stdout=serial
stderr=serial
Environment size: 1175/131068 bytes
And the output when we start to boot the kernel is:
OMAP3_Kajsa # set ethaddr 00:11:22:33:44:55 ; set ipaddr 10.0.0.2 ; set serverip 10.0.0.1 ; tftp 0x82000000 uImage-yaffs
smc911x: detected LAN9220 controller
smc911x: phy initialized
smc911x: MAC 00:11:22:33:44:55
Using smc911x-0 device
TFTP from server 10.0.0.1; our IP address is 10.0.0.2
Filename 'uImage-yaffs'.
Load address: 0x82000000
Loading: T #################################################################
#################################################################
###############################
done
Bytes transferred = 2360952 (240678 hex)
OMAP3_Kajsa # bootm
## Booting kernel from Legacy Image at 82000000 ...
Image Name: Linux-2.6.29-rc3-omap1-gb7a2014-
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2360888 Bytes = 2.3 MB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux...................................................................................................................................................... done, booting the kernel.
We have also tried to write the kernel to NAND and booted from there with the same result.
Any input will be appriciated.
Best regards.
Eric

[Q] Bluetooth media doesnt work on ported rom. Please help?

Any developer here??? Pls help me to fix bt media... My rom is HTC Sense 4 for htc explorer/pico which is ported by derefas from HTC Desire C. Bluetooth file transfer works very well but bt headset doesnt work. Here is the logcat.
E/BluetoothA2dpService.cpp( 349): onConnectSinkResult: D-Bus error: org.bluez.E
rror.Failed (Stream connection failed)
D/BluetoothA2dpService( 349): checkSinkSuspendState(): state=0,mTargetA2dpState
=-1
D/StateMachine( 349): handleMessage: new destination call exit
D/StateMachine( 349): invokeExitMethods: PendingCommandState
I/BluetoothProfileState( 349): Message:Entering Stable State
D/AudioService( 349): isSpecialCase=true , mEventAudioOnly=false , isStreamActi
ve=false
D/AudioService( 349): checkEqIdAndApplyEffect isHeadsetPlugged()=false , mBluet
oothHeadsetConnected=false , id=900 , mHtcSpecificAP=false , mGlobalSoundEffect=
900
V/AudioHardwareMSM72XX( 114): setParameters() global_effect=none
D/AudioService( 349): broadcastSoundEffectChanged beats state=false appName=BT
state changed
V/BluetoothEventManager( 2780): Received android.bluetooth.a2dp.profile.action.C
ONNECTION_STATE_CHANGED
I/LocalBluetoothProfileManager( 2780): Failed to connect A2DP device
D/StateMachine( 349): handleMessage: new destination call exit
D/StateMachine( 349): invokeExitMethods: OutgoingA2dp
I/BluetoothDeviceProfileState( 349): Entering ACL Connected state with: 102
D/BluetoothA2dpService( 349): A2DP state : device: C4:85:08:05:59:5A State:1->0
I/BluetoothA2dpService( 349): [embedded] A2DP state : address: C4:85:08:05:59:5
A name: SHEKHAR-PC State:1->0
D/BluetoothAdapterStateMachine( 349): BluetoothOn process message: 52
D/BluetoothService( 349): CONNECTION_STATE_CHANGE: C4:85:08:05:59:5A: 1 -> 0
V/BluetoothEventManager( 3562): Received android.bluetooth.a2dp.profile.action.C
ONNECTION_STATE_CHANGED
I/LocalBluetoothProfileManager( 3562): Failed to connect A2DP device
I/USERIAL_LINUX( 3593): ##### USERIAL_Ioctl: BT_Sleep, USERIAL_IO_BT_WAKE_DEASSE
RT ####
D/PhoneStatusBarPolicy( 634): isCdma():false hasService:true mSimState=UNKNOWN
gprsState=0 mDataState=0 dataActivity=1 mPhone.htcModemLinkOn:false hspa==true
E/ ( 3593): btm_sec_disconnected - Clearing Pending flag
W/ ( 3593): BTA_DM_LINK_DOWN_EVT::bdaddr c4:85:08:05:59:5a reason x13
I/ ( 3593): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTR
L) 11 pbytes (hdl 22)
D/DTUN_HCID4( 3608): dtun_dm_sig_link_down()
I/DTUN_HCID4( 3608): dtun_dm_sig_link_down device = 0x6f7900 reason = 19
I/DTUN_HCID4( 3608): [embedded]LINK_DOWN name = SHEKHAR-PC, address = C4:85:08:0
5:59:5A, reason = 0x13
D/BluetoothEventLoop( 349): Device property changed: C4:85:08:05:59:5A property
: Connected value: false
D/ ( 3593): >>> STOP GKI_timer_update(), wake_lock_count:0
D/ ( 3593): >>> SUSPENDED GKI_timer_update()
Can anyone guide me to fix this?

why wifi not working? here there is the answer...

hello,
i open this thread to collect informations about a common problem that happens after flashing new roms
this thread has generic purpose, and is not intended for a specific board...
- suggestions on how to discover the cause of the problem
- suggestions on how to fix the problem
anyone that think to have some useful informations on this issue can insert his post
i am not an expert ( and still my wifi is not working )
but i collected some informations, and i would like to share them
The first thing is:
what happens when from the settings i click on wifi to turn it on
to see this, i opened a terminal emulator session
and i have written this:
adb logcat > 'some file name on a writable directory' (for example , i redirected the output to the external sd card)
here is what was written on the file (extracting from the file only the last part, that is the output related to my action of wifi activation):
D/WifiHW ( 368): Read wifi chip type OK ! wifi_chip_type = RK901
D/WifiHW ( 368): wifi_load_driver: DRIVER_MODULE_PATH = /system/lib/modules/rkwifi.ko, DRIVER_MODULE_ARG =
D/BluetoothAdapterService(1097373104)( 811): getState(): mAdapterProperties: [email protected] 4168aef0
D/BluetoothAdapterService(1097373104)( 811): getState(): mAdapterProperties: [email protected] 4168aef0
D/WifiService( 368): setWifiEnabled: true pid=870, uid=1000
D/AudioHardwareALSA( 109): Audio exiting sandby will open audio device
D/AudioHardwareALSA( 109): AudioStreamOutALSA::standby().....
D/WifiHW ( 368): wifi_load_driver: driver load failed
D/WifiHW ( 368): Unable to unload driver module "wlan": No such file or directory
E/WifiStateMachine( 368): Failed to load driver!
E/WifiStateMachine( 368): DriverFailedState
Searching on the web this string: "Read wifi chip type OK ! wifi_chip_type"
i found this:
https://github.com/aloksinha2001/pi****u-3.0.8-alok/blob/master/RK30_MT5931_MT6622/wifi/wifi.c
into procedure check_wifi_chip_type() i saw exactly this part:
else if (0 == strncmp(buf, "RK901", strlen("RK901")) )
{
wifi_chip_type = RK901;
ALOGD("Read wifi chip type OK ! wifi_chip_type = RK901");
}
here is compared the value of string buf with "RK901"
the string buf is read from this file: "/sys/class/rkwifi/chip"
(so i suppose that this file has been written before by some other procedure)
so, i searched the caller procedure of check_wifi_chip_type():
in the same source i find this caller:
int wifi_load_driver()
{
#ifdef WIFI_DRIVER_MODULE_PATH
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for completion */
int type;
char path[64];
if (is_wifi_driver_loaded()) {
return 0;
}
strcpy(path, DRIVER_MODULE_PATH);
type = check_wifi_chip_type();
if((type == RK901) || (type == RK903) || (type == BCM4330)) {
strcpy(path, "/system/lib/modules/rkwifi.ko");
} else if (type == RTL8188CU) {
....
this procedure as first step checks if the driver is already loaded,
if not:
the driver module path is set by default to "/system/lib/modules/wlan.ko"
Then basing on the chip type is got a more specific path:
for example, for RK901/RK903/BCM4330 the path is set to : "/system/lib/modules/rkwifi.ko"
Then, is checked if the file does exist, and if not the path is seth to the default DRIVER_MODULE_PATH,
that is "/system/lib/modules/wlan.ko"
// judge if the KO file exist, if not, insmod wlan.ko
if (access(path, F_OK) < 0) {
ALOGD("DRIVER_MODULE_PATH = %s (Not such file)...", path);
strcpy(path, DRIVER_MODULE_PATH);
}
Then,
is called insmod (insert module),
to load the driver file in 'memory' (a new module into the kernel, i suppose):
if (insmod(path, DRIVER_MODULE_ARG) < 0) {
ALOGD("%s: driver load failed", __FUNCTION__);
wifi_unload_driver();
if(retry_count-- > 0) goto retry_load_driver;
return -1;
}
Looking the logcat above,
the flow in my case stops here, with : wifi_load_driver: driver load failed
so something happened in insmod:it is not able to load the file /system/lib/modules/rkwifi.ko in memory or initialize it
(the file is found, else the process should stop before, when checking access to the file)
The insmod function does this:
allocates memory for the structure name (type utsname) :
memset(&name, 0, sizeof(name));
and load the file on this area:
module = load_file(filename_release, &size);
Then is checked if the file has been loaded
if (!module)
return -1;
and finally
the module is 'initialized':
ret = init_module(module, size, args);
One of this two events went wrong, because insmod returned -1
My investigation stops here... i am not able to proceed more...
but i am open to all suggestions and hints
Thank you!!
Vicolodo said:
The first thing is:
what happens when from the settings i click on wifi to turn it on
to see this, i opened a terminal emulator session
and i have written this:
adb logcat > 'some file name on a writable directory' (for example , i redirected the output to the external sd card)
here is what was written on the file (extracting from the file only the last part, that is the output related to my action of wifi activation):
D/WifiHW ( 368): Read wifi chip type OK ! wifi_chip_type = RK901
D/WifiHW ( 368): wifi_load_driver: DRIVER_MODULE_PATH = /system/lib/modules/rkwifi.ko, DRIVER_MODULE_ARG =
D/BluetoothAdapterService(1097373104)( 811): getState(): mAdapterProperties: [email protected] 4168aef0
D/BluetoothAdapterService(1097373104)( 811): getState(): mAdapterProperties: [email protected] 4168aef0
D/WifiService( 368): setWifiEnabled: true pid=870, uid=1000
D/AudioHardwareALSA( 109): Audio exiting sandby will open audio device
D/AudioHardwareALSA( 109): AudioStreamOutALSA::standby().....
D/WifiHW ( 368): wifi_load_driver: driver load failed
D/WifiHW ( 368): Unable to unload driver module "wlan": No such file or directory
E/WifiStateMachine( 368): Failed to load driver!
E/WifiStateMachine( 368): DriverFailedState
Searching on the web this string: "Read wifi chip type OK ! wifi_chip_type"
i found this:
https://github.com/aloksinha2001/pi****u-3.0.8-alok/blob/master/RK30_MT5931_MT6622/wifi/wifi.c
into procedure check_wifi_chip_type() i saw exactly this part:
else if (0 == strncmp(buf, "RK901", strlen("RK901")) )
{
wifi_chip_type = RK901;
ALOGD("Read wifi chip type OK ! wifi_chip_type = RK901");
}
here is compared the value of string buf with "RK901"
the string buf is read from this file: "/sys/class/rkwifi/chip"
(so i suppose that this file has been written before by some other procedure)
so, i searched the caller procedure of check_wifi_chip_type():
in the same source i find this caller:
int wifi_load_driver()
{
#ifdef WIFI_DRIVER_MODULE_PATH
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for completion */
int type;
char path[64];
if (is_wifi_driver_loaded()) {
return 0;
}
strcpy(path, DRIVER_MODULE_PATH);
type = check_wifi_chip_type();
if((type == RK901) || (type == RK903) || (type == BCM4330)) {
strcpy(path, "/system/lib/modules/rkwifi.ko");
} else if (type == RTL8188CU) {
....
this procedure as first step checks if the driver is already loaded,
if not:
the driver module path is set by default to "/system/lib/modules/wlan.ko"
Then basing on the chip type is got a more specific path:
for example, for RK901/RK903/BCM4330 the path is set to : "/system/lib/modules/rkwifi.ko"
Then, is checked if the file does exist, and if not the path is seth to the default DRIVER_MODULE_PATH,
that is "/system/lib/modules/wlan.ko"
// judge if the KO file exist, if not, insmod wlan.ko
if (access(path, F_OK) < 0) {
ALOGD("DRIVER_MODULE_PATH = %s (Not such file)...", path);
strcpy(path, DRIVER_MODULE_PATH);
}
Then,
is called insmod (insert module),
to load the driver file in 'memory' (a new module into the kernel, i suppose):
if (insmod(path, DRIVER_MODULE_ARG) < 0) {
ALOGD("%s: driver load failed", __FUNCTION__);
wifi_unload_driver();
if(retry_count-- > 0) goto retry_load_driver;
return -1;
}
Looking the logcat above,
the flow in my case stops here, with : wifi_load_driver: driver load failed
so something happened in insmod:it is not able to load the file /system/lib/modules/rkwifi.ko in memory or initialize it
(the file is found, else the process should stop before, when checking access to the file)
The insmod function does this:
allocates memory for the structure name (type utsname) :
memset(&name, 0, sizeof(name));
and load the file on this area:
module = load_file(filename_release, &size);
Then is checked if the file has been loaded
if (!module)
return -1;
and finally
the module is 'initialized':
ret = init_module(module, size, args);
One of this two events went wrong, because insmod returned -1
My investigation stops here... i am not able to proceed more...
but i am open to all suggestions and hints
Thank you!!
Click to expand...
Click to collapse
Interesting... Yesterday i was trying to solve this problem caused by a cwm recovery flashing during about 8 hours with my mk809ii. I let my pc downloading about 10 different roms from other similar devices, and this morning i stay to try one by one. Finally i found "mk808B bob finless 2.1 room (jb4.2.2) with wifi APxxxx" (APxxxx is my wifi chip, i can't remember the xxxx just now) fix both wifi and bluetooth.
You did a good research, i will save your post on case i get the error again, but i think the best thing to do is to search for a compatible rom and try, with same both cpu and wifi chipset. Also now after read your post i am going to save a backup of system /lib and system /etc directories, maybe changing the wifi library files fix the error without needing of flash and reflash...
Thanks, i liked your post!
Enviado desde mi GT-P7510 usando Tapatalk 2

[SOLVED][Q] WiFi won't turn on

All of a sudden, on Stock + Root TF700T, WiFi won't turn on. I highly doubt that this is related to my WiFi router ... the WiFi won't even enable on the tablet, and I can't even see a MAC address in About Tablet section.
I also did some digging and have some additional detail, but I cannot find a solution.
logcat:
Code:
E/WifiHW ( 122): Failed to open wlan fw path param (No such file or directory)
E/SoftapController( 122): Softap fwReload - failed: -1
E/WifiStateMachine( 489): Failed to reload STA firmware java.lang.IllegalStateException: command '43 softap fwreload wlan0 STA' failed with '400 43 Softap operation failed (No such file or directory)'
W/CommandListener( 122): Failed to retrieve HW addr for wlan0 (No such device)
D/CommandListener( 122): Setting iface cfg
E/WifiStateMachine( 489): Unable to change interface settings: java.lang.IllegalStateException: command '45 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 45 Failed to set address (No such device)'
E/WifiHW ( 489): wpa_ctrl_open fail, retry again
I/wpa_supplicant( 2767): Successfully initialized wpa_supplicant
E/wpa_supplicant( 2767): nl80211: Could not add multicast membership for scan events: -2 (No such file or directory)
E/wpa_supplicant( 2767): Failed to initialize driver 'nl80211'
E/wpa_supplicant( 2767): wlan0: Unsupported driver 'nl80211'
D/dalvikvm( 1258): GC_CONCURRENT freed 427K, 14% free 3700K/4272K, paused 3ms+3ms, total 57ms
D/AsusBrightnessManager( 489): br transform : 35 -> 13
D/DockManagerService( 489): mLastAcOnline:false mAcOnline:false
D/LowBatteryService( 1487): onReceive:Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000010 (has extras) }
D/LowBatteryService( 1487): mAcOnline = false, mDeviceBatteryLevel = 96, mDockBatteryLevel = 0, mDockBatteryStatus = 0
D/LowBatteryService( 1487): Battery level is higher than threshold, no need to apply
D/LowBatteryService( 1487): Battery level is good, no need to apply low battery config.
D/DockManagerService( 489): mLastAcOnline:false mAcOnline:false
D/LowBatteryService( 1487): onReceive:Intent { act=android.intent.action.BATTERY_CHANGED flg=0x60000010 (has extras) }
D/LowBatteryService( 1487): mAcOnline = false, mDeviceBatteryLevel = 96, mDockBatteryLevel = 0, mDockBatteryStatus = 0
D/LowBatteryService( 1487): Battery level is higher than threshold, no need to apply
D/LowBatteryService( 1487): Battery level is good, no need to apply low battery config.
E/WifiHW ( 489): Supplicant not running, cannot connect
E/WifiHW ( 489): Supplicant not running, cannot connect
E/WifiHW ( 489): Supplicant not running, cannot connect
E/WifiHW ( 489): Supplicant not running, cannot connect
E/WifiHW ( 489): Supplicant not running, cannot connect
E/WifiHW ( 122): Failed to open wlan fw path param (No such file or directory)
E/SoftapController( 122): Softap fwReload - failed: -1
E/WifiStateMachine( 489): Failed to reload STA firmware java.lang.IllegalStateException: command '46 softap fwreload wlan0 STA' failed with '400 46 Softap operation failed (No such file or directory)'
E/WifiStateMachine( 489): Failed 6 times to start supplicant, unload driver
W/CommandListener( 122): Failed to retrieve HW addr for wlan0 (No such device)
D/CommandListener( 122): Setting iface cfg
E/WifiStateMachine( 489): Unable to change interface settings: java.lang.IllegalStateException: command '48 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 48 Failed to set address (No such device)'
E/WifiHW ( 489): wpa_ctrl_open fail, retry again
I/wpa_supplicant( 2792): Successfully initialized wpa_supplicant
E/wpa_supplicant( 2792): nl80211: Could not add multicast membership for scan events: -2 (No such file or directory)
E/wpa_supplicant( 2792): Failed to initialize driver 'nl80211'
E/wpa_supplicant( 2792): wlan0: Unsupported driver 'nl80211'
D/dalvikvm( 1258): GC_CONCURRENT freed 427K, 14% free 3700K/4272K, paused 2ms+1ms, total 22ms
W/NvCpuClient( 489): Failed to bind to service
D/AsusBrightnessManager( 489): br transform : 35 -> 13
E/WifiHW ( 489): Supplicant not running, cannot connect
W/NvCpuClient( 489): Failed to bind to service
Also, output from netcfg:
Code:
[email protected]:/ # netcfg
lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
dummy0 DOWN 0.0.0.0/0 0x00000082 76:ad:93:6b:c9:b7
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
ip6tnl0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00
And here is output of my wpa_supplicant.conf:
Code:
[email protected]:/ # cat /etc/wifi/wpa_supplicant.conf
update_config=1
ctrl_interface=wlan0
eapol_version=1
ap_scan=1
fast_reauth=1
And I searched the entire filesystem for "nl80211" and found nothing.
Does anyone have suggestions on where to go next? Did my driver somehow get deleted, or am I just not looking for the right thing?
Thanks.
I will use this question in the future as an example of how to ask for support properly. Unfortunately I don't have a solution for you, but you could check the files in your /data/misc/wifi, maybe you can find something unusual. Your MAC address should come from some file on the FAT filesystem on /dev/block/mmcblk0p5 - I'd recommend making an image of it as a backup and then analyze the image.
_that said:
I will use this question in the future as an example of how to ask for support properly.
Click to expand...
Click to collapse
I provide Enterprise-level support to software devs working in the Cloud and particularly on CentOS/RHEL Linux servers. This is why I know how to ask for help properly.
Well, since I can't find much, and there aren't any definitive answers here, my next thoughts are:
1) Something is seriously jacked up on the filesystem, possibly corrupted driver, possibly something worse. Hopefully, this is the case, because a software problem is possible to fix.
2) The WiFi radio is permanently damaged, or "burnt out".
In the hopes that it's something more like software, I'm going to reimage. I just need to decide what ROM to use. Not having network connectivity will make the prep for this a bit more challenging, but I can work through it using a MicroSD card.
If it's #2, well then I suppose I will have wasted my time reimaging and will be on the market for a new tablet ... and I need to get on that right away because I need to travel soon. Any suggestions are welcome ... I'd like a 9" or 10" tablet and it must have an HDMI out (micro preferred) and be able to handle 1080p video.
Thanks.
[SOLVED]
I am having a heckuva time even doing what I described above.
-I had never unlocked the bootloader before, so when I tried the ASUS unlock util v8, it gave error "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE"
-I tried the ASUS unlock tool v7, and was finally able to install it but when I run and select Unlock I get an error that there is no network connection (FFS that's what I'm trying to resolve!)
-I can't get into recovery, I just get the Android guy with "ERROR!" when I enter fastboot and select "RCK".
My only option is to go back to Stock. So, I tried this:
http://forum.xda-developers.com/showthread.php?t=1833212
The steps in that post result in the same Android guy with the "ERROR!" screen ... not a very helpful error msg.
So, I tried this, and used the stock firmware from ASUS. (NOTE: I downloaded "ASUS Transformer Pad TF700T Firmware: V10.6.1.14.10 Only for US SKU (Android 4.2.1)" directly from ASUS after I read their notes on where to check for which one you need ([Settings]-->[About tablet]-->Build number).):
http://www.transformerforums.com/fo...e-firmware-tf700-tf701-tf300-tf101-tf201.html
From that post ^^ I did Method B: Flash from MicroSD. I extracted the .zip I downloaded from ASUS, and renamed the new zip EP201_768_SDUPDATE.zip per the GUIDE linked above.
I put in my MicroSD, went back into fastboot, and selected "RCK". It was at this point that I began typing the above. Total time to get to this point was about 90 minutes!
-----
FINALLY, for the first time, I saw a progress bar under the Android guy, and he had gears turning in his belly.
*INSERT SIGH OF RELIEF HERE*
As I was typing out all the above, progress bars were moving, and a few reboots happened. I expected that I would be fully back on Stock ROM, and that my data would have been wiped. I never ran a data wipe, I just assumed the ASUS installer would do that by default.
Well, it didn't wipe data. But, what it did do: restore all my device drivers!! After about 10 minutes, and 2-3 reboots, Android loaded with my existing desktop and settings, and the WiFi connected right away!!
So, this fixed it. I documented the above so anyone (even me, months from now) having a similar problem might be able to use these steps.
WOO HOO!
lost root
I should add that I lost root now. I think at this point, after all I've been through with this, I'm just going to press on and install CyanogenMod which is what I was planning to do anyway.
CaptainRewind said:
I should add that I lost root now. I think at this point, after all I've been through with this, I'm just going to press on and install CyanogenMod which is what I was planning to do anyway.
Click to expand...
Click to collapse
Just flash this to get root
http://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip
sbdags said:
Just flash this to get root
http://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip
Click to expand...
Click to collapse
Yep, I had to do that anyway because I wanted to do a full Titanium Backup first. Still, I'm moving to CM now.

Categories

Resources