AudioHardware receives TTY mode selection from HeadsetObserver by means of the setParameters() method.
Whenever the audio mode is MODE_IN_CALL and a headset is connected, the sound device selection
is modified by TTY mode in order to select TTY full, VCO ot HCO oudio routes and a1026 configuations accordingly.
libaudio: handle audio path SND_DEVICE_CARKIT.
Submitted on behalf of HK Chen <HK_Chen@htc.com>
Added missing code from HK patch in A1026 configuration.
A regression was introduced by commit 372b6255604d1c54d31e79f1ea31472fe5bc8956 fixing issue 2336461:
voice call volume still needs to be updated when entering IN_CALL mode.
This change reverts modifications made earlier on software voice volume control in audio policy manager.
These modifications are not needed anymore and are partly responsible of this issue now that voice volume is controlled by audio DSP.
Add new config values for usage AudioSystem::FOR_DOCK in setForceUse() to differenciate car and desk docks.
For the desk dock, the sonification strategy will use the phone speaker only as there is no guaranty that
a device is connected to the dock's output jack.
For the car dock, the sonification strategy will use the A2DP output as before.
dual microphone noise suppression should be used during a phone call
in handset mode. The disabling is performed by using the same A1026
settings as those used in Voice Recognition when not using the
Noise Suppression algorithm. This mode uses the exact same input
and gains as the incall receiver mode (A1026_PATH_INCALL_RECEIVER)
A new mode (A1026_PATH_INCALL_NO_NS_RECEIVER) is defined for code
clarity.
This correction in AudioPolicyManager does not directly fix the issue but a potential problem identified when working on the resolution.
The problem is that audio output path is not updated immediately when a headset is unplugged if music or notifications are active. This is however not observable because:
- music is paused by music app when the headset is unplugged, and correct path is re-established when music is resumed.
- ringtones and notifications are playing on both headset and speaker and are still audible on speaker when the headset is unplugged even if
the actual output path is not changed to speaker only.
There could be an impact on applications using MUSIC stream and not reacting to Intent AudioManager.ACTION_AUDIO_BECOMING_NOISY though.
Fixed AudioPolicyManager::getInput() broken in change ddb78e7753be03937ad57ce7c3c842c52bdad65e
so that an invalid IO handle (0) is returned in case of failure.
Applied the same correction to getOutput().
We really need to fix this eventually, but it's not a ship blocker.
Change-Id: I35f66988e7adba13e47c2a86e13a7425cc5aada3
Signed-off-by: Dima Zavin <dima@android.com>
The problem comes from the fact that when a notification is played on both headsets + speaker,
the media strategy is muted. It is only unmuted when a new device is selected on hardwate output
(for instance headset only when music starts).
If an A2DP output is created while music is muted, AudioFlinger with use the last value received
for music volume to initialize the music stream volume on the newly created A2DP output, which in
this case is 0. The code in audio policy manager that applies stream volumes after the A2DP output
has been created is inefficient here, because as music stream is muted, the request to change the
volume is ignored.
As next time music starts it is now played over A2DP output and not on HW output,
no device modification is done on HW output and the music streams remains muted.
This is also applicatble to SYSTEM and TTS streams.
The fix consists in keeping a stream mute count on each output separately instead of a global stream mute count.
Thus when the music volume is re applied after A2DP output creation, the request is not ignored as the music stream is not
muted on A2DP output.
The GPU now correctly maps everything throug hthe MMU so physical addresses
are no longer needed.
Change-Id: Id16a690f63d7141c8ee6694b246b1955f450b8ed
Signed-off-by: Dima Zavin <dima@android.com>
* changes:
Patch from HTC: changes in libaudio - remove redundant ACDB updates for audio playback and recording. - remove redundant ACDB updates for audio route changes during playback or recording. Along with the matching audio driver change, this fixes b/2275992 and click before playback and AudioHardware is going to standby.
- remove redundant ACDB updates for audio playback and recording.
- remove redundant ACDB updates for audio route changes during playback or recording.
Along with the matching audio driver change, this fixes b/2275992
and click before playback and AudioHardware is going to standby.
- libaudio: incorrect ACDB setting was used when starting to record
with wired headset.
- libaudio: remove unnecessary audio path switch when camcorder is started
with wired headset.
Submitted on behalf of HK Chen <hk_chen@htc.com>
to fix issue 2229040. This workaround is considered no longer useful
by HTC since the changes in the A1026 configuration.
Removing workaround on behalf of HK Chen (HTC).
When the ringtone is not looped (non factory ringtone), a new AudioTrack is started every time the ringtone is repeated. The second time the track is started, the condition that triggers volume limitation is not true any more as music has been stopped for more than SONIFICATION_HEADSET_MUSIC_DELAY seconds and ringtone volume is not limited.
The fix consists in checking the condition (music playing or stopped for less than SONIFICATION_HEADSET_MUSIC_DELAY) when entering ringtone mode and latch it until we exit ringtone mode.
This change avoids the audio driver lockup when changing audio input path configuration. It does not solve the root cause in audio driver or dsp.
When applied lockups observed in the folling use cases are eliminated:
- use back mic for camcorder recording (issue 2194140)
- switch input device when headset is plugged in or out during record (issue 2226658).
Also removes warnings.
Submitted on behalf of H.K Chen <hk_chen@htc.com>
-- new a1026.h kernel header that contains just the user-space API and is
sanitized through bionic/libc/kernel/tools/clean_header.py
-- AudioHardware.cpp:
-- replace vr_mode with vr_mode_enabled, and use 0 and 1 instead of
A1026_VR_MODE_DISABLED/ENABLED, which is not defined in the kernel
header;
-- in doA1026_init(), replace a fread() of 1 byte with a read that as
much as possible from the firmware file in as few as possible passes
before we call into the kernel
-- Replace the size of the on-stack f/w buffer with A1026_MAX_FW_SIZE,
which now comes from the kernel header
-- Fix up some signed-unsigned comparison warnings on mBluetoothIdTx
Signed-off-by: Iliyan Malchev <malchev@google.com>
Modified AudioPolicyManager::setDeviceConnectionState() so that the device on active audio input is updated when a device is connected or disconnected.
The wrong key was used when removing the voice recognition mode from parameters list after handling it in AudioStreamInMSM72xx::setParameters() causing the set routing parameter to be removed and ignored.