Closed
Bug 1008849
Opened 11 years ago
Closed 11 years ago
[Tarako][FM] FM does not work after unplugging and plugging the earphone when the screen is locked.
Categories
(Firefox OS Graveyard :: Gaia::FMRadio, defect)
Tracking
(blocking-b2g:1.3T+, b2g-v1.3T verified)
People
(Reporter: bli, Assigned: jesse.ji)
Details
(Whiteboard: [partner-blocker] [POVB])
Attachments
(2 files)
Environment:
-----------------------------------------------------
Gaia fabc8154b31178515795b0a32068257fd5a16269
Gecko https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/a500e34d8819
BuildID 20140511164002
Version 28.1
ro.build.version.incremental=eng.cltbld.20140511.204401
ro.build.date=Sun May 11 20:44:08 EDT 2014
Steps to reproduce:
-----------------------------------------------------
1. Launch FM
2. Lock the screen
3. Unplug the earphone
4. Plug the earphone
5. Unlock the screen
Actual result:
------------------------------------------------------
FM does not work at all.
No response after tapping on the buttons.
Additional info:
------------------------------------------
Need to restart the devices to recover from it.
This sounds like a common use case scenario. I do this often when transporting my own devices. Nom'ing.
blocking-b2g: --- → 1.3T?
Comment 2•11 years ago
|
||
Hi Pin, could you help to check this issue? thanks.
Flags: needinfo?(pzhang)
Whiteboard: [partner-blocker]
Comment 3•11 years ago
|
||
I debugged and found no FM_RADIO_OPERATION_ENABLE event is received after call mozilla::hal::EnableFMRadio by following the steps described in common 0, so something in gonk is wrong in this case.
@Steven, can you take a look?
Flags: needinfo?(pzhang) → needinfo?(slee)
Comment 4•11 years ago
|
||
Hi Pin,
Can you test whether earphone plug/unplug works? You can launch music app and test whether it is OK. If it's not OK, it should not be the problem of FM radio. BTW, you may need to ask Marco to help this problem.
Flags: needinfo?(slee)
Comment 5•11 years ago
|
||
(In reply to StevenLee[:slee] from comment #4)
> Hi Pin,
>
> Can you test whether earphone plug/unplug works? You can launch music app
> and test whether it is OK. If it's not OK, it should not be the problem of
> FM radio. BTW, you may need to ask Marco to help this problem.
@bli tested, earphone works on music app.
@marco, could you take a look?
Flags: needinfo?(mchen)
Reporter | ||
Comment 6•11 years ago
|
||
Reporter | ||
Comment 7•11 years ago
|
||
Comment 9•11 years ago
|
||
Hi Wayne,
Could you help it first? If everything I can help please let me know.
Flags: needinfo?(mchen)
Comment 10•11 years ago
|
||
Jesse,
I found this log after plug earphone
<4>0[ 57.958793] trout_fm _trout_fm_open-44 -- start open fm module...
<4>0[ 57.958859] trout_fm _trout_fm_open-53 -- The system is suspending!
Can you check this?
Comment 11•11 years ago
|
||
After tracing the log, In the moment of pluging out headset, audio driver has some error message, I think the problem is in that.
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): changeRefCount() stream 3, count 0
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getNewDevice() selected device 0
05-12 17:25:36.025 D/AudioPolicyManagerBase( 90): setOutputDevice() output 1 device 0 delayMs 290
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): setOutputDevice() setting same device 0 or null device for output 1
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): setForceUse() usage 1, config 0, mPhoneState 0
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getNewDevice() selected device 0
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() from cache strategy 4, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 4, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() from cache strategy 1, device 1
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 1, device 1
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() from cache strategy 2, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 2, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() from cache strategy 0, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 0, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() from cache strategy 3, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 0, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 3, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 0, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 1, device 1
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 2, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 0, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 3, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 4, device 2
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): getDeviceForStrategy() strategy 5, device 0
05-12 17:25:36.025 D/AudioPolicyManagerBase( 90): setOutputDevice() output 1 device 0 delayMs 0
05-12 17:25:36.025 V/AudioPolicyManagerBase( 90): setOutputDevice() setting same device 0 or null device for output 1
05-12 17:25:36.035 V/AudioPolicyManagerBase( 90): releaseOutput() 1
05-12 17:25:36.195 W/audio_hw_primary( 90): warning:-32, (wait error: hw 0x46640 app 0x4c900 avail 0x140
05-12 17:25:36.195 W/audio_hw_primary( 90): : Unknown error: -32)
05-12 17:25:36.195 W/audio_hw_primary( 90): do_output_standby.mode:0
05-12 17:25:36.215 I/audio_hw_primary( 90): select_devices_signal starting...
05-12 17:25:36.215 I/audio_hw_primary( 90): select_devices_signal finished.
05-12 17:25:36.215 W/audio_hw_primary( 90): open s_tinycard in
05-12 17:25:36.215 W/audio_hw_primary( 90): open s_tinycard successfully
05-12 17:25:36.215 I/audio_hw_primary( 90): Changing devices: 0x00000002
05-12 17:25:36.215 I/audio_hw_primary( 90): Set 'HeadPhone Function'.0 to 0
05-12 17:25:36.215 I/audio_hw_primary( 90): Set 'Earpiece Function'.0 to 0
05-12 17:25:36.215 I/audio_hw_primary( 90): Set 'Mic Function'.0 to 0
05-12 17:25:36.215 I/audio_hw_primary( 90): Set 'HP Mic Function'.0 to 0
05-12 17:25:36.215 I/audio_hw_primary( 90): Set 'Line Function'.0 to 0
05-12 17:25:36.215 I/audio_hw_primary( 90): Changing devices, mask: 0x00004002
05-12 17:25:36.215 I/audio_hw_primary( 90): Set 'Speaker Function'.0 to 1
05-12 17:25:36.215 I/vb_effect( 90): s_cur_devices(0x00000002)
05-12 17:25:36.215 I/vb_effect( 90): profile is Handsfree, ret=0
Flags: needinfo?(waychen)
Updated•11 years ago
|
Flags: needinfo?(jesse.ji)
Whiteboard: [partner-blocker] → [partner-blocker] [POVB]
Comment 12•11 years ago
|
||
(In reply to Wayne Chen [:xwaynec] from comment #11)
> After tracing the log, In the moment of pluging out headset, audio driver
> has some error message, I think the problem is in that.
>
>
> setting same device 0 or null device for output 1
> 05-12 17:25:36.035 V/AudioPolicyManagerBase( 90): releaseOutput() 1
> 05-12 17:25:36.195 W/audio_hw_primary( 90): warning:-32, (wait error: hw
> 0x46640 app 0x4c900 avail 0x140
@Wayne, did you mean the error log highlighted here? I tried plug in/out many times without out Lock/Unlock the screen, but the FMRadio still works well. I am not sure if it is the root cause.
I added the log in GonkFMRadio.cpp. When the step 3(Plug the earphone) runs, it fails on
/* This runs on the main thread but most of the
* initialization is pushed to the radio thread. */
void
EnableFMRadio(const hal::FMRadioSettings& aInfo)
{
...
mozilla::ScopedClose fd(open("/dev/radio0", O_RDWR));
if (fd < 0) {
HAL_LOG(("Unable to open radio device"));
return;
}
...
}
For this fail point, I think SPRD should take effort on it. Thanks
Updated•11 years ago
|
Assignee: nobody → jesse.ji
Comment 13•11 years ago
|
||
(In reply to Vincent Liu[:vliu] from comment #12)
> I added the log in GonkFMRadio.cpp. When the step 3(Plug the earphone) runs,
> it fails on
>
Sorry for the wrong info. |Plug the earphone| should be in step 4, and it means plug in the earphone.
Assignee | ||
Comment 15•11 years ago
|
||
I have fixed the bug on our side.
The root cause is that our FM driver checks whether the system is suspending or not before opening FM. Actually we do want to open FM in early suspending status like this case.
Assignee | ||
Comment 16•11 years ago
|
||
Notice the flaw in GonkFMRadio.
mozilla::ScopedClose fd(open("/dev/radio0", O_RDWR));
if (fd < 0) {
HAL_LOG(("Unable to open radio device"));
return;
}
We should notify opening failed event here.
mozilla::ScopedClose fd(open("/dev/radio0", O_RDWR));
if (fd < 0) {
HAL_LOG(("Unable to open radio device"));
hal::FMRadioOperationInformation info;
info.operation() = hal::FM_RADIO_OPERATION_ENABLE;
info.status() = hal::FM_RADIO_OPERATION_STATUS_FAIL;
hal::NotifyFMRadioStatus(info);
return;
}
Status: NEW → ASSIGNED
Comment 17•11 years ago
|
||
(In reply to Jesse from comment #16)
> Notice the flaw in GonkFMRadio.
>
> mozilla::ScopedClose fd(open("/dev/radio0", O_RDWR));
> if (fd < 0) {
> HAL_LOG(("Unable to open radio device"));
> return;
> }
>
> We should notify opening failed event here.
>
>
> mozilla::ScopedClose fd(open("/dev/radio0", O_RDWR));
> if (fd < 0) {
> HAL_LOG(("Unable to open radio device"));
>
> hal::FMRadioOperationInformation info;
> info.operation() = hal::FM_RADIO_OPERATION_ENABLE;
> info.status() = hal::FM_RADIO_OPERATION_STATUS_FAIL;
> hal::NotifyFMRadioStatus(info);
>
> return;
> }
In GonkFMRadio.cpp:EnableFMRadio(), it seems we have many system calls which doesn't notify by fail situation. @wayne, would you please file another bug for this? Thanks.
Flags: needinfo?(waychen)
Comment 18•11 years ago
|
||
(In reply to Jesse from comment #15)
> I have fixed the bug on our side.
>
> The root cause is that our FM driver checks whether the system is suspending
> or not before opening FM. Actually we do want to open FM in early suspending
> status like this case.
Hi Jesse,
I'm marking this one fixed since it's fixed on gonk.
Status: ASSIGNED → RESOLVED
blocking-b2g: 1.3T? → 1.3T+
Closed: 11 years ago
Resolution: --- → FIXED
Gaia 917174ee3812a43758bf43f7ba5f9416dcdb2ca8
Gecko https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/7296746ab908
BuildID 20140519014003
Version 28.1
ro.build.version.incremental=eng.cltbld.20140519.052855
ro.build.date=Mon May 19 05:29:01 EDT 2014
Tarako
Status: RESOLVED → VERIFIED
![]() |
||
Updated•11 years ago
|
Updated•11 years ago
|
Flags: needinfo?(waychen)
You need to log in
before you can comment on or make changes to this bug.
Description
•