Commit Graph

116 Commits

Author SHA1 Message Date
Haynes Mathew George 822b549ce2 audio: Fix realtime stream routing behavior
Update adm of pending routing event before handling
routing in audio_hw.

CRs-Fixed: 1061281
Change-Id: Iea6f28a27c9c86406edad558b533ed4a5d9aff43
2016-10-21 12:15:19 -07:00
Lakshman Chaluvaraju 22ba9f1ab2 hal: Integrated QTI Audio framework changes
- Added support for DD/DDP/AAC/MP4 decode through QAF.
- Added support for Rencoding to DD/DDP through QAF..
- Added support for DAP through QAF.
- Added suport for mixing DD/DDP with PCM through QAF.
- Added suport for mixing AAC with PCM through QAF.
- Added support for Dual Decode through QAF.

CRs-Fixed: 1063555
Change-Id: Icc3ddf62f9bc1c45e1027fb93bf9fa0e154a783e
2016-09-30 02:27:17 -07:00
Shiv Maliyappanahalli c065640fb6 hal: enable audio over display port
Add support for audio over display port.

Change-Id: I3480d89c61ee5e5983715ec943fb02b1a9d5d151
2016-09-16 01:31:25 -07:00
Haynes Mathew George 3a1f1fbde2 audio: sndmonitor
Monitor sound card status and report online/offline
events back to the streams registered with it and to audio_dev.

Bug: 30075678
CRs-Fixed: 1053073
Change-Id: Iea74d5c83f7fe92ba4a24f4f4650ce255bdb48e8
2016-09-02 06:37:57 -07:00
Preetam Singh Ranawat b0c0dd7063 hal : native DSD concurrency support over headphone.
-Enable ASRC mode for headphone backend if headphone 44.1 or
  native DSD backend is active.
 -Disable headphone backend and reopen it with ASRC mode for upcoming
  use case over headphone 44.1 or native DSD backend

Change-Id: Ic8fb0ab9f254d3472fda49dbb824f622d518a451
2016-08-29 00:33:57 -07:00
Preetam Singh Ranawat cb6212e053 hal: Add support for native-DSD and native sampling rates
-set passthrough flag and diable gapless for native dsd
 -Select new backend for native dsd.
 -Add support for e2e playback of clips with sampling rate
  multiple of 44.1.

Change-Id: I6aa0ef5ea176a0923b0b88924ab046f9a11b7b12
2016-08-29 00:09:16 -07:00
Haynes Mathew George 5beddd4208 audio: low latency playback optimizations
Add support to configure input and output streams as
legacy (faster than realtime) or realtime

CRs-Fixed: 1035545
Change-Id: Idebe3624bd14d5384b8c42d4f74d1874537b6028
2016-08-04 11:13:56 -07:00
Ashish Jain 83a6cc249a hal: Add support for 24 bit through deep buffer
Enable support for 24 bit through deep buffer
path. Remove hardcoding of 16 bit and honor
the format and sample rate set by flinger.
24 bit support includes support for 8_24 and
24 bit packed pcm format.

Change-Id: I2cbc2005b188c3bc21b4e7a7275e9ee21c7b820d
2016-07-26 23:48:15 -07:00
Ashish Jain f1eaa58966 hal: Enable direct playback support for AUDIO_FORMAT_PCM_FLOAT
-Add changes to support PCM_FLOAT format using direct track.
-For targets supporting true 32 bit, convert FLOAT pcm data
to 32 bit.
-Targets which dont support true 32 bit, convert FLOAT or
32 bit input to 24 bit Packed in HAL.

Change-Id: I8052c8b878bbd4d70c0453df054953d494773b0a
2016-07-04 17:14:55 +05:30
Ashish Jain 5106d36bb0 audio: Enable 24 bit packed direct pcm support.
-Add support for 24 bit packed audio in audio hal.
-Disable gapless for AV playback and direct pcm usecase,
this ensures that the buffering in DSP is not more.
-Simulate rendered time stamp for direct pcm usecase
based on the number of frames written to the compress
driver, bufferring in the driver and DSP latency.
-Pass mixer instance to offload effects library to avoid
an unnecessary mixer_open call, this optimizes audio
start delay in compress playback.

Change-Id: I422a53af5632eaf6cc362a6c44f62ff8412965f7
2016-05-31 05:17:13 -07:00
Manish Dewangan ba9fcfa29e hal: changes to support 24 bit record
-Changes to support 24 bit record if input format request is
 AUDIO_FORMAT_PCM_8_24_BIT or AUDIO_FORMAT_PCM_24_BIT_PACKED

