summaryrefslogtreecommitdiffstats
path: root/audio
Commit message (Collapse)AuthorAgeFilesLines
* samsung: audio: Add libprocessgroup dependency to set_sched_policy usersSuren Baghdasaryan2019-10-131-0/+1
| | | | | | | | | | | | | | Add libprocessgroup dependency to audio hal that uses set_sched_policy. Include sched_policy_ctrl.h header which now contains set_sched_policy definition. Exempt-From-Owner-Approval: janitorial Bug: 111307099 Test: builds, boots Change-Id: I8286daed7065c405ca06e87c1b8f6f6c301dc388 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* audio_hw: Prevent referencing input devices from empty listVasyl Gello2019-02-051-0/+10
| | | | | | | | Fixes audioserver crash in in_get_capture_position() if PCM input device was not properly opened. Signed-off-by: Vasyl Gello <vasek.gello@gmail.com> Change-Id: I2f2d9bc8151cf61af112a9544268513effacacb5
* Audio: fix voip calls over bluetooth for Wolfson Microelectronics codecs.stenkinevgeniy2019-02-051-0/+8
| | | | | | | | Some devices, that using wm* codecs like i9500, t805, p601 and others need open CP pcm's when using BT SCO in IN_COMMUNICATION mode. Change-Id: I64935aabf1c52e66409e727f02752cd325f8ef58 Signed-off-by: stenkinevgeniy <stenkinevgeniy@gmail.com>
* Audio: fix voip calls over bluetooth headset.stenkinevgeniy2019-02-054-74/+47
| | | | | | | | | | | Current HAL start/stop bt_sco session only for incall mode - rewrite logic to start/stop bt session when system switch to one of the bluetooth devices. Move bt_sco_active and pcm_sco_rx/tx to main audio_device structure. Remove bt_sco_capture profile. Change-Id: I7bbe4273f759e255bb857f8292f2921df31d4b0b Signed-off-by: stenkinevgeniy <stenkinevgeniy@gmail.com>
* Audio: fix call recording.stenkinevgeniy2019-02-051-6/+0
| | | | Change-Id: I312d2a36009ec1415dd5ccba4fbb68ae4a10e2ab
* audio: Re-worked sound pre- and post-processingBasil Gello2019-02-053-63/+24
| | | | | | | | | | | In order to activate proprietary sound pre- and post-processing, the following parts of audio HAL were revised: * Activated ENABLE_PREPROCESSING directive in Android.mk * Removed unused variables and functions * Re-written set_preprocessor_echo_delay() function Change-Id: I868087f422764895df7d2bc6bbf4bbd76672b8e7
* Revert "audio: Fix incall device switch handling"stenkinevgeniy2019-02-051-5/+2
| | | | | | | | | | | | | This commit cause bug - no sound after end voice call when using speaker. Sound come back after audioflinger send standby and hal reenable speaker for new stream (usecase). Reason - hal need reenable speaker (or other devices) for other streams (usecases). This reverts commit f33a728b205f7656ca6211a07e3dd69c623b75ca. Change-Id: Icde4e83ab824008e931b681cdbb6e11d6a2a7aa5
* Audio: get_input_snd_device - use all bt sco devices for voice calls.stenkinevgeniy2019-02-051-7/+2
| | | | | | | | | | | | Use AUDIO_DEVICE_OUT_BLUETOOTH_SCO AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET and AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT and not only AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET for voice calls. Remove default voice_mic for sco devices - why we need default mic for sco output devices if now we handle all sco output devices. Change-Id: Ibf4eb42eebcf7dc229649d8afe6e8b3ea9354165
* Audio: remove separated bt_sco playback profilestenkinevgeniy2019-02-051-23/+6
| | | | | | | | | | Myabe this related to htc flounder hw but this not needed for samsung and this cause bug when hal trying open bt pcm device for system sounds while voice call active on sco and bt pcm device opened with start_voice_session_bt_sco. Change-Id: I75482dad42feccae5e8ca9df2623ef4693a7bdb0
* Audio: check and route usecasesstenkinevgeniy2019-02-051-0/+63
| | | | | | | | | | | | | | | | | | | | Add check_and_route_usecases - this function is to make sure that all the usecases that are active on the hardware codec backend are always routed to any one device that is handled by the hardware codec. Example: When voice call starting - we need earpice - hal enable earpice, but befor - we put call button - and hal enable speaker and play sound - "click" And now we have speaker and earpice enabled. Later when audioflinger send standby (default after 3 sec) to stream which use speaker - hal disable speaker while voice call active - and we have no sound in earpice. check_and_route_usecases will not allow such situations. Change-Id: Ibc534bb14c25e4a4ffb4f3487d1424e9e1ed6a67
* Audio: HAL should handle other streams (when call active)stenkinevgeniy2019-02-051-11/+0
| | | | Change-Id: I70fbd41ac386d7ea9a7fa0abb540151727461ac1
* Audio: remove out stream resampler.stenkinevgeniy2019-02-052-56/+2
| | | | | | | | This never use - because - out->sample_rate and out->config configured in adev_open_output_stream out->config = can have deep or no pcm config with only 48000 sample rate. Change-Id: Ie1c4025585ab6e1b7a900486181c1bceeff88139
* audio: Directly link voice data <-> sessionChristopher N. Hesse2019-02-053-17/+8
| | | | | | | | This is part of a cleanup series. In the future, we should reconsider the struct usage and (maybe?) move the members into one common place. Change-Id: I3218d75acb0c4965332ba0de30b40ca7821596a7
* audio: run ril_set_call_clock_sync() in stop_voice_session()Usaamah Patel2019-02-051-2/+2
| | | | | | | | | | Some devices like the Samsung Galaxy S6, require this to be run at the end of the voice session. However some devices also need this to be run at the start of the voice session whereas the S6 does not (see previous commit). Change-Id: I833b57e262795fcbd8be6f44afb17b0f1ca6fee3 Signed-off-by: Usaamah Patel <ussyp2015@gmail.com>
* audio: Fix WBS sample rate usageMartin Hoffmann2019-02-051-2/+1
| | | | | | | | | | | | | | | | | | | Fixes: BUGBASH-302 Correctly use 16khz for the WBS-SCO pcm_config. No more garbled or mute in-call sound on bt. Apply together with a device specific port of: https://review.lineageos.org/#/c/177996/ and REMOVE any definitions of SCO_WBS_SAMPLE_RATE https://review.lineageos.org/#/c/178371/ This requires testing for all devices using: android_hardware_samsung (universal audio HAL part) Change-Id: I84fb1b234bf2880bf98bf99f1e4ff6c05500b0e3
* audio: improve log message to support for devices that dont have an ampChristopher N. Hesse2018-07-121-1/+5
| | | | | Change-Id: I3fe824c4dbdb57bb0d63b395cfcef2f9dbbe556b Signed-off-by: Abhay Ruparel <abhayruparel2000@gmail.com>
* Audio: remove unsupported aec loopback stuff.stenkinevgeniy2018-07-033-158/+0
| | | | Change-Id: Ibabe4c5fc3b23cd5a0e33fc90b76db93a72099a6
* Audio: out_open_pcm_devices - use out->config instead of ↵stenkinevgeniy2018-05-181-1/+1
| | | | | | | | | | | | | | | | | pcm_device->pcm_profile->config. Current get_pcm_device return always first finded pcm_profile. And out->pcm_dev_list always have only pcm_device_playback pcm_profiles. But if we need use deep_buffer pcm device we need use deep_bufer pcm_config - current hal don't did this... And we configure out->config in adev_open_output_stream function with proper pcm_config (deep or no). Change-Id: I86fdb18202afb0e83393f32830d57c929f174ae6 (cherry picked from commit 39d1d019965d04ddfad2c643de53cd5501803aa4)
* Audio: remove unsupported hotword/soundtrigger stuff.stenkinevgeniy2018-05-182-138/+20
| | | | | Change-Id: Ie21f94e80a18f5a5805a3ee00e12e83fa2fc3f1a (cherry picked from commit 35dbc1e39fa7d355edbebe0071145aac45cc1075)
* audio: return EINVAL to avoid get_presentation_position spamming logsVictor Lourme2018-04-011-2/+1
| | | | Change-Id: I32ec0c5651395c7af3dc4b80d25204bf0fcc1977
* audio: Use audio_route_{apply/reset}_and_update_pathChristopher N. Hesse2018-03-101-37/+17
| | | | | | We don't need to handle the mixer updates here anymore. Change-Id: Id60759e31a6501e4772bbd7377505197c932545a
* audio: Update mixer knobs after re-applying output routeChristopher N. Hesse2018-03-061-0/+1
| | | | Change-Id: I35fbcc03e9666e579134512b443610e546c31441
* audio: Guard mixer path dependency fixChristopher N. Hesse2018-03-041-1/+1
| | | | Change-Id: Id93d7941ae322a83488da3cea62c6eb36a6e9160
* audio: Support new and old mixer paths locationsChristopher N. Hesse2018-02-161-2/+7
| | | | Change-Id: Ifa2a55cbfe45ab9d53cd23098012443f9b32ca31
* audio: Print error in case of nonexistant mixer pathsChristopher N. Hesse2018-02-161-0/+5
| | | | | Change-Id: I131ed6518ce8f26638a3490ee1be7a5d93b4e5b8 (cherry picked from commit 0524e26d2a1d155ce1dc9609b8e8741fd5f1500f)
* audio: Avoid mixer path dependency conflictsChristopher N. Hesse2018-02-091-0/+11
| | | | | | | | | | | | | | | On some devices, certain input and output mixer controls share the same endpoint, which means that if an input stream is disabled (and the mixer is updated), that shared endpoint may be disabled as well. This would result in no audio, because no one is aware that the output stream in fact does still need the shared endpoint to be enabled. We prevent this by enabling the output mixers after disabling input mixers, if any. Change-Id: I4d80fcd0648a11099f27177da3cd29095b6a8c34 (cherry picked from commit 507e8ce5bffb36fae8b1cd4e5498fa19a6273ee6)
* audio: Fix BT sample rate handling properlyChristopher N. Hesse2018-01-202-4/+20
| | | | | | | | | This should now support both old and new headsets, as we rely on codec negotiation in the bluetooth stack for narrow/wide band switching. Change-Id: Ie9d308dfc55726fd1591a7d158f610bd267340e6 (cherry picked from commit d462f7b86e957f858959ef5d80fd1744689ee6ea)
* audio: End voice call in set_mode()Christopher N. Hesse2018-01-201-4/+4
| | | | | | | | Previously, we would only end the voice call once the next output stream happened (and parameters would be set). Change-Id: Id0d2711605e57ad69d9b26b36afb562444349358 (cherry picked from commit 5169e86c10b7429b01d6ab0500a0509141dcbfe1)
* audio: Fix incall device switch handlingChristopher N. Hesse2018-01-201-2/+5
| | | | | | | | The whole code block was no-op, since we would override (in|out)_snd_device at a later point anyways. Change-Id: Ieb2b0918c9c72f18d195d6b34b5c9768fce130b3 (cherry picked from commit f33a728b205f7656ca6211a07e3dd69c623b75ca)
* audio: Improve code readabilityChristopher N. Hesse2018-01-201-1/+1
| | | | | Change-Id: I5b1f24ab6098a037559603a92b4a1a38987488f5 (cherry picked from commit 4b29ec95d88d7cb99a7c55f0d3297a3b8c2149c4)
* audio: Initial support for amplifier HALsChristopher N. Hesse2018-01-203-2/+169
| | | | | Change-Id: I04ef5b89ca595a0df02f6a4a68748bd0d0cdb245 (cherry picked from commit 7a82a0e691d884045c78d1cb9f7ab0dd51a5d871)
* audience: Cleanup write_int()Christopher N. Hesse2017-04-021-12/+19
| | | | Change-Id: Idfec2093c63a864d5f9d37353adbf6f8fc5d4fcd
* audience: Use O_WRONLY flag for write_int()Christopher N. Hesse2017-04-021-1/+1
| | | | Change-Id: I9a0bdc78644e7a4875d7e49051722fff3d47ee6b
* audience: Always log write_int() failsChristopher N. Hesse2017-04-021-7/+1
| | | | Change-Id: I747c38646599ae3f687279ca8a95db804f3ad015
* audience: Warn when we cannot handle the output deviceChristopher N. Hesse2017-04-021-0/+2
| | | | Change-Id: I0cddd94f22c5e912436682d713a1ae441723cfee
* audio: Split BT SCO media/incall pathsChristopher N. Hesse2017-03-203-15/+27
| | | | Change-Id: I23a621855e8b96edcd92d8740dfec270ff7e7407
* audio: add support for bluetooth wideband voice callsFevax2017-03-204-8/+42
| | | | Change-Id: I02bf23a83c52389cc02ba1f61572eb651418fe24
* audio: Add support for Audience EarSmart ICsChristopher N. Hesse2017-03-036-0/+291
| | | | | | | | | Some devices (often T-Mobile variants) have extra hardware for incall audio processing. Audio must be routed to the ES IC properly so it can be passed to ALSA, otherwise the RX/TX streams are lost. Change-Id: Ib29c747d5728a09726e14bab00f26ad273400aba
* audio: Add error logging to ril_interfaceChristopher N. Hesse2017-03-011-0/+20
| | | | Change-Id: I447d1bf2745990bd71688847d3e9cdb432c57f47
* audio: Restart the voice call on device changeAndreas Schneider2017-02-242-1/+13
| | | | | | | When we change the device during a phone call we need to completely restart it. This is required by the modem. Change-Id: I902c78bf50dfb5dc3da51fca0fb862f872df86ca
* audio: Improve logging in out_set_parameters()Andreas Schneider2017-02-191-2/+10
| | | | Change-Id: I5800307905870ca836383e7d492a7472a9a386be
* audio: Implement WB_AMR callback correctlyAndreas Schneider2017-02-194-16/+26
| | | | Change-Id: Ib2392c8a122d07b40814ca2eeaecf30f9bdb0f99
* audio: Fix get_snd_device_name() for earpieceAndreas Schneider2017-02-161-1/+1
| | | | | | SND_DEVICE_MIN_OUT_EARPIECE is set to SND_DEVICE_MIN. Change-Id: I3a442df7f388b72d433257f6ac1db473e4cb14a6
* audio: Cleanup and fix voicecall preparationChristopher N. Hesse2017-02-161-36/+36
| | | | | | | | * if (usecase == NULL) should actually be if (vc_usecase == NULL) * Avoid unnecessary if-block indentation by updating the control flow Change-Id: If00ac405a1eac429862b953580e8614227015134
* audio: Guard WB_AMR callbackChristopher N. Hesse2017-02-153-11/+26
| | | | | | | Some devices do not support this; some devices are WiFi only and obviously do not have it. Change-Id: I6d245eee447bd87849cbdfd41c0cf73c6af714e6
* audio: Rename HANDSET to EARPIECE to follow libsecril-clientAndreas Schneider2017-02-151-3/+3
| | | | Change-Id: I9e99e1bdf8c8c29aca4d753269190dd34c229d8a
* Revert "audio: Disable voice log by default"Christopher N. Hesse2017-02-151-1/+1
| | | | | | | | | | This was intentionally left enabled and does not spam anyways, but allows users to extract helpful information without recompiling. This reverts commit e06577dc818d047dae1caec397fa7316762e3fb7. Change-Id: I604ee674a1db466b3d3e364cb95f5688edd4947c
* audio: Use labs() instead of abs()Paul Keith2017-02-141-2/+2
| | | | | | | | | | | * abs() accepts ints as parameters, but this breaks compile since the times are longs, not ints * Use labs() instead, which accepts longs as parameters, to fix compile Change-Id: I8f980a78380cdae18abd5b9602e281beae3ee4d3 Signed-off-by: Paul Keith <javelinanddart@aidenswann.com>
* audio: Disable voice log by defaultAndreas Schneider2017-02-141-1/+1
| | | | Change-Id: I56c54fe1f3d75cbd05693f98f2f2210ea13295dc
* audio: Log error if we fail to set the audio pathAndreas Schneider2017-02-141-1/+3
| | | | Change-Id: Ide469d644aaab2a97dd72244bd316c2ff497d9db