Commit Graph

84 Commits

Author SHA1 Message Date
Aalique Grahame 6e7637151a hal: Fixes for dynamic audio HAL feature enable
- Update audio and voice feature init sequence
- Update API names for querying whether feature is enabled
- Fix A2DP audio_extn APIs
- Fix compress VOIP set parameter default return val issue that
  was causing no other set param to be processed
- Fix dynamic primary usecase check

Change-Id: I08fa3bc369ec197932347b01491588d42655797c
2019-02-05 16:34:45 -08:00
Arun Mirpuri b1bec9c80b hal: enable dynamic audio HAL feature extensions
Move audio and voice extension feature to seperate
dynamic libraries. Loading these libraries will be
controlled from config store based on target. These
flags can be changed at runtime

Change-Id: I042450768243124ea80945efac0821984f96b9bf
2019-01-30 17:36:06 -08:00
Aalique Grahame 22e4910d3d audio: unify hal
Unify audio hal components

CRs-Fixed: 2380934
Change-Id: Iacafdc44d935de5f343240421a1572a0a3241bd0
2019-01-25 15:15:46 +05:30
Weiyin Jiang ea88d7a7fd hal: reset adm of ull when routing restored by voip call
When restoring realtime stream from compress voip call, adm still needs
to be updated.

Change-Id: I0c160a86f7271c42e5ebe899fd5970110093e522
CRs-Fixed: 2365346
2018-12-23 21:18:35 -08:00
Arun Mirpuri 7da752abb4 hal: Fix incall music delivery during voice call issues
Fix incall music delivery issue by adding support for incall
music usecase in out_write and adev_open_output_stream

CRs-Fixed:2308665
Change-Id: I26f9f36c29017480ec064b8db2b2b9ae6b357fb5
2018-09-14 16:39:10 -07:00
Vinay Verma addfa4a100 Fix VNDK Compilation Errors
VNDK restrictions doesn't includes standard headers by
default, add them explicitly.

Change-Id: Icafac6f07fcdf58fccaabde8d472509090fb3e6f
2018-05-08 05:17:02 -07:00
Linux Build Service Account 9beb409e53 Merge "hal: Reduce logging level in compress VoIP functions" 2017-11-10 06:32:23 -08:00
Manish Dewangan 338c50a293 audio-hal: 64 bit hal porting changes
-Use long for mixer control with integer type to match with
 kernel snd_ctl_elem_value definition.
-Use packed structure for mixer controls with byte type

Change-Id: I9fbb1d10c5ee212348b58fc4b27a3d74403d8bda
2017-10-23 15:03:03 +05:30
Vikram Panduranga d0f900f44c hal: Reduce logging level in compress VoIP functions
Reduce logging level from error to warning in compress VoIP entry
functions to limit excessive logging when feature is disabled.

Change-Id: Ib7bbf6af06d8f24a396c2c5062ad005b2f17322c
2017-10-18 12:46:04 -07:00
Vikram Panduranga 93f080ecd8 audio: Add dedicated streams for VoIP call
Add dedicated streams for VoIP usecase. This includes adding
a new direct output and input types that use audio playback
and record paths respectively. It falls back to compress VoIP
wherever this feature is not applicable.

Change-Id: I9b7654819b9d8deb00f8888fbfc31f0fbbae5266
2017-08-15 14:52:10 -07:00
Ashish Jain 1b9b30c259 audio: Add check to confirm if routing to BT SCO is successfull
-Routing to BT-SCO can fail if the BT SOC gets disconnected or
the remote disconnects
-In such scenarios if audio is in process of routing streams to
BT SCO then those routing requests fail, hence the complete
data chain gets stalled.
-Add a mechanism to confirm with BT Codec driver if the last
routing request was successfull, if not close the stream
to avoid hang.

Change-Id: Ic78ba90ad55f30d99cdd76a6c0a0dc5398706b03
2017-07-20 18:21:39 -07:00
Aniket Kumar Lata 8fc67e65e2 hal: Update prefixes for audio system properties
Vendor created android system properties are required to have
vendor/qti prefix. Update vendor specific audio system
properties used in HAL.

CRs-Fixed: 2034869
Change-Id: Ibdb1d12fedee1ce12073e8b90fdec814318f3acf
2017-07-11 15:40:19 -07:00
Dhananjay Kumar e6293dd5b4 audio: enable SoundMonitor to handle ADSP SSR events
Enable SoundMonitor in audio hal to handle ADSP SSR events,
do required cleanup and restore any active sessions gracefully.

Change-Id: I83270b7c12095e56a6677f41efe0f5618a27e0e5
2017-07-11 15:01:33 -07:00
Zhou Song f6f7e12b5e hal: set initial value of stop_threshold for compress voip
Member stop_threshold of pcm_config for compress voip is not
initialized, then it will be set to default value equals to
buffer size during pcm_open. XRUN may happen and stop the
stream due to delayed writes to fill buffers. When stream is
restarted, path configuration could fail and cause RX mute.
Set the intial value to INT_MAX to avoid XRUN.

