Commit Graph

54 Commits

Author SHA1 Message Date
Vidyakumar Athota ea269c646d hal: Fix aanc sequence during voice call
When aanc is enabled during voice call, TX and RX  path mixer
controls are issued back to back, this causes the codec path to be
enabled from TX to RX as the internal loopback for aanc exists. Due
to enabling this path, mute is observed on handset. This issue
is fixed by treating aanc as special usecase and changing the enable
and disable sequence of aanc mixer controls.

Change-Id: I305156cb80e6faf35bd6ab4fc089740ffa847f43
2016-11-01 16:08:22 -07:00
Dhanalakshmi Siddani 823dc5a581 hal: Implement tx mute in HFP usecase
Add support for tx mute in HFP use case

CRs-Fixed: 1068669
Change-Id: I28602fcb8e061b3ca196db0e82908bbdf9266f98
2016-10-14 01:01:17 -07:00
Kuirong Wang 1cad714fb6 hal: Add device sidetone support for USB audio ADSP solution
Add device sidetone support for USB ADSP solution if the USB headset
has the sidetone capability.

CRs-Fixed: 1019158
Change-Id: Ie40c286eb9988aeb5093f32c7f81cdb142e88eb6
2016-06-23 10:37:38 -07:00
kunleiz 0f7d0a9e9b hal: fix no sound issue in voice call
No audio is observed in voice call scenario since in_call state
is not update when voice usecase is stopped. This results in not
starting voice call usecase when setting up next call.

Fix by setting in_call state as false in voice_stop_usecase(). This
is to ensure that voice usecase is stopped and in_call state is update
properly.

CRs-Fixed: 996510
Change-Id: I480bb14899d678a47df8a61fbdd208b75ef7b395
2016-05-19 23:18:38 -07:00
Satya Krishna Pindiproli f1cd92b17e hal: fix compiler warnings which are now treated as errors
With CLANG enabled and -Wall & -Werror being set in
LOCAL_CFLAGS, all warnings are treated as errors.

This commit fixes all the warnings most of which are
about unused variables and functions.

Change-Id: I32c6593fa0ad6a4fdca5dc8e6c76982a146a8bc6
2016-04-19 18:12:23 +05:30
Alexy Joseph b13799480b hal: Fix warnings in audio HAL and policy
Enable Wall and Werror and fix warnings in
HAL and policy manager

CRs-Fixed: 962049

Change-Id: Ie93c8f933943875ac68e8318d777602ed864f531
2016-03-08 04:50:17 -08:00
Dhananjay Kumar 9125b2a775 policy_hal: fix improper voice-playback concurrency handling
- 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
2015-12-14 04:31:19 -08:00
Preetam Singh Ranawat 61716b1bcc Merge 9c4ba54b3e on remote branch
Change-Id: I5a80c57243eda5a4fdd98a233766cd622b4ef9a3
2015-12-14 11:55:32 +05:30
Zhou Song be61ed01b1 hal: update in_call state to false when call stopped
Sometimes the mode of HAL may be not in AUDIO_MODE_NORMAL while
active call stopped, then it will return with incorrect call state
to APM.

Update the state to false regardless of the HAL mode when active
call stopped.

Change-Id: I8b1c356f65ec273802cda282b1500a3859e837ce
CRs-Fixed: 899756
2015-10-23 01:58:56 -07:00
Panwar Vivek b306983b0e Merge commit 'eb9127a942289de0cf9587d7456cc6c9a44eb411' into remote_branch
Change-Id: Ic630ae55085197a1bc7b79c726f7a0e39b9927b4
2015-07-13 19:10:23 +05:30
Sharad Sangle b27354b10e hal: compilation fix for extended feature flags
- Fix compilation error for offload, Dolby,
  HDMI pass through, FLAC decoder, and hardware
  accelerated effects when extended feature
  flags are disabled.

