yashsingh1/xdaforums huggingface dataset:
[Sony Xperia T, TL, TX, V] vrl13:
Question: in /etc there is this script init.sony.bt.sh

In it there is a line #load bd addr

BDADDR=`/system/bin/cat /data/etc/bluetooth_bdaddr`

but this path /data/etc/bluetooth_bdaddr is wrong.

The only bdaddr file I found is persist.service.bdroid.bdaddr in /data/property but the value within had nothing to do with my current BT MAC: 22:22:96.:etc

My current BT MAC address is present in a file /data/misc/bluedroid/bt_config.xml

<N2 Tag='Address'

Type"string">00:A0..blah:c0</N2>

Anyone got a clue on how is the BT MAC address generated in this ROM? :D cause then maybe we can at least spoof it somehow..
[Sony Xperia T, TL, TX, V] Aria.A97:
Maybe this sounds stupid but can you change permissions of that file with ES File Explorer to only read? and then see what happens :laugh:
[Sony Xperia T, TL, TX, V] vrl13:
Hi,

Stupid or not I actually DID try that... No use, the file is only a record of the current BT MAC, not the source.

I also made the path and the missing target file for the script...BT does no longer start with it, so I had to remove it.

Any other ideeas? :D
[Sony Xperia T, TL, TX, V] neofral:
i'm currently reading bout the script that is enabling bluetooth (system\etc\init.sony.bt.sh), it's quite different than the stock one. i put the stock script and also renamed it but it's not working. right now i'm moving further to read what are the differences in the procedure of setting the mac address via the stock and the omni rom script. it seems like they both use the (system\bin\btnvtool) to load the address or generate random address. my opinion is that the kernel somehow is not reading the address from the board thus btnvtool generates one randomly. work in progress...
[Sony Xperia T, TL, TX, V] WhiteNeo:
It cant be related to the kernel, as the bluetooth issues persist on CM11 NeoKernel.

Perhaps the CM11 btnvtool would fix it?

I have the feeling that if we find out what's wrong here we'll also fix the bt pairing bug. :good:
[Sony Xperia T, TL, TX, V] colonel_lp:
It seems that this is not a new problem, found references to this happening as far back as CM7 and also on some stock devices.. Only solutions I came across involved scripts to change files that I can find on our roms.. Well done on neofral on looking into the files, good luck. :)
[Sony Xperia T, TL, TX, V] vrl13:
Credits due here too :) [MENTION=5039141]jeromemo[/MENTION]
[Sony Xperia T, TL, TX, V] colonel_lp:
Found this:

BT Fix

dont know if it helps, looks different to our file....
[Sony Xperia T, TL, TX, V] neofral:
i tried to write those lines into init.sony.rc which is woken by init.qcom.rc, because there were other related commands. however, didn't make any difference. it looks like the problem is more serious between the scripts and the .rc files. i looked each file from stock sony rom and compared to our NeoWave and files are very different. it seems like the omni rom is build that way and this should be general omni rom or our masters kitchen bug. since i'm not very familiar with linux and the android platform, i think only experienced developers can help us identify the lines or files missing which are not reading and setting the mac address.

i'm sure that btnvtool environment is not setup correctly (especially the persistent files which store the ma-caddres of the bluetooth.

also just for information, the mac address is not changing on each reboot but on each enable/disable of bluetooth even without rebooting

EDIT: when executing btnvtool with parameter -O, returns "The file /persist/.bt_nv.bin doesn't exist"

perhaps [MENTION=5122093]WhiteNeo[/MENTION] can look into this and try to fix this issue either in init.qcom.rc or init.sony.rc :)
[Sony Xperia T, TL, TX, V] pollob666:
BT MAC change problem solved temporarily

I guess I might have a temporary solution. I just need someone checking it for me.

As [MENTION=2075099]neofral[/MENTION] said, He was looking at the init.sony.bt.sh I also got interested and like [MENTION=4618211]vrl13[/MENTION] I also found these lines

