Closed
Bug 812434
Opened 13 years ago
Closed 13 years ago
support FM volume control for implement AudioChannel API
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-basecamp:+, firefox18 fixed, firefox19 fixed, firefox20 fixed)
VERIFIED
FIXED
blocking-basecamp | + |
People
(Reporter: rlin, Assigned: rlin)
References
Details
Attachments
(2 files, 8 obsolete files)
4.33 KB,
patch
|
mwu
:
review+
|
Details | Diff | Splinter Review |
4.34 KB,
patch
|
Details | Diff | Splinter Review |
After change to use AudioChannel API design,
The volume control wouldn't use setMasterVolume anymore.
b2g v1 version need to hook in music stream and apply fm volume also when fmRadio is on.
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → rlin
Assignee | ||
Comment 1•13 years ago
|
||
[Approval Request Comment]
Bug caused by (feature/regressing bug #):
User impact if declined:
Testing completed (on m-c, etc.):
Risk to taking this patch (and alternatives if risky):
String or UUID changes made by this patch:
Attachment #682363 -
Flags: review?(mwu)
Assignee | ||
Comment 2•13 years ago
|
||
remove try msg
Attachment #682363 -
Attachment is obsolete: true
Attachment #682363 -
Flags: review?(mwu)
Attachment #682364 -
Flags: review?(mwu)
Assignee | ||
Comment 3•13 years ago
|
||
tryserver result:
https://tbpl.mozilla.org/?tree=Try&rev=37306c3257c7
Assignee | ||
Updated•13 years ago
|
OS: Linux → Gonk (Firefox OS)
Hardware: x86_64 → ARM
Updated•13 years ago
|
blocking-basecamp: ? → +
Comment 4•13 years ago
|
||
So the plan is to have gaia control FM radio eventually? Is there a bug for that? Why don't we do that instead?
Assignee | ||
Comment 5•13 years ago
|
||
Hi Michael,
This change comes from this bug
Bug 795237 - Web API for setting audio stream type.
Gaia layer won't control the volume by call the set Master Volume anymore.
Comment 6•13 years ago
|
||
(In reply to Randy Lin [:rlin] from comment #5)
> Hi Michael,
> This change comes from this bug
> Bug 795237 - Web API for setting audio stream type.
> Gaia layer won't control the volume by call the set Master Volume anymore.
My question was more about whether gaia can set the fm volume at the same time the music stream volume is set.
Assignee | ||
Updated•13 years ago
|
Assignee | ||
Comment 7•13 years ago
|
||
Dear Michael,
The adjust FM volume API isn't published to gaia layer and there is no fm stream type for setting app to use(795237). As talk with alive, keeping the music/fm volume index in the same setting is better for UX. So we want to hook this FM volume control as MUSIC type in audioManager.cpp.
Assignee | ||
Comment 8•13 years ago
|
||
This can be done if we group the fm stream volume into content and control by settings/fm app.
Comment 9•13 years ago
|
||
Comment on attachment 682364 [details] [diff] [review]
patch2
r=me on the dom/system/gonk/AudioManager.cpp part *only*. I'm assuming you accidentally mixed in the b2g/chrome/content/shell.js part.
Change the comment to:
// music volume also controls the fm volume
Also make the AUDIO_STREAM_MUSIC == aStream check go first, so we don't run IsFmRadioAudioOn() if we don't have to.
Attachment #682364 -
Flags: review?(mwu) → review+
Comment 10•13 years ago
|
||
What will be happened in the scenario as below?
1. FM & Music stream volume indexes are 15.
2. FM didn't be enabled and set music stream index to 3.
(Due to FM not enabled so FM stream index didn't be set to 3).
3. Start to play FM, and in this time the FM stream index will be 15 not 3.
Comment 11•13 years ago
|
||
Comment on attachment 682364 [details] [diff] [review]
patch2
Good point. Passing review to marco.
Attachment #682364 -
Flags: review+ → review?(mchen)
Comment 12•13 years ago
|
||
Just to clarify, is this bug tracking that the Volume rocker buttons dont work when FM Radio app is running? Because that's what i'm seeing.
Daily unagi build 11-26-2012,
20121126071306
Comment 13•13 years ago
|
||
(In reply to Tony Chung [:tchung] from comment #12)
> Just to clarify, is this bug tracking that the Volume rocker buttons dont
> work when FM Radio app is running? Because that's what i'm seeing.
>
> Daily unagi build 11-26-2012,
> 20121126071306
Yes, FM volume control is broken now.
Comment 14•13 years ago
|
||
The FM stream volume will be set to FM chip and change output volume by FM chip too.
So a limitation here is we need to sync music stream volume into FM while FM is enabling but before playing.
Assignee | ||
Comment 15•13 years ago
|
||
sync with music stream type and set volume when enable the fm radio.
also correct the volume step
Attachment #682364 -
Attachment is obsolete: true
Attachment #682364 -
Flags: review?(mchen)
Attachment #685508 -
Flags: review?(mchen)
Comment 16•13 years ago
|
||
Comment on attachment 685508 [details] [diff] [review]
patch3
Review of attachment 685508 [details] [diff] [review]:
-----------------------------------------------------------------
::: b2g/chrome/content/settings.js
@@ +79,5 @@
> ['audio.volume.bt_sco', 15, nsIAudioManager.STREAM_TYPE_BLUETOOTH_SCO],
> ['audio.volume.enforced_audible', 7, nsIAudioManager.STREAM_TYPE_ENFORCED_AUDIBLE],
> ['audio.volume.dtmf', 15, nsIAudioManager.STREAM_TYPE_DTMF],
> ['audio.volume.tts', 15, nsIAudioManager.STREAM_TYPE_TTS],
> + ['audio.volume.fm', 15, nsIAudioManager.STREAM_TYPE_FM],
So do we already make sure that Gaia will hardcode the values for max volumes?
::: dom/fm/DOMFMRadioParent.jsm
@@ +361,5 @@
> + if ("nsIAudioManager" in Ci && audioManager) {
> + const nsIAudioManager = Ci.nsIAudioManager;
> + let idx = audioManager.getMaxStreamVolumeIndex(nsIAudioManager.STREAM_TYPE_FM, idx);
> + idx = audioManager.getStreamVolumeIndex(nsIAudioManager.STREAM_TYPE_MUSIC, idx);
> + audioManager.setStreamVolumeIndex(nsIAudioManager.STREAM_TYPE_FM, idx);
The usage of audioManager.getXXXIndex() should just have one argument for stream type only and get index from return value. By the way if we put audio volume sync here, the user may listen the FM audio first then find volume be adjusted.
::: dom/system/gonk/AudioManager.cpp
@@ +378,5 @@
> AudioManager::SetStreamVolumeIndex(int32_t aStream, int32_t aIndex) {
> status_t status =
> AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(aStream), aIndex);
> + // sync the fm stream volume with music type
> + if (IsDeviceOn(AUDIO_DEVICE_OUT_FM) && AUDIO_STREAM_MUSIC == aStream) {
Follow the Michael's comment, please move easy condition check to first one (AUDIO_STREAM_MUSIC == aStream) then we can avoid to call IsDeviceOn(AUDIO_DEVICE_OUT_FM).
Assignee | ||
Comment 17•13 years ago
|
||
update patch 4 and move the fm power-on volume sync to AudioManager.
Attachment #685508 -
Attachment is obsolete: true
Attachment #685508 -
Flags: review?(mchen)
Assignee | ||
Updated•13 years ago
|
Attachment #685539 -
Flags: review?(mchen)
Assignee | ||
Comment 18•13 years ago
|
||
Follow by Jonas suggestion, we will request gaia layer hard-code the maximal volume at this stage.
Assignee | ||
Comment 19•13 years ago
|
||
Attachment #685539 -
Attachment is obsolete: true
Attachment #685539 -
Flags: review?(mchen)
Attachment #685544 -
Flags: review?(mchen)
Comment 20•13 years ago
|
||
Comment on attachment 685544 [details] [diff] [review]
patch 5
Review of attachment 685544 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/system/gonk/AudioManager.cpp
@@ +360,5 @@
>
> NS_IMETHODIMP
> AudioManager::SetFmRadioAudioEnabled(bool aFmRadioAudioEnabled)
> {
> + int32_t volIndex= 0;
Since we didn't use this variable on the case of "else", maybe we can move it into line 368.
@@ +370,5 @@
> AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, "");
> InternalSetAudioRoutes(GetCurrentSwitchState(SWITCH_HEADPHONES));
> + // sync volume with music after powering on fm radio
> + AudioSystem::getStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_MUSIC), &volIndex);
> + AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_FM), volIndex);
This timing here seems to be later then change of audio routing path.
We may need to move these codes before line 368.
Assignee | ||
Comment 21•13 years ago
|
||
Try to move those codes before line 368 but found it don't work.
That may cause by kernel driver only allow the volume-control during the enabled status.
Comment 22•13 years ago
|
||
Comment on attachment 685544 [details] [diff] [review]
patch 5
Review of attachment 685544 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for helping to confirm timing between routing path and FM volume setting.
As you mentioned, I think the reason is not about the timing of FM enabled or not.
But the ADSP need to change the routing path internally then ADSP just can accept the FM volume changing.
Attachment #685544 -
Flags: review?(mchen) → review+
Updated•13 years ago
|
Attachment #685544 -
Flags: review?(mwu)
Comment 23•13 years ago
|
||
Comment on attachment 685544 [details] [diff] [review]
patch 5
Review of attachment 685544 [details] [diff] [review]:
-----------------------------------------------------------------
Please update the patch by comments then ask for review by Michanel Wu.
::: dom/system/gonk/AudioManager.cpp
@@ +370,5 @@
> AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, "");
> InternalSetAudioRoutes(GetCurrentSwitchState(SWITCH_HEADPHONES));
> + // sync volume with music after powering on fm radio
> + AudioSystem::getStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_MUSIC), &volIndex);
> + AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_FM), volIndex);
In addtional that, this function will be called in two conditions for eanbling and disabling FM audio. We should only do it on the case of enabling FM audio.
Attachment #685544 -
Flags: review?(mwu)
Assignee | ||
Comment 24•13 years ago
|
||
avoid sent volume control on disable fm radio
Attachment #685544 -
Attachment is obsolete: true
Attachment #685917 -
Flags: review?(mwu)
Comment 25•13 years ago
|
||
Comment on attachment 685917 [details] [diff] [review]
patch 6
Review of attachment 685917 [details] [diff] [review]:
-----------------------------------------------------------------
Please pay closer attention to style. The patch looks fine otherwise.
::: dom/system/gonk/AudioManager.cpp
@@ +369,5 @@
> AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, "");
> InternalSetAudioRoutes(GetCurrentSwitchState(SWITCH_HEADPHONES));
> + // sync volume with music after powering on fm radio
> + if (aFmRadioAudioEnabled) {
> + int32_t volIndex= 0;
The whitespace on this line is wrong.
@@ +383,5 @@
> NS_IMETHODIMP
> AudioManager::SetStreamVolumeIndex(int32_t aStream, int32_t aIndex) {
> status_t status =
> AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(aStream), aIndex);
> + // sync the fm stream volume with music type
This code is indented wrong.
Use this for the comment:
// sync the fm stream volume with music volume
@@ +384,5 @@
> AudioManager::SetStreamVolumeIndex(int32_t aStream, int32_t aIndex) {
> status_t status =
> AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(aStream), aIndex);
> + // sync the fm stream volume with music type
> + if ((aStream == AUDIO_STREAM_MUSIC) && IsDeviceOn(AUDIO_DEVICE_OUT_FM)) {
Remove the parenthesis around the aStream check.
Attachment #685917 -
Flags: review?(mwu)
Assignee | ||
Comment 26•13 years ago
|
||
correct the coding style
Attachment #685917 -
Attachment is obsolete: true
Assignee | ||
Comment 27•13 years ago
|
||
Attachment #686374 -
Attachment is obsolete: true
Assignee | ||
Comment 28•13 years ago
|
||
Attachment #686375 -
Attachment is obsolete: true
Assignee | ||
Comment 29•13 years ago
|
||
Comment on attachment 686378 [details] [diff] [review]
patch 9
Dear Michael,
Please help to review my patch, thanks.
Attachment #686378 -
Flags: review?(mwu)
Updated•13 years ago
|
Attachment #686378 -
Flags: review?(mwu) → review+
Assignee | ||
Comment 30•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Whiteboard: checkin-needed
Comment 31•13 years ago
|
||
Whiteboard: checkin-needed
Comment 32•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 33•13 years ago
|
||
Comment 34•13 years ago
|
||
verified on Unagi
2012-12-03
gaia master : 5d150b2b10472478e8841730abd9ae9597595206
mozilla-beta : 1e56f66d7ee9
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•