Change-Id: Ic405390f43b7d97ffcdfa6f3b749376f8220e24a
CRs-Fixed: 2047671
2017-06-09 02:32:19 -07:00
Linux Build Service Account 11e89fa37b Merge "hal: Add support for dynamic logging" 2017-06-06 06:15:55 -07:00
Revathi Uddaraju 1eac8b0e2d hal: Add support for dynamic logging
Changes to support dynamic logging in hal

Change-Id: I315c919bd940d8ccdb9103eb06bf67c1e3ff3f4b
2017-05-29 03:20:20 -07:00
Dhananjay Kumar 3ce0a910ca hal: fix incorrect routing for voip calls
-VOIP usecase uses primary output for routing and volume
 control, if no active output is explicitly associated
 with the usecase. But the usecase is getting updated with
 primary output even when an active VOIP output is still
 associated with the usecase, and only input stream is closed.
 This result in incorrect routing for the usecase, as primary
 output is not active and would not have updated device info.
-To fix the issue associate primary output with VOIP usecase
 only if the usecase is not having any other output associated
 but still have a valid input which can be used for voip call.

CRs-Fixed: 2026594
Change-Id: Ib40698cb8cd7577093f98d061ec3923dbe20b7e2
2017-05-26 06:21:24 -07:00
kunleiz 90fc6dd2da hal: Update active input stream when voip input is closed
In recording and VoIP both active scenario, when voip input
is closed, active input stream would set to NULL. Therefore,
as active input stream is NULL, audio recording input device
is wrong to select after closing voip call.

Fix this by updating proper active input stream when voip input
is closed.

CRs-Fixed: 2035512
Change-Id: Ie8be5d6d9de65249122de497d8689ad4c78698e5
2017-05-05 02:45:14 -07:00
Vignesh Kulothungan 305d0d21a3 hal: Fix for VoIP call audio mode switch bug
- Audio mode switch between speaker and headset fails during a VoIP call
- This is because only one request is allowed by APM with Direct/VoIP
  flag to get VoIP usecase in HAL.
- If another VoIP request comes in while a VoIP session is still open,
  then the request falls back and is treated as a request for primary
  output with NONE flag.
- And if there are no low-latency sessions open and any previously
  active VoIP session is closed, then the latter VoIP request handles
  routing for primary output.
- The fix allows VoIP usecase to handle routing properly when using
  primary output.

CRs-Fixed: 2000184
Change-Id: Ibda10fe0de64f33ad34340dd0ff3b710918c4461
2017-02-08 15:19:06 -08:00
Sharad Sangle 8ecefdc750 hal: make sure hal compiles with AOSP flag
Make sure if the TARGET_USES_AOSP flag is defined
 then all QTI specific features should be disabled
 and compilation is successfull.

Change-Id: I440b538b5449177e14ca47f1dcfbec70a2ee7fed
2017-01-12 06:02:07 -08:00
Zhou Song 0154bf133c hal: restore device for other active usecases when VOIP stopped
When music stream is started before VOIP released, the output device
will be aligned to the device used by VOIP stream. And after VOIP
released later, the device for audio stream keeps unchanged.
Also if an audio record session is started during VOIP playback,
input device won't be aligned to the input device used by VOIP. Then
when VOIP released, the input device will be disabled and due to they
share the same BE, input path for audio record breaks.
Make alignments of input device for audio record session with VOIP,
and restore the device for current active usecases when VOIP released.

Change-Id: I19419a44e509e27be41ce06c36ca14592f7b09c1
CRs-Fixed: 1033873
2016-08-09 23:55:31 -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
Shiv Maliyappanahalli e66aba2f74 hal: add support for 32/48KHz for voip
Enable support for 32/48KHz for voip applications.

Change-Id: Icfde47d14c9a0ee2b6efb0e2bed1642610f841df
2016-03-16 08:10:50 -07:00
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
Zhou Song d50037291b voice_extn: remove redundant check of mode when stop voice use case
voice use case is still active when mode switched from MODE_IN_CALL
to MODE_IN_COMMUNICATION, while the output used for driving call is
NULL.

This could possibly makes segment fault in mediaserver when call
is activated before the output updated to valid value.

Change-Id: I070dd5e7a1c6d2883ea611588737b1f5c577b275
CRs-Fixed: 953010
2016-01-07 23:43:01 -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
Banajit Goswami 20cdd21a6b hal: Add support to enable VBat feature
Add support to enable VBat feature. This includes required changes
to select VBat speaker devices for audio and voice usecases and
sending the VBat calibration data to codec driver.

Change-Id: I2234bee3cc4d6f16934a4b27ef9da21cde74bb48
2015-09-13 17:45:37 -07:00
Narsinga Rao Chella 884fa889e8 hal: enable sidetone for VoIP calls on voice path
Add support for sidetone for VoIP calls on voice path.
Enable/disbale sidetone during VoIP call set up/tear down
and also during device switch.

