yashsingh1/xdaforums huggingface dataset:
[HTC One X] pakjebakmeel:
I have flashed both CM10.2-20131001 and CM10.1.3 stable and wifi scanning worked fine. I have not experienced any issues. The one and only issue I was posting about is the issue where the HOX (and maybe other phones) do not hop onto another access point with the same SSID if the signal decreases for the current AP and the signal increases for the other AP.

For instance, I come into my house and connect to AP1 downstairs. I move upstairs and am standing 1 meter next to AP2 now. What should be happening is that the HOX terminates the connection with AP1 and connects to AP2. This is called roaming.

Instead what happens (on stock, CM10.1 and CM10.2) is that it will struggle and try to maintain a connection with AP1 even if the signal is -95db and the speed is 1Mbit/s. Only when the connection is fully lost it will try to reconnect and pick AP2 and immediately it connects on -45db with 54Mbit/s.

This is bad because;

a) The battery will drain faster trying to maintain a bad connection (I have 4 hours or wlan wakelocks during 1 night)

b) The connection will be very slow

c) Maybe other issues I don't know about

1. I can confirm I had this issue. Once connected it did not rescan and show any new neighbouring networks. I can also confirm this works fine now.

2. Had this too and also fixed for me.

3. This is the problem I'm discussing

4. Cannot be fixed it this is a hardware issue. (Don't look at the bars only in comparison with a Sense ROM, it will lie to you an make the bars look better than the connection actually is. The db values will be the same and yet Sense shows more bars.) It's a matter of perspective.
[HTC One X] festa20:
I got a problem

My phone finds other WiFi but my WiFi BT hub doesn't find it but finds everyone else's on the street is there a fix for this or something I got to live with for a while
[HTC One X] Thömy:
I have merged http://review.cyanogenmod.org/#/c/50843/ this morning. Please check if it makes a difference for you.

Also if you want to check if the roaming section is compiled or not you could just add some garbage to it. If it fails to compile then it will be compiled ;). I think somewhere the android build system also stores the output files from the preprocessor. Lastly you can increase the loglevel by replacing wpa_dbg with the appropriate function in case debug logging output is disabled.
[HTC One X] pakjebakmeel:
I will wait for the nightly, if I start compiling now it will finish after the nightly appears :p

I can see this event happening on my phone:

): wlan0: [HTC] wpa_supplicant_event():2272- Got an original EVENT_SCAN_RESULTS
I/wpa_supplicant(26939): Got an original EVENT_SCAN_RESULTS

But nothing happens afterwards.

So appearently the scanning is working and WPA_SUPPLICANT receives the results but somehow it doesn't trigger re-evaluation of the AP's because that's where my log stops. In the example above you can see that that's the event that triggers re-evaluation of the AP's and WPA_SUPPLICANTS conciders candidates for roaming.

Question is, which code should trigger the roaming evaluation if it receives the scan results?

Maybe this is worth looking into, the code in wpa_supplicant.c has a lot of references to #ifdef CONFIG_BGSCAN. Under these statements is some code to enable roaming support but CONFIG_BGSCAN is not defined. Could it be that we need to enable this config parameter CONFIG_BGSCAN=Y?

I've added CONFIG_BGSCAN=Y to external/wpa_supplicant_8_ti/wpa_supplicant/android.config and I'm compiling it now. Maybe I can upload a zip file with the files for someone to (backup his device) and test? I'm not running CM at the moment so I have to reinstall my device and restore it everytime I want to test something.
[HTC One X] PAGOT:
Man just wanna say if you fix-adjust-hack the roaming on the phone to work correctly am gonna buy you and Thoemy(already owing him for another wifi related fix) beer (well Pepsi (not allowed to buy alcohol) wanted to say coke but that could be misunderstood)..

Thanks guys
[HTC One X] pakjebakmeel:
Don't get you're hopes up.. I'm not a dev eh? Just a user having an issue trying to help solving it :)
[HTC One X] yossi2010:
touch delay

i've come to notice that our device has a kind of big latency with the touch and i thought to myself that its probably android but no.

my mom's lg optimus net(2.3.7 stock) has iphone kind of latency and so does the htc one s(latest stock) and the samsung galaxy s1(running 4.2.2 cm) too.(my old defy with jb had better delay too)

