Commit Graph

64 Commits

Author SHA1 Message Date
Lukasz Mastalerz
75b531f7e2 [MOS-871] Loudspeaker icon is not updated when audio routing has changed
Fix for the loudspeaker becomes active again when a headset is unplugged
if it was on while the headset was connected to the phone.
Fix typo in Bluetooth in EventType enum.
2023-02-21 15:40:39 +01:00
Lefucjusz
01843fbadd [MOS-814] Fix no sound after BT device connection during call
Fix of the issue that connecting or
disconnecting BT device while call
was in progress resulted in no sound
being heard anywhere due to audio
routing being stopped when HFP device
disconnected.

Additionally minor code cleanup.
2023-01-16 13:36:52 +01:00
Lefucjusz
9b7d5be07a [MOS-779] Fix music files extensions case sensitivity
Fix of the issue that only files with
extension in lowercase were detected
and listed in the music player's
library.
Additionally code cleanup.
2022-10-25 09:53:24 +02:00
Lefucjusz
434a335ef3 [MOS-411] Wired headset audio fix
Fixes non-working wired headset audio
during call
2022-05-16 10:20:48 +02:00
Bartosz Cichocki
d59ac56d51 [MOS-347] Separate A2DP from HFP in ProfileManager
Now, both profiles can operate separately. Additonally, minor
fixes has been applied to allow calling via car audio system.
Some infotainment systems still don't work though.
2022-04-25 10:26:38 +02:00
Marcin Smoczyński
bd90e57516 [BH-907] Split utils module into components
Split module-utils into smaller components for better dependency
management. Fix many dependencies throughout the project.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-09-23 15:14:40 +02:00
Bartosz Cichocki
e8dd8aacbe [EGD-7404] Adapt & prepare CVSD codec for usage in HFP
Adapted both codec and HFP profile to be able to work together.
Now it's possible to stream 2-way audio via HFP profile, but it
has to be integrated properly with EGD-7405
2021-09-23 10:08:30 +02:00
Jakub Pyszczak
689bd3069d [EGD-7206] Fix audio profiles priorities
Audio profiles priorities should be set as stated below:
1. Jack
2. Bluetooth
3. Earspeaker.
Added UT's to cover those requirements.
2021-07-28 13:49:04 +02:00
Lukasz Skrzypczak
7fee0d9cfb [BH-378] Utils move log to library
Moved log to separate library
2021-06-08 12:24:29 +02:00
Marcin Smoczyński
ece6a51e5b [EGD-6800] Enable voice transcoding
Add voice transcoding during phone call with two basic transforms:
 - sample rate downscaling by a factor of 2 with a decimator
 - sample rate upscaling by a factor of 2 with an interpolator (no
low-pass filter)

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-05-21 18:12:57 +02:00
Marcin Smoczyński
f6dd452c41 [EGD-6799] Cleanup audio device interface
This refactoring removes invalid interface dependencies of the original
AudioDevice implementation:
 - move things characteristic to RT1051AudioCodec to audio::codec
 - remove dead methods
 - make start/stop optional and codec configuration independent
 - add more convenient way to get supported formats

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-05-20 19:31:06 +02:00
Marcin Smoczyński
a3e512a89b [EGD-6674] Change negotiation of audio block size
Replace faulty implementation which produced ambiguous results with one
which is suited for both phone calls and music playback requirements,
including A2DP and HSP Bluetooth profiles.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-05-05 21:36:00 +02:00
Jakub Pyszczak
00a9d5d0b3 [EGD-6438] Loudspeaker headset fix
Fixed enabling loudspeaker during phone call with headphones plugged.
2021-05-04 10:28:31 +02:00
Jakub Pyszczak
95ce71818e [EGD-6281] Fix microphone mute
Fix microphone mute during the phone call.
Previously phone would unmute on:
- connecting/disconnecting a jack
- turning loudspeaker on/off
- switching to the bt device.
2021-04-07 19:27:59 +02:00
Hubert Chrzaniuk
cceb5b09d6 [EGD-5789] Fix loudspeaker in-call logic
In some cases loudspeaker state night have not
been passed properly ignoring users choice.
2021-03-01 09:22:52 +01:00
Marcin Smoczyński
bda18b5b54 [EGD-5706] Refactor creating audio device
Audio devices are created in the audio subsystem and it is not possible
to send a device to bt service upon creation.