CRs-fixed: 890371
Change-Id: Ib79eed79ddcd2bfed1d9bc322195036736a67cb2
2015-08-28 03:39:56 -07:00
Narsinga Rao Chella 116142b2b9 hal: enable sidetone for VoIP calls on voice path
Add support for sidetone for VoIP calls on voice path.
Enable/disbale sidetone during VoIP call set up/tear down
and also during device switch.

CRs-fixed: 890371
Change-Id: Ib79eed79ddcd2bfed1d9bc322195036736a67cb2
2015-08-26 03:42:51 -07:00
Linux Build Service Account f24cb8f626 Merge 4957408904 on remote branch
Change-Id: Ie006885b5cd9774b13cfee8f0a510a36107b0d25
2015-08-16 23:56:30 -06:00
Venkata Narendra Kumar Gutta 55def54bf1 hal: Add support to enable vbat feature
Add support to enable vbat feature. This includes required changes
to select vbat speaker devices for audio, voice usecases and
sending the vbat calibration data to codec driver.

Change-Id: I2234bee3cc4d6f16934a4b27ef9da21cde74bb48
2015-08-14 19:07:10 +05:30
Linux Build Service Account a6188c0c16 Merge "hal : Remove compress voip formats and voip_rx flag" 2015-08-12 11:48:19 -07:00
Karthik Reddy Katta d633c54e90 hal : Remove compress voip formats and voip_rx flag
Remove compress voip formarts as only PCM is
supported. Remove redundant voip_rx flag from HAL.

Change-Id: I1291f1fab0e3f6af68ace39ea99812a9596625b3
2015-08-11 14:41:00 -07:00
Karthik Reddy Katta a9e085eef0 hal: compilation fix for voice extended feature flag
Fix compilation error in voice extended feature file
for M upgrade.

Change-Id: I4921f8ff6d129a7c57978bd963f89fab58c33867
2015-08-10 15:13:01 -07:00
Karthik Reddy Katta 2125d63836 hal : Remove compress voip formats and voip_rx flag
Remove compress voip formarts as only PCM is
supported. Remove redundant voip_rx flag from HAL.

Change-Id: I1291f1fab0e3f6af68ace39ea99812a9596625b3
2015-07-30 22:02:45 -07:00
Karthik Reddy Katta c48f90134b hal: compilation fix for voice extended feature flag
Fix compilation error in voice extended feature file
for M upgrade.

Change-Id: I4921f8ff6d129a7c57978bd963f89fab58c33867
2015-07-16 02:36:04 -07:00
Linux Build Service Account 06675a84c4 Merge "hal: add single session VSID voice call support" 2015-04-16 17:00:01 -07:00
Vidyakumar Athota 0e1093537b hal: add single session VSID voice call support
With new Voice architecture, a voice session per subscription
will support different call types such as Voice/VoLTE/VoWLAN etc.
These new voice sessions will be tagged with new VSID.

Change-Id: I7e9c90fb3935ebce5ff281f2d1c25c66aa96e55e
2015-04-14 16:11:05 -07:00
Vidyakumar Athota 5c39821723 hal: update input source type during open input stream
Currently input stream source type is updated in in_set_parameters().
Some of the effects like AEC are applied based on input source type.
If effects API is called before in_set_parameters() then that effect
does not apply. Fix this issue by updating the source type in
adev_open_input_stream() instead of in_set_parameters().

Change-Id: Iff0670264e156840c40f1f15cfc93fd5b2506e0d
2015-04-09 17:32:17 -07:00
Pavan Chikkala 51b4b9a62e hal: Update pcm_open flag for VOIP
- By default CLOCK_REALTIME is used.
- Change the clock type to CLOCK_MONOTONIC
  to synchronize the framework and VOIP driver
  clock and timestamps.

Change-Id: I8ab64e948cea5d027bf28c4e101ff517fda3558c
2015-03-04 18:07:03 -08:00
Narsinga Rao Chella 2f92062aa9 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
2015-01-06 17:18:36 -08: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
Venkata Narendra Kumar Gutta 6b5e728e55 hal: properly reset sample rate of VoIP data
During skype call if headset is inserted next voip
input request is failed.
VoIP data sample rate is not being reset properly is
causing the aforementioned issue.

CRs-Fixed: 725583
Change-Id: I9f85936aec0caeaf53b9aeff93a481fd38afe3ff
2014-09-22 06:44:19 -07:00
Linux Build Service Account b5b2cb4308 Merge "hal: fix unused param warnings" 2014-09-20 07:35:53 -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
kunleiz f266f48890 hal: Update active input stream for Voip when voip input started
When voip input started, active input stream is not updated.
Therefore, as active input stream is NULL no tx device switch
occurs for a voip call with primary output.

Fixed this by updating active input stream for voip when
voip input started.

Change-Id: I058bfaa0091eea4a0259224de17be32f271dbdc9
CRs-Fixed: 710923
2014-09-16 23:24:29 -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
Mingming Yin 2d8aa2e3dc hal: NULL pointer check before using audio_usecase
- Add check for NULL pointer before using audio_usecase

Change-Id: Iaedd7b1dfbcf727957f6b19a54199d29afa25703
2014-08-14 14:07:36 -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