summaryrefslogtreecommitdiffstats
path: root/audio
Commit message (Collapse)AuthorAgeFilesLines
* audio: Legacy: Use monotonic clock for presentation positionMisael Lopez Cruz2015-01-071-5/+13
| | | | | | | | | | The timestamp returned by AudioHAL's get_presentation_position() must be from the MONOTONIC clock. An additional flag has to be passed when opening the pcm ports in tinyalsa in order to get timestamps from the monotonic clock. Change-Id: Ib06c686985ae9229df59a2756c5da35e858e2d0e Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Use pcm_update_avail for voice input framesMisael Lopez Cruz2014-12-041-3/+2
| | | | | | | | | | | | | | | | | | | The pcm input stream is said to be "steady" when the ALSA buffer has available frames to read. However, the input stream could go into the XRUN state when the voice thread takes too long between explicitly starting the stream and querying the number of available frames. For the purpose of determining whether the input stream is ready, the XRUN state means that the ALSA buffer is full and the audio frames can be read immediately. The number of available frames was previously queried using the pcm_get_htimestamp() function which returns an error when the stream is in overrun state and doesn't update the number of available frames. The pcm_update_avail() function does return the amount of available frames regardless of the stream state. Change-Id: I3afbb6f3d274b5f4fbd7133e48d2cbe51c223ccc Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Use smaller ALSA buffersMisael Lopez Cruz2014-11-261-3/+3
| | | | | | | | Reduce the size of the ALSA buffers in order to reduce the audio latency. The new buffer sizes allow using fast tracks. Change-Id: I40f3af55cde72b1183d6fc8ffa8e01ecbef71a42 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Use BT sound cardMisael Lopez Cruz2014-11-261-9/+25
| | | | | | | | | | Starting in kernel-3.14, Bluetooth SCO audio has a separate sound card. Previously, BT SCO was a PCM device of the primary card. The index of the BT SCO card is found dynamically when present in the system. Change-Id: I5c24e07df48b836473ce56170f9b12e5aac9f975 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Zero-initialize allocated structsMisael Lopez Cruz2014-11-261-5/+5
| | | | | | | | | | Initialize to zeros the different structs used in the HAL. The HAL uses non-NULL checks to free temporary audio buffers. There were some aborts caused by freeing unallocated memory because the audio buffer pointers were not zero-initialized. Change-Id: I75ae704d5469e9e028bc7b67ef84b6a4047a7409 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Remove BT SCO workaroundMisael Lopez Cruz2014-11-262-23/+1
| | | | | | | | | | WiLink 8 is now able to provide the PCM clocks until the voice call is completely terminated, so there is no risk of blocking read() and write() calls anymore. The workaround is no longer needed, so it is removed. Change-Id: Idb9c4d9dc9e2940c9ce6a9f49448a2fa9ad76ae2 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Replace deprecated macros and methodsMisael Lopez Cruz2014-11-261-19/+9
| | | | | | | | | | | Replace deprecated macro audio_stream_frame_size() with the new per-stream direction macro: audio_stream_*_frame_size(). The get_supported_devices() method is also dropped as it's not required for API version 2.0. Change-Id: Ia7c1b6b020832401a0a6a018f704444ad465f78f Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Fix input channel mask macroMisael Lopez Cruz2014-11-261-1/+1
| | | | | | | | | An incorrect channel mask macro was used to report the input channel mask. The correct macro is: audio_channel_in_mask_from_count(). Change-Id: I1b5c10980ddc7b034654d899d159df80ccc50b81 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* jacinto6evm: update bluedroid configurationVishal Mahaveer2014-11-141-0/+8
| | | | | | | | | Update bluedroid device configuration to enable car related Bluetooth profiles. Reference patch taken from device/lge/hammerhead. Change-Id: Idc3a00c98ce5a0f89153ad248d45994ad414ef0d Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
* Merge remote-tracking branch 'omap-mirror/d-kitkat-mr2.1-release-k3.14' into ↵Vishal Mahaveer2014-11-121-0/+1
|\ | | | | | | sync
| * audio: Legacy: Add DRA7xxEVM to supported cardsMisael Lopez Cruz2014-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an audio driver for the DRA7 EVM that supports a single PCM device (McASP3). The name of the card created by this driver is "DRA7xxEVM", so this name has to be added to the cards supported by this Audio HAL. The IN_CALL mode is supported in the Audio HAL but won't work with the "DRA7xxEVM" card because the PCM device used for BT is not implemented by the driver. Change-Id: Iacee36175cd4c90e74fce57f41cc6ca7c07291b9 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* | audio: Legacy: add parameters to open stream functionsVishal Mahaveer2014-11-051-2/+6
|/ | | | | | | Add new parameters needed in lollipop for open stream functions Change-Id: I69073c1fa908ef37d9097ed50fedc72cdd409a6d Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
* audio: Legacy: Fix leave voice callMisael Lopez Cruz2014-08-281-1/+1
| | | | | | | | | The AudioHAL must leave the voice call only when it's no longer in the IN_CALL state. Previously, the voice call leave sequence was incorrectly executed when entering other modes (e.g. RINGTONE). Change-Id: Id0134706fcf1f5999a765c5152ff77ba15d86015 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: BT SCO voice call supportMisael Lopez Cruz2014-06-032-24/+514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Bluetooth SCO voice call has the following data flow: Uplink: +----------- SRC -----------+ | | McASP7 McASP3 | | Bluetooth Mic Downlink: +----------- SRC -----------+ | | McASP7 McASP3 | | Bluetooth Speaker The voice call uses the ALSA PCM devices that are normally used by the primary output and input. The primary output is switched to a null/dummy sink when the voice call starts, and switched back to the ALSA devices when the call ends. The null/dummy sink consumes the data at the same rate than an actual PCM device does, but does not render anything to an output device (e.g. speaker). Change-Id: I63a41de96c4ed34b60aab9240d10ad83c06c69ac Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Use audio_route for kcontrol settingsMisael Lopez Cruz2014-06-035-162/+18
| | | | | | | | | Simplify the kcontrol settings through the audio_route library. The control settings are now moved to a XML audio paths file. Change-Id: I72670523968a6646aea28e1625798b04f7a7799f Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Legacy: Initialize Variables to NULLAngela Stegmaier2014-06-031-0/+2
| | | | | | | | | If uninitialized, then a crash may result if they were not successfully allocated during the constructor and then the destructor runs. Change-Id: Iad15e558fe6ba9b42aab482511cd30c1476f0f18 Signed-off-by: Angela Stegmaier <a0866189@ti.com>
* audio: Legacy: Implement get_presentation_position()Misael Lopez Cruz2014-02-041-0/+28
| | | | | | | | | Implement the get_presentation_position() operation in the legacy AudioHAL of jacinto6evm. get_presentation_position() is a new stream out operation added in AudioHAL interface 3.0. Change-Id: Ifbaac4239596d03c7880695c0ec32290dc2fa64e Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Multizone: Flush voice call mono pipesMisael Lopez Cruz2014-02-021-0/+3
| | | | | | | | | | Flush the mono pipes used during voice call to avoid rendering old data from the last time the pipe was used (e.g. when the paired phone enables, disables and re-enables Bluetooth during the voice call). Change-Id: I43756abed06143522e5630ca0276ca5fbc02bb29 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Multizone: Add support for auxiliary inputMisael Lopez Cruz2014-02-022-2/+11
| | | | | | | | | Add support for the auxiliary input available in the JAMR3 board in the Jacinto6 EVMs. The auxiliary input is a stereo analog port. Change-Id: I815dbcad3ea3ec47c57580a3243a631abdcbf4b9 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Multizone: Dynamic JAMR3 supportMisael Lopez Cruz2014-02-024-52/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | JAMR3 board may not always be present in the system, the port usage is being changed dynamically to: - JAMR3 is present o Cabin : port 1, slots 0 & 1 o Mic : port 1, slot 2 o Back Mic: port 1, slot 3 - JAMR3 is not present o Cabin : port 0, slots 0 & 1 o Mic : port 0, slots 0 & 1 Above port allocation allows: - Relinquish McASP3 (port 0) when JAMR3 is connected. This allows DSP Radio to own that McASP instance for its rendering. - Hardware setups that don't have JAMR3 fall back to the port 0 that is present in the main Jacinto6 EVM board (CPU board). The default hardware setup is assumed to have JAMR3 connected. When it's not connected, the property "persist.audio.use_jamr" must be set to "0" or "false" and system has to be rebooted (or media server restarted). This is meant to be a development option. Change-Id: Icc5399b370e2247a1a0d5a967dcd47e0ef4947ac Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Multizone: Don't Round to 16 Input Buffer SizeAngela Stegmaier2014-02-021-6/+4
| | | | | | | | | | | | | The input buffer size returned from AudioStreamIn::getBufferSize() and AudioHwDevice::getInputBufferSize() was being rounded to a multiple of 16 with a note that it is required by AudioFlinger, but AudioFlinger has no such requirement for input buffer size (only output buffer size). Rounding to 16 caused an issue for the multizone audio when certain sample rates were used. So, the rounding is removed as it is not needed. Change-Id: I8d5010f5bab7eb780868b47899ea0115fa8c1c4b Signed-off-by: Angela Stegmaier <a0866189@ti.com>
* audio: Multizone: Bluetooth slave mode workaroundMisael Lopez Cruz2014-01-242-5/+31
| | | | | | | | | | | | | | | | | | The PCM ports used for Bluetooth SCO are in slave mode in Jacinto6 EVM board. So the BT side masters the BCLK and FSYNC. The BT side could cut the BCLK and FSYNC while the ALSA PCM ports are not closed, which leads to blocking read() and write() calls. They would eventually timeout and cause an I/O error. The workaround consists of switching the BT DAI link to slave mode (McASP is master, BT is slave) while leaving the call, it guarantees that the BCLK and FSYNC are present as they are generated from an internal source, the actual rate of the clock is irrelevant. For the new source to take effect, the ALSA PCM ports used for BT are explicitly stopped. Change-Id: Ifadb8b1348529d404d06d4b043c5fe686f85a49a Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Reorder voice call output stream terminationMisael Lopez Cruz2014-01-241-2/+2
| | | | | | | | | | | | Unregister the voice call downlink stream before letting any ongoing stream on cabin switch back its original writer. Otherwise, it may end up trying to register two streams with the same slot masks. An incorrect log message is also fixed. Change-Id: Ic5cb4d2ed0cc4de4232151df9ed8d45b2de9d5c2 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Fix inverted mic mute stateMisael Lopez Cruz2014-01-131-1/+1
| | | | | | | | | "rs_capture" array holds the controls for the non-muted state, so set_route_by_array() requires the inverted value of the "mute" state parameter. Change-Id: I9274e7000ce6905fe54e79be4dce9c05e296855a Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Add OMAP_ENHANCEMENT to card name queryMisael Lopez Cruz2013-11-251-1/+3
| | | | | | | | | | | | | Primary audio HAL uses mixer_get_card_name() function (from tinyalsa which is under OMAP_ENHANCEMENT) to dynamically find the id of the McASP-based sound card. The dynamic search of the card must also be dependent on OMAP_ENHANCEMENT and provide a default card id if the flag is not defined. Change-Id: Id2c610e85d65bc5d559a0c9d1dda0359893a12fa Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Multizone: Add support for voice callMisael Lopez Cruz2013-11-112-10/+354
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Voice call is supported using two data pipes: Uplink: PcmWriter <-- MonoPipe <-- PcmReader | | McASP7 McASP3 | | Bluetooth Mic Downlink: PcmReader --> MonoPipe --> PcmWriter | | McASP7 McASP3 | | Bluetooth Speaker Voice call reuses the PcmWriter associated with Cabin/Speaker that is otherwise used for media. So, when the voice call starts any ongoing media stream active on that writer has to be re-routed to a null writer and routed back to the actual writer when the voice call ends. The null writer is a PcmWriter that writes data to a null output port. The null port consumes the data at the same rate that the actual port does. IOW, media streams going to the Cabin output (primary output) during voice call will not be rendered on the actual hardware output. Change-Id: I7856b67ab1cf788ea2f2cb251d9097e57e487cb5 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Multizone: Refactor stream resume/idleMisael Lopez Cruz2013-11-093-50/+69
| | | | | | | | | | | | Refactor the resume (leaving standby on first read/write) and idle (entering standby) in preparation for voice call support. JAMR3 outputs have mixer controls that do not need to change dynamically, so they are moved to the default routes section of the dra7evm paths. Change-Id: I432a69ca67eff0e276ce90170dff4a5201ac181a Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: multizone: Add initial implementationAngela Stegmaier2013-11-017-0/+1939
| | | | | | | | | | Add the multizone AudioHAL support to jacinto6evm. The multizone audio is built if the multizone flag is set, otherwise the legacy AudioHAL is built. Change-Id: Ib0b401f963cd9327caeb73623bba163fe8129870 Signed-off-by: Angela Stegmaier <a0866189@ti.com> Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Make audio_policy.conf a Pre-builtAngela Stegmaier2013-11-011-0/+8
| | | | | | | | | | | | Make audio_policy.conf a pre-built. This allows for a different audio_policy.conf to be copied based on which audio hal is used (legacy or other). The audio_policy.conf file is removed from the PRODUCT_COPY_FILES list and added to the PRODUCT_PACKAGES list. Change-Id: I0bde7c6b01e69cf184354fc354f63c652fdbc212 Signed-off-by: Angela Stegmaier <a0866189@ti.com>
* audio: Move jacinto6evm Audio HAL to new folderAngela Stegmaier2013-11-014-22/+42
| | | | | | | | | The existing Audio HAL is moved to a new folder named "legacy". This change is done in preparation for adding the multizone support to the same audio folder. Change-Id: Id8c7417a1b5f4fba59ab021bc136e7f451aac551 Signed-off-by: Angela Stegmaier <a0866189@ti.com>
* Revert "jacinto6evm: TEMP: disable audio library build"Misael Lopez Cruz2013-08-201-0/+41
| | | | | | | | Enable J6's primary AudioHAL. This reverts commit ee86512ffba9e0a8d45bbe184967b02f567e715d. Change-Id: I1875e09a9bf7b5193fad75767d6584d7267c6ee8 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* Merge remote-tracking branch 'omap-mirror/d-jb-mr1-release' into syncVishal Mahaveer2013-08-191-0/+3
|\
| * audio: Increase HP power-on delay to 200msMisael Lopez Cruz2013-08-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | It takes around 130ms for the HPLOUT/HPROUT pins to reach the VCM level. HP output driver power-on delay less than that causes the HP pins to abruptly reach VCM leading to glitches on the headphone. Next power-on delay step available in tlv320aic3106 codec is 200ms. Change-Id: I05e80ba129b665bec529810b5e6fed4d82031be7 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
| * audio: Enable pop reduction on HP outputMisael Lopez Cruz2013-08-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | High power output drivers have pop reduction mechanism that consists of power-on delay and ramp-up step time. Power-on time of 50ms can help reducing a large spike when output is first enabled. Ramp-up step time introduces additional artifacts so is not used. Change-Id: I9df3ff0fcb670d04c6fd3babfbfec089f77c2e8c Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* | jacinto6evm: TEMP: disable audio library buildVishal Mahaveer2013-07-311-41/+0
|/ | | | | | | | Disable audio library build for time being. Will be reverted, when the correct patches to fix the build are submitted. Change-Id: I02c5448f8d943aec156ad516facb0aaf4e3d2639 Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
* audio: Enable Headphone and Line-Out outputsMisael Lopez Cruz2013-07-211-51/+31
| | | | | | | | | | | | | | | | | | | Default output was Line-Out, it was mapped to AUDIO_DEVICE_OUT_SPEAKER. However, jacinto6evm board doesn't have headphone detection so it's not possible to dynamically enable the Headphone output. Line-Out is meant for loads with higher impedances than headphone's, so Headphone output has to be enabled by default too. Now, Line-Out and Headphone outputs will both be enabled all the time, no dynamic routing will occur. Output mixers (HP Mixer, Line-Out Mixer) have to be used if DACs are routed to more than one output, as required by tlv320aic3106 specs. So the route strategy changes as direct DAC to output connection was used before. Change-Id: I8b17f2953d56ffbe7b572bc2c293a1e7962627ab Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Fix Line1 mode mux controlsMisael Lopez Cruz2013-07-211-5/+10
| | | | | | | | | | | | "Left Line1[LR] Mux" and "Right Line1[LR] Mux" controls refer to Line1 input mode (single-ended vs differential), so they have to be grouped with other input controls. Line1L mode was properly configured, but Line1R was not. Appropriate controls are now added to defaults array. Change-Id: I5c84ddb72da3902b645fec1dd4f48d877f8a625a Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Create definitions for supported input and output devicesMisael Lopez Cruz2013-07-191-12/+9
| | | | | | | | Add defines containing the input and output devices supported by this AudioHAL. Change-Id: Iba6104451c27ff8547faba574d95e567d34b2079 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Add dra7evm to supported cardsMisael Lopez Cruz2013-06-191-0/+1
| | | | | | | Add "dra7evm" as a valid card name supported by primary audioHAL. Change-Id: I79299352aff1a78915b876a34b40d7b8ebf17e3a Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio: Initial version of McASP + tlv320aic3106 sound cardMisael Lopez Cruz2013-05-283-12/+1361
| | | | | | | | | | | | Jacinto6 EVM CPU board has an instance of tlv320aic3106 analog codec connected to McASP3, this initial version of the audioHAL uses that port. Additional audio features in JAMR3 board are not supported at the moment. This module is based on AudioHAL used by OMAP. Change-Id: I6853c469c199b057ff4e5169b914776140b31b90 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
* audio_policy: Default hdmi device for audio on J6 platformSunita Nadampalli2013-05-031-2/+2
| | | | | Change-Id: If0374636728c4b92530b381a2a5dd27b7df70bee Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
* jacinto6evm: audio: Add audio_policy.confMisael Lopez Cruz2013-05-021-0/+101
Add an audio_policy.conf specific for jacinto6evm platform. Change-Id: I5724d1d935ebe3b2249716a72289c74f57d1c7c0 Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>