Change-Id: I68076524ccccbf9f0be3c88bb01180ae7e4fd8b1
2016-05-26 04:43:41 -07:00
Mingming Yin 218546574a hal: add support for compress passthrough
- Add support for compress passthrough.

Change-Id: I4934470ac8b23cb8de9b2d7d1b0014afe74b5a27
2016-04-29 10:07:58 +05:30
Mingming Yin 3a941d4a7f hal: read HDMI sink capability for dynamic output profile
- update read_hdmi_sink_caps to support dynamic sample
  rate, channel, and format based on HDMI EDID information

Change-Id: I69b3f19cb1d81c3e51695adae4f2379cbb439dc8
2016-04-29 10:01:51 +05:30
vivek mehta 344576aca7 hal: Fix WFD and voice call over USB concurrency
- If WFD framework occupies the AFE proxy, it may result unintended
  behavior while starting voice call over USB.
- Audio is always routed to the USB audio device when connected,
  even if WFD is connected. So no need to allow afe proxy port
  usage by WFD framework.
- Disallow the afe proxy port usage by external modules when
  AUDIO_DEVICE_OUT_USB_DEVICE is connected.

CRs-Fixed: 998488

Change-Id: I889be7f477ae3f7ad46757592a46f3d0e8eb41e2
2016-04-18 03:14:56 -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
Sidipotu Ashok e6f78cb2c6 hal: Changes to support true 44.1 Native playback
- add changes to support single BE mode on top of the
Double BE mode which is supported.

- support reading of version or mode from XML.

- add logic to switch between single and double BE
based on the mode in XML.

- define a new device for true native.

- add logic to read tasha codec version and allow
true native only for 2.0 version of codec

- enchance log msgs for better debugging.

Change-Id: I970487f16af32144ec26f967e8bfcb32d44d67a4
2015-12-28 05:00:00 -08:00
Linux Build Service Account ea413ba70c Merge "policy_hal: add support for multiple offload playback" 2015-10-23 19:12:50 -07:00
Mingming Yin 4a4a8c81b2 policy_hal: add support for multiple offload playback
- Add support for multiple offload playback.
- Do not check for reuse of current offload playback
  session if multiple offload feature is enabled.
- Remove multiple offload feature flag to enable
  compilation by default.

Change-Id: I91a8797ec5e260975ffd022d56bca01bc832da80
2015-10-21 11:05:08 -07:00
Sudheer Papothi fa9d228c71 hal: Add performance lock for playback usecase
Add performance lock during device path bringup in
playback usecase to reduce cold start output latency.

Change-Id: I2ff217beedb270f057fd4ea577a7a317ee1f20e6
2015-10-20 06:21:47 +05:30
vivek mehta 446c39660b hal: remove explicit direct pcm usecase
- remove direct pcm offload usecase
- incase of direct pcm add support for one extra offload usecase

Change-Id: I75f68a8e85c8685091928c09df211e9d7939f342
2015-10-13 09:15:05 -07:00
Linux Build Service Account 8055d14e09 Merge "hal: fix thread starvation" 2015-10-09 18:04:12 -07:00
Linux Build Service Account 6e3bff24a0 Merge "audio: Enable External HDMI support" 2015-10-09 18:04:03 -07:00
Shiv Maliyappanahalli 736d4cea87 hal: fix thread starvation
Fix thread starvation issue where the capture or playback
threads running in FIFO priority would constantly acquire
the stream mutex preventing other threads to complete
routing commands.

Change-Id: I8d1befa0791ae9a3bce868c1c3ef262ff489f052
2015-10-06 17:58:54 -07:00
Linux Build Service Account 0d8dcb0c4e Merge "hal: Audiosphere SA+ concurrency implementation" 2015-09-29 06:10:15 -07:00
Ashish Jain 81eb2a8d8d audio: Enable External HDMI support
-For HDMI compliance, channel status bits
should be configured for the external HDMI chip.
-Hence HAL based on the output format i.e compressed
or LPCM populates the channel_status information
and passes it to the dai-driver which in turn
configures the external HDMI chip