#load bd addr
BDADDR=`/system/bin/cat /data/etc/bluetooth_bdaddr`

It says to read the bluetooth address from the /data/etc/bluetooth_bdaddr file and set $BDADDR variable value with it.

But the problem is there is no /data/etc/ directory. So I created one with 777 permission and created a simple text file with 777 permission named bluetooth_bdaddr gave it 777 permission and rebooted.

From now on, whenever I enable bluetooth, it shows the MAC I specified in the /data/etc/bluetooth_bdaddr, it doesn't change I need someone else to check & confirm.

I guess that also answered how to spoof Bluetooth the MAC ;)
[Sony Xperia T, TL, TX, V] vrl13:
What I find strange is that I did the same (cteated the path and the file), but then I could no longer enable BT at all.

The permissions were rw-r--r--(644?) and the MAC format 00:1a:2b:etc (the last MAC address I had)

What was the MAC format you used?

L.E.- nevermind me, I found an error (i used an O instead of a 0) :D silly...

---------- Post added at 12:42 PM ---------- Previous post was at 12:10 PM ----------

With absolute satisfaction and enthusiasm I hereby announce the BT problem to be SOLVED via using the initialization script workaround.

With the small change described above (O to 0) BT starts normally and the pairings now survive both BT toggles and phone reboots.

All my best [MENTION=5039141]jeromemo[/MENTION] and [MENTION=2075099]neofral[/MENTION] for getting to the bottom of this!
[Sony Xperia T, TL, TX, V] pollob666:
I would like to know, how the bluetooth_bdaddr file is being generated. I guess it has something to do with btnvtool and When I use it with -p (Print settings) I get something like

--board-address: 88.40.fa.**.**.**
--reference-clock: 19.2 MHz
--clock-sharing: Enabled

Here the board address is different than the MAC I defined in bluetooth_bdaddr, but When I set it to fix the value at boot (-o option) it says

The file /persist/.bt_nv.bin doesn't exist...