Change-Id: If64d5fa5d124b42d40d7e123b887db8e0a5d7426
2015-06-29 03:50:49 -07:00
Bhalchandra Gajare fd72d3ee3e hal: Fix sidetone sequence during voice call
When sidetone is enabled during voice call, the RX and TX path mixer
controls are issued back to back, this causes the codec path to be
enabled from TX to RX as the internal loopback for sidetone exists. Due
to enabling this path, pop noise is observed on headphones. This issue
is fixed by treating sidetone as special case and changing the enable
and disable sequence of sidetone mixer controls.

CRs-fixed: 839663
Change-Id: I7aea55af963cf939286e5b349ff25fd783314679
2015-06-29 11:50:58 +05:30
Bhalchandra Gajare 45fee28d6c hal: Fix sidetone sequence during voice call
When sidetone is enabled during voice call, the RX and TX path mixer
controls are issued back to back, this causes the codec path to be
enabled from TX to RX as the internal loopback for sidetone exists. Due
to enabling this path, pop noise is observed on headphones. This issue
is fixed by treating sidetone as special case and changing the enable
and disable sequence of sidetone mixer controls.

CRs-fixed: 839663
Change-Id: I7aea55af963cf939286e5b349ff25fd783314679
2015-06-25 16:58:28 -07:00
Vidyakumar Athota b000e0b28f hal: Ensure mic mute state updated before starting voice call
Currently the mic mute state is not propagated to the DSP if
the call is already disconnected.

Change-Id: I85cc5c202aea0dc818390b49fe2a3fcd6e62973c
2015-04-09 17:45:20 -07:00
Venkata Narendra Kumar Gutta 76440ba853 hal: Fix ANR if In-Call recording is started at end of voice call
Sometimes ANR is observed, if In-call recording is started at the
end of voice call.
Incorrect use case "afe-proxy-record" is being picked up in this
case as voice call is not active by the time audio HAL starts
the input stream, thus resulting in pcm device open failures.
Fix this by rejecting start input request if voice call is not
active by the time input is started.

CRs-Fixed: 810997
Change-Id: I8a9d0789cf37f5523de5d1da5e9fda59198eb901
2015-04-02 15:56:04 +05:30
Shiv Maliyappanahalli 4d2d97cd24 hal: Fix incorrect device selection for incall recording
Incall recording usecase should select non-fluence
device in audio path to avoid recorded data from
getting cancelled in audio path when fluence is
enabled.
Fix by adding missing break for the case statements.

Change-Id: I3832013423956683f403c8322d0547325c336c73
2015-02-23 17:20:50 -08:00
Anish Kumar 50ebcbf8f9 hal: fix null pointer de-reference
When speaker protection is turned on input stream can be
NULL. Add a check to fix de-referencing NULL pointer.

Change-Id: I75647d9360a559b5255c29d0baca264b1274eba2
2014-12-10 06:44:54 +05:30
Narsinga Rao Chella 212e254a47 hal: use AUDIO_TX_MONO_COPP topology for incall record usecases
The Audio COPP topology is hard coded to NULL topology in kernel
for incall recording stream. Remove the hard coding in kernel and
send default input device's audio calibration from audio hal
so that AUDIO_TX_MONO_COPP topology will be used for incall
recording stream.

This change is needed to be able to fine tune audio calibration
data for incall recording stream.

Change-Id: I1680731afb0c0e1c1eedbc9afd56064d856e3940
2014-11-21 22:21:37 -08:00
Narsinga Rao Chella d06b0984b4 hal: fix Rx path mute issue during incall recording
When MULTI_VOICE_SESSIONS feature flag is not enabled, the state of
incall recording stream is returned incorrectly. Fix the issue by
moving the corresponding piece of code from voice_extn.c to voice.c.

Change-Id: Id350bad65d12a4f165e80ee11cda3a8f342d38ee
2014-11-21 16:20:39 -08:00
Ravi Kumar Alamanda be149396ca hal: use consistent in call indication
Use voice_is_in_call() instead of mode == MODE_IN_CALL
as a valid indication that we are in call to choose sound
devices.

