Commit Graph

76 Commits

Author SHA1 Message Date
Christopher N. Hesse c487bbe389 audio: improve log message to support for devices that dont have an amp
Change-Id: I3fe824c4dbdb57bb0d63b395cfcef2f9dbbe556b
Signed-off-by: Abhay Ruparel <abhayruparel2000@gmail.com>
2018-07-12 13:53:18 +02:00
stenkinevgeniy 0b52b58af8 Audio: remove unsupported aec loopback stuff.
Change-Id: Ibabe4c5fc3b23cd5a0e33fc90b76db93a72099a6
2018-07-03 07:38:08 +00:00
stenkinevgeniy 2ef158a268 Audio: out_open_pcm_devices - use out->config instead of 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)
2018-05-18 12:45:41 +02:00
stenkinevgeniy 44335364f6 Audio: remove unsupported hotword/soundtrigger stuff.
Change-Id: Ie21f94e80a18f5a5805a3ee00e12e83fa2fc3f1a
(cherry picked from commit 35dbc1e39fa7d355edbebe0071145aac45cc1075)
2018-05-18 12:45:17 +02:00
Victor Lourme 5869cd357e audio: return EINVAL to avoid get_presentation_position spamming logs
Change-Id: I32ec0c5651395c7af3dc4b80d25204bf0fcc1977
2018-04-01 02:23:39 +02:00
Christopher N. Hesse 8179c011c6 audio: Use audio_route_{apply/reset}_and_update_path
We don't need to handle the mixer updates here anymore.

Change-Id: Id60759e31a6501e4772bbd7377505197c932545a
2018-03-10 00:09:15 +01:00
Christopher N. Hesse ecb6050e40 audio: Update mixer knobs after re-applying output route
Change-Id: I35fbcc03e9666e579134512b443610e546c31441
2018-03-06 19:25:21 +00:00
Christopher N. Hesse 719630aaf6 audio: Guard mixer path dependency fix
Change-Id: Id93d7941ae322a83488da3cea62c6eb36a6e9160
2018-03-04 13:54:52 +00:00
Christopher N. Hesse d8d04fd497 audio: Support new and old mixer paths locations
Change-Id: Ifa2a55cbfe45ab9d53cd23098012443f9b32ca31
2018-02-16 11:59:28 +01:00
Christopher N. Hesse 2beff4222c audio: Print error in case of nonexistant mixer paths
Change-Id: I131ed6518ce8f26638a3490ee1be7a5d93b4e5b8
(cherry picked from commit 0524e26d2a1d155ce1dc9609b8e8741fd5f1500f)
2018-02-16 10:58:10 +00:00
Christopher N. Hesse 11ef211749 audio: Avoid mixer path dependency conflicts
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)
2018-02-09 15:23:07 +00:00
Christopher N. Hesse e4a1c59a0b audio: Fix BT sample rate handling properly
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)
2018-01-20 22:32:04 +00:00
Christopher N. Hesse 6c0020c6a9 audio: End voice call in set_mode()
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)
2018-01-20 22:31:42 +00:00
Christopher N. Hesse 77880a2b13 audio: Fix incall device switch handling
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)
2018-01-20 22:31:27 +00:00
Christopher N. Hesse 33affb806e audio: Improve code readability
Change-Id: I5b1f24ab6098a037559603a92b4a1a38987488f5
(cherry picked from commit 4b29ec95d88d7cb99a7c55f0d3297a3b8c2149c4)
2018-01-20 22:30:35 +00:00
Christopher N. Hesse 6a2a3079c0 audio: Initial support for amplifier HALs
Change-Id: I04ef5b89ca595a0df02f6a4a68748bd0d0cdb245
(cherry picked from commit 7a82a0e691d884045c78d1cb9f7ab0dd51a5d871)
2018-01-20 22:30:10 +00:00
Christopher N. Hesse d483dd7898 audience: Cleanup write_int()
Change-Id: Idfec2093c63a864d5f9d37353adbf6f8fc5d4fcd
2017-04-02 14:14:46 +02:00
Christopher N. Hesse 658f447ad3 audience: Use O_WRONLY flag for write_int()
Change-Id: I9a0bdc78644e7a4875d7e49051722fff3d47ee6b
2017-04-02 14:12:54 +02:00
Christopher N. Hesse 2036814f43 audience: Always log write_int() fails
Change-Id: I747c38646599ae3f687279ca8a95db804f3ad015
2017-04-02 14:11:25 +02:00
Christopher N. Hesse 705246055a audience: Warn when we cannot handle the output device
Change-Id: I0cddd94f22c5e912436682d713a1ae441723cfee
2017-04-02 14:07:46 +02:00
Christopher N. Hesse 56caa269d2 audio: Split BT SCO media/incall paths
Change-Id: I23a621855e8b96edcd92d8740dfec270ff7e7407
2017-03-20 19:48:35 +01:00
Fevax 51bd12c20d audio: add support for bluetooth wideband voice calls
Change-Id: I02bf23a83c52389cc02ba1f61572eb651418fe24
2017-03-20 14:44:03 +00:00
Christopher N. Hesse 0fdef0cbd6 audio: Add support for Audience EarSmart ICs
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
2017-03-03 21:49:59 +00:00
Christopher N. Hesse a13e517a69 audio: Add error logging to ril_interface
Change-Id: I447d1bf2745990bd71688847d3e9cdb432c57f47
2017-03-01 11:22:04 +01:00
Andreas Schneider e9a44a2d55 audio: Restart the voice call on device change
When we change the device during a phone call we need to completely
restart it. This is required by the modem.