Introduce hookable audio device factory to allow sharing bluetooth
audio device. Move audio devices from bsp to audio allowing removal of
unwanted bsp -> audio dependency.

Remove Bluetooth proxy device which turned out to be a dead end.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-02-17 16:20:59 +01:00
Hubert Chrzaniuk
42879b1c1e [EGD-5580] Fix broken mute during call
The mute button during a call did not cause
any effect.
2021-02-09 16:52:50 +01:00
Marcin Smoczyński
f1fc9df152 [EGD-4977] Reduce audio lag during voice call
Reduce audio delay by reducing audio buffer size in router operation.
Audio streams are now created directly in the operations, not in the
audio service, which gives more flexibility.

Audio Buffer size is calculated based on endpoints (source, sink) and
operation capabilities. This commit also enables allocations in a
non-cacheable region of OCRAM for endpoints that use DMA for data
transport.

Introduce power-of-two operations that use built-in functions and
possibly dedicated hardware instructions of an MCU. These operations
are required by the audio stream buffer size calculation algorithm.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-02-01 22:22:12 +01:00
Marcin Smoczyński
40bf381eca [EGD-5086] Fix voice not starting when calling
Due to a race condition between source and sink voice is not always
starting when calling. Introduce audio stream connections to avoid
race condition and improve handling of audio start and stop operations.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-01-14 11:03:47 +01:00
Hubert Chrzaniuk
1bdc829588 [EGD-5086] Change audio device switching logic
Upon hardware change event, audio profile had been switched multiple
times forcing redundant initializations of all related objects. Logic
has been optimized and prepared for further refactor. Now upon hardware
event objects are initialized exactly once.
2021-01-11 09:48:52 +01:00
Hubert Chrzaniuk
10e46cbbbc [EGD-5061] Fix lack of audio during call
Audio might have not work if audio streams
were reused. This was fixed by introducing proper
cleaning procedures.
2020-12-23 11:23:53 +01:00
Hubert Chrzaniuk
bb6989c2a8 [EGD-4978] Add Bluetooth virtual audio device
Bluetooth audio device requires different handling than other
audio devices. The commit adds proxy device that does not
handle requests itself but instead sends requests too Bluetooth
service.
2020-12-21 13:46:40 +01:00
Hubert Chrzaniuk
6b36d35507 [EGD-5009] Change messy callback logic in audio module
Refactor audio module to use only one callback for communication
with audio service. This also simplifies the logic and removes
necessity to define defaults for audio values in multiple places.
2020-12-18 14:52:57 +01:00
Marcin Smoczyński
871b250d86 [EGD-4534] Change audio data path synchronization
Refactor audio data path to fix several synchronization issues and
excessive copy operations on large memory blocks. Introduce
audio::Stream data structure to allow connecting audio source and sink
with a zero-copy capability.

Introduce system mechanisms:
 - critical section guard lock needed for stream synchronization
 - non-cacheable memory allocator to allocate memory for DMA safe
   buffers

