242 Commits

Author SHA1 Message Date
Jean-Michel Trivi
541bf8c3ad HTC update: add attenuation to avoid distortion, and compensate in
acoustic parameters.
2009-11-02 15:01:45 -08:00
Eric Laurent
d861f3a7a3 Fix issue 2194140: [Passion] Support Audience chip.
AudioHardware QSD8k:
- Add setParameters comment to control noise suppression states via new IOCTL A1026_SET_NS_STATE implemented in a1026 driver.
- Add support for new input device DEVICE_IN_BACK_MIC.
AudioPolicyManager:
- Add support for audio source AUDIO_SOURCE_CAMCORDER.
2009-11-02 05:26:06 -08:00
Eric Laurent
6bb9f88291 Fix issue 2194140, Part 1.
Submitted on behalf of HK Chen <hk_chen@htc.com>

1) implement ACDB dynamic update for 1) audio playback, 2) audio recording, 3) BT headsets.
2) implement A1026 hard reset recovery mechanism
2009-10-31 00:51:56 -07:00
Mathias Agopian
b73f40535f fix[2222341] Soft reset while going back from camcorder settings
add a way to convert a mapped "pushbuffer" buffer to a gralloc handle
which then can be safely used by surfaceflinger

also make sure to not send empty rectangles to the MDP.
2009-10-30 14:52:52 -07:00
Jean-Michel Trivi
b8dba8904e Fix bug 2210203 where Music volume is reduced after reducing in-call volume.
This is the combination of two issues:
- on QSD8K, the voice volume affects all streams, even when not in call.
 This is fixed by setting the voice volume to unity gain whenever
 exiting a call.
- another related issue was that when entering a call with no audio
 playing, the in-call volume would be at its max. This is due to
the audio driver resetting the gain to unity when creating a new
output. AudioPolicyManager::setPhoneState() would sometimes fail
to force the reset of the audio volumes when entering a call, causing
the driver to use the unity gain, not the in-call volume set by the
user. This is fixed by testing whether is call is starting or ending
independently from the logic to determine the new ouput device.
2009-10-28 17:24:53 -07:00
Dave Sparks
61e76b47a1 Add wakelock to audio HAL. Bug 2218158.
Applications are supposed to hold a wakelock. However, since 1.0,
the audio driver and/or HAL has held a partial wakelock. That means
that many apps will be broken if we don't hold a wakelock while
audio is playing. This patch holds a wakelock while the audio
driver is open and releases it when it goes to standby mode.
2009-10-27 16:27:04 -07:00
Eric Laurent
52af604c93 do not merge - Fix for issue 2184627 cherry picked from eclair-mr2
Bluetooth A2DP suspend-resume improvements.

This change will reduce the occurence rate of A2DP sink suspend resume failures observed in issues 2184627, 2181005 and possibly 2189628.

Suspend A2DP output when phone state is not NORMAL and not only when it is RINGTONE.
Update A2DP suspend state when an A2DP or SCO device is connected or disconnected while phone state is not NORMAL.
2009-10-26 09:07:41 -07:00
Eric Laurent
7996f999be Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Modified checkAndSetVolume() method to adjust VOICE_CALL, BLUETOOTH_SCO and DTMF stream volumes to match audio hardware behavior (never 0).
Also do the following adjustments on stream volumes:
- VOICE_CALL:
	if in call, force software volume to max to avoid applying the volume twice (software mixer + audio hardware)
	send setVoiceVolume() to set in call volume in audio hardware
- BLUETOOTH_SCO:
	send setVoiceVolume() with max value because volume is applied by BT headset and should not be also applied by audio hardware.
- DTMF:
	if in call and not using the BT SCO device, force software volume to max to avoid applying the volume twice (software mixer + audio hardware)
2009-10-21 08:19:36 -07:00
HK Chen
b5075dd3df qsd8k: fix set_mic_mute() in AudioHardware.
Signed-off-by: Brian Swetland <swetland@google.com>
2009-10-15 01:23:48 -07:00
Android (Google) Code Review
7c65dd73a3 Merge change I34a989e8 into eclair
* changes:
  Fix issue 2172934: AudioHardware for msm7k: some file descriptor tests must be fixed.
2009-10-12 12:42:51 -04:00
Eric Laurent
0933f47098 Fix issue 2172934: AudioHardware for msm7k: some file descriptor tests must be fixed. 2009-10-09 18:18:47 -07:00
Jean-Michel Trivi
fcc698f9b4 Fix bug 2172716. Align AudioPolicyManager code in msm7k/libaudio and msm7k/libaudio-qsd8k 2009-10-09 16:58:34 -07:00
Dima Zavin
ef7776257a gralloc-qsd8k: Call glFinish on composition complete.
Change-Id: I09c8287bcaf89f3f8bcaa4108631641a0fcc397b
Signed-off-by: Dima Zavin <dima@android.com>
2009-10-08 01:13:51 -07:00
Eric Laurent
addb2c56fc Fix issue 2146459:AudioPolicyManager: notification and ringtone streams can remain muted.
The fix consists in adding a parameter to handleIncallSonification() indicating that it is called from setPhoneState() in which case the stream mute or unmute is called as many times as there are active tracks on the output.

