xzckiller / openeve

Automatically exported from code.google.com/p/openeve
0 stars 1 forks source link

bluetooth headset sound problem #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.pairing the bluetooth headset
2.making a call
3.pressing on the bluetooth button while make a call to route audio to the 
headset.
4.scratching voice (noise) like an no-signal radio station audio
5- I tried another bluetooth headset, but the same

What is the expected output? What do you see instead?

routing the audio while calling to the headset

What version of the product are you using?

latest 2.3.3 with updates with latest libaudio.so (which makes the FM radio 
working perfectly)

Do you have logcat or dmesg ?
 (adb shell logcat > logcat.txt ^C, adb shell dmesg > dmesg.txt)

attached

What version of the *Official LG* Firmware were before using Custom
firmware ?
(V20G, V20D, V15x, V16x etc. )

V20G

Original issue reported on code.google.com by justsad.eng@gmail.com on 18 Apr 2011 at 6:24

GoogleCodeExporter commented 9 years ago
Same issue here...:P

Original comment by cmgonza...@gmail.com on 18 Apr 2011 at 7:10

GoogleCodeExporter commented 9 years ago
same issue was in openetna, no way to correct this were found.

Original comment by Fedo...@gmail.com on 19 Apr 2011 at 4:14

GoogleCodeExporter commented 9 years ago
Same for me, hoping for a solution one day !!

Original comment by denislap...@gmail.com on 20 Apr 2011 at 6:40

GoogleCodeExporter commented 9 years ago

Original comment by wkp...@gmail.com on 30 Apr 2011 at 12:21

GoogleCodeExporter commented 9 years ago
Same for me, phonebook and audio not werking in car audio system,hoping for a 
solution.
I need it every day.
Thanks for everyting.

Original comment by arnovano...@gmail.com on 1 May 2011 at 8:31

GoogleCodeExporter commented 9 years ago
I think this is according to proprietary firmware for BT-module. File transfer 
speed is low too, so not enouth speed for sound routing

Original comment by Fedo...@gmail.com on 2 May 2011 at 5:58

GoogleCodeExporter commented 9 years ago
Fedo..>>>>  File transfer speed is good (from 20-40 Kbps).

Original comment by justsad.eng@gmail.com on 2 May 2011 at 6:28

GoogleCodeExporter commented 9 years ago
Mb this is not enough to sound?

Original comment by Fedo...@gmail.com on 2 May 2011 at 6:51

GoogleCodeExporter commented 9 years ago
It's enough , the Ideal speed of blue-tooth 2.0 is (20-40) Kbps .

Original comment by justsad.eng@gmail.com on 2 May 2011 at 7:34

GoogleCodeExporter commented 9 years ago
I have just converted from Official 2.2 Froyo on my GW620R-v10f.Everything 
works well except the bluetooth phone audio to my hands free motorola T505. 
Media audio is fine. Had the same problem with Openetna, so I installed the 
Official 2.2 and the bluetooth worked perfectly. Is there any way to install 
the bluetooth.apk from 2.2(if it exists) into the 2.3 gingerbread. If not 
please make bluetooth a priority as we all need handsfree in our cars with the 
new safety laws. Thanks for all your work on this project. You've done a 
marvelous job and keep it up.

Original comment by warrenfr...@gmail.com on 17 May 2011 at 10:24

GoogleCodeExporter commented 9 years ago
without any logcat this issue is nothing for me.

feel free to attach your logcat if you can.

Original comment by wkp...@gmail.com on 17 May 2011 at 11:24

GoogleCodeExporter commented 9 years ago
Here is my logcat

Original comment by warrenfr...@gmail.com on 18 May 2011 at 2:23

Attachments:

GoogleCodeExporter commented 9 years ago
there are two checkpoints exists.
 1. pairing : Settings => wirelss & network settings => Bluetooth settings => make your divice discoverable and try to pair with another bluetooth device.
 2. sound routing : after step #1, try to route audio.
----
if step #1 fail, try to change your device name and try again. (I think, 
pairing have somthing bug)

Original comment by wkp...@gmail.com on 19 May 2011 at 5:04

GoogleCodeExporter commented 9 years ago
exactly i try make a call whit bluetooth headset and press bluetooth button and 
no sound in bluetooth headset only in the phone or speaker maybe another lib or 
something i search about that see you

Original comment by Jonas.Ca...@gmail.com on 20 May 2011 at 1:29

