2500 Commits

Author SHA1 Message Date
Glenn Kasten
0f0fbd9441 Use audio_source_t consistently
Was a mix of audio_source_t, uint8_t, and int.

Related fixes:
 - fix comments in MediaRecorder.java
 - AudioPolicyService server side was not checking source parameter at
   all, so if the client wrapper was bypassed, invalid values could be
   passed into audio HAL
 - JNI android_media_AudioRecord_setup was checking source for positive
   values, but not negative values. This test is redundant, since already
   checked at Java and now checked by AudioPolicyService also, but might
   as well make it correct.

Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
2012-01-26 16:50:19 -08:00
Andreas Huber
afe02df45e The software AAC encoder is now an OMX component.
Yay.

Change-Id: I74938a20b4e0a622836ea5184d3761180eb0f5de
2012-01-26 15:45:38 -08:00
Dianne Hackborn
d96e3dfa02 Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc.
Change-Id: I519d6cdc527a402d93b98df17a64fc1da52ad598
2012-01-25 15:14:50 -08:00
Glenn Kasten
34f9f8bb83 Remove AudioFlinger dependencies on client
Change-Id: Ibb591e41a3ca5d7015e2b66b98b8fef5f415fb37
2012-01-20 17:12:59 -08:00
Glenn Kasten
bc4de888c1 Make AudioTrack control block volume field private
This is part of the process of abstracting the control block
to make it easier to maintain.

Change-Id: Idb8f461e68dab3bcf268159cc0781651c6fb7094
2012-01-20 16:19:59 -08:00
Glenn Kasten
0a204ed0f5 Use audio_format_t consistently, continued
Was int or uint32_t.

When AudioFlinger::format can't determine the correct format,
return INVALID rather than DEFAULT.

Init mFormat to INVALID rather than DEFAULT in the constructor.
Subclass constructors will set mFormat to the correct value.

Change-Id: I9b62640aa107d24d2d27925f5563d0d7407d1b73
2012-01-20 14:41:34 -08:00
Glenn Kasten
15f51ccee1 Merge "Remove dead file include/media/thread_init.h" 2012-01-20 12:15:38 -08:00
Glenn Kasten
7524a59252 Merge "Remove dead setRingerMode(mode, mask)" 2012-01-20 10:07:06 -08:00
Steve Block
933e856150 Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF)
Change-Id: I26f76452ac49e2890b14d133c065493d8df0fb4a
2012-01-19 14:44:56 -08:00
Glenn Kasten
96f46033b4 Remove dead file include/media/thread_init.h
Change-Id: I98688bb7109b5f82953988935c7c33fe3c7f4ec0
2012-01-19 10:13:52 -08:00
Glenn Kasten
92ecdd6303 Merge "Fix incorrect includes of AudioTrack.h" 2012-01-19 06:10:37 -08:00
Glenn Kasten
a6dafea172 Fix incorrect includes of AudioTrack.h
Remove unnecessary includes of AudioTrack.h.
Use forward declaration of class names in preference to #include when possible.

Change-Id: I12982811fa75c2c7695d8bbfa595a7aaec047dc0
2012-01-18 16:06:47 -08:00
Glenn Kasten
ee7fea9f2f Remove dead setRingerMode(mode, mask)
Change-Id: Ia4cc8be8424a40b3dcb7ebd0264fdff4e5247f7f
2012-01-18 15:10:31 -08:00
Andreas Huber
28ea013f25 Temporarily restore AudioSystem/AudioTrack APIs with their former signatures
until we get updated prebuilts from vendor.

Change-Id: I8aae81d2513edca0ab268053a11c8c4206879e61
2012-01-18 10:51:55 -08:00
Glenn Kasten
540c35f7aa Merge "Track volume cleanup" 2012-01-18 07:46:18 -08:00
Steve Block
ad3f5145fe Rename (IF_)LOG() to (IF_)ALOG()
Change-Id: If49c81a2793182771c6160fbca93905daa6f44c1
2012-01-18 11:08:20 +00:00
Eric Laurent
1be4afecb7 Merge "audio framework: manage stream volume per device" 2012-01-17 17:35:03 -08:00
Glenn Kasten
0632bad8ba Track volume cleanup
Always read and write track volumes atomically. In most places this was
already being done, but there were a couple places where the left and
right channels were read independently.