Update the Googletest CMake template to match the capabilities of the
Catch2 template.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
Signed-off-by: Hubert Chrzaniuk <hubert.chrzaniuk@mudita.com>
2020-12-17 12:20:40 +01:00
Szymon Mroczek
8d9719e8b9 [EGD-3510] audio codec configuration for headset microphone (#1004)
[EGD-3510] Audio stereo outputs fixed. Microphone bias handling for headset. Headset microphone gain adjusted.
2020-11-13 13:51:30 +01:00
Hubert Chrzaniuk
691ca41c1f [EGD-4378] Fix audio bugs (#1003)
* fix - call ear-speaker does not work
* fix - BT sink state is not stored
2020-11-12 16:39:44 +01:00
Hubert Chrzaniuk
7ccc52c04c [EGD-4357] Improve error handling in audio (#990)
- error code can be now returned also during
   initialization
 - fixed crash when user requested to playback
   file that does not exist
2020-11-12 16:15:42 +01:00
Hubert Chrzaniuk
b7e1a04a12 [EGD-4301] Bluetooth Audio profile support (#984)
- implemented audio sink/source switching
 - reorganized / renamed sound events
 - moved SetBluetoothStreamData and AudioDevice instance to base Operation class
 - added audio profiles RecordingBluetoothHSP, RoutingBluetoothHSP
 - removed unused audio Profiles
 - removed redundant OutputPath and InputPath classes from CodecParamsMAX98090
2020-11-09 17:53:28 +01:00
Marcin Smoczyński
481c4238bf [EGD-4004] audio: fix routing synchronization (#880)
Protect copying to buffers with mutex locks. Fix C style copying.

Add sanity checks to detect synchronization issues when routing.
2020-10-28 11:01:58 +01:00
Hubert Chrzaniuk
4c22ef5107 [EGD-4099] BT set stream (#846) 2020-10-20 13:43:53 +02:00
Radoslaw Wicik
2276ceed67 [EGD-3743] Update copyrights in fies 2020-10-20 12:55:10 +02:00
Hubert Chrzaniuk
78f075712c [EGD-4023] Vibration - get values from DB (#807) 2020-10-15 10:16:58 +02:00
Hubert Chrzaniuk
ebcef7a692 [EGD-4054] Audio API for setting stream parameters (#826) 2020-10-15 09:27:15 +02:00
Marcin Smoczyński
2cff347326 [EGD-4002] audio: remove phone call recording (#794)
There is no requirement for this functionality and it complicates the
audio subsystem.

Fix includes and cleanup minor flaws in the process of this change.
2020-10-07 15:49:40 +02:00
Jakub Pyszczak
2df98eea48 [EGD-3841] Add audio vibration and enable sound option 2020-10-06 17:06:34 +02:00
Hubert Chrzaniuk
f38960e1b3 [EDG-3870] Fix audio looping (#769) 2020-10-05 16:56:19 +02:00
hubert-chrzaniuk
b327fc36e2 [EGD-3778] Add priorities and sound mux to audio system (#726) 2020-09-28 11:50:13 +02:00
jimmorrisson
7b626ce755 [EGD-3098] Add audio volume control per functionality. 2020-09-20 13:41:19 +02:00
jimmorrisson
63685f9247 [EGD-3097] Add storing and updating audio settings in database. 2020-09-11 12:06:03 +02:00
Szymon Mroczek
88e928c2f2 [EGD-3426] Audio buffers handling fixed to eliminate sending uninitialized data. This eliminates loud noise on start of a call. 2020-08-21 08:56:33 +02:00
Szymon Mroczek
4321151252 [EGD-3099] StartRecording and StopRecording APIs converted to return RetCode instead of dummy int32_t 2020-07-29 09:08:49 +02:00
Szymon Mroczek
217148cf43 [EGD-3099] SwitchProfile and SendEvent APIs converted to return RetCode instead of dummy int32_t 2020-07-29 09:08:49 +02:00
Szymon Mroczek
151c804b2e [EGD-3099] Volume and Gain APIs converted to return RetCode instead of dummy int32_t 2020-07-29 09:08:49 +02:00
Szymon Mroczek
8d7b2a4eb8 [EGD-3099] Resume API converted to return RetCode instead of dummy int32_t 2020-07-29 09:08:49 +02:00
Szymon Mroczek
1aca6706f6 [EGD-3099] Pause API converted to return RetCode instead of dummy int32_t 2020-07-29 09:08:49 +02:00
Szymon Mroczek
b2894c596d [EGD-3099] Stop API converted to return RetCode instead of dummy int32_t 2020-07-29 09:08:49 +02:00
Szymon Mroczek
eb3fd9c4c6 [EGD-3099] Start API converted to return RetCode instead of dummy int32_t 2020-07-29 09:08:49 +02:00
alek
cb0f0b2a9b [EGD-3095] added audio workers synchronization mutexes
Added incoming call ring tone.
2020-07-23 23:58:29 +02:00
Adam Dobrowolski
4a61f400e7 EGD-3055 Fixed printf issues 2020-04-08 12:23:53 +02:00
Przemyslaw Brudny
c0822b6658 [EDG-3019] Moved log.hpp and debug.hpp into main PurePhone repo 2020-03-24 15:55:32 +01:00