:( Now as it is a .bin file, I can't just create one blank file with the same name, but if it's possible to read the command output and set the value in bluetooth_bdaddr with a lot of text parsing scripting, then it can work for all. Else, there is a possibility that more than one person may end up with same Bluetooth MAC address :confused:
[Sony Xperia T, TL, TX, V] neofral:
I think we shouldn't mind if we end up with the same mac address :D

Please post the files so we can replace ours with yours that is working and everyone can change their address to their liking until we connect the board address and the .bt.nv_bin

Thanks for your help

Sent from my SM-G850F
[Sony Xperia T, TL, TX, V] WhiteNeo:
I was thinking about providing a flashable zip with one random bluetooth mac adress..

People can modify it to their liking, but the chance that two people using NeoWave actually meet in real life and do a bluetooth pairing is extremely low. :D

Also, has anyone tried replacing NeoWave's btnvtool with CM11's yet?
[Sony Xperia T, TL, TX, V] pollob666:
I know that would slove the issue, but I was thinking to come up with a better script for

#load bd addr
BDADDR=`/system/bin/cat /data/etc/bluetooth_bdaddr`

something like,

BDADDR='/system/bin/btnvtool -e | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' '

that could really solve the issue

I tried replacing btnvtool with the stock JB one, same error. :(
[Sony Xperia T, TL, TX, V] neofral:
As i've said earlier the btnvtool is working ok. But the environment to store the board readings isn't there. Perhaps you know how to create the correct environment by comparing the init.qcom.rs and init.sony.rs with CM ones :D

In the meantime tha would be great if you post in addons this temp solution :thumbup:

Sent from my SM-G850F
[Sony Xperia T, TL, TX, V] vrl13:
What about /data/property/persist.service.bdroid.bdaddr?

This never changes on BT toogle or reboots.

Mine contains a MAC address like 22:22:96:xn:xm:6a where x is a repeating hex number and n and m are another (different) 2.

Is this unique for my board or do we all still have the same?

If it's unique then it can be used as a source for the BDADDR in the script by simply redirecting the cat command to this file.
[Sony Xperia T, TL, TX, V] pollob666:
After looking closely, It is not working OK. :(

Though it says that the -p option is used to read the address and print it, It is always giving a Random MAC

Sorry I didn't notice this at first. :(

We might need to go with the temporary solution by [MENTION=5122093]WhiteNeo[/MENTION] for permanent.
[Sony Xperia T, TL, TX, V] neofral:
In that file i have:

22:22:a5:2d:c7:14

Sent using my XperiaV running NeoWave 1.2.2 rom
[Sony Xperia T, TL, TX, V] vrl13:
It's different than mine!

If we can get at least one more confirmation I would say we found our "real" MAC addresses.

Note: the file permissions (rw- --- ---)do not allow a normal cat to be run on it.

I ran in terminal:

/system/bin/cat /data/property/persist.service.bdroid.bdaddr

Permission denied

Running the same after running su worked though (since root has rw)

Is there a way to make the initialization script run the cat command with su rights?

Alternatively we could change the target file permissions, but this should also be done within the ROM zip for new installations.
[Sony Xperia T, TL, TX, V] pollob666:
Lets change the permission and modify

BDADDR=`/system/bin/cat /data/etc/bluetooth_bdaddr`

to point to the persist.service.bdroid.bdaddr

let me check and give you the update.
[Sony Xperia T, TL, TX, V] WhiteNeo:
I might look into this later :good:

Mine is different as well. So this might actually work! :good:

I was thinking about just creating a simple symlink via an init.d script. Would probably be the easiest way to solve this. :D
[Sony Xperia T, TL, TX, V] Knutselmaaster:
Didn't you say that there is no init.s support on our rom?
[Sony Xperia T, TL, TX, V] WhiteNeo:
I did.. Well. Most likely the script would have to be executed only once anyway. So I think it could be done from recovery.
[Sony Xperia T, TL, TX, V] banciii:
Hello! Is this kernel fully compatible with the latest CM11 builds? Cause yesterday I flashed the fixed kernel and today morning I realized that my phone is off. I turned back on, and after a few hours in deep sleep, it was off again. o.O

(As I checked the ZIP before the install, it looked like a flasheble ZIP for me, so after I flashed boot.img with fastboot, I flashed the ZIP in recovery too, just to be sure.)
[Sony Xperia T, TL, TX, V] Aria.A97:
Some users here have that problem. Don't know what causes that. I had this problem on NeoWave too. I flashed CM Based kernel over Carbon ROM and it's working like charm :good:
[Sony Xperia T, TL, TX, V] finac94:
I had that problem too so I had to switch to another rom. I guess it's got something to do with decreased voltages :confused:
[Sony Xperia T, TL, TX, V] peter-k:
I suspect that, too. Yesterday I increase the 384 MHz voltage one nod.
[Sony Xperia T, TL, TX, V] WhiteNeo:
The low frequency values are nearly the same. The higher the cpu clock, the higher my voltage decrease. :)
[Sony Xperia T, TL, TX, V] peter-k:
Running since 3 days at 912.5 for the idle Mhz. I will report back.

I think the idea by our friendly Dutch neighbour to make it run more on the intermediate frequencies is worthwhile. I adjusted it according to his data and it shows more frequency spread. The 2. core however less so but that seems all right to me.
[Sony Xperia T, TL, TX, V] Knutselmaaster:
The system tuner app lets you set everything for each separate core.

Apparently it is even possible to set different governor for each core, but I haven't tried that.

Running only one core overclocked (I use when playing ingress in warm places to prevent overheating) is really effective too.

I'm still on the omni kernel, waiting for some more feedback on the newest cm11 one, so I don't know if it works on the cm kernel.

Edit:

I forgot to mention the sampling_down_factor setting.

This indicates the number of cycles the cpu remains in higher clock when it isn't needed anymore.

Default setting is 4, but I haven't found anything indicating that it is needed so I have set this to 1. This greatly lowers the time that is spent in high clocks and I haven't found any negative side effects, it just gets temps lower and battery usage is significantly better.
[Sony Xperia T, TL, TX, V] WhiteNeo:
Could anyone try the following bluetooth fix?

Just enter the following lines in terminal:

This will create a /data/etc directory and link the requested bluetooth address to the one specified in data/property (and thus a unique one for every phone)

Bluetooth starts properly here, so it should work. I couldn't test pairing yet, however.

If you are already using the other bluetooth workaround, just delete the complete /data/etc directory before typing the stuff in terminal.

If it works for you, I'll create an app or script for everyone to fix this issue with one button press. :)

EDIT: Tested it myself. NeoWave does indeed have init.d support, if scripts are placed with the proper uuid. As such, I've created a flashable zip with an init.d script that will fix the bluetooth issues.

Please test and report!

https://www.androidfilehost.com/?fid=95784891001602832
[Sony Xperia T, TL, TX, V] neofral:
I tested the zip, didn't work. Tested command line, again not work. Since i changed quite some files on system dir, i flashed 1.2.2 again, flashed zip - again not work.

Somebody else please try the zip and let me know if i need to do a full wipe

Sent from my SM-G850F
[Sony Xperia T, TL, TX, V] vrl13:
I don't think this will work as long as the target file has permissions only for root.

When you create the link with su you're still doing it as root, but the cat from the initialization script is not.

Can an init script run a command as su? Cause that would really simplify things.. Upon install run a su and cat on the /data/property file to copy the content in /data/etc/blahbdaddress, then the script should self-delete.
[Sony Xperia T, TL, TX, V] WhiteNeo:
What do you mean by "doesn't work"?

Init.d scripts are executed as superuser by default.

The symlink makes the content of data/property visible for the bluetooth initialization.

I'll test pairing myself in a few minutes. But bluetooth activates without problems, so it should be fine..

[MENTION=2075099]neofral[/MENTION]

Did you delete data/etc folder before flashing?

If yes, please tell me what error the Terminal prints. :)
[Sony Xperia T, TL, TX, V] WhiteNeo:
Perhaps just a "chmod" at the end of the script is missing?
[Sony Xperia T, TL, TX, V] vrl13:
$>su

$>/system/bin/cat /data/property/persist.service.bdroid.bdaddr > /data/etc/bluetooth_bdaddr

$> /system/bin/cat /data/etc/bluetooth_bdaddr

22:22:96:Xn:Xm:6a

$>exit

Flawless victory:D

Note: in my case the bluetooth_bdaddr was created in the 1st place with 777 permissions.

So I guess the complete script to implement this solution from scratch needs a chmod anyway so:

$>su

$>/system/bin/cat /data/property/persist.service.bdroid.bdaddr > /data/etc/bluetooth_bdaddr

$>chmod 777 /data/etc/bluetooth_bdaddr

$>exit

Test without su:

$> /system/bin/cat /data/etc/bluetooth_bdaddr
[Sony Xperia T, TL, TX, V] neofral:
i checked, there is no such folder in system :eek:

---------- Post added at 11:09 PM ---------- Previous post was at 11:00 PM ----------

i tried this, it didn't return my bluetooth address as you have. in stead, the result is the command content
[Sony Xperia T, TL, TX, V] jeromemo:
thanks! im glad i helped with reporting issues :good: oh and btw [MENTION=5122093]WhiteNeo[/MENTION] i didnt know you mentioned init.d isnt supported on NeoWave, but since 1.1.0 ive been using init.d script for swap on /cache and it works :)
[Sony Xperia T, TL, TX, V] Aria.A97:
Guys, I found something. I'm using NeoKernel on Carbon ROM. Everything was fine till yesterday. Yesterday I installed Smile Alarm Clock and set an alarm for today morning but when I woke up, phone was turned off. Battery was 89%
[Sony Xperia T, TL, TX, V] WhiteNeo:
So there is no /data/etc directory?

