This change makes sure that changes in the base function
are moved to custom policy if the function is derived in
custom policy.
Below changes are taken care
1) audio policy: fix capture indication to sound trigger service.
Only indicate active capture to sound trigger service
when capturing from primay HW module.
Bug: 31826453
Bug: 31771879
Change-Id: Idf92393d3e7dbf926b847ab23f670e7ab5dd5248
2) audio policy: fix media volume after ringtone
Fix regression introduced by commit 11c499a5 causing
music volume not to be restored after ringtone playback
over duplicated output (speaker + A2DP).
Bug: 31539910
Change-Id: I1c4eebea1f1a8f82ae2acfeecb9a61c437a74e25
3) audio policy: fix call volume over USB
Make sure the cache of output device selection per strategy is updated
also when an input device is connected or disconnected as the list of
input devices sometimes impacts the output device selection in
getDeviceForStrategy().
Bug: 30659619
Change-Id: Ie9f7bafda0074afcc803f309379c35b538f50170
4) audio policy: workaround for truncated touch sounds
Implement workaround to avoid touch sound truncation when
audio path or volume changes are triggered by user actions.
Also:
- Fix regression introduced by commit c75307b7 causing failure
to honor playback start delay in case of path change.
- Fix failure to report path switch delay in updateCallRouting().
- Make sure we delay temporary mute according to requested device
switch delay in checkDeviceMuteStrategies().
Bug: 29528161
Bug: 27535199
Change-Id: Id729579b6623ee67a767055b9aca7d2e2dde8491
Change-Id: I2f0b0e51ec725a462e913432f648cb7b3cf125fe
Revert the synchronization fix handled in
Changed-Id: I9f1c4f82b84805b5f7a0aa770b333e7f2aeee21c
as it's already handled as part of upstream soundtrigger
AOSP refresh
CRs-Fixed: 1108103
Change-Id: I796230b2e1f5e02ed84e29eebc0e7d7be54c1842
Restrict conditions under which we force a routing change
when an output becomes active to reduce the number of useless
binder calls, context switches and pausing of fast mixer thread.
Change-Id: Iab214fa92e0e829b2f609bd53b4731c862456fc0
CRs-Fixed: 1048593
In APM, VoIP output would be closed even if Voice+VoIP concurrency
is enabled. This is due to FLAG_DIRECT is set for compress VoIP by
default. While direct output is forced to closed if Voice+Playback
concurrency is disabled.
Fix this by adding proper flag check to avoid VoIP output is
closed.
CRs-Fixed: 1087113
Change-Id: Idbfc1b499a1252f162300f4e1be4d27b44b7e95c
-mediaplayer now opens a sink with DIRECT_PCM flag for eligible
playbacks, now if setPlayback rate api is triggered for
mediaplayer object,fall back to deep buffer output should happen.
But as the DIRECT_PCM flag is not removed from the requested flags,
the same direct output gets selected.
-Ensure that DIRECT_PCM flag is removed always if present,
before query for output, otherwise even when no direct output
is required, might end up with one.
Change-Id: Ie27e90851a0de4a6a6c2dc205a8ed9e281663626
-Update Direct pcm implementation to identify direct pcm client
as mediaplayer or app based audio track.
-This gives flexibility to disable direct pcm either of these clients.
Change-Id: Ief418a864a6f776c4dea7b2e953df9497cbcb5d0
Revert original change to "remove 5.1 channel mask if SSR is
not supported". Android N introduces index based channel
mask format which breaks this position channel mask logic.
Change-Id: I0e4fde87c23dbf1f9a1ad871259a312f366236e4
-APM tries to open output for all profiles supported on headphone
device During insertion of headphone and invalidate music stream
if number of output doesn't matches with outputs on previous device.
Since DSD profile is supported on headphone device only, APM opens
DSD output on headphone insertion and invalidate music stream.
-Check if any of the new output is for DSD profile if number of output
doesn't match on new device and prev device. Avoid invalidation if
difference in outputs is because of DSD output.
Change-Id: I97092f620851b22a66a6f9cbfc9337db3828c5d6
-Native DSD playback is not supported concurrently with vocie call.
-Reject offload request for DSD if voice call is in progress.
Close DSD compress output for incoming voice call.
Change-Id: I5aae69e232db8d12f2492f0774984597ef06b610
-All DSD clips are being played over offload path on headset irrespecitve
of clip duration.
-Add DSD format as well for duration check during offload request.
Change-Id: Ib952c6de11c8e977275e7e5ee59eafd47a190cec
HW decoded wma is wrong when bit rate of wma files is over specific
threshold, and noise can be heard when playing high bitrate wma files.
Check the bitrate of wma files when checking offload support, when
bit rate is too high, wma cannot be offloaded.
Change-Id: Ib477b9a9fc583caabfd738c620de345105a08988
CRs-Fixed: 1053169
- Attempt to get sound card status from isOffloadSupported() can
cause cross deadlock if audio flinger calls other audio policy
APIs concurrently to update effect status with AudioFlinger's
mLock already acquired.
- Also fetching sound card status from the context of
isOffloadSupported() is not necessary as even though offload is
marked supported here, error from request to open audio output
would always make player fallback to non offload path.
CRs-Fixed: 1048043
Change-Id: I95cd3310da130deb1e6b3847bd6af79f15dd7415
When FM resumed after notification tone played, device updated for
primary output is still headset and speaker. This makes the device
to be switched back to headset and speaker after FM started on headset,
and temp mute can be applied for FM as new device changed from combo
device to headset when stopOutput() called for notificaton tone playback.
Update device for all outputs after FM started, and update the current
device of FM playback for primary output to avoid unnecessary temp mute.
Change-Id: I41badee6fb11e8c4574daa8042e38262a41b7735
CRs-Fixed: 1008864
This is a subsidiary bug fix of the following incomplete one.
- audio: don't allow track offloaded if there's active sw effect
- Change-Id: Idf76374a3fd721eee595a8a9f6197a47a3c25e1c
CRs-Fixed: 984621
Change-Id: I8997f49560550d4174e1146340e0cd4d33957b24
-With voice playback concurrency handling in place, offload or direct
outputs are force closed if a voice call is on.
-In such scenario, on closeOutput, global effects are moved to
primary output by audioflinger instead of deep buffer output
(mix output).
- When call ends, and playback resumes, movement of effects
from previous output to new output fails.
- Ensure that when a output is closed, effects if present
are moved to mix output, such that when a new output comes up
the effects can be moved from MIX output to the required output.
CRs-Fixed: 1030710
Change-Id: I127c02adff3f2148e318d9f4945c501f3f20dc55
Add a log message to print the value of the flag that
enables XML based audio policy configuration. This will
help in determining the actual policy configuration file
being loaded (whether XML or text based legacy config file).
Change-Id: I476cc16e89438709bdd6ceea371eed6bdb7b62f4
-Ensure once direct output is rejected, and the stream has
AUDIO_OUTPUT_FLAG_NONE and is not a music stream then primary output
should only be selected.
Change-Id: I0d01ba4c3e492fa0b78c4f5122a7c0ac5e830e9d
When getting new output with DIRECT_PCM flag set, the existing direct
pcm output can be closed and interrupted mutually with the requested one.
Don't add DIRECT_PCM flag if there's an active direct output for track
offload.
Change-Id: I250c9555dff2c17f94b57a14a1722bae00fe9f9b
CRs-Fixed: 986087
-Pass correct bit width when creating a direct pcm output.
-Control 16 bit and 24 bit PCM offload request based on
properties.
Change-Id: I1d1c038acb6fd97a228df098383710eb4d27794d
-This change enable custom audio policy and also includes
the fixes that went in to audio policy manager.
audio policy: add support for external audio sources
Change-Id: If5805d58a4356b2f681f1aabf54375f62b55b98a
Add setMasterMono and getMasterMono
Change-Id: I32dc1fcecf285967a61bd508af3bb299595db57d
AudioPolicy: AudioOutputDescriptor set/get for patch handle
Change-Id: I5bffecf7a157ec042d749064208bc6c279008542
AudioPolicyManager: force encoded surround setting
Change-Id: I0f7a486bf1aa7a27f15cf220e2c75ef23f8f8536
audio: several fixes in audio routing callbacks
Change-Id: Ieb0d9f92f563a40552eb31bc0499c8ac65f78ce4
audio policy: move volume table to XML file
Change-Id: I78c91bc3378b6c47202abe7b5c1c1e011ff62eed
AudioPolicy: capture sample rate 0 is route-specific default
Change-Id: I7d193640572c08ab5e5f1ecfc8ad6d31635967dd
audio policy: remove deserialization from policy objects
Change-Id: I1ce798848f4657b37e47446c9fbdc63f7ed0390e
DO NOT MERGE - audio policy: disable concurrent capture
Change-Id: I9085918f1f7b12e28430958cceb768bb29c12bdb
audio policy: select output with best sample format match
Change-Id: I31981940be5d1c06d713d52187cfb0a7bf355773
audio policy: audio sessions on input descriptors
Change-Id: I915a65989a7fd0d3cbe2fcf5a0aee2ea0df5f4f5
Call SoundTrigger::setCaptureState in AudioPoilcyManager::closeAllInputs
Change-Id: I613434ecacce3ef03a657008fd94c314948ba2b8
Change-Id: Iee8ef2647691fe1167b95f19357f17c28f54bf0e
This is a subsidiary bug fix of the following incomplete one.
- audio: don't allow track offloaded if there's active sw effect
- Change-Id: Idf76374a3fd721eee595a8a9f6197a47a3c25e1c
CRs-Fixed: 984621
Change-Id: I8997f49560550d4174e1146340e0cd4d33957b24
Due to wrong func isInCall() called in setPhoneState() after phone state
changed, notification tone won't be stopped after call ended.
Correct the func to isStateInCall(int state).
Change-Id: I607e96f1fecdcf37d8865af2aa9b4cbd4450aca6
CRs-Fixed: 978534
Volume inconsistencies are observed when a headset is
plugged in and out repeatedly while FM is active.
This is because the volume stored for stream music for the primary
output is first applied and then the FM volume for headset is applied.
Do not set volume as part of headset connection/disconnection to fix
the issue as it gets set as part of setOutputDevice anyway.
CRs-Fixed: 978396
Change-Id: Ibe0f3639ac4825330a710e86abc31d609136c924
Incorrect condition check causes direct output still being chosen even
if there's none offload effect enabled. Hence, sw only effect
implementation is bypassed and won't work.
Don't allow track offload if there's active sw effect.
CRs-Fixed: 979125
Change-Id: I79d54581f4347475d347f164b6471744c1301032
Call handleIncallSonification in startSource and stopSource without
checking mRefCount to make sure ringtone mute/unmute is called for
multiple active stream.
Change-Id: I52290f9ae09dff3619ac3a36c8969da6c07853ec
CRs-Fixed: 972582
- Increase primary output ref count before getting new device
- This prevents to use NULL device for FM playback.
Change-Id: Idd2b36dab1990cdc1c1f603c5bdfd53b53c5c311
CRs-Fixed: 957807
Delay update of FM volume to start of FM playback.
This avoids unnecessary set_parameter calls on primary output
whenever volume changes on primary output. Unnecessary calls
on primary output can cause breaks in audio since FastMixer
will be put to HOT_IDLE more often
CRs-Fixed: 948361
Change-Id: Id614d32df7f35ac93dd029a08b10e19f64ac631e
- Issue: Volume burst is heard during device switch
(headphone and speaker) for FM playback
- Root cause: delayMs passed to CheckAndSetVolume is
not applied for FM playback
- Fix: Double delayMs and apply FM volume with this delay
Change-Id: Ifa0b214d16527973277a5c84b8a4f3fbd0760d07
APM calls a set_parameter on primary output with key fm_volume
whenever a checkAndSetVolume is called. This is done irrespective
of whether the volume values are same of different.
A side effect of doing so is that the FastMixer associated with
the MixerThread will be put into HOT_IDLE unnecessarily which in turn
can cause glitches/breaks in audio.
CRs-Fixed: 948361
Change-Id: I7fd8b7340e6c78ee6d00b41ccf679582338c011a
- adding both deepbuffer and direct pcm is causing issue where wrong
config is set to ADM
- add deepbuffer flag when fail to get direct output if deepbuffer
was forced
Change-Id: I3bd65002c7a8895d461df257111faf22101cbe30
- setPhoneState checks call-state in audio hal to filter out
unworthy usage of this API.
- With M upgrade, change to update call-state with audio hal is
removed, instead permission checks are introduced to prevent
random usage of such APIs. But setPhoneState is still checking
for this call-state causing improper concurrency handling.
- Fix the issue by removing state check from setPhoneState.
- Remove set and get for parameter "in_call" from voice_extn.
Change-Id: I92fe10c617d6158976a0e07eed3275acb0aadd15
Ringtone mute is observed in LINE app MT call over BT headset.
VoIP direct output isn't returned due to incorrect flags update.
Primary output is returned even though the FLAG_DIRECT is set,
this in turn causing issues when renderer queries for getPosition(),
which is resulting in mute. Fix this by updating flags, so that
track gets VoIP direct output in this scenario.
Change-Id: I6d570ae6ed9e0a7506cb29be5b41687417b7d221
CRs-Fixed: 893558