Also change the time when handleIncallSonification() is called in setPhoneState() to make sure that both mPhoneSate and the selected device are coherent with the IN_CALL state when the fucntion is called.
2009-09-29 15:04:46 -07:00
HK Chen
2d2802d283 Fix get_snd_dev() in AudioHardware. 2009-09-28 14:58:06 -07:00
Android (Google) Code Review
ac5de163ca Merge change 27062 into eclair
* changes:
  Fix bug 2146274. Modify the Audio Policy Manager to support dynamic rerouting of STREAM_VOICE_CALL streams when using AudioManager.setSpeakerphoneOn(bool) even when not in call.
2009-09-25 18:01:44 -04:00
Jean-Michel Trivi
5312b467f3 Fix bug 2146274. Modify the Audio Policy Manager
to support dynamic rerouting of STREAM_VOICE_CALL streams when using
AudioManager.setSpeakerphoneOn(bool) even when not in call.

The setSpeakerphoneOn() method is mapped in the AudioPolicyManager to
a call to setForceUse for the AudioSystem::FOR_COMMUNICATION usage.
This was only updating the output device when the current mode
was MODE_IN_CALL. The change consists in changing the routing
also when there is an active stream of type AudioSystem::VOICE_CALL
as we allow that stream type to be used not just for telephony streams,
but for communications in general.
2009-09-25 10:53:27 -07:00
HK Chen
c71bbda56f qsd8k: audio: remove pre-filling buffers for pcm playback.
Signed-off-by: Brian Swetland <swetland@google.com>
2009-09-24 17:09:27 -07:00
Dima Zavin
d24467414b copybit: hack to always request premultiplied alpha blend.
The kernel will only do it for images with an alpha plane.

Change-Id: Idcba41945ed7d17daae0a5bcc48c64a82a49dded
Signed-off-by: Dima Zavin <dima@android.com>
2009-09-24 01:10:49 -07:00
Eric Laurent
3dfe38ac24 Fix issue 2118500: Ringer volume control broken after a call is terminated while a ring tone is playing and a BT headset is connected.
There was a problem in the special management of notifications while incall when using a duplicated output (with A2DP headset connected). When in call, the notifications are not played on both A2DP + speaker outputs but replaced by a tone in the device used for in call audio. When the call ends while a notification or ring tone is playing, the notification was not moved back to duplicated output (A2DP+speaker).
We must also make sure that the code that unmutes notification playback and stops the tone is called before the notification stream is moved back to duplicated output as it handles the volume and routing on hardware output only.
Also fixed a potential problem in active tracks counting when moving DTMF stream from A2DP output to hardware output when changing cal
l state.
2009-09-15 08:22:39 -07:00
Android (Google) Code Review
0cbca01ed2 Merge change 23947 into eclair
* changes:
  Fix issue 2100324: Limit ringtone and notifications volume when a headset is connected.
2009-09-08 22:40:06 -07:00
Dima Zavin
03f9cb24dd libcopybit: Fix typo, and the build
Change-Id: I4f75e7ee4eff4f6159099de92ae3b4501ad7474a
Signed-off-by: Dima Zavin <dima@android.com>
2009-09-08 18:49:41 -07:00
Mathias Agopian
f2d52d61f9 QSD8K supports 8x scaling 2009-09-08 16:18:51 -07:00
Eric Laurent
c9e1cbd5c9 Fix issue 2100324: Limit ringtone and notifications volume when a headset is connected.
Apply the following rules to ring tones and notifications to avoid sound level bursts in user's ears:
- always attenuate ring tones and notifications volume by 6dB
- if music is playing, always limit the volume to current music volume, with a minimum threshold at -36dB so that notification is always perceived.
2009-09-04 02:38:50 -07:00
Android (Google) Code Review
4640d3dde0 Merge change 23733 into eclair
* changes:
  liblights: fix LED transitions when an amber LED is supported
2009-09-02 17:14:18 -07:00
Android (Google) Code Review
fc90c2461f Merge change 23567 into eclair
* changes:
  libaudio-qsd8k: very rough cut of 8k audio support
2009-09-02 16:27:15 -07:00
Iliyan Malchev
c7aa563636 liblights: fix LED transitions when an amber LED is supported
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-09-02 16:14:13 -07:00
Mike Lockwood
1a4cba4225 librpc: Support new RPC major/minor versioning scheme.
Change-Id: I31035c8ace5f6db6694d699fa778e08f1a061dbc
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-09-01 21:55:10 -04:00
Brian Swetland
9bad96082a libaudio-qsd8k: very rough cut of 8k audio support
This really needs a lot of cleanup and AudioPolicyManager should be
shared with the 7k bits, etc, etc.
2009-09-01 18:52:58 -07:00
Eric Laurent
57417552c3 Fix issue 2091594: music chirp after disconnecting A2DP.
Mute media streams during 2 seconds while the music is being switched from A2DP output to hardware output and before it is paused by the music application.
Also improve code readability by using pointers to output descriptors.
2009-09-01 05:56:08 -07:00
Android (Google) Code Review
79a061bf2d Merge change 23296 into eclair
* changes:
  Fix issue 2085730: AudioPolicyManager: The A2DP output descriptor is not released if the associated duplicated output cannot be opened.