It should have been created by the script.

Did you flash it in recovery? (Permissions and uuid are really important here.)

If you face issues, I suggest manually extracting the script from my zip to a location of your choice and executing it via Terminal. Then tell me what the shell responds.

Also, check if a data/etc directory had been created after using the script.

If no, it's most likely some error with the mkdir command.
[Sony Xperia T, TL, TX, V] WhiteNeo:
Can you reproduce the problem and grab a kernel log when it happens next? :)

Otherwise I cant find the reason for this issue.
[Sony Xperia T, TL, TX, V] finac94:
That happened to me too when I was on this rom :(
[Sony Xperia T, TL, TX, V] peter-k:
What were the orgianl voltages please?
[Sony Xperia T, TL, TX, V] WhiteNeo:
I think I've showed a table of this, lots of pages ago. :D
[Sony Xperia T, TL, TX, V] Aria.A97:
Tonight I'll sleep with CatLog app running :)

---------- Post added at 01:37 PM ---------- Previous post was at 01:27 PM ----------

http://xdaforums.com/showpost.php?p=55814391&postcount=481
[Sony Xperia T, TL, TX, V] neofral:
while working on solution to the address i've replaced some files in system and system/etc. i went out on the mountains for a weekend and i lost track of what i did and the backup files were :o

so after trying the fix on as is system didn't work, each time i enable/disable bluetooth the mac address changes. so i did a restore of the system to a point before i started messing up the files again the same. so i did full wipe, installed fresh 1.2.2, applied the fix tried and again mac address changes. so i returned to my the restore and waiting for a different solution :good:
[Sony Xperia T, TL, TX, V] WhiteNeo:
Thanks for trying anyway :)

