Closed Bug 1131945 Opened 6 years ago Closed 6 years ago

[FFOS2.0][Woodduck][monitor][BT]The sound can't play from BT headset when take a call

Categories

(Firefox OS Graveyard :: Bluetooth, defect, P2)

defect

Tracking

(b2g-v2.0M affected)

RESOLVED WORKSFORME
Tracking Status
b2g-v2.0M --- affected

People

(Reporter: sync-1, Assigned: wiwang)

References

Details

(Keywords: qawanted)

Attachments

(2 files)

Created an attachment (id=1153089)
 screenshot
 
 PR Reporter:欧阳文丽
  contact:0752-2639312(61312)
 		
  DEFECT DESCRIPTION:
 >The sound can't play from BT headset when take a call
 
  REPRODUCING PROCEDURES:
 1.Pair with some devices via BT.
 
 2.MS Pair with a BT headset -> call MS -> take the call from BT headset.
 
 3.The sound can't play from BT headset -- KO.
 
 PS:试过多个蓝牙耳机,可以从蓝牙耳机端接电话,挂电话,听音乐,控制音量等,但是接听电话的时候声音不能从蓝牙耳机端播放出来。
 
  EXPECTED BEHAVIOUR:
 >The sound can play from BT headset when take a call
 
  ASSOCIATE SPECIFICATION:
 
  TEST PLAN REFERENCE:
 
  TOOLS AND PLATFORMS USED:
 
  USER IMPACT:
 
  REPRODUCING RATE:
 
  For FT PR, Please list reference mobile's behavior:
Component: Gaia::Bluetooth File Transfer → Bluetooth
What do you mean 'the sound'? Are you saying Music sound playing through bluetooth SCO?
If the requirement is to play music sound through Bluetooth SCO (voice call audio channel), I guess this need to check from BSP audio part.
Attached file log
Hi Jason,

Please contact to reporter, We wanna know what does 'the sound' mean? Is it music or ?
Thanks

Sincerely,
Wayne
Flags: needinfo?(chien-hao.li)
Will, please help to follow up.
Assignee: nobody → wiwang
Hi all,

'The sound' is means calling sound,there are MTK’s reply as below:

Dear Custoemr,

