FIXED ISSUE - Trying to fix the BT calling issue

Bogdan010

Senior Member
Feb 29, 2016
422
207
53
Reading in the tread rayman95 provided. I found mainly instability issues ie.. dropped connections and conflicts with WiFi. No issues like we have with the note 3.

I unpacked the kernels of klte+hlte 15.1. I don't know of any way to view the zImage it self. In the files and folders I can view, the setting for Qcom and Bluetooth are the same. I didn't find any mention of es325. Wish I knew more, then I could be more helpful.
Someone said: even voice recording over bluetooth doesn't work. I think instead of fixing bt call, better fix this thing and maybe bt call will be fixed too… :)
 

cssr

Senior Member
Jun 4, 2013
317
224
0
Zachary
Someone said: even voice recording over bluetooth doesn't work. I think instead of fixing bt call, better fix this thing and maybe bt call will be fixed too… :)
Bluetooth voice recording does work on my note 3. I tested it to be sure. When trying to make a BT call I get a loud static sound ( 3-5 seconds ) followed by silence ( 30-60 seconds ) and it repeats as long as the call is active.
 
Last edited:

iesous-kurios

Senior Member
Aug 26, 2009
208
235
0
Spokane
iesouskurios.us
Found somebody that fixed a similar problem on another device which shares the msm8974 with us:
3a) Description: Garbled /mute incall sounds on bluetooth (msm8974)
Background:
The sample rate for calls is usually 8k, however for wide-band speech it is 16k. It seems that some devices cannot handle this sample rate and will only work on WBS with 8k.
This behavior was confirmed on the klte. The fix might be ported to other devices:
Fix: https://review.lineageos.org/#/c/178371/
Link Found Here

I was going to look into it more and see if applying this fix would do something, but I'm still new to git/repo changes so figured I would share here to see if this has already been fixed in our version and the problem still persists or if it hasn't been applied to our source code somebody here could try it faster than I could.

edit:

found:
https://github.com/jfuginay/android...mmon/blob/lineage-16.0/bluetooth/vnd_hlte.txt

looks like we've already applied this fix, and still have issue, so, I'm sorry for yet another dead end :(

edit2:

There is another potential fix they utilized which is not in our common source code:

3c) Description: Garbled /mute incall sounds on bluetooth (msm89** / jfltexx)
@jorgemiguel4 Found out what fixes the mute calls: Thanks to you!
Quote:
#define BTM_WBS_INCLUDED TRUE
#define BTIF_HF_WBS_PREFERRED FALSE //With this set to TRUE there is no sound on my side.

This will enable WBS (for the car support) but it will use the default codec instead which does not have the WBS samplerate issue.
Therefore audio quality might not be perfect but at least it works.
I forked the sourcecode and have changed it to FALSE and will repo sync, build, and test it out...

Edit: test update
Sad to say the Bluetooth calling was still static/garbled :(

I will try disabling wbs and test again. In training all day so will be tonight before I can change code and rebuild.
 
Last edited:

cssr

Senior Member
Jun 4, 2013
317
224
0
Zachary
What did you used to test it? I can't record with my headset, it's the same garbled sound recorded.
I used my $10 Dollar General store headset, the brand name is travelocity. I ran it on my own los 15.1 hltetmo build dated 01/11/19. VLC wouldn't play the file, but the lineage music player did. I can test an older build if needed. Link to the same ROM for all 4 hlte... phones. Thanks!

https://androidfilehost.com/?a=show&w=files&flid=287906
 
  • Like
Reactions: Marvino.

txx3

Senior Member
Feb 16, 2013
2,325
736
0
Never seen a bug this nasty ..

Hope u guys figure it out, good luck!!! :good:
:fingers-crossed: :fingers-crossed: :fingers-crossed:

Death to the Bluetooth Bug
DTTBB!!!
 

Bogdan010

Senior Member
Feb 29, 2016
422
207
53
Bluetooth voice recording does work on my note 3. I tested it to be sure. When trying to make a BT call I get a loud static sound ( 3-5 seconds ) followed by silence ( 30-60 seconds ) and it repeats as long as the call is active.
like what i said :)
 

txx3

Senior Member
Feb 16, 2013
2,325
736
0
from Android N to O ..what exactly did change, sound output work with Bluetooth, can it be something with the phone app itself?
 

DaOldMan

Senior Member
Oct 6, 2010
3,284
5,562
253
What did you used to test it? I can't record with my headset, it's the same garbled sound recorded.