they all have little latency and the content that you scroll is almost sticking to your finger but on our device its like the content is chasing your finger instead of tracking it.

about 3-4 times the delay.

why is that?

any way of fixing that or is it just a low sampling rate digitizer?(i bet its software as this is a synaptics kind of high end digitizer)

i feel like its the os having too much touch filtering anyway of tweaking that?

the only worse device that i've come to encounter is the sgs3 running ics stock.

PS: does anyone else has playstore problems? googled the hell out of the web and i can find a soulution to that:

gp wont work on my wifi AT ALL!(connection timed out retry?) the app is dead. however on data it works perfectly fine and the weird thing is that it will install apps via wifi if i tell it to from the pc site.

tried everything reinstalling the apk clearing data cach and more stuff(even changed my wifi channel) the weird thing is that my mom has the same problem with stock and that our whatsapps wont send images and sound files any idea?(wifi is fine btw all other apps including browser gmail youtube works... also google now/voice is dead too recognizing forever works on 3g)

---------- Post added at 11:01 PM ---------- Previous post was at 10:33 PM ----------

i was thinking about something in the style of app settings xposed module.

where you choose your app that you want to change its theme out of the main theme chooser theme see what themes you have installed that changes it apply soft reboot(or even not reboot just restart the app) and bam! mixed theme.

just like nova launcher can see what themes you have for it and choose an icon from any theme you have for an app.

i don't know android programming very well but i guessed someone would do it by now.

this need comes from beautiful themes that 1 might hate a single app theme in it and may want to change just that.

ex: your have chromium theme hate the white dialer and want the dialer from holo sense 5. you apply chromium in theme chooser and use the app themer to apply the holo sense 5 only for the dialer by clicking the phone app and choosing an available theme for it.
[HTC One X] TimeWasterNL:
Does anybody else have a FC when opening the Buttons in Settings?
[HTC One X] dreamonn:
Yes, me too
[HTC One X] pakjebakmeel:
I've clean installed this nightly and the problem is still here; however 3 debug log lines catch my attention:

Unsupported command: BTOEXMODE 1
Unsupported command: BTOEXMODE 2
wlan0: Failed to start sched scan (-16)

The first 2 apparently something to do with the power states of the wifi card, something not quite right but we're not looking into that now. The last line apparently reports it cannot start the scheduled scan for some reason? I have no clue what error code 16 is but it's not scanning. It might be trying to trigger a bgscan with wpa_supplicant cli and it doesn't understand the command. It returns an error and this get caught by the exception in events.c.

Could be missing support for background scans because of CONFIG_BGSCAN? I can't find this parameter anywhere although it seems to be actively used in the code.
[HTC One X] PAGOT:
What this nightly? You self compiled? It's still building http://jenkins.cyanogenmod.com/job/android/43517/
[HTC One X] pakjebakmeel:
According to CMXLOG this change: http://review.cyanogenmod.org/#/c/50843/ is already in the 20131002 nightly..

http://10.2.cmxlog.com/?device=endeavoru
[HTC One X] PAGOT:
Ah well. Anyways new nightly is up :)
[HTC One X] pakjebakmeel:
By the way; I have compiled wpa_supplicant_8_ti with CONFIG_BGSCAN=y. I'm flashing it now for testing.
[HTC One X] PAGOT:
You need testers?

Am out... Am in an area where there is no suitable AP's for testing :/ (will be home in a week)
[HTC One X] pakjebakmeel:
Ok just a new post here because the old one is getting quite long..

I think I may have cracked it. There is another file /data/misc/wifi/wpa_supplicant.conf.

When I add the bgscan line into there it parses the line upon starting wpa_supplicant because it throws an error when starting complaining this is not a global variable. So I added it manually to the network specific configuration area like so:

ctrl_interface=wlan0
driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1
update_config=1
device_name=endeavoru
manufacturer=HTC
model_name=HTC One X
model_number=HTC One X
serial_number=SH34BW101272
device_type=10-0050F204-5
config_methods=physical_display virtual_push_button
p2p_disabled=1
disassoc_low_ack=1
p2p_go_max_inactivity=60
p2p_go_ht40=1
p2p_multi_chan=1
concurrent_sched_scan=1
autoscan=periodic:30

network={
ssid="Mobile-Wireless"
psk="<VERYSECRETPASSWORD"
key_mgmt=WPA-PSK
priority=2
bgscan="simple:20:-30:20"
}