Change-Id: Ibf192492d259a722070a08f4764fde9498dd268d
2015-09-24 21:50:47 -07:00
Chaithanya Krishna Bacharaju a70cb6a9e3 audio: hal: Add support to send codec specific data in gapless
Codec specific  metadata is sent only for first stream in gapless
playback.
This causes incorrect configuration to be set for second
stream and distortions are observed due to framedrops in adsp.
Add support to send codec specific format data of second stream
during gapless playback.

Use vorbis bitstream format info from metadata instead of hardcoding.
This avoids sending gapless metadata each time set parameters
is called during vorbis playback.

Set flag to send new metadata at start of session for first track
and for the next stream in gapless after return from partial drain.

Change-Id: I3d8be22a4e28c50335820cab1e2b924f3b3b2d1c
2015-09-22 23:34:39 -07:00
Dhananjay Kumar d68883db32 hal: Audiosphere SA+ concurrency implementation
Audiosphere effect cannot be used along with any other SA+
effects, and needs handling for such concurrent use cases.
Remove audiosphere controls from audio extention, these controls
are now moved to audio post_proc module, where both audiosphere
and SA+ events are made available providing easy detection and
handling for concurrent use cases.
Extend audio hal's set and get parameter functionality to post_proc
module, this is required to set/get audiosphere params inside
post_proc module.

Change-Id: Ia4b6dcf74b2434f3751cd76e02704b62fc30f822
2015-09-22 01:46:12 -07:00
Ravi Kumar Alamanda 474de5a780 hal: add support for ull audio playback
Add a new use case and mixer paths to support ultra
low latency audio playback. This use case exercises the
ULL mode in the DSP.

CRs-Fixed: 892056
Change-Id: I6685dd0f346072029ca51e4ce92856a13e74ee76
2015-09-15 13:27:39 -07:00
Linux Build Service Account ac2d751182 Merge "hal: integrate ADM module" 2015-09-15 07:12:47 -07:00
vivek mehta 0ea887a9e6 policy_hal: hal: add support to enable Direct PCM
- add support for direct pcm output
- add support for direct pcm in hal
  if output flag is direct_pcm choose compress offload path
- add support for direct pcm in custom audio policy manager
  force add direct flag when we detect pcm track in music and
  game use case

Change-Id: Ie69c988ef9cd0477efa77611ceddccdd6b17a163
2015-09-03 18:41:43 -07:00
Ravi Kumar Alamanda 8a0f9774df hal: integrate ADM module
HAL dynamically loads the ADM module and registers all the input
and output streams and also notifies all read and write operarations.

CRs-Fixed: 892056
Change-Id: Ie599f990c5d7224a6261e703c099fb98b5980c35
2015-08-31 11:36:00 -07:00
Mingming Yin 497419fcb8 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: I5b36d7668f63a396ed930d62c0337c2c3f311c95
2015-07-06 10:44:23 -07:00
Apoorv Raghuvanshi 214921673e hal: native audio backward compatibility
- all changes for native audio backward
  compatibility and related
- add set parameters from UI
- enable dynamic device switching
- featurize the code
- various backend concurrency changes

Change-Id: Id0f824c4b4c033f42008a4e8868652c8f6fe5c42
2015-06-05 12:14:36 -07:00
Apoorv Raghuvanshi f59bb22e6d hal: Add support for Native Audio(44.1kHz)
- Changes for device/Usecase selection
- Add new and combo devices for headphones
- Combo device handling
- Add new backend and logic to handle multiple
  backends
- Remove hardcoded mixers and select them
  dynamically based on the device

Change-Id: I7207291f2c27da13ba0cc77c66de1144f4b9888a
2015-05-26 17:35:39 -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
Narsinga Rao Chella f928a98e1f hal: add support for source tracking feature
Fluence module on ADSP is upgraded to support source
tracking, sound focus and audio zoom features. This
change adds support for the same in audio HAL and is
needed to support the features end-to-end.

Source Tracking is the capability to identify the
source of speech. Sound Focus is the capability to
configure which sectors in the 360 degrees plane to
listen to. Audio Zoom is the capability to combine
the sound focus with other technologies so that a user
can listen in on a particular source in a scene.

Change-Id: I019b22d6541e6d1a10552d808c3320a998b86e48
2015-04-14 16:00:20 -07:00
Bharath Ramachandramurthy 837535b957 audio: stop reading sound trigger lab data on SSR
While sound trigger lab data being read, if CPE SSR
happens the pcm read returns -ENETRESET. Instead of
updating the sound card sate, mark the sound trigger
state as inactive to avoid reading the lab data from
driver. Marking the session as inactive handle both
CPE and ADSP SSR scenarios where HAL is prevented
to read from kernel.

