Closed Bug 914069 Opened 11 years ago Closed 6 years ago

[B2G][Helix][Audio][tianhuajian]The headset has noise when camera take photos in FM mode

Categories

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

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: lecky.wanglei, Unassigned)

Details

Attachments

(1 file)

12.96 KB, application/octet-stream
Details
Attached file ddms.zip
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; aff-kingsoft-ciba; .NET4.0C; .NET4.0E)

Steps to reproduce:

1. Insert wired headset 
2. Open FM
3. Open camera app 
4. Take a phone



Actual results:

In step 4, the wired headset can hear noise


Expected results:

In step 4, the wired headset can not hear noise
【Test Count*】:5
【Found Count*】:5
【Gaia commit ID*】: V1.1HD
【Gecko commit ID*】:  1.1.0 HD
【Log*】:The ddms log
【Network environment】:
【Resume operation】:
I find there are several audio route changes in these operation, and the stream mute is after the rpc_snd_set_device, Is this the reason why there are the noise?
09-09 17:16:36.750: WARN/AudioHardwareMSM76XXA(171): rpc_snd_set_device(26, 0, 0)
09-09 17:16:36.780: ERROR/AudioManager(163): thj AudioManager::SetStreamVolumeIndex , Stream = 10, index = 0
Thanks,
Tian
blocking-b2g: --- → hd?
Flags: needinfo?(wchang)
Flags: needinfo?(mchen)
QAWANTED to check this as this could be device specific.
blocking-b2g: hd? → ---
Flags: needinfo?(wchang)
As I Know that camera shutter sound is fired on notification channel so it will be output to both of speaker and headset. Is that sound like the shutter sound?
Flags: needinfo?(mchen)
Flags: needinfo?(mchen)
Hi Macro,
The noise is not shutter sound.
Have you do the test?And Can this issue reproduced on your device?
Hi Lecky,

Yes, I tested it. The sound from headset is came from shutter sound.
Flags: needinfo?(mchen)
Severity: normal → critical
Severity: critical → normal
Priority: -- → P2
Hi Macro,
If we want to close FM when take photograph by using camera, Can you give me some suggestions on how to modify the js app code?
Thanks
Flags: needinfo?(mchen)
The issue can be reproduced on mozilla version.

