276 Commits

Author SHA1 Message Date
Jean-Michel Trivi
4fc9cbccc1 Fix bug 2111240 When docked to a BT dock, give priority to wired
accessories over BT, and don't duplicate outputs for notifications.
2009-12-09 10:32:03 -08:00
Eric Laurent
148f11328f Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
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().
2009-12-07 04:23:46 -08:00
Dima Zavin
6d4fd653ce gralloc-qsd8k: If using gpu composition, request rgba8888 instead of rgbx8888
Change-Id: Ic41d4854d6acbc21c85a03e82bd63af234273886
Signed-off-by: Dima Zavin <dima@android.com>
2009-12-04 20:22:41 -08:00
Dima Zavin
62447949f2 gralloc-qsd8k: Change composition_complete being a glfinish from stopship to a TODO
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>
2009-12-04 15:41:54 -08:00
Eric Laurent
5cc6387254 Fix issue 2304701: Media streams can remain muted on A2DP output.
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.
2009-12-04 07:01:06 -08:00
Dima Zavin
be6f97aad3 libgralloc-qsd8k: Do not use the physical address of surfaces/framebuffer
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>
2009-12-02 21:15:33 -08:00
Android (Google) Code Review
3b81370104 Merge change I14a54ae2 into eclair
* 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.
2009-11-30 16:24:27 -08:00
Eric Laurent
b65217ffe2 Fix issue 2192673: Music Pausing Even when notifications are set to silent.
If a stream cannot be muted (ENFORCED_AUDIBLE stream in some countries), make sure that getStreamVolumeIndex()
returns the actual stream volume.
2009-11-27 05:06:23 -08:00
Jean-Michel Trivi
e204be3647 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.
2009-11-24 16:40:49 -08:00
Mathias Agopian
1e1a87f0a5 part of fix [2186418] switch qsd8k devices to 24-bits framebuffer
Add support for 32 bits framebuffers
2009-11-23 23:19:54 -08:00
Eric Laurent
bbb5f58f76 Improvement for issue 2197683: English IME key-press latency is noticeably higher on passion than sholes.
Change audio buffer count to match number of buffers used by audio dsp.
Change buffer size from 4800 bytes to 3072 bytes to reduce output latency.
2009-11-21 00:45:02 -08:00
Eric Laurent
d8c81ab5d3 Issue 2276684: Kernel audio driver should fully support AUDIO_SET_CONFIG.
Align HAL audio input buffer size with kernel driver for the time being.

For mr2 release the driver shall support AUDIO_SET_CONFIG.
2009-11-20 09:57:40 -08:00
Jean-Michel Trivi
e00f5f2bb9 Patch from HTC related to use of camcorder with wired headset plugged in:
- 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>
2009-11-18 19:32:44 -08:00
Jean-Michel Trivi
b5f536cb89 Remove workaround introduced in 956f7ba5ee0f087c91b5fefd2718dae30f8c1e29
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).
2009-11-15 13:48:42 -08:00
Eric Laurent
dc2b08fd2a Fix issue 2245963: incoming call rings in ringtone-volume level through a wired headset is while listening to music.
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.
2009-11-13 02:57:12 -08:00
Eric Laurent
b0987a90f9 Fix issue 2242614: Wired headset not recognized: bogus "state" in ACTION_HEADSET_PLUG broadcast.
Removed platform specific devices from the list of devices listed in AudioSystem.
2009-11-12 12:18:31 -08:00
Android (Google) Code Review
e961f58156 Merge change I42e2860a into eclair
* changes:
  should help [2223746] qsd8k MDP locks up, logs show copyBits failed (Connection timed out) in Passion camera zoom level 1