Change-Id: Iefa968ee463d4ade6c7d09626be667faab6eda98
2014-10-21 15:51:14 -07:00
Ravi Kumar Alamanda 060bc5a327 hal: add support to send/receive voice call TX/RX audio
Add support for routing voice calls to devices in other audio
HALs by allowing playback and capture to/from AFE proxy

Change-Id: I2c6a1ddec072e1d5f1a8b7ded874e9c082a7b810
2014-10-17 09:57:20 -07:00
Ravi Kumar Alamanda bdf1416c29 hal: fix unused param warnings
Fix unused param warnings.
Take care of coding style issues.
Remove unwanted code to set acdb_settings.
Fix compilation issues on 8960 platform.

Change-Id: Ifc72472b487abee83ff85e21fd324cee938973e9
2014-09-18 15:56:42 -07:00
Linux Build Service Account 1697c95a6c Merge "hal: avoid usage of extern functions and tables" 2014-08-27 01:57:25 -07:00
Ravi Kumar Alamanda 263d80ca36 hal: avoid usage of extern functions and tables
If there is any difference in the signature of a function declared
as extern, it will not be reported by the compiler and may result
in unexpected results when executed.
All the API functions should be declared in a header file.

Change-Id: I89662e23da8118c3a9eac728b389498ed52e19c2
2014-08-21 10:46:25 -07:00
Vidyakumar Athota 8d931f0b7c hal: fix to set tty mode properly
If set parameters API called with key "tty_mode" and
MULTI_VOICE_SESSION_ENABLED flag is not enabled then tty mode is
not executed because voice_extn_set_parameters returns error(-ENOSYS).
Fix by ignore -ENOSYS return code for voice_extn_set_parameters
and voice_extn_compress_voip_set_parameters.

Change-Id: Id2308b2218fdf74e420ecbe25eeadd49756494f1
2014-08-13 12:09:03 -07:00
Vidyakumar Athota ad34d57000 hal: fix voice call device routing issue
adev->voice_device_set flag is to indicate voice call
device routing update from policymanager to HAL. It is
set to true in voice_start_call and reset in update_calls()
which causes mismatch in flag update during back to back
voice calls scenario. Update adev->voice_device_set flag
in voice_stop_call instead of update_calls(). Rename
voice_device_set flag to in_call for readability.

Change-Id: Ie07105671f254899890bdb4c0635c7dc1f55dbff
2014-08-08 16:56:47 -07:00
Haynes Mathew George b51ceb1e78 hal: miscellaneous fixes
Fixes for the following issues reported by KW

21725, 21726, 21727, 21737, 21738, 21739, 21740, 21750,
21751, 21752, 25317, 30602, 32620, 36778, 41817, 41819,
50942, 54468, 54470, 54479, 55569, 54481, 55570, 55571,
58485, 85112, 85122, 85123

Change-Id: I9abef07db7ccdc19789a201eb268a97e1b360cad
2014-07-31 08:17:03 -07:00
Venkata Narendra Kumar Gutta 5f64eea499 hal: Enhance voice concurrency support for 8916
- All VoIP, compress, deep buffer, record usecases need to close
before voice call setup and don't allow these usecases during
voice call on 8916.
- setMode(IN_CALL) itself is not sufficient to know if we are
in actual voice call.
- Add keyvalue parameters support to know if we are in voice call
and policy hal can query the same and make decissions based on it.

CRs-Fixed: 662804
Change-Id: I20d660fadd07c4d227a7e3dfe356fc39806ca167
2014-05-29 15:05:25 +05:30
kunleiz c5a639b0ba hal: Fix VoIP Mute failure in SIP call during Voice call HOLD
- Unable to apply the mute in MT SIP call during Voice call
  in CALL_HOLD.
- Mute is only applied if the voice call state is INACTIVE.
  Thus when SIP call is made during Voice call in CALL_HOLD,
  the mute is not being reflected.
- Fix this issue by checking voice stream type to allow
  the mute to be applied.