Bottom line under network configuration bgscan="simple:20:-30:20". Beware this is a very bad setting because it implies now:

Do background scans when the signal gets lower than -30db (so almost continuously, this was on purpose for my testing)

Then rescan every 20 seconds, and I believe the second 20 value is the scan interval when the signal is good.

Despite being a bad value'd test setup.

IT WORKSSS!!!

I can see it re scanning every 20 seconds and considering the roaming candidates. WHOOHOO.

I'm not sure how to put a line in that file from source because it's maintained on the fly I guess because the network is added to it when you connect to it and provide the key. So someone has to make a change in the code that appends lines in that file upon connecting to an unknown network and saving it in there.

In case anyone goes working on this; a sensible config like would be:

bgscan="simple:30:-65:300"

So don't bgscan unless the signal gets worse than -65db and then once every 30 seconds.

When the signal is good do it every 300 seconds.

:victory::victory::victory::victory::victory:

So now all we need is a developer who can change whatever code that generates that /data/misc/wifi/wpa_supplicant.conf to include an extra line per network that gets added. That should resolve the issue. Again, I have no dev skills so I'm kindly asking someone to have a look at this.

So until this gets merged we actually have a manual fix.. ADB pull the file, put the line in the network section. Push it back and fix the permissions and ownership. Then reboot or wpa_cli reconfigure.

Re-testing now on the stock CM10.2 20131002 nightly to see if it works without the CONFIG_BGSCAN=y
[HTC One X] Thömy:
Once again, you're awesome. The template for this file is in /system/etc/wifi/ and the file should also be somewhere in the wpa_supplicant source code repository.
[HTC One X] pakjebakmeel:
There is a drawback.

At least we're heading in the right direction. Let's get the facts straightened out:

1.) Roaming relies on background scanning. When a background scan is performed and it finds multiple BSSID's for the same SSID it evaluates the signal strength and if the difference is big enough it will roam.

2.) The code for bgscans is present, there are several modules for bgscanning, I think simple scan will be sufficient. A simple scan uses a theshold signal strength. Anything worse it will scan with short intervals to find a roaming consideration. Any signal better than the threshold roaming isn't required and it will use loooong intervals. fine.

3.) As the code is there we can enable it in the config as proven. This works as expected, the roaming alternatives are evaluated and the device roams when the signal is weak on the connected AP.

But I found once the list of networks has been populated during initial scan it does not update anymore. When I got home there were still the networks from the office and none from my neighbourhood. (I mean in the GUI where you connect to wireless networks.. The list doesn't update)

So would it;

1) Be confused because of the extra line in the config, not be able to deal with that and cease updating the list with the scan results?

2) Break scanning just like before the 'SCAN TYPE=ONLY' commit?

hmm.. Keep digging. But at least we found the cause of the device not roaming :D Thömy could you possible advise on this? Any clue what might be happening here?