2009-11-11 16:45:41 -08:00
Mathias Agopian
ef686c51fd should help [2223746] qsd8k MDP locks up, logs show copyBits failed (Connection timed out) in Passion camera zoom level 1
make sure to return an error when mdp limits are exceeded
2009-11-11 16:28:21 -08:00
Eric Laurent
e210a8ccce Workaround for issue 2229040: [Passion] Audio driver stuck when changing input routing while recording is active.
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>
2009-11-11 10:49:32 -08:00
Android (Google) Code Review
a6675bb910 Merge change I08516fe5 into eclair
* changes:
  libaudio-qsd8k: update a1026.h header and improve firmware-loading code
2009-11-10 15:20:02 -08:00
Android (Google) Code Review
05a1ef9930 Merge change I108ada59 into eclair
* changes:
  Fix issue 2226658: Audio path not updated when a headset is plugged or unplugged while recording.
2009-11-09 22:39:39 -08:00
Mathias Agopian
9e8b8a119d enable mdp debugging on error, also check for invalid inputs 2009-11-09 20:15:50 -08:00
Iliyan Malchev
84abafaf65 libaudio-qsd8k: update a1026.h header and improve firmware-loading code
-- 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>
2009-11-09 16:06:57 -08:00
Eric Laurent
920fea9258 Fix issue 2226658: Audio path not updated when a headset is plugged or unplugged while recording.
Modified AudioPolicyManager::setDeviceConnectionState() so that the device on active audio input is updated when a device is connected or disconnected.
2009-11-09 11:57:59 -08:00
Jean-Michel Trivi
af1701fa98 When configuring the A10026 for microphone input outside of a call,
always use the A1026_xx_RECEIVER paths.
This prevents the use of the A1026_xx_SPEAKER paths for voice reco
modes for which the gain is too high.
2009-11-08 18:50:57 -08:00
Jean-Michel Trivi
2cf344031b Use new acoustic parameters when recording in voice recognition mode
or for camcorder mode.
2009-11-08 14:03:59 -08:00
Eric Laurent
420a78df14 Fix issue 2243808: Audio input routing broken.
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.
2009-11-06 03:02:05 -08:00
Jean-Michel Trivi
8ea88d0389 Fix typo in AudioPolicyManager log for voice recognition mode.
This fixes a build error when the log for AudioPolicyManager for
QSD8K is enabled.
2009-11-05 17:58:40 -08:00
Android (Google) Code Review
9059d84a60 Merge change Id27d9e35 into eclair
* changes:
  Update lights to support the change in parameters passed by the framework
2009-11-05 19:23:58 -05:00
Eric Olsen
1220be4e5e Update lights to support the change in parameters passed by the framework
Signed-off-by: Eric Olsen <eolsen@android.com>
2009-11-05 15:32:32 -08:00
Jean-Michel Trivi
c932adcc2c Use new A1026 header to us 1026 presets that match the driver.
Update record configuration to use those presets.
2009-11-05 12:44:31 -08:00
Jean-Michel Trivi
f49a990555 Fix bug 2194140 Add support for the voice recognition mode.
The voice recognition mode is enabled when using the
AUDIO_SOURCE_VOICE_RECOGNITION audio recording source. The intended
behavior is to use the same microphone input as the default input,
but to configure the A1026 chip in the special mode tuned for
voice recognition, for the matching input. For testing purposes,
two settings will be available for each input, the choice of which
one is used will be dependent on the vr_uses_ns property.
The availability of the voice rec mode is dependent on the enable1026
system property.
Note that the final A1026 configuration modes are not used yet
(not available) but the ones to use are specified in the comments
of the AudioHardware::doAudience_A1026_Control() function at line
952 of AudioHardware.cpp for instance.
Upon availability of other presets, the enable1026 property could
be used to disable or enable even more of the 1026 features.
2009-11-05 10:32:48 -08:00
Eric Laurent
850c6e0214 Fix issue: no audio after media_server process crash while in call.
Reset audio ctl driver voice mode when AudioHardware is initialized in case media_server process crashed while in call.
2009-11-05 00:56:21 -08:00
Eric Laurent
3262f5a8b3 Log for issue 2203561.
Added detailed dump for AudioPolicyManager when AudioPolicyService is dumped.
2009-11-03 09:18:39 -08:00
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