The problem is that your description doesn't tell me what's wrong. I need the terminal's output when the script is running. :)
[Sony Xperia T, TL, TX, V] neofral:
ok, please let me know what you need. i'm available now and also have adb via pc :D

EDIT: the terminal output:

root@tsubasa:/ # /system/bin/cat /data/etc/bluetooth_bdaddr

/system/bin/cat /data/etc/bluetooth_bdaddr

22:22:a5:2d:c7:14root@tsubasa:/ #

however, when i turn bluetooth on this address is not assigned
[Sony Xperia T, TL, TX, V] WhiteNeo:
Hm... Alright, so the symlink isn't recognized. That's all I wanted to know :D

Will create a script with the "cat" comand later, this might work better. :)
[Sony Xperia T, TL, TX, V] WhiteNeo:
Improved the script.

https://www.androidfilehost.com/?fid=95784891001603301

Please test and give some feedback. :)
[Sony Xperia T, TL, TX, V] neofral:
Congratulations, i confirm that this script works :D

I enabled/disabled bluetooth several times and each time the same mac address appears. Yes it's the one from /data/etc/bluetooth_bdaddr :thumbup:

If you want you can wait for another confirmation or go ahead and post the link on add-ons right away.

Thank you for your kind support :beer:

Sent using my XperiaV running NeoWave 1.2.2 rom
[Sony Xperia T, TL, TX, V] colonel_lp:
Yep it works, as in the mac address stays.. Dont really use BT, so haven't tested pairing...

There was no mac address in my /data/property/persist.service.bdroid.bdaddr file, had to go looking for it in the /data/misc/bluedroid/bt_config.xml and paste it in.. Unless that was the point! :o
[Sony Xperia T, TL, TX, V] neofral:
The point was to have the same address appear after enable/disable bluetooth or after reboot. The reason why pairing didn't work was because the pairings had all necessary security but the mac address confused devices so you had to unpair and pair again. So, thanks for confirming :thumbup:
[Sony Xperia T, TL, TX, V] peter-k:
The voltages are lowered in between 50 - 100 mV. That's sounds smaller than it is in the CPU world.