main_log中看到如下异常点
###如下时刻进入通话
047042 02-05 16:23:19.621   152   996 D AudioFlinger: +setMode mode=2
###force use 0x20即BTSCO
071181 02-05 16:23:23.102   152  1921 D AudioMTKPolicyManager: setForceUse()
usage 0, config 3, mPhoneState 2
071324 02-05 16:23:23.116   152   438 D AudioResourceManager: TurnonAudioDevice
= 0x20 DeviceCount = 1
###force use none
072220 02-05 16:23:23.976   152   990 D AudioMTKPolicyManager: setForceUse()
usage 0, config 0, mPhoneState 2
072272 02-05 16:23:23.985   152   438 D AudioResourceManager:
TurnoffAudioDevice = 0x20 DeviceCount = 1
异常点是为什么刚刚force使用BTSCO,但是有马上停止使用了!
目前分析setForceUse()应该是AudioService.java中的setBluetoothScoOn()调用过来的(贵司有把audioservice.java的log去掉了)
而AudioService.java中的setBluetoothScoOn()应该是Gecko中建立或者断开sco时通过audiiomanager调用的,
所以需要请Gecko check为什么刚刚建立sco却又断开!
(In reply to zhensen.su from comment #7)
> Hi all,
> 
> 'The sound' is means calling sound,there are MTK’s reply as below:
> 
> Dear Custoemr,
> 
> main_log中看到如下异常点
> ###如下时刻进入通话
> 047042 02-05 16:23:19.621   152   996 D AudioFlinger: +setMode mode=2
> ###force use 0x20即BTSCO
> 071181 02-05 16:23:23.102   152  1921 D AudioMTKPolicyManager: setForceUse()
> usage 0, config 3, mPhoneState 2
> 071324 02-05 16:23:23.116   152   438 D AudioResourceManager:
> TurnonAudioDevice
> = 0x20 DeviceCount = 1
> ###force use none
> 072220 02-05 16:23:23.976   152   990 D AudioMTKPolicyManager: setForceUse()
> usage 0, config 0, mPhoneState 2
> 072272 02-05 16:23:23.985   152   438 D AudioResourceManager:
> TurnoffAudioDevice = 0x20 DeviceCount = 1
> 异常点是为什么刚刚force使用BTSCO,但是有马上停止使用了!
> 目前分析setForceUse()应该是AudioService.
> java中的setBluetoothScoOn()调用过来的(贵司有把audioservice.java的log去掉了)
> 而AudioService.java中的setBluetoothScoOn()应该是Gecko中建立或者断开sco时通过audiiomanager调用的,
> 所以需要请Gecko check为什么刚刚建立sco却又断开!

Hi zhensen.su,
If the voice call sound cannot be heard from bluetooth headset, did the tester hear from earpiece or speaker?
Hi Shawn,

Yep,the voice sound from device.
Flags: needinfo?(sync-1) → needinfo?(shuang)
Hi
We're not Android, so we don't have setBluetoothScoOn().
AudioManager will check Bluetooth SCO connection status and if SCO is connected, then do:
SetForceForUse(nsIAudioManager::USE_COMMUNICATION, nsIAudioManager::FORCE_BT_SCO);
If disconnected,
SetForceForUse(nsIAudioManager::USE_COMMUNICATION, nsIAudioManager::FORCE_NONE);
See:
http://hg.mozilla.org/releases/mozilla-b2g32_v2_0m/file/b23d848b8639/dom/system/gonk/AudioManager.cpp#l263
​From your case,  please check if Bluetooth SCO connection status is connected or not.
Flags: needinfo?(shuang)
Per discussed about Bug 1131945,
we checked the log you mentioned, there is no SCO disconnection during that time.
Gecko only setForceUse while SCO connected or SCO disconnected.
Hi Zhensen,
We need to clarify a few things here:
1. Please let vendor clarify that there is any Bluetooth SCO connect/disconnect operation which cause setForceUse to config 'none' at timestamp 02-05 16:23:23.976.
Because I did not see any Bluetooth stack log at that time, maybe MTK BT owner can help on it.
2. Clarify why during call, there is any process is trying to write audio buffer

Thanks!
Hi Zhensen,
Despite setForce to none that you're talking about, I have another huge concern about current symptom I observed.

I saw even during the call (SCO connected and audio path to BT_SCO), I still see A2DP streaming is ongoing. This may cause a lot of Bluetooth compatibility issues if the headsets cannot handle two modes (both HFP and A2DP) at the same time, voice-call audio might not be heard from headset or bluetooth speaker. It shall not behave like this. During call session, A2DP shall not be streaming during call sessions.
I have double checked setforce in Gecko codebase.
https://dxr.mozilla.org/mozilla-central/search?q=SetForceForUse&case=false

The only two places that set COMMUNICATION mode and set none are:
dom/system/gonk/AudioManager.cpp
https://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/AudioManager.cpp#301
301 	SetForceForUse(nsIAudioManager::USE_COMMUNICATION, nsIAudioManager::FORCE_NONE); 

dom/telephony/gonk/TelephonyAudioService.js
https://dxr.mozilla.org/mozilla-central/source/dom/telephony/gonk/TelephonyAudioService.js#108
108 	gAudioManager.setForceForUse(nsIAudioManager.USE_COMMUNICATION, force); 

Since we don't see any bluetooth operation log, we shall check any chance we call into TelephonyAudioService.
Hi aknow,


Who will use TelephonAudioService?
Flags: needinfo?(waychen) → needinfo?(szchen)
Hi all,

Except gecko code, I found there is another place which contains setForceUse

vendor/mediatek/proprietary/external/atcid/atci_service/src/atci_audio_cmd.cpp:            AudioSystem::setForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION, AUDIO_POLICY_FORCE_NONE);
vendor/mediatek/proprietary/external/atcid/atci_service/src/atci_audio_cmd.cpp:            AudioSystem::setForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION, AUDIO_POLICY_FORCE_SPEAKER);

does anybody know what is this for?

Sincerely,
Wayne
(In reply to Wayne Chen [:xwaynec] from comment #15)
> Hi aknow,
> 
> 
> Who will use TelephonAudioService?

Telephony will call the function setForceUse if speaker is enabled.
Flags: needinfo?(szchen)
(In reply to Wayne Chen [:xwaynec] from comment #16)
> Hi all,
> 
> Except gecko code, I found there is another place which contains setForceUse
> 
> vendor/mediatek/proprietary/external/atcid/atci_service/src/atci_audio_cmd.
> cpp:           
> AudioSystem::setForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION,
> AUDIO_POLICY_FORCE_NONE);
> vendor/mediatek/proprietary/external/atcid/atci_service/src/atci_audio_cmd.
> cpp:           
> AudioSystem::setForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION,
> AUDIO_POLICY_FORCE_SPEAKER);
> 
> does anybody know what is this for?
> 
> Sincerely,
> Wayne

Hi Wayne,
Form log,we can see setForceUse() is called by /home/swd3/code/0212/vendor/mediatek/proprietary/platform/common/hardware/audio/AudioMTKPolicyManager.cpp and I don't know why called 'AudioMTKPolicyManager: setForceUse() usage 0, config 0, mPhoneState 2' every hundreds millisecond.
The patch adds some debug info in telephony module.
02-05 16:23:08.055   152  1920 D AudioMTKPolicyManager: setForceUse() usage 1, config 0, mPhoneState 1
02-05 16:23:08.056   152   982 D AudioMTKPolicyManager: setForceUse() usage 5, config 0, mPhoneState 1