Change-Id: I902c78bf50dfb5dc3da51fca0fb862f872df86ca
2017-02-24 22:50:27 +00:00
Andreas Schneider dd8a36941b audio: Improve logging in out_set_parameters()
Change-Id: I5800307905870ca836383e7d492a7472a9a386be
2017-02-19 11:47:26 +00:00
Andreas Schneider 49b9dcb284 audio: Implement WB_AMR callback correctly
Change-Id: Ib2392c8a122d07b40814ca2eeaecf30f9bdb0f99
2017-02-19 11:46:55 +00:00
Andreas Schneider dde54c0469 audio: Fix get_snd_device_name() for earpiece
SND_DEVICE_MIN_OUT_EARPIECE is set to SND_DEVICE_MIN.

Change-Id: I3a442df7f388b72d433257f6ac1db473e4cb14a6
2017-02-16 14:50:48 +01:00
Christopher N. Hesse 130da9f065 audio: Cleanup and fix voicecall preparation
* if (usecase == NULL) should actually be if (vc_usecase == NULL)
 * Avoid unnecessary if-block indentation by updating the control
   flow

Change-Id: If00ac405a1eac429862b953580e8614227015134
2017-02-16 14:50:48 +01:00
Christopher N. Hesse 74c317d1bd audio: Guard WB_AMR callback
Some devices do not support this; some devices are WiFi only
and obviously do not have it.

Change-Id: I6d245eee447bd87849cbdfd41c0cf73c6af714e6
2017-02-15 11:25:45 +01:00
Andreas Schneider e6286b9208 audio: Rename HANDSET to EARPIECE to follow libsecril-client
Change-Id: I9e99e1bdf8c8c29aca4d753269190dd34c229d8a
2017-02-15 10:38:30 +01:00
Christopher N. Hesse 86f7ea8e9f Revert "audio: Disable voice log by default"
This was intentionally left enabled and does not spam anyways,
but allows users to extract helpful information without
recompiling.

This reverts commit e06577dc81.