Change-Id: I3af5225edd8e9a4123867b647de9405d5c4b9efc
CRs-Fixed: 642893
2014-05-05 19:31:24 -07:00
Haynes Mathew George 1376ca60d8 audio: Remove unused var and unnecessary code
Remove update_mixer (as its unused) and change function signatures
wherever used.
Remove code chunk to set BT sample rate before enabling device as
thats part of the mixer path file now.

Change-Id: I5eb3bce5183acf505596be2b0ec93cdbd728bdaa
CRs-Fixed: 581453
2014-04-29 14:54:21 -07:00
Narsinga Rao Chella 22d8d7acd1 hal: apply TTY mode change for all voice use cases
Update devices for Voice2, VoLTE and QCHAT sessions
based on the TTY mode. This change is needed to support
enabling/disabling and switching TTY mode during
voice call.

Change-Id: I4f1fde8ce6b20fad0d24e0cd963e2c3709ff25d5
CRs-fixed: 608183
2014-03-21 15:32:09 -07:00
Helen Zeng 6a16ad7ed0 hal: add support for I2S based external modem
There are specific xml files used for I2S based external modem.
Add check to load the correct xml file.

For I2S based external modem, voice sample rate can be 8k or
16k based on vocoder type. Call csd client api to get the
correct sample rate to configure voice call.

Change-Id: Ie9799336620f49a890355be74fe1830eb348cabe
2014-03-03 14:16:24 -08:00
Krishnankutty Kolathappilly 061a9499e2 hal: Fix memory leak in HAL debug logs
String returned from str_parms_to_str for set/get parameter in
debug logs is not de-allocated. Fix is to make sure the memory
allocated for set parameter key value pair is de-allocated.

CRs-Fixed: 610079
Change-Id: I5027d8f1741c9e7223e7b4721f8d5473404998d3
2014-02-03 15:19:05 -08:00
Linux Build Service Account d3072b6915 Merge "hal: fix incorrectly updated copyrights for source files" 2014-01-13 23:12:43 -08:00
Shiv Maliyappanahalli 07a9ea232c hal: fix no audio in qchat call with speaker as default device
HAL doesnt let voice calls start if the device is set to speaker
as voice calls generally start on devices other than speaker.
However QCHAT calls start by calling setForceUse and setting the
device to speaker.

Fix by updating a flag whenever device routing happens when
AUDIO_MODE_IN_CALL. Reset the flag when mode is AUDIO_MODE_NORMAL.

CRs-fixed: 596074
Change-Id: I546959d2b0123828562dba1f6439aa494a365c3f
2014-01-10 16:27:18 -08:00
Shiv Maliyappanahalli 8911f28005 hal: fix incorrectly updated copyrights for source files
Fix incorrectly updated copyrights for source files.

Change-Id: If321f8fb0489f3088e867d4f200c6d1581ed9f57
2014-01-10 15:56:19 -08:00
Shiv Maliyappanahalli 3e064fdd0f hal: fix set_parameter() returning -2 error
When setparameters() is called and if the known keys are not found,
the implementation returns -2 error.Fix this by setting error only
when keys are found and there is an error while executing corresponding
implemention.

CRs-fixed: 589280
Change-Id: If5544d6fdeac47ddfc1f7e8e18bfa81e2ef5cbc2
2014-01-02 10:53:12 -08:00
Shiv Maliyappanahalli f93084982f hal: add support for all_call_states key
Add support for all_call_states which can be queried by
applications to know call states.

Change-Id: I5ba66186e9d9f6d5769a814f4c1e0627c6f6dd74
2014-01-02 10:24:37 -08:00
Apoorv Raghuvanshi 84fa2fe20e hal: Detect sound card dynamically
- HAL always assumed SOUND_CARD/MIXER_CARD
  number to be zero. This could cause HAL
  not to load when some other card is
  detected earlier to HAL.
- Fix by removing these Macro(s) and reading
  correct sound card number runtime while loading
- Corrected its use cases across HAL replacing it
  with appropriate platform API

CRs-fixed: 580226