2009-08-31 23:25:32 -07:00
Android (Google) Code Review
09c284b754 Merge change 23299 into eclair
* changes:
  liblights: Use constants instead of hard coded file paths.
2009-08-31 12:25:16 -07:00
Mike Lockwood
30e54207f5 liblights: Use constants instead of hard coded file paths.
Change-Id: I87d1b64a2d67ef3674232aa0c48fac4f8f8f3ace
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-31 13:32:51 -04:00
Eric Laurent
9dc608646d Fix issue 2085730: AudioPolicyManager: The A2DP output descriptor is not released if the associated duplicated output cannot be opened.
The fix consists in deallocating the A2DP output descriptor when the duplicated output opening fails in AudioPolicyManager::setDeviceConnectionState().
2009-08-31 09:31:03 -07:00
Eric Laurent
28cc97ea3e Fix issue 2085911: Volume control is broken when A2DP headset is connected.
A regression on volume control was introduced by change 22899. When a volume change was requested on 2 different outputs for the same stream, the change on the second output was ignored because the requested value was the same as current one.
The fix consists in storing current stream volume for each output instead of globally for all outputs.
2009-08-31 00:24:53 -07:00
Eric Laurent
060f98e062 Fix issue 2080258: audio routing is not reset when call ends.
Modify AudioPolicyManager::setPhoneState() to force a routing command to audio output when call ends or starts even if the same device is selected.
Implement AudioHardware::setMode() to force routing change to be taken into account when phone state changes.
2009-08-27 11:49:33 -07:00
Eric Laurent
c33b88974d Fix issue 2045911: Camera Shutter tone does not play correctly while listening to music.
The problem is partly due to the fact that if music is playing in the headset, a routing change is done to play the shutter sound in both headset+speaker. When the shutter sound ends, the routing is reset to headset, but the change is immediate and there is still audio data pertaining to the shutter sound in the audio hardware buffer queue. As the shutter sound is short, sometimes none of it is output to the speaker before the audio path is reset to the headset.
Another factor is the long time taken by the audio hardware to execute some routing or volume change commands (especially in call volume). Current AudioPolicyManager design reapplies all stream volumes when the output device is changed which adds an unecessary delay in the routing command execution.
Another side problem is that althoough the music is muted while the shutter sound is played, the audio latency makes that some music is heard briefly before the shutter sound in the speaker.
In addition a regression in change 21083 broke the mute mechanism.

This fix consists in:
1 Delay the routing change when the shutter sound stops by a duration longer than the audio output latency.
2 Do not send unecessary volume changes by comparing current value with requested value.
3 Wait until the music is muted before proceding with the reset of the audio routing change when starting the shutter sound.
4 fix mute regression
2009-08-27 06:10:56 -07:00
Simon Wilson
fde8e11201 Enforce 32 pixel alignment for Adreno 200 2009-08-25 14:01:36 -07:00
Mathias Agopian
1e11826433 fix a bug with RGBX_8888 surfaces would be rendered incorrectly by the MDP. 2009-08-21 18:19:16 -07:00
Mathias Agopian
717cf60b7a fix gralloc qsd8k. we actually don't need to use /pmem/gpu1, since the gpu is now able to use regular PMEM.
this module is now closer to the generic gralloc module, although it will have to evolve in the near future.
2009-08-20 15:41:34 -07:00
Dima Zavin
dcb8e74a93 Update to the correct location of msm_hw3d.h - Fix build
Signed-off-by: Dima Zavin <dima@android.com>
2009-08-19 21:58:59 -07:00
Mathias Agopian
854a1e77bb use the same magic value for native_handle in 7k and 8k, since the handles are actually identical 2009-08-19 15:16:48 -07:00
Mathias Agopian
faaf609f89 fix the build 2009-08-19 15:14:59 -07:00
Mathias Agopian
c779b2b67d make gralloc_priv.h for msm7k and qsd8k identical and C friendly 2009-08-19 14:17:17 -07:00
Mathias Agopian
6e83a30251 reenabled partial updates in msm7k/qsd8k 2009-08-19 13:45:02 -07:00
Mathias Agopian
6b8826c7c0 add (disabled) support for partial updates and use MDP for single-buffer framebuffer updates. the reason for this change is to make the msm7k and qsd8k modules as identical as possible. 2009-08-19 13:15:21 -07:00
Mathias Agopian
78087b2664 make gralloc-qsd8k closer to the generic gralloc so it's easier to maintain 2009-08-19 13:14:55 -07:00
Mathias Agopian
edc0cd6c3f update gralloc to match the generic version structure 2009-08-18 17:58:41 -07:00
Danke Xie
1b8c82a0a2 librpc: fix bug in xdr_std_recv_bytes()
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-14 17:27:59 -04:00
Dima Zavin
0c7b6963a6 gralloc8k: make sure to set the physical address of the framebuffer
Signed-off-by: Dima Zavin <dima@android.com>
2009-08-13 16:43:21 -07:00