GoogleCodeExporter commented 9 years ago
I tried the suggestions made in comment 13. Pairing works perfectly well. 
Connection to media and phone audio shows a checkmark for both. When I press 
bluetooth button to start a call, vlingo recognizes it and asks what I would 
like to do. This occurs in media audio. I answer and the phone dials the 
correct person, but as soon as the phone connects to the called person the 
phone audio takes over and remains on the phone rather than switching to the 
car speaker. I believe the problem is with the phone's bluetooth library. On 
the froyo 2.2 official by LG the bluetooth works perfectly, but with this 
gingerbread and also openetna it does not work properly.
I hope you can help with a solution. Otherwise I will have to go back to LG 
official froyo 2.2 . I really like the gingerbread operating system better 
though.

Original comment by warrenfr...@gmail.com on 20 May 2011 at 8:11

GoogleCodeExporter commented 9 years ago
yes. you are already know that. this is libaudio.so problem.
the libaudio.so try to route it's sound to snd devices like as BT, FM radio, 
Headset, speaker of phone.

this is just same the libaudio.so but can print out more verbose debugging 
infos.

you can try to install this libaudio.so (adb remount;adb push libaudio.so 
/system/lib)
and make more verbose logcat like as following.
 1. adb logcat -c (clear logcat)
 2. test your phone with bluetooth etc...
 3. adb logcat -v time > logcat.txt

Original comment by wkp...@gmail.com on 21 May 2011 at 2:24

Attachments:

GoogleCodeExporter commented 9 years ago
hi i test libaudio.so following the instructions i hope so help with this 
problem 

this is my logcat

thanks in advanced

Original comment by Jonas.Ca...@gmail.com on 21 May 2011 at 5:37

Attachments:

GoogleCodeExporter commented 9 years ago
And here is my logcat with the libaudio.so that I downloaded from comment 16

Thanks for your efforts.

Original comment by warrenfr...@gmail.com on 22 May 2011 at 1:06

Attachments:

GoogleCodeExporter commented 9 years ago
I forgot to use the -v option, so here is another logcat with the  -v option

Original comment by warrenfr...@gmail.com on 22 May 2011 at 1:13

Attachments:

GoogleCodeExporter commented 9 years ago
I tried the new chinese version 6++ and found that the phone audio did work on 
the handsfree speaker, but there was lots of static and you could not 
understand anything. So it certainly was not an improvement.

Original comment by warrenfr...@gmail.com on 22 May 2011 at 2:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
maybe my question and useless anyway if we try to replace the 2.2 with the 
official phone.apk maybe the problem lies exactly they would know if you can 
show me how? thanks

Original comment by matteo.b...@gmail.com on 20 Jun 2011 at 6:58

GoogleCodeExporter commented 9 years ago
hello
i've tried some things to try to resolve this problem and found 2 things, i use 
a car hand free integrated with sound system and a classical hand free. when y 
make a call with my car the sound is not routed correctly (ok we know it) and 
when y make a call witch my hand free i ear only noise instead voice (we know 
it to)....
i reflash witch official 2.2 and found that there is 2 apk for bluetooth, the 
first bluetooth.apk and the second who is more interresting : 
BrcmBluetoothServices.apk associated witch BrcmBluetoothServices.odex.... i 
think this is the propriatery apk for bluetooth. i've tried to install on 2.3.4 
but without success. via adb it doesn't found sbin/sh/pm (if someone can help 
to resolve it??) and if y want to install it within the os it give me the 
application is not installed....
y attach the 2 files if someone want to try it and put the phone.apk too (i 
think the problem don't come from it)
maybe we will solve this problem, this rom is really good and give life to ower 
eve !!!

Original comment by thecho...@gmail.com on 30 Jul 2011 at 2:31

Attachments:

GoogleCodeExporter commented 9 years ago
I'm using a Jabra handsfree, and i can get media sound like music on it but 
when i make calls it's still on the handset and not at bluetooth device.

I made sure under bluetooth options that phone and media is used for the 
handsfree.

Thank you.

Original comment by munp...@gmail.com on 5 Aug 2011 at 5:27

GoogleCodeExporter commented 9 years ago
I look at the logcat of comment #18

there are something wrong in this log.

1) doAudioRouteOrMute()
...
05-21 21:10:17.998 V/AudioHardwareMSM72XX( 1280): 
AudioStreamOutMSM72xx::setParameters() routing=32
05-21 21:10:17.998 V/AudioHardwareMSM72XX( 1280): set output routing 20
05-21 21:10:17.998 V/AudioHardwareMSM72XX( 1280): AudioHardware::doRouting 
device 20, fm = 0
05-21 21:10:17.998 I/AudioHardwareMSM72XX( 1280): do output routing device 20
05-21 21:10:17.998 I/AudioHardwareMSM72XX( 1280): Routing audio to Bluetooth PCM
05-21 21:10:17.998 V/AudioHardwareMSM72XX( 1280): doAudioRouteOrMute() device 
ffffffff, mMode 2, mMicMute 0
05-21 21:10:17.998 I/AudioHardwareMSM72XX( 1280): msm72xx_enable_audpp: 0x0000
.....