Changed constant MAX_GAIN_INT to be a uint32_t instead of a float.
It is always used as a uint32_t in comparisons and assignments.
Use MAX_GAIN_INT in more places.

Now that volume is always accessed atomically, removed the union
and alias for uint16_t volume[2], and kept only volumeLR.

Removed volatile as it's meaningless.

In AudioFlinger, clamp the track volumes read from shared memory
before applying master and stream volume.

Change-Id: If65e2b27e5bc3db5bf75540479843041b58433f0
2012-01-17 16:25:17 -08:00
Eric Laurent
9bc8358dda audio framework: manage stream volume per device
Improve volume management by keeping track of volume for each type
of device independently.
Volume for each stream (MUSIC, RINGTONE, VOICE_CALL...) is now maintained
per device.

The main changes are:
- AudioService now keeps tracks of stream volumes per device:
 volume indexes are kept in a HashMap < device , index>.
 active device is queried from policy manager when a volume change request
 is received
 initalization, mute and unmute happen on all device simultaneously
- Settings: suffixes is added to volume keys to store each device
volume independently.
- AudioSystem/AudioPolicyService/AudioPolicyInterface: added a device argument
to setStreamVolumeIndex() and getStreamVolumeIndex() to address each
device independently.
- AudioPolicyManagerBase: keep track of stream volumes for each device
and apply volume according to current device selection.

Change-Id: I61ef1c45caadca04d16363bca4140e0f81901b3f
2012-01-17 15:15:04 -08:00
Glenn Kasten
fb6b5bdcea Merge "Use audio_mode_t consistently" 2012-01-17 11:32:53 -08:00
Glenn Kasten
55fa4fb4a7 Rename Visualizer::mLock
This avoids confusion with parent class AudioEffect's mLock which is
protected.

Change-Id: I2ae0b0869fe3c606f682252973795b34477951d0
2012-01-17 10:06:38 -08:00
Glenn Kasten
06a864413f Thread::getTid returns pid_t gettid() after run
This is needed when the parent or any other thread besides the child
needs access to the child's kernel tid.

Change-Id: Ib148505913eb78314cfd76657c30d7b20663dffd
2012-01-17 09:38:23 -08:00
Glenn Kasten
8c17a2f088 Merge "Use size_t for frame size" 2012-01-17 07:27:46 -08:00
Glenn Kasten
3c6b9cca79 Merge "Use audio_stream_type_t consistently" 2012-01-17 07:25:36 -08:00
Glenn Kasten
dd3ca2e268 Merge "AudioTrack and AudioFlinger send level cleanup" 2012-01-17 07:18:26 -08:00
Glenn Kasten
4790bd8be8 AudioTrack and AudioFlinger send level cleanup
Add an API to control block for getting/setting send level.
This allow us to make the mSendLevel field private.

Document the lack of barriers.

Use 0.0f to initialize floating-point values (for doc only).

Change-Id: I59f83b00adeb89eeee227e7648625d9a835be7a4
2012-01-13 15:25:14 -08:00
Jeff Brown
4bedb48103 Merge "Fix compilation with Clang." 2012-01-13 15:16:59 -08:00
Glenn Kasten
faf354dc7f Use size_t for frame size
except in the control block, where we don't have room.

In AudioFlinger::ThreadBase::TrackBase::getBuffer,
read the frame size from control block only once.

Change-Id: Id6c4bccd4ed3e07d91df6bbea43bae45524f9f4e
2012-01-13 14:58:44 -08:00
Glenn Kasten
bc1d77b6cb Use audio_stream_type_t consistently
At native level it was a mixture of audio_stream_type_t, int, uint32_t,
and uint8_t.  Java is still int.  Also fixed a couple of hard-coded -1
instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0
instead of AUDIO_STREAM_VOICE_CALL.

Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
2012-01-13 10:20:14 -08:00
Evgeniy Stepanov
0922328270 Fix compilation with Clang.
warning: extraneous template parameter list in template specialization
template<>

Change-Id: If3e3e1d06a018343b40ac0984dfd9ecc12629f8d
2012-01-13 15:33:54 +04:00
James Dong
b5c6ff5993 Merge "Separate sniffing from session initialization" 2012-01-12 16:56:58 -08:00
James Dong
d1ba6ed945 Separate sniffing from session initialization
This avoid lengthy/duplicate sniffing for drm plugins when a decrypt session is opened