It looks like two mode had been heavily set, and getDeviceForStrategy() had been called all the time.
(In reply to Shawn Huang [:shawnjohnjr] from comment #20)
> 02-05 16:23:08.055   152  1920 D AudioMTKPolicyManager: setForceUse() usage
> 1, config 0, mPhoneState 1
> 02-05 16:23:08.056   152   982 D AudioMTKPolicyManager: setForceUse() usage
> 5, config 0, mPhoneState 1
> 
> It looks like two mode had been heavily set, and getDeviceForStrategy() had
> been called all the time.

Ok, so now I saw AUDIO_POLICY_FORCE_SPEAKER (usage 1) and AUDIO_POLICY_FORCE_WIRED_ACCESSORY (usage 5).
(In reply to Shawn Huang [:shawnjohnjr] from comment #21)
> (In reply to Shawn Huang [:shawnjohnjr] from comment #20)
> > 02-05 16:23:08.055   152  1920 D AudioMTKPolicyManager: setForceUse() usage
> > 1, config 0, mPhoneState 1
> > 02-05 16:23:08.056   152   982 D AudioMTKPolicyManager: setForceUse() usage
> > 5, config 0, mPhoneState 1
> > 
> > It looks like two mode had been heavily set, and getDeviceForStrategy() had
> > been called all the time.
> 
> Ok, so now I saw AUDIO_POLICY_FORCE_SPEAKER (usage 1) and
> AUDIO_POLICY_FORCE_WIRED_ACCESSORY (usage 5).

Oh sorry i'm worng.


I saw AUDIO_POLICY_FORCE_FOR_MEDIA, (usage 1) and
 AUDIO_POLICY_FORCE_FOR_SYSTEM, (usage 5).
(In reply to Szu-Yu Chen [:aknow] from comment #19)
> Created attachment 8564034 [details] [diff] [review]
> add telephony debug info
> 
> The patch adds some debug info in telephony module.

Zhensen,
I cannot reproduce but can you add the logs and reproduce for further clarification?
Hi Shawn,

It break out one times,so I also can't reproduce,i will submit the patch,if it was reproduced,i will update the log.

Thanks!
Flags: needinfo?(zhensen.su.hz)
(In reply to zhensen.su from comment #24)
> Hi Shawn,
> 
> It break out one times,so I also can't reproduce,i will submit the patch,if
> it was reproduced,i will update the log.
> 
> Thanks!
OK, I'm waiting for new logs if you can reproduce. Thanks.
Hi Norry,
qawanted for Woodduck 2.0M and Flame 2.0/2.1/2.2. Thanks!
Flags: needinfo?(chien-hao.li)
Keywords: qawanted
Flags: needinfo?(fan.luo)
This issue cannot be reporduced on lasted build of wooduck 2.0m,  Flame 2.0,2.1,2.2
Reproducing rate: 0/5
Wooduck[Unaffected]:
Build ID               20150402050314
Gaia Revision          7b6a61871b2dfefe9ec9868da99de5b85e0076e2
Gaia Date              2015-03-19 02:12:16
Gecko Revision         13159a3dc4164e9656046129ba6a0b9b98d10105
Gecko Version          32.0
Device Name            jrdhz72_w_ff
Firmware(Release)      4.4.2
Firmware(Incremental)  1427922297
Firmware Date          Thu Apr  2 05:05:17 CST 2015

Flame 2.0[Unaffected]
Build ID               20150401160206
Gaia Revision          896803174633fc6acd3fd105f81c349b8e9b9633
Gaia Date              2015-03-10 06:32:26
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g32_v2_0/rev/9c12f28cc73f
Gecko Version          32.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150401.192439
Firmware Date          Wed Apr  1 19:24:48 EDT 2015
Bootloader             L1TC000118D0

Flame 2.1:[Unaffected]
Flame2.1:
Build ID               20150401001203
Gaia Revision          63c89e001010a9a43ea55afd39333ded3d5e83fc
Gaia Date              2015-03-31 14:44:21
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/30ac9a03343a
Gecko Version          34.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150401.035300
Firmware Date          Wed Apr  1 03:53:11 EDT 2015
Bootloader             L1TC000118D0

Flame v2.2:[Unaffected]
Build ID               20150401002624
Gaia Revision          8b3086ad3963f1707e2bee9094baccafffe161c4
Gaia Date              2015-03-31 21:48:06
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g37_v2_2/rev/20b67213a047
Gecko Version          37.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20150401.042225
Firmware Date          Wed Apr  1 04:22:36 EDT 2015
Bootloader             L1TC000118D0
Flags: needinfo?(fan.luo)
Zhensen,
Is this issue reproduced again on your side? We still could not reproduce. If it does not appear anymore, can we close this bug first and reopen once it occurs?
Flags: needinfo?(zhensen.su.hz)
Hi Peipei,

We also can't reproduced again,you can close it now,if it reproduced,i will create new bug.

Thanks!
Flags: needinfo?(zhensen.su.hz)
(In reply to zhensen.su from comment #29)
> Hi Peipei,
> 
> We also can't reproduced again,you can close it now,if it reproduced,i will
> create new bug.
> 
> Thanks!

Close per comment 29. We can reopen or create new bug once it's reproduced.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.