Recently the doAudioRouteOrMute() is slightly modified at issue #118
(Please see the issue #118 and the comment #25 => 
http://code.google.com/p/openeve/issues/detail?id=118#c25

2) doRouting()
....
05-21 21:09:55.018 V/AudioHardwareMSM72XX( 1280): 
AudioStreamInMSM72xx::setParameters() input_source=6;routing=262144
05-21 21:09:55.018 V/AudioHardwareMSM72XX( 1280): set input routing 40000
05-21 21:09:55.018 V/AudioHardwareMSM72XX( 1280): AudioHardware::doRouting 
device 0, fm = 0
05-21 21:09:55.018 I/AudioHardwareMSM72XX( 1280): do output routing device 0
05-21 21:09:55.018 I/AudioHardwareMSM72XX( 1280): Routing audio to Handset
....

doRouting incorrectly route it input/output devices

------
Please feel free to attach your logcat if you can. (please see comment #16)

Original comment by wkp...@gmail.com on 9 Sep 2011 at 4:54

GoogleCodeExporter commented 9 years ago
Using the libaudio.so from comment #16 above, I produced two logcat's:

The first (logcat-media-first.txt) I tried Media to BT first, but didn't 
realize the volume was off until the second or third try.  I raised the BT 
media volume while a song was playing then it came throught the BT device just 
fine.  After this, I tried a phone call and the sound stay on the phone and 
didn't route through the BT device.  I switched between speaker and bluetoot 
while in the call, with no sound through BT being achieved!

The second (logcat.txt) I tried Phone to BT first, toggled the Bluetooth, Mute 
and Speaker buttons while in a call, but nothing came through the BT device.  
Then, I tried Media to BT and that worked just fine.

Hope this helps narrow down the faulty settings/code!!!

Original comment by nrapa...@gmail.com on 9 Sep 2011 at 1:25

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks!!

09-09 09:15:11.718 V/AudioHardwareMSM72XX( 1279): AudioHardware::doRouting 
device 20, fm = 0
09-09 09:15:11.718 I/AudioHardwareMSM72XX( 1279): do output routing device 20
09-09 09:15:11.718 I/AudioHardwareMSM72XX( 1279): Routing audio to Bluetooth PCM
09-09 09:15:11.718 V/AudioHardwareMSM72XX( 1279): doAudioRouteOrMute() device 
ffffffff, mMode 2, mMicMute 1

also strange that device is still ffffffff(-1)

it might be invalid "libaudio.so".. so I attach the newest libaudio.so.
Please check again.

Thankyou for your feedback!! :)

-----------
I just commented out all of meaningless code for EVE.

...
status_t AudioHardware::doAudioRouteOrMute(uint32_t device)
{
    /*
    if (device == (uint32_t)SND_DEVICE_BT || device == (uint32_t)SND_DEVICE_CARKIT) {
        if (mBluetoothId) {
            device = mBluetoothId;
        } else if (!mBluetoothNrec) {
            //device = SND_DEVICE_BT_EC_OFF;
            device = SND_DEVICE_BT;
        }
    } */

    LOGV("doAudioRouteOrMute() device %x, mMode %d, mMicMute %d", device, mMode, mMicMute);
,,,

Original comment by wkp...@gmail.com on 9 Sep 2011 at 3:52

Attachments:

GoogleCodeExporter commented 9 years ago
With the newest libaudio.so in comment #27, I first heard static over the phone 
to BT connection but once I switched between Speaker and Bluetooth, I could 
hear the phone call through the BT devices.  There were loud noises intermixes, 
but I could hear the voice call.  I didn't try to speak as there other end of 
my call had an answering message machine.  However, it is not routing clear 
sound at the onset.

We are close.  See the attached logcat-new.txt for more details.  At the 
beginning I had a hard time pairing the BT device, but eventually got it to 
work after turning BT off/on on the LG Eve.

By the way, that code snippet above, where does mBluetoonNrec come from?

Original comment by nrapa...@gmail.com on 9 Sep 2011 at 5:38

Attachments:

GoogleCodeExporter commented 9 years ago
>By the way, that code snippet above, where does mBluetoonNrec come from?

Nevermind, I found it here 
https://github.com/OpenEtna/android_hardware_msm7k/blob/eclair/libaudio/AudioHar
dware.cpp

Original comment by nrapa...@gmail.com on 9 Sep 2011 at 7:14

GoogleCodeExporter commented 9 years ago
> There were loud noises intermixes, but I could hear the voice call.

I think the noise reduction is done by Bluetooth headset itself.
and... I guess plug USB cable off could be helpful.

Original comment by wkp...@gmail.com on 9 Sep 2011 at 9:42

GoogleCodeExporter commented 9 years ago
No, I don't feel this issue has been fixed yet.  The first instance of phone to 
BT results in static and to switch you need to have your phone to press the 
Speaker button and then the Bluebooth button, but that doesn't work all the 
time to get voice on the BT device.  In fact, there's no hands-free operation 
here.. ;)  The Speaker "source code" must be setting some values that the 
Bluetooth source code doesn't, thus I was able to hear some voices, but it is 
far from acceptable.  