o The change is backward compatibile in that no update is required
  for existing drm plug-ins if they do not plan to provide separate
  sniffer/extractor

related-to-bug: 5725548

Change-Id: I7fc4caf82d77472da4e2bc7b5d31060fb54fd84c
2012-01-12 16:25:12 -08:00
Mathias Agopian
2fdc357bc6 Merge "remove dead/usnused code" 2012-01-12 10:37:10 -08:00
Glenn Kasten
1c66547ba2 Merge "Use audio_format_t consistently" 2012-01-12 10:30:28 -08:00
Glenn Kasten
accb114e59 Use audio_mode_t consistently
It was int or uint32_t.
Also make getMode() const.

Change-Id: Ibe45aadbf413b9158e4dd17f2b3bcc6355288d37
2012-01-12 09:52:37 -08:00
Mathias Agopian
0db7590ed2 remove dead/usnused code
Change-Id: I6fa2bc6ee01790abd2c1533f043d61a5e5c8d26e
2012-01-11 22:03:41 -08:00
Glenn Kasten
c57b063192 Merge "Fix bug in JetPlayer::loadFromFile" 2012-01-11 11:39:06 -08:00
Glenn Kasten
f733831fc7 Merge "Declare IAudioTrack methods in binder opcode order" 2012-01-11 10:23:34 -08:00
Glenn Kasten
77b6aaf62d Fix bug in JetPlayer::loadFromFile
A long pathname would corrupt the heap due to incorrect use of strncpy.

Also was using hard-coded constant 256 instead of PATH_MAX.

Change-Id: Iba382bbb38624fbc41fec91449f9814f77d4ac0d
2012-01-10 15:43:24 -08:00
Glenn Kasten
8cf6d6f148 Merge "Clean up AudioTrack::mActive and stopped()" 2012-01-09 10:24:40 -08:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Glenn Kasten
798ef8e882 Declare IAudioTrack methods in binder opcode order
This makes it easier to match up the declarations.

Change-Id: I0996c20b2903b778b356dfe52b07b0ec634855dd
2012-01-06 13:35:57 -08:00
Glenn Kasten
1c5a89d4af Use audio_format_t consistently
Was int, uint32_t, uint16_t, and uint8_t with 2-bit bitfield.
Also replace 0 by AUDIO_FORMAT_DEFAULT and replace 1 by
AUDIO_FORMAT_PCM_16_BIT.

Change-Id: Ia8804f53f1725669e368857d5bb2044917e17975
2012-01-05 13:34:54 -08:00
Glenn Kasten
e6810ffaa1 Clean up AudioTrack::mActive and stopped()
mActive is protected by mLock; volatile is meaningless on SMP.

Fixed a couple of places where mActive was accessed without a lock:
 - stopped()
 - processAudioBuffer()

Added stopped_l() for cases where we already hold the lock.

Made mActive a bool not int.

Moved down a lock in setPosition that was being acquired too early.

Change-Id: I73ff368e991c0db9f9472df0b3f96fd33fcc7311
2012-01-05 11:55:24 -08:00
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Joe Onorato
44fcb83b38 Add a new ui mode for "appliance"
The idea is that this is a device which is more-or-less headless.  It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.

Change-Id: Ib92f53a120bf83de781728011721a4859def7d9f
2011-12-15 16:16:14 -08:00
Glenn Kasten
e5fb263a36 Audio C++ comments
Change-Id: I84906ebb9dfcfa5b96b287d18364b407f02a30c1
2011-12-14 14:38:26 -08:00
Romain Guy
d3209c1bb2 Merge "GenerationCache::get would return a random value instead of NULL Bug #5401917" 2011-12-08 18:51:03 -08:00
Romain Guy
46b9f7cc20 GenerationCache::get would return a random value instead of NULL
Bug #5401917

This was causing a ton of random crashes in apps.

Change-Id: I9069a060824ec89115cd3bcd38beaeb9ecc4488e
2011-12-08 18:50:27 -08:00
Mathias Agopian
6779df2c28 Improve the VSYNC api a bit.
- add the ability to set the vsync delivery rate, when the rate is
set to N>1 (ie: receive every N vsync), SF process' is woken up for
all of vsync, but clients only see the every N events.

- add the concept of one-shot vsync events, with a call-back
to request the next one. currently the call-back is a binder IPC.

Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
2011-12-06 22:43:10 -08:00