gaia:f601fe6e5edb7d5016c07abfad8f069af7354f7b
gecko:60d9e982e07e8d09e9d0e52bad6433c302c17f32
gonk-misc:ca9192d7ef6037016d4723647d86b72f7a410633
(In reply to lecky from comment #7)
> The issue can be reproduced on mozilla version.
> 
> gaia:f601fe6e5edb7d5016c07abfad8f069af7354f7b
> gecko:60d9e982e07e8d09e9d0e52bad6433c302c17f32
> gonk-misc:ca9192d7ef6037016d4723647d86b72f7a410633

Cool. Thanks for providing that this can be reproduced on Mozilla version.
Flags: needinfo?(mchen)
Hi,

I suspect that this is caused by timing between AUDIO_DEVICE_OUT_FM and "Notification stream type will change routing to both headset and speaker". Maybe you can modify your Audio HAL as "when before changing routing to headset and speaker, remove AUDIO_DEVICE_OUT_FM first".
Hi Macro,
Now I modify the camera shutter audio stream type ,and the camera shutter sound will not output to headset.
But  there are several audio path change when camera shutter and fm play, so the headset still can hear noise.
For Android will disable fm when camera shutter, Can we modify as Android?
If I want to do this in camera app ,can you give me some modify suggestion?
Thanks
Hi,

Even you closed the FM Radio, it still caused the routing path change. They are no difference with the current case.
Could you try to remove http://mxr.mozilla.org/mozilla-b2g18/source/dom/fm/FMRadio.cpp#277 & 284? Could this eliminate the problem?
(In reply to Marco Chen [:mchen] from comment #12)
> Could you try to remove
> http://mxr.mozilla.org/mozilla-b2g18/source/dom/fm/FMRadio.cpp#277 & 284?
> Could this eliminate the problem?

Hi Macro,
After remove the FMRadio.cpp code as you told, the issue dispear.
But the modify will lead new issue:
When device in fm mode, play music or video, Both the music sound and fm sound will output to headset.
(In reply to lecky from comment #13)
> Hi Macro,
> After remove the FMRadio.cpp code as you told, the issue dispear.
> But the modify will lead new issue:
> When device in fm mode, play music or video, Both the music sound and fm
> sound will output to headset.

It is strange because the line as below should mute the FM stream already.
http://mxr.mozilla.org/mozilla-b2g18/source/dom/fm/FMRadio.cpp#283

Could you confirm this?
 Hi Macro,
 In comment 12, you suggest me to remove line from 277 to 284, and the line 283 has removed as you told.
 So the FM strem will not muted.
 Could you confirm whether my understant is correct?
 

 277     audioManager->SetFmRadioAudioEnabled(true);
 278     int32_t volIdx = 0;
 279     // Restore fm volume, that value is sync as music type
 280     audioManager->GetStreamVolumeIndex(nsIAudioManager::STREAM_TYPE_MUSIC, &volIdx);
 281     audioManager->SetStreamVolumeIndex(nsIAudioManager::STREAM_TYPE_FM, volIdx);
 282   } else {
 283     audioManager->SetStreamVolumeIndex(nsIAudioManager::STREAM_TYPE_FM, 0);
 284     audioManager->SetFmRadioAudioEnabled(false);
Hi Macro,
I want to know whether this issue has any modify method?
Or Could you please give me some modify suggestions?
Thanks
Hi Wayne

   Please help to process this bug and give feedback.

Thanks
Flags: needinfo?(wchang)
(In reply to lecky from comment #15)
>  Hi Macro,
>  In comment 12, you suggest me to remove line from 277 to 284, and the line
> 283 has removed as you told.
>  So the FM strem will not muted.
>  Could you confirm whether my understant is correct?

Hi,

What I mean is to remove line 277 & 284 not "from 277 to 284".
Flags: needinfo?(wchang)
(In reply to Marco Chen [:mchen] from comment #18)
Hi,
What I mean is to remove line 277 & 284 not "from 277 to 284".

I remove line 277 & 284 as you told, when play music and video the sound still can be mixed with fm sound.
Thanks
(In reply to lecky from comment #19)
> I remove line 277 & 284 as you told, when play music and video the sound
> still can be mixed with fm sound.
> Thanks

Hi,

It is strange that since you didn't remove line 283, that function should mute the FM sound.

> 283     audioManager->SetStreamVolumeIndex(nsIAudioManager::STREAM_TYPE_FM, 0);
Hi Marco,
Do you have other modify suggestions?
Or Could you please analyse this issue more deeply?
Thank
Hi,

It is my fault.
Please also remove the line from 269 to 273.

http://mxr.mozilla.org/mozilla-b2g18/source/dom/fm/FMRadio.cpp#269
(In reply to Marco Chen [:mchen] from comment #22)
> Hi,

It is my fault.
Please also remove the line from 269 to 273.
> http://mxr.mozilla.org/mozilla-b2g18/source/dom/fm/FMRadio.cpp#269

Hi Macro,
I have test as you told.
But the audio sound still will mix fm sound when I change audio level.
Thanks
blocking-b2g: --- → hd?
Flags: needinfo?(wchang)
Flags: needinfo?(mchen)
Not blocking on this as only occurs when FM + camera combination and impact is minimal.
blocking-b2g: hd? → ---
Flags: needinfo?(wchang)
Hi Macro,
I want to know what's the audio channel type of FM?
The music audio channel type is content, Can I modify the FM audio channel type to normal?
I think the issue maybe dispear if I lower down the priority of FM audio channel type.
Thanks
Hi Macro,
Now I modify the camera shutter sound  from notification type to content type ,the modify method is as following.
For the sound audio channel priority of shutter is same as FM, so when take camera shutter , it will not disable and enable fm , the issue is dispeaer.
Can you help me assess this modification?

//modify code in \gaia\apps\camera\js\camera.js
this._shutterSound.mozAudioChannelType = 'content';
Is this still an issue? Thanks.
Flags: needinfo?(mchen)
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: