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.
This change fixes two issues:
1 There is a problem with the mutex mA1026Lock protecting access to Audience chip configuration. The mutex is always locked
after the driver is opened and unlocked before the driver is closed. There is a risk that the driver is closed by an instance
of doAudience_A1026_Control() ready to exit while it had already been tested as opened by another instance of doAudience_A1026_Control()
entering and waiting for mA1026Lock to be released. This is what happens when a record is starting and that at the same time the output routing
is changed because the record jingle is playing.
The fix consists in locking mA1026Lock before opening the driver and unlocking it after closing the driver.
2 There is a problem on both 7k and 8k with the way doRouting() handles the routing requests for inputs and outputs. Current implementation
of doRouting() has a parameter indicating if the requestest comes from an input or from an output. The input device is only considered if the
request comes from this particular input. This creates a problem when the input is already active and a routing request is received on an output.
In this case, the new device is chosen as if no record was active resulting in potential change in input routing and a1026 configuration.
The fix consists in checking if at least one input is active when entering doRouting() and always take its device selection into account.
If no input is active, the device selected for the output is used.
For 8k platform, also call doRouting() instead of doAudience_A1026_Control() when record is started or stopped to make sure that all audio path and
accoustic parameters are properly selected and not only the A1026 configuraiton applied.
Added getRenderPosition() API to AudioHardwareInterface to retreive number of audio frames
written by DSP to DAC.
This API is not yet implemented on 7k and 8k kernel drivers.
make sure to reject incompatible buffers in special function
GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER
we use ioctl(PMEM_GET_SIZE) to validate that the given buffer is indeed
a pmem buffer.
Merge commit 'c42d5b9bd789034e4e10679b24a7bd38e68f4556' into eclair-plus-aosp
* commit 'c42d5b9bd789034e4e10679b24a7bd38e68f4556':
Fix issue 2378103: Bluetooth car kit partly handled by Passion AudioHardware implementation.
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.
Merge commit '3964d4ed448b00791bc1b574913be24f44b45f0f' into eclair-plus-aosp
* commit '3964d4ed448b00791bc1b574913be24f44b45f0f':
Fix issue 2199233: ERD16 Incall volume with headset is crazy loud / volume buttons have no effect
A regression was introduced by commit 372b6255604d1c54d31e79f1ea31472fe5bc8956 fixing issue 2336461:
voice call volume still needs to be updated when entering IN_CALL mode.
First implementations of audio policy manager in Eclair branch have shown that most code is common to all platforms.
Creating AudioPolicyManagerBase base class will improve code maintainability and readability.
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.
Merge commit 'eb3af645781d858eea3bccfe193411e23474e11d'
* commit 'eb3af645781d858eea3bccfe193411e23474e11d':
Use the media.enable1026 system property to indicate whether the
Merge commit '9ffa86825c57c8bf82669b438bd0e8feb865d4b7' into eclair-plus-aosp
* commit '9ffa86825c57c8bf82669b438bd0e8feb865d4b7':
Use the media.enable1026 system property to indicate whether the
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 gralloc module is only used on msm7k and doesn't need
synchronization in lock/unlock because we don't allow EGLImageKHR
with the GPU renderer on this platform.
hopefully this will remove some of the confusion about how gralloc
should be implemented.
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.
Merge commit '57d3b3680a6d37ffe04e1f24be25b4907bcbaa20'
* commit '57d3b3680a6d37ffe04e1f24be25b4907bcbaa20':
gralloc-qsd8k: make sure that we never try to allocatio 0 bytes
Merge commit '6a6befc0430820ab5d837694f1b71b63c34f8b14' into eclair-mr2-plus-aosp
* commit '6a6befc0430820ab5d837694f1b71b63c34f8b14':
gralloc-qsd8k: make sure that we never try to allocatio 0 bytes
Merge commit '2754389d0e7638b3065ecb3c965b1f262d2205ed' into eclair-mr2
* commit '2754389d0e7638b3065ecb3c965b1f262d2205ed':
gralloc-qsd8k: make sure that we never try to allocatio 0 bytes
Merge commit '3909820584e35b696f8387bda4313fb417cd8ab0'
* commit '3909820584e35b696f8387bda4313fb417cd8ab0':
Fix bug 2111240 When docked to a BT dock, give priority to wired
Merge commit '259ede35b4d8d50d0394624780733e4c061fbe7e' into eclair-mr2-plus-aosp
* commit '259ede35b4d8d50d0394624780733e4c061fbe7e':
Fix bug 2111240 When docked to a BT dock, give priority to wired