@Michelsup , he is correct. When I tested the BT bug my recordings from Call Recorder were 100% fine. I could hear in the recordings the guy from other side like he is standing in front of me. At the same time I got horrible shrieks in the car loudspeakers instead. That is how I knew RIL is working fine and the bug just in the BT transmissions.
 

iesous-kurios

Senior Member
Aug 26, 2009
208
235
0
Spokane
iesouskurios.us
After many cul-de-sac due to my lack of brain power, I think I might got an hint on the issue. I might be completely wrong so please just tell me what you think.

When you do a call with BT the kmseg is like


So es325 is routing to route 4, which is


per

I beleive this is wrong, as instead it should be something like route 21



In fact the ES325 chip is not properly loaded to start with.

So the question is: shall we use ES325 or not ? (I think we should)

If the answer is positive, it would worth a try to load it properly.

What do you think?
Searching through that file, I found that when the es325 is first defined, it is being automatically defined as Narrow Band. This normally isn't too bad, but later on in the file there are if/then statements to do particular things when we are on either narrow or wide band.
Code:
#define ES325_INTERNAL_ROUTE_MAX 26
static long es325_internal_route_num;
static int es325_network_type = NARROW_BAND;
I'm thinking about taking off that auto definition of "NARROW_BAND" and seeing if the rest of the code can do it's proper switching to narrow or wide band based on your network type:

Such as:

Code:
if (network != NARROW_BAND)
		es325_network_type = WIDE_BAND;
	else
		es325_network_type = NARROW_BAND;
	
	if(FW_not_ready || es325_priv.wakeup_cnt == 0) {
		pr_info("%s: es325 not ready, return\n", __func__);		
		return 0;
This doesn't make sense to me to include code like this if "network type" is automatically defined as narrow band from the getgo.

edit:

Looked at haggertk git, his galaxy s5 with working bluetooth has :

Code:
#define ES325_INTERNAL_ROUTE_MAX 26
static long es325_internal_route_num;
static int es325_network_type = NARROW_BAND;
So it doesn't look like removing the auto definition of "narrowband" will fix our bluetooth calling. I will continue comparing this file to ours and see if there are any differences.

Going to go ahead and let my build complete and flash it anyway, just in case, but not so hopeful that it will fix our bluetooth now that I see that haggertk has bluetooth calling working with this narrowband being defined by default.
 
Last edited:

Buslova

Senior Member
Jan 11, 2012
172
129
43
It's there any chance that BT call issue will be solved sometimes or is it a permanent problem with missing drivers or similar issue?
Well people have been trying to figure it out for almost 2 years now since Oreo came out and no one has succeeded yet. I REALLY REALLY hope someone solves it but considering the time and effort that has already been put in with no true solution, I really have my doubts. I fully expect to be "stuck" on Nougat (to be fair, Samsung never bothered bringing Nougat to our devices so mega kudus to the home brewed devs who made it happen) for the remainder of the life of my Note3 since I absolutely have to have BT calling. I don't speak on the phone without it. Stupid to be tying up an arm/hand just to hold a phone to my ear in this day and age not to mention its safer while driving and also while multi-tasking.
 

loudawg11

Senior Member
Mar 8, 2010
93
21
8
Cincy
I'm in the same boat. The Dev for the Note 3 have tried everything to get the BT calling working .... true troopers. I with keep my Note 3 with the hope's they crack the issue. For the past 3 weeks I'm trying out the LG v20 which has stock Oreo and removable battery and IR blaster that I use .... I really miss My Note 3. So I'll Keep Hope Alive.
 
  • Like
Reactions: smartmaxdr

bluetooth-bug

Member
Jan 11, 2019
21
12
0
I know what the issue might be. It is described here: https://forum.xda-developers.com/showpost.php?p=78902533&postcount=5262

It appears that this might be a hardware issue with the chipset related to AD2P being sent over PCM but apparently only being able to send HFP over UART and if that UART is not configured exactly you get lots of distortion and other issues.
Route audio through PCM and not UART. If you do it though UART you get the distortion. There's not enough bandwidth for the audio streams.

Here's a datasheet for the BCM4339/CYW4339 (same chip): https://www.cypress.com/file/298016/download
 

Buslova

Senior Member
Jan 11, 2012
172
129
43

abloodyrookie

Member
Mar 5, 2019
5
1
0
Well nice idea, but then people want a successfull fix.
For me it seems that Google removed the necesssary code as the chipset is 6 years old. And this is an other way to get rid of old devices. May be i am wrong. :confused: