Commit graph

154 commits

Author SHA1 Message Date
Glenn Kasten
044bac40a1 Add audio_input_flags_t to HAL open_input_stream
Change-Id: I17db01e92bfa939c7a15e7f9f95197d0a0568033
2014-07-17 07:29:12 -07:00
Eric Laurent
40508f66ca audio: fixed channel count determination from channel mask
Do not use popcount() to derive channel count from channel mask.

Bug: 15000850.
Change-Id: I5050ce7fd7884369eb0de37967e40052630006a9
2014-07-01 20:33:36 -07:00
Paul McLean
03d92f4a6e Enabling USB Device and Android Device Vol inc/dec functionality
for USB Audio Output

Bug: 13747844
Change-Id: I53b7db8102fd2ed24014c338ea5e7290cda8b2f3
2014-06-27 08:48:20 -07:00
Eric Laurent
d97aa170de audio policy: add parsing for more audio formats
Bug: 9428304.
Change-Id: Ie3c9827ed78703a1b2d9699e38ce628f3055138b
2014-06-19 10:10:54 -07:00
Eric Laurent
f466bfe146 Merge "handle in and out audio device connection separately" 2014-05-30 17:09:19 +00:00
Eric Laurent
806fab660a handle in and out audio device connection separately
AudioService now indicates in and out device connection
separately in case of combined devices like wired headset
or BT SCO headset.

Change-Id: Id20e02bb351cc732ceddccf597742ced049671a8
2014-05-29 16:14:44 -07:00
Mike Lockwood
33bf1b0fe3 AudioPolicyManagerBase: Add support for A2DP sink input
Change-Id: I500d1f2f8f2199c674b289cf671b7f863a7d02ee
2014-05-28 12:21:52 -07:00
Eric Laurent
9c599afbc0 am 62038fc4: am 2c388a44: am 8eb3354a: Merge "Audio: add an openOutputStreamWithFlags API"
* commit '62038fc4c5c596f04a87388bb42bdef13d359c39':
  Audio: add an openOutputStreamWithFlags API
2014-05-08 18:24:06 +00:00
Eric Laurent
8eb3354ad0 Merge "Audio: add an openOutputStreamWithFlags API" 2014-05-07 23:34:19 +00:00
Paul McLean
fd61179b64 Update policy handling for USB inputs
Change-Id: Ib2e531f115f8bd1d5f290094032f3f4a4753e726
2014-04-25 17:00:48 +00:00
Colin Cross
b10621c1f1 resolved conflicts for merge of 75402fdb to master
Change-Id: Ie85a3c7d498d7685738190267916e9a205cc469e
2014-04-24 08:39:41 -07:00
David Wagner
cc029e59f7 Audio: add an openOutputStreamWithFlags API
The existing openOutputStream API did not allow passing stream flags even
though its audio hardware interface's open_output_stream counterpart does take
a "flags" argument.  This means that, when the audio hw_module is implemented
using libhardware_legacy, the output flag was lost.

This commit adds an API in libhardware_legacy's audio module, allowing to pass
the flag, and updates the default wrapper in order to call this new API instead
of the old version that missed the flag.

Change-Id: I20c102d32b489f87fabbd7d02aa0b28fae13948b
Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
2014-04-23 14:42:21 +02:00
Colin Cross
c7b6e3c857 audio: allow compiling for 64-bit
Fix a few 64-bit warnings and set -Wno-unused-parameter, which makes
the directory warnings-clean on 32-bit and 64-bit.
Remove LOCAL_32_BIT_ONLY.

Change-Id: I688b31683f1a6598419866d9b7b6bc27a7056f4a
2014-04-18 15:48:06 -07:00
Paul McLean
c26f454f8d Initial implementation of USB Audio output.
Change-Id: I4e2517233487ca7487ed7948a974fc2cc6c41190
2014-03-28 10:34:25 -07:00
Glenn Kasten
67d562280d am fa8ad9fb: am 60089828: Merge "Audio policy is 32-bit only"
* commit 'fa8ad9fb544e01e663709e8dccd9b358e4d3ede9':
  Audio policy is 32-bit only
2014-03-17 23:32:53 +00:00
Glenn Kasten
a7b1bc9eda Audio policy is 32-bit only
Change-Id: I2eca0286d98bb5eebe9c68286d4ee7ed366f173d
2014-03-17 11:47:56 -07:00
Glenn Kasten
dcc6e9f299 am e6c7127e: am be39c1e4: Merge "audio policy : add AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable"
* commit 'e6c7127ef2491ddeb995ffb48843fda4e30ff9ff':
  audio policy : add AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable
2014-03-17 15:56:18 +00:00
Peter Yoon
26101ada7b audio policy : add AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable
This commit adds AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable[],
It had to be added here, when it was defined in system/core/include/system/audio.h

AudioPolicyManagerBase::loadHwModule() fails to parse device type of
AUDIO_DEVICE_IN_USB_DEVICE in audio_policy.conf.
By applying this commit, AUDIO_DEVICE_IN_USB_DEVICE can be used for
audio policy customization.

Change-Id: I0165956334d7105129dca4c746372dbca0d9e324
2014-03-17 13:10:04 +00:00
Glenn Kasten
9df8ecc68b Add more PCM formats to audio_policy.conf parser
In particular, we need AUDIO_FORMAT_PCM_24_BIT_PACKED.

Change-Id: I28abe8466024bdd4d1edbb4281c6472d45a2d94f
2014-03-07 10:21:40 -08:00
Glenn Kasten
316222fcd6 Rename setStreamOutput to invalidateStream
And simplify by removing the unused I/O handle parameter 'output'.

Change-Id: Ie9c4df17a7378066312d4ed8790fda7a9125c95e
2014-02-28 11:54:03 -08:00
Patrick Tjin
4387d30660 audio_policy: clean up dumpsys
Remove NUL characters from audio_policy's dump output

Change-Id: If591473dbe3e5adbc34dbbdb0d552b329f19eb6a
2014-02-06 09:11:50 -08:00
Colin Cross
1150598d80 am 3582b9b0: am 84b5cd7c: Merge "hardware/libhardware_legacy: convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH"
* commit '3582b9b0e1caa4a43b8706e699903142e34ad5c0':
  hardware/libhardware_legacy: convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH
2014-01-28 01:12:46 +00:00
Colin Cross
a13a2b960a hardware/libhardware_legacy: convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH
LOCAL_MODULE_PATH doesn't work for multiarch builds, replace it
with LOCAL_MODULE_RELATIVE_PATH.

Change-Id: I4e4ceec61d026bbe74ba604554c06104bde42e5e
2014-01-24 21:00:32 -08:00
Eric Laurent
9f4165f36d audio policy: send config params when opening output
When a new output stream is opened upon device connection,
always send mandatory configuration parameters
(A2DP device address, ALSA card and device number etc...)
immediately after opening the output.

Change-Id: Id1fc1d99d3b30e2ef907dcb231a6a9e70560ecae
2014-01-08 09:34:38 -08:00
Glenn Kasten
2d749b0bda Continued cleanup of audio policy's use of audio_format_t
Change-Id: I6ef6ec50cd5e0e751dc5063af1f7d8882588a89b
2013-12-20 15:37:53 -08:00
Glenn Kasten
2c3d2379ee Use audio_channel_mask_t in AudioPolicy
Also:
 - use %x format for logging channel masks
 - use AUDIO_CHANNEL_IN_* constants from system/audio.h instead of AudioSystemLegacy.h symbols
 - remove redundant casts
 - use "channelMask" instead of "channels" to avoid possible confusion with channel counts

Change-Id: If05d6b1cae5cf1b560cd53a93ae9e592b719ec9e
2013-12-16 14:10:22 -08:00
Glenn Kasten
5082dbeb19 Use audio_format_t in AudioPolicy
Also remove unnecessary default parameters

Change-Id: I553c01a98b8c2a3f3fd2ac98724aded3ad3c3022
2013-12-10 10:06:28 -08:00
Glenn Kasten
6742b02106 Fix typos in logs
Change-Id: Ie2e49d108a4dd33725296c96aaf9458585b81d32
2013-11-22 09:09:58 -08:00
Jean-Michel Trivi
9d3950389b am 18fc094c: Define and use DRC-specific volume curves when applicable
* commit '18fc094c0ed41851be3d746423c6695dd28d48e1':
  Define and use DRC-specific volume curves when applicable
2013-11-15 09:04:54 -08:00
Jean-Michel Trivi
18fc094c0e Define and use DRC-specific volume curves when applicable
Add support for property defining whether a DRC on the speaker path
 is enabled and will boost soft sounds.
Define new volume curves with more attenuations than existing ones
 to compensate for DRC-induced boost on sonification sounds to
 provide a more "linear" control to the user over the applied volume.

Bug 11600699

Change-Id: If23dd097a8b9b5ebb61e75dd8512ff75e63ba899
2013-11-14 16:36:43 -08:00
Nick Kralevich
a8809cd068 am 376356d4: Merge "audio: do not use GNU old-style field designators"
* commit '376356d4e0c135e710c6232e7e3f5c950247c848':
  audio: do not use GNU old-style field designators
2013-11-06 19:29:23 -08:00
synergy dev
c9f04f9cb4 audio: do not use GNU old-style field designators
Avoiding the use of gnu extensions improves code portability

Change-Id: Ifa8f5d230de20a6284bb943c1ca3c48fd5fd5f2d
2013-11-06 18:04:54 -08:00
Elliott Hughes
7e7add707a am 2c14d798: Merge "Revert "audio: do not use GNU old-style field designators""
* commit '2c14d79895593d4f8e1241b522cd3ce2d7225aaf':
  Revert "audio: do not use GNU old-style field designators"
2013-11-06 17:41:31 -08:00
Elliott Hughes
5d5a2805e0 Revert "audio: do not use GNU old-style field designators"
This reverts commit d2bd76e0da.

Change-Id: I6fb884cd0e1efa0c792521b67ed193420f6929ba
2013-11-07 01:34:47 +00:00
Nick Kralevich
e1ffc9aa46 am 636ab7e2: Merge "audio: do not use GNU old-style field designators"
* commit '636ab7e2dd52c3cdad575a49b952c1235d734240':
  audio: do not use GNU old-style field designators
2013-11-06 17:10:53 -08:00
synergy dev
d2bd76e0da audio: do not use GNU old-style field designators
Avoiding the use of gnu extensions improves code portability

Change-Id: Ifa8f5d230de20a6284bb943c1ca3c48fd5fd5f2c
2013-11-06 17:05:37 -08:00
Eric Laurent
000bb51ca5 audio policy: fix gapless playback when effects enabled
Do not allow offloading if one non offloadable effect is enabled. This prevents from
creating an offloaded track and tearing it down immediately after start when audioflinger
detects there is an active non offloadable effect.
Not doing so breaks gapless playback because AwesomePlayer will always be able to open
an offloaded track which will not be compatible with the previous PCM track and
Audiosink::open() will not recycle it.

Bug: 11181933.
Change-Id: I6d163806849d9093b9ec701ba8e8c1ccb658e3c8
2013-10-14 11:15:39 -07:00
Eric Laurent
b40b96a785 audio policy: fix direct output selection
commit a527ffd broke the selection of an available
direct output profile in getProfileForDirectOutput().
getProfileForDirectOutput() should check for direct output profiles
regardless of the flags provided to getOutput().

Bug: 11051912.
Change-Id: I4a84734331bfed03d6024ea1c2e8776c27d0b28f
2013-10-07 10:10:44 -07:00
Eric Laurent
87e28f7b35 audio policy: fix DTMF tones volume while in call
When voice call stream volume is at 0, DTMF are not heard at all.
DTMF volume should follow the behavior of voice call volume which
is never completely muted.

Bug: 10932676.
Change-Id: Iaf0e33284be75b00516a837907e66be3123e5331
2013-10-03 18:02:16 -07:00
Eric Laurent
727fef1b1a remove audio HAL warning when inserting a headset
A valid offload info structure must be provided when
opening an offload output stream in checkOutputsForDevice()
upon headset insertion.

Bug: 8174034.
Change-Id: Id800a206536e5ce979febf89747a51db581c53b6
2013-09-30 19:20:15 -07:00
Eric Laurent
962a0a4d75 audio: fix remote submix sampling rates
Only list 48000 Hz in supported sampling rates for remote submix
output and input stream profiles to avoid mismatch betwen playback
and capture.

Bug: 10900252.
Change-Id: Id96e914caeb42e8f4aa5fe4e55e19156cdd67b58
2013-09-26 11:28:36 -07:00
Eric Laurent
45c763947b audio policy: add support for audio effect offload
Add rules to select the appropriate output for global
effects.
Move global effects if needed when an offloaded output is
created or released.

Bug: 8174034.

Change-Id: I0bbd8e9f8aa717f672462dd74ba0d01eaef1fda7
2013-09-17 11:27:45 -07:00
Eric Laurent
fc9b2457ce AudioPolicyManageBase changes to enable HOTWORD audio source
- This change enables HOTWORD audio source to be preempted by any other
  audio source

Bug: 10640877.

Change-Id:  I6f7acbe95a6521306db70ad73260d2ba7b38b940
2013-09-09 15:43:35 -07:00
Eric Laurent
4e57a1d497 audio policy: remove verbose logging.
Change-Id: I268935bd8f7e58f90c698c098686a04681b43887
2013-08-30 15:47:52 -07:00
Eric Laurent
41b150b659 audio policy: disable audio offloading with video
Do not enable offloading of audio decompression when
playing video.

Change-Id: I6ee8b59370219f5ef810a99a27ba4a1cf222b55b
2013-08-30 15:36:55 -07:00
Chong Zhang
fe97ee4b99 audio policy: allow virtual input even if there are active inputs
Bug: 10460751

Change-Id: Ic6fcd14162e9c6e03366d887063321e21fcf14cd
2013-08-24 16:45:36 -07:00
Jeff Brown
b96b2839f4 Automatically enable/disable remote submix when input started.
When recording from the audio submix begins, enable the remote
audio submit output device.  When it ends, disable it.

Bug: 10265163
Change-Id: Ia0dc2e20623bb834d06561469ce856688991243b
2013-08-19 15:47:33 -07:00
Richard Fitzgerald
a527ffd3c2 Code changes for audio offload support
- Share existing offload output if compatible instead of
  creating a new one. Hardware has limited number of
  offload channels (possible only 1) so we must use as
  few as possible

- Changes to routing handling for offloaded outputs

Change-Id: I11111d8f504828595bd8dbf66444cbd1202e7192
Signed-off-by: Eric Laurent <elaurent@google.com>
2013-07-24 18:39:05 -07:00
Eric Laurent
ae57fbe12a am 8e7e4254: am e92d6238: audio policy: apply default device volume
* commit '8e7e42547116b1d5f49118ba41946b2906ad3936':
  audio policy: apply default device volume
2013-07-15 17:26:21 -07:00
Eric Laurent
e92d623811 audio policy: apply default device volume
Make sure that we apply default device volume to
active outputs in case no specific volume for selected
device is received afterward.

Bug: 9760269.
Change-Id: I216de40396e1075e77493c97e8b192cd3a31d546
2013-07-15 15:41:08 -07:00