Closed Bug 730944 Opened 12 years ago Closed 12 years ago

nsIAudioManager: Support for voice volume

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-basecamp:-)

RESOLVED DUPLICATE of bug 791642
blocking-basecamp -

People

(Reporter: philikon, Assigned: echou)

References

Details

Basically make it so that we can undo the hack in bug 730176, by exposing voice volume in nsIAudioManager.
Is Philipp or anyone working on this? If no, then I'll take this bug. :)
Go ahead!
Assignee: nobody → echou
Simply sum up the result of what I've found in these two days.

After tracing the code of Audio part in Android, I found that
they use AudioSystem::setStreamVolumeIndex to set volume for 
each streams. However, I called it but nothing happened. In fact, 
I've tried several ways to adjust voice volume but all failed:

AudioSystem::setStreamVolumeIndex(stream_type stream, int index)
AudioSystem::setVoiceVolume(float value)
AudioSystem::setStreamVolume(int stream, float value, int output)

I dumped real-time system log and checked the status of service 
media.audio_policy, and the log appealed some problems. The most
obvious one is each stream_type has a MAX_INDEX and a MIN_INDEX 
indicating the scale of volume, and this range should be determined
by calling AudioSystem::initStreamVolume() which we didn't do. So 
the MAX_INDEX of all streams was 1, and MIN_INDEX was 0. That meant
we can only pass argument 'index' into AudioSystem::setStreamVolumeIndex()
with 0 or 1, and that would make the real value of volume passed to 
driver very small.

One more thing, if we called AudioSystem::isStreamActive(0, 
&isVoiceCallActive) during the IN_CALL state, the out parameter 
isVoiceCallActive would be false, which was apparently wrong.

Although the voice volume still could not be adjusted correctly after 
I added related initStreamVolume function call, I figured that the main 
problem might be similar to this. Maybe we skipped some steps that 
implemented in Android Java code. 

I've been still dealing with this issue and will update asap.
After upgraded my device to ICS, it magically worked! I now can adjust voice volume during a voice call. However, I cannot mute the voice even volume panel has already shown the mute icon.
Blocking, so that this stays on the radar if for some reason it magically stops working on otoro+ics.
blocking-basecamp: --- → +
blocking-kilimanjaro: --- → +
I would say we can unblock here. Please renom if you disagree.
blocking-basecamp: + → ---
blocking-kilimanjaro: + → ---
Per IRC conversations with a few other folks, I think the best course of action if there is disagreement on whether this blocks or not is to do the following:

- Move the blocking-basecamp flag to ? for re-evaluation
- Indicate a rationale for why you disagree
blocking-basecamp: --- → ?
blocking-basecamp: ? → -
Rationale for blocking-: AFAICT this bug is about removing a hack in favour of a more proper implementation. I would not hold the release for this.

Also, I think the audio code has been refactored at least once, so I wonder if this bug is even still valid.
I've tested on otoro with kernel 7 and galaxy s2, using latest code base for both, and the voice volume could be adjusted. Since this issue happened on GB but not on ICS, and also, there has been no big change to the volume-adjusting flow, so I would say this is a porting issue.
Thanks for verifying, Eric!
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Apparently this is needed now. Fwd duping to bug 791642.
Resolution: WORKSFORME → DUPLICATE
You need to log in before you can comment on or make changes to this bug.