By un-commenting out that code in comment #27, it removes that the 
ErrorCorrecting_Off that is the norm for BT sound, so leaving the:  "device = 
SND_DEVICE_BT_EC_OFF;" would be a better choice, but that device result hasn't 
work before.  Perhaps, it's just a matter of determining the correct 
number/value for "device".  With the latest libaudio.so that device # is 
returned as hex "c" and before it was hex "ffff".  

Hopefully, I can help by reading through the source code to see if there is an 
obvious fix!!!  It is a shame that media/music to BT device works so nicely, 
and hands-free phone to BT is broken.  In my area (Ontario, Canada) it is 
mandatory to have hands-free BT, thus my interest in this issue.  Thanks for 
ALL your help thus far!

Regards,
-Nick

Original comment by nrapa...@gmail.com on 12 Sep 2011 at 1:17

GoogleCodeExporter commented 9 years ago
In the libaudio source found here 
https://github.com/OpenEtna/android_hardware_msm7k/blob/eclair/libaudio/AudioHar
dware.cpp I do not see where "SND_DEVICE_BT_EC_OFF" is defined except as (-1) 
or hex "ffff", in:
 AudioHardware::AudioHardware() :
    mInit(false), mMicMute(true), mBluetoothNrec(true), mBluetoothId(0),
    mOutput(0), mSndEndpoints(NULL), mCurSndDevice(-1),
    SND_DEVICE_CURRENT(-1),
    SND_DEVICE_HANDSET(-1),
    SND_DEVICE_SPEAKER(-1),
    SND_DEVICE_HEADSET(-1),
    SND_DEVICE_BT(-1),
    SND_DEVICE_CARKIT(-1),
    SND_DEVICE_TTY_FULL(-1),
    SND_DEVICE_TTY_VCO(-1),
    SND_DEVICE_TTY_HCO(-1),
    SND_DEVICE_NO_MIC_HEADSET(-1),
    SND_DEVICE_FM_HEADSET(-1),
    SND_DEVICE_HEADSET_AND_SPEAKER(-1),
    SND_DEVICE_FM_SPEAKER(-1),
    SND_DEVICE_BT_EC_OFF(-1)

In libaudio-qsd8k, it does get explicitly defined along with others at the top 
of 
https://github.com/OpenEtna/android_hardware_msm7k/blob/eclair/libaudio-qsd8k/Au
dioHardware.cpp , namely:
    static const uint32_t SND_DEVICE_CURRENT = 256;
    static const uint32_t SND_DEVICE_HANDSET = 0;
    static const uint32_t SND_DEVICE_SPEAKER = 1;
    static const uint32_t SND_DEVICE_BT = 3;
    static const uint32_t SND_DEVICE_CARKIT = 4;
    static const uint32_t SND_DEVICE_BT_EC_OFF = 45;
    static const uint32_t SND_DEVICE_HEADSET = 2;
    static const uint32_t SND_DEVICE_HEADSET_AND_SPEAKER = 10;
    static const uint32_t SND_DEVICE_FM_HEADSET = 9;
    static const uint32_t SND_DEVICE_FM_SPEAKER = 11;
    static const uint32_t SND_DEVICE_NO_MIC_HEADSET = 8;
    static const uint32_t SND_DEVICE_TTY_FULL = 5;
    static const uint32_t SND_DEVICE_HANDSET_BACK_MIC = 20;
    static const uint32_t SND_DEVICE_SPEAKER_BACK_MIC = 21;
    static const uint32_t SND_DEVICE_NO_MIC_HEADSET_BACK_MIC = 28;
    static const uint32_t SND_DEVICE_HEADSET_AND_SPEAKER_BACK_MIC = 30;