Change-Id: Id82eed597c01265a7d26f17e5ac3c5cd0e17adbf
CRs-fixed: 790726
2015-02-12 22:37:05 -08:00
Linux Build Service Account 098dcbdd50 Merge "hal: bug fixes for PCM offload" 2014-12-06 21:58:18 -08:00
Alexy Joseph aa54c87a7e hal: bug fixes for PCM offload
When pcm offload is done, override the buffer size
that was calculated and use the value from the system property
Make write call blocking if small buffers are used in offload
Update latency value for pcm offload with small buffer hint based
on period size and period count.

Change-Id: Ic74caa6bd172c8e4554384e9fa98a5137117f07c
2014-12-04 07:42:06 -08:00
Jitendra Naruka 1b6513f811 hardware/qcom/audio: Integrate Eagle framework for HeadphoneX
Add support to integrate the Eagle framework for HeadphoneX
audio post processing feature 1.1

Change-Id: Ib119c27c359950a6087d5e6ae200dfc1e83b7551
Signed-off-by: Jitendra Naruka <jitendra.naruka@dts.com>
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
2014-12-01 15:52:26 -08:00
Pradnya Chaphekar 80a8cfb81f hal: Audio HAL / APM changes for HDMI passthrough
-Add support for HDMI passthrough for DD/DDP contents to HAL and
 APM.
-Add mixer control to set volume on volume module on passthrough
 COPP. The mixer control  takes zero volume for mute and unity
 volume for max volume.
-DDP content requires sample rate to be four times native sample
 rate. HAL sample rate is changed to four times native rate from
 start output stream. During rapid pause/resume offload thread
 calls standby when there is no active track and no activity for
 over a second. On resume start output steam is called and
 sample rate is converted to four times its current value.
 This results in session to be started with invalid sampling
 rate and playback failures.
-Add HDMI passthrough support for JOC format.
 Expose DDP/JOC as pass-through supported format if sink
 supports either DD or DDP. This is to allow support for
 pass-through convert based on edid data.
-Deep buffer music stream does not switch back to HDMI after
 ringtone playback ends. Ringtone, alarm, notification etc are
 played on speaker if HDMI pass-through is enabled. The
 decision is taken based on stream or strategy. The decision
 to change the device from HDMI to speaker is taken based on
 the stream type. When a patricular stream ends use the
 reference count instead of stream type.
-DAP is not turned on when switching from passthrough stream to
 deep buffer stream.DAP bypass call from HAL to DAP HAL expects
 integer pointer. Address of a bool variable is passed into the
 function. Corrupt value is set on driver instead of turn on/off
 causing random failures in DAP on/DAP bypass. Use same data type
 and use enumeration to make the function call readable.

CRs-Fixed: 761339
Change-Id: Ided9439ec5e87233a1fec3ff9f50a1e9ba4cb788
2014-11-28 19:09:34 -08:00
Linux Build Service Account 615ed6ac44 Merge "hal: use AUDIO_TX_MONO_COPP topology for incall record usecases" 2014-11-22 16:19:14 -08:00
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
Pradnya Chaphekar 4403bd796e hal: Add support for parsing hdmi edid information
Add support for parsing hdmi edid data and setting channel map
to asm
Parse edid data on hdmi connection and invalidat on disconnection.
Fix audio playback errors on HDMI when source channel count is
greater than sink channel count for offload playback.

Change-Id: I1e0a8335611a87974cb273431659938a0b345e68
2014-11-18 12:40:59 -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
Ravi Kumar Alamanda dc9bb157cf hal: add support for low-latency capture
- add support for low-latency capture

Change-Id: Ic8a82854799adfa4eb1fcd323e0177eeadc7e319
2014-10-17 09:53:09 -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
Ravi Kumar Alamanda 8fa6b1916a hal: support for sound trigger LAB and concurrency
Sound trigger lookahead buffering data is read through audio hal.
Also the audio hal has to inform sound trigger hal about concurrencies
and subsytsem restart events. Audio Hal uses proprietary interface
defined by sound trigger for communication with sound trigger hal.

Change-Id: Id344077b40b481a953769518f8a6ac0adc13b709
2014-09-10 16:35:16 -07:00
Linux Build Service Account 79123b00d5 Merge "hal: Fix policy conf parser for FLAC playback on multiple sample rate" 2014-09-07 00:26:37 -07:00