summaryrefslogtreecommitdiffstats
path: root/audio/audio_hw.c
Commit message (Collapse)AuthorAgeFilesLines
* tuna: fix in call mic mute for toro and toroplusTrulan Martin2016-02-101-2/+21
| | | | | | Adapted from a patch by @MWisBest Change-Id: I1b0cb2db0e5473088eb42b623bfd902332b1ec47
* [TEST] audio: Set short period size to 882.Kyle Repinski2016-01-151-1/+4
| | | | Just a hunch, see the comment...
* audio: Fix buffer underrun doing short to long period transition.Kyle Repinski2016-01-151-2/+4
| | | | | This basically halves the long period size. I wish there was a different way to fix this but I don't think there is.
* audio: further tweaking to use_long_periods.Kyle Repinski2016-01-151-19/+29
| | | | | | | | | | Move the detection in start_output_stream_deep_buffer down to allow a call to pcm_set_avail_min now. Did a few micro-optimizations as well. Conflicts: audio/audio_hw.c Change-Id: I90d5663040986ffd597f37ae66334467adacea3b
* audio: Make buffer_frames dependent on OUT_RESAMPLER.Kyle Repinski2016-01-151-3/+3
| | | | (buffer_frames is only used for OUT_RESAMPLER)
* audio: Decide use_long_periods on start_output_stream.Kyle Repinski2016-01-151-2/+7
| | | | | Previously this was corrected on the first write, however that was causing a buffer underrun sometimes when a stream was started. This avoids that.
* audio: Initial work towards a variable sampling rate.Kyle Repinski2016-01-151-2/+75
| | | | | | | Conflicts: audio/policy/audio_policy.default.conf Change-Id: I4d13946e88cacbf5e4ca383d5d0756262442efd2
* audio: Use separate sampling rate for MM-UL (input stream).Kyle Repinski2016-01-151-1/+6
| | | | Fixes MM-UL not working.
* audio: Fix PLAYBACK_PERIOD_COUNT and OUT_RESAMPLER definition detection.Kyle Repinski2016-01-151-19/+19
| | | | By moving this block down, the sampling rates are properly defined for this check.
* audio: Add ability to actually force the out stream sampling rate.Kyle Repinski2016-01-151-1/+15
| | | | | This audio HAL has always required some sort of resampling. THIS. ENDS. NOW.
* audio: Determine whether or not to use out stream resampler automatically.Kyle Repinski2016-01-151-0/+1
|
* audio: Add ability to disable built-in out stream resample.Kyle Repinski2016-01-151-0/+22
| | | | | | | | | This needs further testing before enabling by default, but so far it's been OK. Conflicts: audio/audio_hw.c Change-Id: Ic4f86440ff4d01ab4d0d9f977bdec22f10f60555
* tuna: Proper 48kHz audio support.Kyle Repinski2016-01-151-1/+1
| | | | | | This fixes a bunch of annoying junk in the logcat about fast path being denied to UI sounds due to them having a 48000Hz sample rate. Also allows playback of 96kHz audio, as Android refuses to resample to anything lower than a divide by two.
* audio: Fix aliasing violation.MWisBest2016-01-151-2/+3
|
* audio: forward call mute to RIL client interfaceDheeraj CVR2015-06-181-0/+3
|
* tuna: audio: mark unused parametersZiyan2015-04-111-31/+31
| | | | Change-Id: I26e7436513bacf951a0cf4fc252521a8f1cdd3d8
* tuna: audio: align widget names with recent kernel changesZiyan2015-04-111-5/+5
|
* tuna: audio: add parameters to open stream functionsZiyan2015-04-111-2/+5
| | | | | | | Pass device address (and audio source for inputs) to open_output_stream() and open_input_stream() audio HAL functions. Bug: 14815883.
* tuna: audio: Add audio_input_flags_t to HAL open_input_streamZiyan2015-04-111-1/+2
|
* tuna: audio: deprecate audio_stream_frame_size()Ziyan2015-04-111-14/+13
|
* audio: implement mute on hdmi multichannelEric Laurent2013-04-041-1/+18
| | | | | | | | | | | On direct output streams the audio HAL must implement the volume function. In the case of HDMI the only function required is to mute audio when volume is 0 as volume is defined as fixed on digital output streams. Bug 8541062 Change-Id: I4b4e28a910e7b321b3a68567e9ad03fede065ca8
* audio: added support for dual mic capture.Eric Laurent2013-01-221-1/+2
| | | | | | | Added support for simultaneous capture from front and back mics. Change-Id: Ica1b75fe432f419272ae92e8ab04b1d34524c189
* audio: changes ringtone volume when call is commingleemin2012-09-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | the ringtone offset has to be setted to analog side. Buganizer : 6920555 According to Samsung's spec, the earphone ringtone volume level should be 14dB lowere than the media playback volume. On ICS, this behavior was working properly, but on JB this behavior is not working properly. Below is the analog and digital volume change from ICS to JB: ICS : Digital Volume = Normal / Analog volume = lowered 14dB JB : Digital Volume = increased 14dB (in comparison to ICS) / Analog volume = lowered 14dB (same as ICS) Hence the volume in JB has increased by 14dB when compared to ICS. Bug 6920555. Change-Id: Ibc248612db378b5b991221468d8f801257ba4103
* audio: increase toro media speaker volume +2dBSimon Wilson2012-09-181-1/+1
| | | | | Bug: 6878923 Change-Id: Id49d6489e5a99dee088246d146ee38151ba9499c
* audio: fix string leakage in out_get_parameters()Eric Laurent2012-09-071-1/+1
| | | | | | | | | out_get_parameters() was calling strdup() on the string returned by str_parms_to_str() before returning it to the caller. This creates a new string which is never freed as str_parms_to_str() already allocates a new string. Change-Id: I4bcc4aa17ab55e830d7a0569151f717422f6459b
* audio: changes for new audio device enumsEric Laurent2012-09-061-69/+43
| | | | | | | | | | | | Modifications for new audio device enums: - Separated input and output device fields as output and input device values are now on 32 bits. - Changed audio device API version to 2.0 Also removed get_supported_devices() function not needed if audio_policy.conf file is present. Change-Id: I41b782e7450b4664048cc484a681b9327d8395da
* audio: fix echo reference channels configurationEric Laurent2012-08-301-1/+1
| | | | | | | | When an auxiliary mic channel is used, the echo reference should use only the main channels to be consistent with the way the reverse effect processing is configured. Change-Id: I28ee1e2a9852fdd0e904fb01bedf90f3372683c9
* Use 3 ms buffers for low latency pathGlenn Kasten2012-08-271-1/+1
| | | | Change-Id: Icf113e2e863a79cb3d870fac5781539702cdbfa8
* Triple buffer if SRC enabledGlenn Kasten2012-08-211-0/+7
| | | | | Bug: 6881638 Change-Id: I76255c2cd5845671c2342e22932c692342257208
* Use audio_channel_mask_t consistentlyGlenn Kasten2012-06-251-2/+2
| | | | Change-Id: I90a50b58dd23fe522724df53f08b4f9687150da6
* audio: acquire lock in adev_set_voice_volume()Eric Laurent2012-06-191-1/+3
| | | | | | | | | | Acquire the audio device mutex before calling into ril library in adev_set_voice_volume() to avoid concurrency with other calls to ril from select_mode() or set_incall_device(). Bug 6626532. Change-Id: I2347477b39ce46137a654047266b70dd691c021c
* audio: fix in call audio path switch issueEric Laurent2012-06-181-1/+4
| | | | | | | | | | | | Switching from BT SCO to earpiece does not seem to work when in call and an output stream is active. This change modifies out_set_parameters() to force the output stream into standby when a new audio path is selected while in call. Bug 6676684. Change-Id: I2817f80ea3fa3a0e00e9705fdb6d9a7e3183549b
* audio: workaround for hdmi multi channel swapEric Laurent2012-06-111-0/+11
| | | | | | | | | | Workaround for HDMI multi channel channel swap on first playback after opening the output stream: force re-opening the HDMI pcm driver after writing a few periods. Bug 4282214. Change-Id: Ibe1452a8905a27bc3f95564a45cfb9bb490b65ae
* audio: add support for multichannel HDMIEric Laurent2012-06-011-13/+241
| | | | | | | | | Added a dedicated audio output stream for multichannel HDMI. This output stream is used when an HDMI sink supporting 6 or 8 PCM channels is connected and 5.1 or 7.1 multichannel content it played. Change-Id: I7ad1cd6be4c2b3a9e24a4811aa87e7223badedc4
* audio: variable deep buffer sizeEric Laurent2012-05-141-20/+92
| | | | | | | | | | | Add back the capability to change the deep buffer size according to screen state. This solves various issues related to audio focus, volume and pause control that arise with large audio buffers. Those issues should be ultimately addressed by changes in the audio framework. Change-Id: I6889ecf0e5d8740745152261f27343e1ff533e7b
* audio: fix media volume issues.Eric Laurent2012-05-101-24/+88
| | | | | | | | | | | | | | | Fixed 2 issues with media volume: 1 - since we use mm port for music and tones port for other use cases the digital volume should be applied to both "DL2 Tones Playback Volume" and "DL2 Media Playback Volume". 2 - the total gain applied to audio originating from the AP is the combination of digital gain in ABE and analog gain in codec. Some use cases like telephony have a higher priority than media and apply a different (higher) analog gain. As this analog gain is common to all sources, digital media gain should be adjusted accordingly to avoid volume bursts while in call and playing music. This is particularly important in speaker phone mode. Change-Id: I90200282edca7098603edca2d56821290988cb20
* audio: fix memory leak.Eric Laurent2012-05-021-4/+8
| | | | | | | Fixed memory leak introduced by commit 4e7a573f in case of error in adev_open_output_stream(). Change-Id: I4acc070d748cea228da846f95c7826160e0196a5
* audio: add support for deep PCM bufferingEric Laurent2012-04-301-121/+230
| | | | | | | | | | | | | | | Implement one output stream with short buffers and one output stream with deep buffers. The stream with short buffers is selected for most use cases and provides short latency. It uses TONES_DL port and IOCTL write mode. The stream with deep buffers is used for music playback. It uses MM_DL port and MMAP NOIRQ write mode. The deep buffer stream is not used when the device selection is BT SCO, HDMI or SPDIF. The echo reference is only taken from the short buffer stream. Change-Id: I60ef720e52e96970b8b6618f9f43f24baadce60b
* Adjust output buffer size and sample rateGlenn Kasten2012-04-271-10/+78
| | | | | | | | | | | | Use 4 buffers of 96 frames each = 4 ms at 48 kHz. Keep the 44.1 kHz -> 48 kHz up-sampler in HAL. Disable mmap mode and non-IRQ mode; this gives better variance for cycle times. Reduce number of buffers from 4 to 2, works OK in non-mmap mode but not mmap mode. Update comments based on code review. Tested with audio input. Not yet tested with echo cancellation. Change-Id: I69db00ab408cd2aad5788d602eb01fc0c7e4e78b
* new audio device API version.Eric Laurent2012-04-161-23/+26
| | | | Change-Id: I1169d279b4a59355cf4362a7128b053bf940c158
* audio: add dual mic support for pre processingEric Laurent2012-04-101-101/+584
| | | | | | | | | | | | | | | | Added support for audio pre processing libraries implementing dual mic solutions. When a pre processor is enabled, its multi channel capabilities are queried and compared to capture channel combinations supported by the device and other enabled pre processings. The most favorable configuration is chosen and pcm capture driver is restarted with the appropriate channel config. Also made various capture and process buffers naming and allocation more consistent. Change-Id: I90be4798951d0a34dc77d6bdc93ef15cad3ff5af
* audio: fix audio drop when speaker is selected 2.Eric Laurent2012-04-021-1/+2
| | | | | | | | | | | Commit 78a7609d fixed audio drop at the start of ringtone. This commit fixes another similar issue with camera shutter sound being dropped while in call over headset. There was a workaround for this second issue in audio policy manager but this was not satisfactory as it was impacting all devices for a problem that is Prime specific. Change-Id: I42b37c7da4a232323b520a8a55ac5b3086b5a230
* audio: fix error in capture path delay calculationEric Laurent2012-04-021-2/+5
| | | | | | | | Fix error in get_capture_delay() that was not taking into account the fact that frames in in->buffer are at driver sampling rate while frames in in->proc_buf are at requested sampling rate. Change-Id: I09e627bd316daedab5ffea3dd638254eaa270a5b
* am d28a1a80: am 467c02b6: am 78a7609d: audio: fix audio drop when speaker is ↵Eric Laurent2012-03-201-0/+12
|\ | | | | | | | | | | | | selected * commit '2cb034ebbf5eb4f9ead26150d288bf6d90dc2fee': audio: fix audio drop when speaker is selected
| * audio: fix audio drop when speaker is selectedEric Laurent2012-03-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | When changing audio path to speaker while playback is active, several hundred ms of audio are dropped. This is mostly noticeable when a ringtone starts playing. This change is a workaround forcing the output in standby when speaker is selected. The root cause must still be indentified and fixed. Change-Id: Idef8dc1cdbf2da499a414d0b60244f91ef66e73b
* | audio_channel_in_mask_from_countGlenn Kasten2012-03-151-5/+1
| | | | | | | | Change-Id: Ib1d5af6687479c8d189a3407c229a6ac0ed5c03b
* | Fix memory leaksGlenn Kasten2012-02-141-1/+2
| | | | | | | | Change-Id: If9c95a4808785e58ee4595e5c762d01d87f1936d
* | resolved conflicts for merge of 8c61349a to masterSimon Wilson2012-01-261-48/+117
|\ \ | |/ | | | | Change-Id: Id432e901f8107a00a7f371e5882b1290a1154961
| * audio: support multiple output PCMsSimon Wilson2012-01-251-48/+117
| | | | | | | | Change-Id: I5179699b22224473bd158e90f864e4e73895b5dc
* | Use audio_format_t consistentlyGlenn Kasten2012-01-201-9/+9
| | | | | | | | Change-Id: I2e2a5f625956dc5d09dbdc3f6f2d9a010ecc7bad