wkpark, could you add the above defines to the libaudio compile and remove the 
uncommented code and restore the "device = SND_DEVICE_BT_EC_OFF;" line. Perhaps 
it is a simple as this? ;)

Cheers!
-Nick

Original comment by nrapa...@gmail.com on 12 Sep 2011 at 4:16

GoogleCodeExporter commented 9 years ago
>remove the uncommented code

Sorry, that line above should read: remove the comments "/*" and "*/" from your 
revised code

Original comment by nrapa...@gmail.com on 12 Sep 2011 at 4:22

GoogleCodeExporter commented 9 years ago
msm7k/libaudio/AudioHardware.cpp is htc kernel specific. so we dont have to 
worry about DEVICE_BT_EC_OFF
OpenEtna also removed BT_EC_OFF stuff.

Original comment by wkp...@gmail.com on 12 Sep 2011 at 5:15

GoogleCodeExporter commented 9 years ago
https://github.com/OpenEtna/android_hardware_msm7k/commit/dbbc973ae4ad028d343199
ae86eb89f2bdd94a70

Original comment by wkp...@gmail.com on 12 Sep 2011 at 5:16

GoogleCodeExporter commented 9 years ago
Huge progress, now the phone connects to the headset but the background noise 
is terrible. I don't believe that the noise cancelling process takes place on 
the headset, since with the same BT hardware and using the official Froyo 
release I was able to hear perfectly.

However, I do think you guys are going to figure it out eventually.

Thanks

Original comment by savalent...@gmail.com on 13 Sep 2011 at 5:46

GoogleCodeExporter commented 9 years ago
We are perhaps a setting away from getting this to works clearly. ;)

When I used the original libaudio.so it routed phone to BT device, but it 
seemed like it WANTED to work but was muted or had a wrong device setting.  

I don't recall OpenEtna having the phone to BT device working, nor the Italian 
or Chinese ROMS therefrom.  The official Froyo worked just fine for me too!

A bit more trial and error? :)

Original comment by nrapa...@gmail.com on 13 Sep 2011 at 3:12

GoogleCodeExporter commented 9 years ago
I re-installed the new Froyo 2.2 custom ROM as prepared by marcjero in the 
OpenEtna forums here http://forum.openetna.com/index.php?topic=15987.0

Everything (phone/music to Bluetooth) works fine so I thought I would attach my 
logcat-efr.txt to see it anything happens differently that with OpenEve's ROM.

After connecting with the BT device (Jabra handsfree), I first connected phone 
to BT, then lowered/raised the in-call volume.  Second I connected music to BT 
and lowered/raised the in-call volume.  All worked perfectly.

Hope this helps.

Original comment by nrapa...@gmail.com on 17 Sep 2011 at 7:03

Attachments:

GoogleCodeExporter commented 9 years ago
@nrapa // thanks~!
anyway, the bluetooth part of Official Firmware is totally different from 
OpenEtna/OpenEVE.
the Official firmware use modified BT stack and it's source codes are totally 
closed.
so we can't use LG's BT related programs at all like as FM-radio etc.

but anyway, your logcat might be good information to fix this BT problem.
I think I have to hack libaudio.so (msm7k/AudioHardware.cpp) based on other 
smartphones of LG etc,
device/lge/thunderg/libaudio/ will be a good starting point found at the CM7 
repo.
https://github.com/CyanogenMod/android_device_lge_thunderg/tree/gingerbread/liba
udio

Original comment by wkp...@gmail.com on 18 Sep 2011 at 8:02

GoogleCodeExporter commented 9 years ago
It reminds me a problem I faced some years ago developping some hw: one device 
was talking in little endian mode, the other in big endian and sound resulted 
as a similar noise.

Original comment by Michael....@gmail.com on 18 Oct 2011 at 4:16

GoogleCodeExporter commented 9 years ago
Will this going to be fixed soon?

Original comment by renato.g...@gmail.com on 19 Oct 2011 at 11:03

GoogleCodeExporter commented 9 years ago
in Colombia does not work on 2G and connecting Bluetooth handsfree but the 
sound is very bad, I have installed the version 2.3.7 with FW V10H

Original comment by wrk...@gmail.com on 2 Nov 2011 at 6:57