Change-Id: I604ee674a1db466b3d3e364cb95f5688edd4947c
2017-02-15 09:42:05 +01:00
Paul Keith f114e2ee35 audio: Use labs() instead of abs()
* 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>
2017-02-14 21:31:26 -06:00
Andreas Schneider e06577dc81 audio: Disable voice log by default
Change-Id: I56c54fe1f3d75cbd05693f98f2f2210ea13295dc
2017-02-14 17:42:15 +01:00
Andreas Schneider d44edaa261 audio: Log error if we fail to set the audio path
Change-Id: Ide469d644aaab2a97dd72244bd316c2ff497d9db
2017-02-14 17:42:15 +01:00
Andreas Schneider df6fc8a6a9 audio: Add missing deep buffer to use_case_table
Change-Id: I5216838e0de257241206546f2e9f71896292fe9e
2017-02-14 17:42:15 +01:00
Andreas Schneider adb788d97c audio: Fix device table access in get_snd_device_name()
We have a value for SND_DEVICE_NONE so we should use that. There is no
field for SND_DEVICE_MIN so we need to check it is bigger.

Change-Id: I041930c8c4b552d45804a178aeb1aa981ae7c13f
2017-02-14 17:42:14 +01:00
Andreas Schneider 58735a9cf9 audio: Fix time diff to always return positive numbers
Change-Id: I62f835f95fc1d1a671cfdb2e6e6ac1758524235f
2017-02-14 17:42:14 +01:00
Andreas Schneider 7c367c0adf audio: Update comments for voice mics
Change-Id: I3fc888a4046a2b49bc887088750dd0e5be1c543c
2017-02-12 11:57:02 +00:00
Andreas Schneider 05bc1882e2 audio: Add support for bluetooth voice calls
Change-Id: Ic63b7c09ed7401ab72824a406db333e3fbce780b
2017-02-12 11:56:30 +00:00
Andreas Schneider 757e2d8a77 audio: Remove device bit only on active_input
This makes the code less confusing.

Change-Id: I6020f892f5165a6c784b05737e29b24d7121b8c9
2017-02-11 13:59:48 +00:00
Andreas Schneider 04037e7121 audio: Add a mixer_path_0.xml template for the HAL
Change-Id: Iec0976cf7d9d54edb850b972c44b7159a2374ef2
2017-02-11 14:24:35 +01:00
Andreas Schneider 107a848bc3 audio: Add support for voice session mic mute
Change-Id: I5277736fffcb4511e4a7adb2e3e10090dcab484c
2017-02-11 14:23:16 +01:00
Andreas Schneider 59486fa48c audio: Add voice call wideband support
Change-Id: Idf6725aaaf906109ce973a8109b7c252a997dead
2017-02-11 14:23:16 +01:00
Andreas Schneider 82f3248400 audio: Add support for two mic control
Change-Id: I0176b41b071577e9e55f5177ec1219d4e9aa91a2
2017-02-11 14:23:16 +01:00
Andreas Schneider 97fa7f1c5c audio: Leave out_get_presentation_position() early when switching to WB
When the voice session switches from NB to WB we should just leave
early.

Change-Id: Ib4bfe336f6e51fa469fee50c96a81c819f58678b
2017-02-11 14:21:56 +01:00
Andreas Schneider d6359186ea audio: Do not segfault in out_get_presentation_position()
When a voice call is stopped we switch back to the default primary
output (speaker). Then this function gets executed and as ther was
no active PCM because voice_session is handling that it segfaults
because the PCM is NULL.

Change-Id: I927504b7962b096c0d4c3642b48aee55c85ec013
2017-02-11 14:20:24 +01:00
Christopher N. Hesse 696959dda1 audio: Enable voice call support
Pair-Programmed-With: Andreas Schneider <asn@cryptomilk.org>

Change-Id: I284f21240e56dda93cb8a2ab98b903ff712504a6
2017-02-10 21:41:49 +01:00
Andreas Schneider 5a2f10031a audio: Remove unused variables and function
The unused functions have just been commented out.
This also sets the CFLAGS to -Wall and -Werror.

Change-Id: Iea097426313a68a01a074627115853fccc680579
2017-02-10 21:35:24 +01:00
Andreas Schneider ecd17ce8ba Revert "audio: Remove unused screen_state parameter"
We want that to avoid an error message in the log, so revert the
revomal.

This reverts commit cdad20da45.

Change-Id: Ic90cd6b02e5b3e8aae73d824153c3084643a8acc
2017-02-10 21:33:14 +01:00