I set the idle voltage (=384 Mhz) to 925 mV. No black screen in the morning since 4 days.

I also set the 1620 Mhz voltage to 1250 mV, which now is the same as the factory value for the factory max speed 1512 Mhz, albeit this has nothing to do with the morning black screen.
[Sony Xperia T, TL, TX, V] WhiteNeo:
Run a benchmark with 1620MHz at that voltage and your phone will shut down. That's why I kept it one step higher.
[Sony Xperia T, TL, TX, V] peter-k:
I am confused now. I found you set the voltage at 1200 mV for 1620 MHz on my device. That seemed indeed very low and that is why I raised it. Indeed, I was wondering about all the values which I find quite on the low side.
[Sony Xperia T, TL, TX, V] WhiteNeo:
Its all a little confusing. Our CPU seems to have three variants - fast, normal and slow - and different voltages for each. (check my kernel source)

It seems not every XV is of the same variant.

If you increase the voltages, of course everything will be fine, but your phone might heat up more. Just dont set 1300mV or more cause this will cause a soft reboot. It's the kernel's voltage limit.
[Sony Xperia T, TL, TX, V] peter-k:
So testers will get the phone with the Sony display and the "fast" processor. Consumers later buy the version with the Toshiba screen and the slow processor?

I increased the idle voltage and the overclocked 1620 hoping that this will solve the morning black screen. Is it the "slow" people who get the back screen?
[Sony Xperia T, TL, TX, V] Knutselmaaster:
Not exactly.

The most reviews I read about the V (and other sony phones that exist with different displays) are definitely not the Sony display ones, testers often complain about the screen, indicating that are not the Sony displays.

I bought my V at the lowest possible price at a webshop with very bad reputation ( no I won't say which as they really don't deserve the attention) and it has got the Sony display.

I didn't know there are different types of processors, how can we know and how can the lucky owners take profit of this advantage ?
[Sony Xperia T, TL, TX, V] WhiteNeo:
If you want to find out what type your cpu is, you can compare your phone's voltages when using NeoKernel on default settings with the freq tables here.

https://github.com/WhiteNeo-/NeoKernel/blob/master/arch/arm/mach-msm/acpuclock-8960.c

As the voltage for the "fast" cpu is much less, I think those might have the reboot issues. But I need confirmation by some people. :)
[Sony Xperia T, TL, TX, V] colonel_lp:
Well, for information, mine came with the sharp screen, before I smashed it!! and the voltages correlate with fast processor! :D
[Sony Xperia T, TL, TX, V] neofral:
i bought my phone from germany in the very start of it's release. i know for sure that it had Sony display. when i compare the voltages it seems my voltages are lower than the link.

for having different variants i'm sure because i cracked my front glass and had to order from amazon. i ordered a complete digitizer and display along with the frame. but when i was assembling the phone, the frame wouldn't fit my phone. i had to do extensive work trying to fit the frame into the body of the phone thus i lost water resistance since the panel didn't close properly.
[Sony Xperia T, TL, TX, V] Knutselmaaster:
Mine goes from 9000 to 12000 so it is the middle table.

I never had sleep of death on any rom.
[Sony Xperia T, TL, TX, V] Aria.A97:
Mine is from 9000 to 12000 too! :) and comes with awesome Sony display :good: but I had reboots and Sleep Of Death :D
[Sony Xperia T, TL, TX, V] neofral:
true that. i've had them too at first when 1.2.2 came out. after flashing the testing kernels from WhiteNeo the sleeps of death stopped and never had them since. now after flashing several times the 1.2.2 due to the bluetooth fixing, i'm still on stock kernel that was with the rom version and stock voltages and frequencies as they came. today is day 2 since my last flash and no sleep of death. i'm thinking to flash the CM Kernel that WhiteNeo suggested and will report in few days
[Sony Xperia T, TL, TX, V] Knutselmaaster:
So apparently there is no link between proc speed and sleep of death as I have had the same setup with no problems.