Sooo do you mean if I put an option in /etc/wifi/wpa_supplicant.conf and reboot the device and connect to a network (that I did not connect before it should adopt the settings from /etc/wifi/wpa_supplicant.conf and stick them under /data/misc/wifi/wpa_supplicant.conf? Or does it adopt the global settings only? The main problem is is that this setting appearently needs to be set on a per network basis as far as I found. When I put it in the global sections of the config file it starts complaining about the settings when doing a wpa_cli reconfigure.

Apart from all this, the good news is I found that -75db is a nice threshold, I can sit downstairs and no rescans occur. When I move upstairs it finds the signal exceeds -75db (about 2 bars). I logs that the signal strength exceeds the threshold and a bgscan occurs, it finds the second AP, considers and elects it. It re-connects to the second AP. Really really fast and smooth. Better than I expected. Now just need to fix the scan behaviour in the GUI. :( (And I have no clue where to start). Thömy heeeeeelp :eek:

OK hold that.. It seems OK now. Maybe it was just a fluke because I messed with it too much. I'm going to monitor it's behavior for a day or so..
[HTC One X] CaracalSef:
Anyone have volume in call problems? When I get or make a call, sometimes the volume is up (very loud) and the other person hears his echo. I have to end the call and retake it. Using volume buttons does not resolve the problem. This happens randomly (didn't figure a pattern).

Another thing: is there a way to get the dialer working like the one from Sense? What I mean is that I want to predict phone numbers that are not saved in contacts, but dialed recently. If I dial a part of the name or phone number from a contact saved in contacts, the dialer autocomplete, but if I dial a number that is not saved in contacts, autocomplete function shows nothing.

---------- Post added at 03:48 PM ---------- Previous post was at 03:47 PM ----------

Anyone have volume in call problems? When I get or make a call, sometimes the volume is up (very loud) and the other person hears his echo. I have to end the call and retake it. Using volume buttons does not resolve the problem. This happens randomly (didn't figure a pattern).

Another thing: is there a way to get the dialer working like the one from Sense? What I mean is that I want to predict phone numbers that are not saved in contacts, but dialed recently. If I dial a part of the name or phone number from a contact saved in contacts, the dialer autocomplete, but if I dial a number that is not saved in contacts, autocomplete function shows nothing (that number was previously dialed - it's in recent calls).
[HTC One X] shinigamikris:
Is there a sound performance mod I can flash on the latest build? To increase the sound. Seems a bit quiet. Cheers
[HTC One X] pavik62:
http://xdaforums.com/showthread.php?t=1920557
[HTC One X] pakjebakmeel:
I think that that WPA_SUPPLICANT stuff just does as told by the framework. I believe that saving the individual networks to the file is higher up..

I think it might be in here:

android_frameworks_base/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java

Anyone can comment on this? I can see it reads and writes data to data/misc/wifi/wpa_supplicant.conf, maybe this file needs to write an additional line for each network?
[HTC One X] sathara:
grrrr i am having status 7 error in recovery .. tried some recoveries ..not survived .

i am falshing 4.3 and hboot is 1.73 . unlocked and i am on sense 5. any help ?
[HTC One X] Thömy:
This is just for restoring settings and saved access points from the Google cloud. Hence the name BackupAgent. From looking at the code it will backup all the network { ... } sections in the wpa_supplicant.conf and restore them if a network with the same SSID does not exist.
[HTC One X] pakjebakmeel:
Hmm okay thanks.. Was the only file I could find that interacts with that file.. But again I'm not a dev..

Any pointer in the right direction?
[HTC One X] Thömy:
wpa_supplicant itself. The config file is passed as the -c parameter to the service. I'm a little short on answers about the whole bgscan stuff since I'm just starting to have a look at it.

And to better investigate this I would need to have more than AP in my home and a device where roaming works correctly. Both is unfortunately not the case.

---------- Post added at 07:29 PM ---------- Previous post was at 07:24 PM ----------

CONFIG_BGSCAN_SIMPLE and CONFIG_BGSCAN_LEARN are not enabled in the "normal" wpa_supplicant. So I'm wondering how it is supposed to work and if there is another way to achieve the same without the bgscan command.

---------- Post added at 07:47 PM ---------- Previous post was at 07:29 PM ----------

Also the wpa_supplicant_8_ti is pretty outdated compared to the normal wpa_supplicant_8. I have been told that TI is working on a rebase for Android 4.3. So I would rather wait and see.

The second wpa_supplicant hotfix I posted was built from a rebased work-in-progress branch. This branch seems to enable CONFIG_BGSCAN_SIMPLE and CONFIG_IEEE80211R=y.

So I guess what's left is to figure out how to automatically add the bgscan line to each network, right?
[HTC One X] pakjebakmeel:
Well honestly 802.11r is nice but you will only see that in firms with expensive AP's with RADIUS backend or advanced linux based homesetups with hostapd. You need RADIUS backend and WPA2-Enterprise anyway. If it's got no downside it's nice to support it but the main priority is normal roaming. You only need 802.11r for VoIP conversations not to drop during roaming or existing connections to survive a roam.

In regards to bgscan simple; apparently the module is already built for WPA_SUPPLICANT in the latest 10.2 nighlies and probably before because the module works fine when I enable it. Even on 10.1.3.

So I think the only thing required is to get bgscan enabled in config by default, as far as I understand we can add it to wpa_supplicant.conf and it will be copied to it's sibbling in /data/misc/wifi. The only problem with that is that it's not a global parameter and it complains unless it's defined within the network configuration section and I don't know how to provide that in the reference config.

Other than using bgscan I wouldn't know, this seems to be the best way to roam in general in wpa_supplicant world.

As far as I looked at the makefiles CONFIG_BGSCAN enables scanning support and CONFIG_BGSCAN_SIMPLE compiles the simple module. Maybe enabling CONFIG_BGSCAN_SIMPLE automatically defines CONFIG_BGSCAN, it'll be in the makefile.

Then you have the support and the only thing required would be to enable it with adding 1 line in the config per network that gets added. Also, I found that the sense 5 ROM adds bgscan_learn to every network in the config but it DOES NOT ROAM.. grrr. dunno why but it seems HTC tried to enable it but they failed. I cannot see any debug messages about the modules so my guess is they added the config line but did not enable the compile flag for the module?

So the short answer is yes :)
[HTC One X] scotte9999:
Isn't http://stackoverflow.com/questions/...e-wifi-configuration-file-location-in-android the solution to that?
[HTC One X] shinigamikris:
delete
[HTC One X] teemo:
I did a search on the code, looking for the ssid-variables in the wpa_supplicant.conf. The only results I got was from the wpa_supplicant binary.

You can check "wpa_cli -h". It will give you a long list of options to control wpa_supplicant, but you probably already did that...

The conf template in etc is copied by wifi.c (hw_libhw_legacy) to misc.

Just checked my old sense 4 backups, they all have bgscan_learn in the conf file, so that is not new.

At my work, my wifi seems to roam: When moving, it actually connects to the better AP. I am connected, but not authenticated for Internet (open network

network={ ssid="guest" key_mgmt=NONE priority=2 }).

Finally one question: In all your testing, DID YOU FLASH THE WPA-FIX posted earlier? I don't know what it changes, but it definitely enables scanning when already connected.
[HTC One X] pakjebakmeel:
Jup, couldn't find anything there, I know sense has the line but I mean that it doesn't work. I cannot see anything about the module bgscan in the debug log so my guess is that the config is there but the module isn't.

Also checked Sense's wpa_supplicant.conf in /etc and it doesn't contain any per-network lines nor does it contain anything about the learn module. So it's added to the /data/misc config file by some other process, it's not taken from the wpa_supplicant.conf template.

When you say you're device roams, does it actually roam or does it just loose connection and reconnect? Could you debug log a 'roam' that will show us what happens. maybe the behaviour is different on open networks, that's also an option. You can enable debug logging for wpa_supplicant through wpa_cli. "log_level debug". I'd be interested to see what it looks like when it roams.

I did put the WPA fix on: http://xdaforums.com/showpost.php?p=46084175&postcount=15332 and found it did not fix roaming so I did not try again. But one could add the bgscan line to the per-network config and put that fix on to see if it fixes scanning? I can do that monday.
[HTC One X] teemo:
It seems to roam. Yes I did take some logs. https://db.tt/42c1o3mI

There are a few disconnects first, from playing around with settings, but later you can see it roams without disconnects. Also, as you say, it may be different than normal wpa roaming.

One thing to note, I am on xzzz9097s paranoid, but it should be using cm-repo for all the wlan stuff, so it is the same.
[HTC One X] pakjebakmeel:
As I can understand this it's code for embedding into a 3rd party application to trigger an instance of WifiConfiguration and pass configuration parameters to it so that can be saved to the networks list.. It speaks to the API for wireless.

The wireless API will need to know any additional configuration value and know what to do with it. But nevertheless I think we need to look at that WiFi API and add code there to understand a per-network configuration entry. Probably 2 changes:

a) WiFi GUI to send that configuration parameter to the API upon connecting

b) API to interpret that parameter and write it to the file

I can only see informational logging, when you enable debug logging with wpa_cli you can see a lot more. All I can see now it that it connects to an AP and later in the log it connects to another. The reason for leaving AP1 and connecting to AP2 is only visible in the debug logging. For instance, if the log says the signal of the previous ap is -9999db it means it lost connection and it's a re-connect, not a roam. When it says the other AP signal is stronger and it's going to change AP whilst still connected to the old it's a roam.

Apart from this, if you don't have the config line in your config then the bgscan module is not loaded (unless hardcoded which would be silly). So my guess is that it might look like roaming but isn't.

Or the other possibility, because it's not encrypted the driver can maybe handle this. And when it's encrypted WPA_SUPPLICANT needs to trigger authentication before being able to hop AP's.

Anyhow, a debug log should tell what's happening. Thanks