Change-Id: I4512e4a2f7f81d8415c3ba8ec393c96867e6d69a
2013-12-17 12:29:42 -08:00
Helen Zeng e56b485b7a hal: Use compress audio for incall recording with AMR WB
Currently, AMR WB recording uses tunnel mode instead of
software encoding. Update audio hal to use compress audio
path to do incall recording with AMR WB format.

Change-Id: I93deb3dbc7dcd6a8d2b178334f8b43117ee6841c
CRs-Fixed: 581298
2013-12-05 12:14:55 -08:00
Vidyakumar Athota 2850d5327d hal: In-call recording and In-call music support on APQ targets
-In-call recording feature support is added in APQ.
-In-call music delivery support is added in APQ.

Change-Id: Id473eac87da33f1f566b6910ec1feadcd3f08317
2013-11-22 11:17:57 -08:00
Kiran Kandi de144c8495 hal: notify listen while enabling/disabling snd device
Listen needs be stopped when audio capture is active. Also
Listen needs to be started again after audio capture becomes
inactive. Stop and start listen based on audio capture device.

Change-Id: I05ca7cccd59b43a163604881bd9c6ee10cc8fba3
Depends-on: 510494
2013-11-21 11:45:19 -08:00
Linux Build Service Account 81d733416c Merge "hal: Fix incall recording with AMR-WB format" 2013-11-20 20:12:35 -08:00
Helen Zeng fe095b41c8 hal: Fix incall recording with AMR-WB format
Select AMR-WB and start incall recording, the audio quality is bad.
The root cause is that the sample rate is set to 8k not 16k for AMR-WB.
Use audio record configure instead of voice configure for incall recording.

Change-Id: Ib71e0e8d1f2c5eb72db3260110e55179e415fa26
CRs-Fixed: 576412
2013-11-20 11:37:53 -08:00
Narsinga Rao Chella 05573b74bf hal: Add support for compressed voip
Add support to enable voip calls using compressed
audio formats.

Change-Id: If20493b75befbcc56945e4309c8f01384948a7b5
2013-11-18 14:47:49 -08:00
Linux Build Service Account c497a3ca34 Merge "hal: add voice call support on apq8084" 2013-11-15 03:14:44 -08:00
Vidyakumar Athota d9d9ff34fa hal: add voice call support on apq8084
APQ8084 uses external modem to make voice calls.
APQ uses CSD QMI interface to communicate with external
modem. Add csd client apis to support voice calls

Change-Id: I11fe0cc614ee38c42e95b40d5cd5e2d8b3afd43a
2013-11-13 16:56:22 -08:00
Shiv Maliyappanahalli 3bb7358558 hal: end all calls when setmode(AUDIO_MODE_NORMAL) is called
Telephony will call set_mode(AUDIO_MODE_NORMAL) when a
call is ended which will trigger audio policy manager setting
routing with audio usecase compatible device. Voice calls can
still be active if RIL has not yet called
setparameters(vsid,callstate). This would result in routing
voice call usecases with incompatible device for voice calls.
Fix this by ending all voice calls when set_mode(MODE_NORMAL)
is called.

Change-Id: Id2c9f2ff9ed46969e5cbd27b525b81735c1d49d8
2013-11-11 13:36:11 -08:00
Kiran Kandi 910e186c70 hal: Enable support for Listen voice wakeup feature
enable the support for Listen voice wakeup feature by loading
listen hal library dynamically.

Change-Id: Ife8e71589620342e21b4c52751466edaccc536ef
2013-11-05 15:35:27 -08:00
Ravi Kumar Alamanda 48c921d4e8 hal: Add support for multiple hardware variants
- Most of the targets supports multiple hardware variants such as
  MTP, CDP, Fluid, Liquid etc. The mixer paths for certain devices
  may vary on some of the variants. For example, the mixer controls
  for speaker device are different on msm8974 MTP and Fluid variants.
- Update audio HAL to select corresponding entry in the
  mixer_paths.xml file based on HW information.

Change-Id: I060f2e6c331344dd41417c19fb688ff27a129308

Conflicts:

	hal/Android.mk
2013-11-03 15:44:13 -08:00