Commit Graph

144 Commits

Author SHA1 Message Date
Hubert Chrzaniuk
bb76fe4080 [EGD-5713] Change volume hardware buttons behaviour
The volume button policy has been redesigned to be less
ambiguous for the user.
2021-03-01 13:54:39 +01: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
Hubert Chrzaniuk
4490d0da7f [EGD-5714] Add phone mode handling for Audio Service
Added separate set of settings for all phone modes along
with basic support for phone mode change.
2021-02-24 13:00:43 +01:00
Wiktor S. Ovalle Correa
fe72169338 [EGD-5737] Merge master into experimental
Synchronize with master before merging
2021-02-23 18:10:52 +01:00
Hubert Chrzaniuk
18f9227fce [EGD-5716] Change sound priorities
Sound API has been extended with new playback types.
2021-02-19 12:37:45 +01:00
Wiktor S. Ovalle Correa
c7b7cc4c27 [EGD-5737] Merge master into experimental
Keep experimental up to date with changes from master
2021-02-17 17:10:32 +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
f7a6b72006 [EGD-4342] Remove audio profile db callback
This callback is not needed.
2021-02-16 11:49:42 +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
e9de840a51 [EGD-5290] Fix on audio on voice call
Due to an error in the stream's block reservation, when the stream was
full, SAI was trying to read data to an unitialized data span randomly
disabling audio channel.

Fix the problem by overwriting data after the peek position, always
returning valid data span.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-02-01 22:01:56 +01:00
Radoslaw Wicik
d14e40d378 [EGD-4831] Add license headers to c, h and sql files
Add license headers to `h`, `c` and `sql` files as this files haven't
been checked previously, script now to automatically updates current
year in existing licenses.
2021-01-28 14:41:33 +01:00
Hubert Chrzaniuk
fc5ab3a70c [EGD-5325] Remove using namespace directives from headers
"Using namespace" directive should not be added in headers
because this practice pollutes source files.
2021-01-22 11:25:45 +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
Hubert Chrzaniuk
f69384525a [EGD-4332][EGD-4482] Fix playback of mono sound in headphones (#1080)
Addressed problem - when playing files containing only one
audio channel the sound could be heard in only one speaker.
2020-11-26 09:46:30 +01:00
Bartosz Cichocki
50f28e8f19 [EGD-4270] updated test API, added sending message case in test harness (#1042)
[EGD-4270] build fix for GCC 10

Co-authored-by: SP2FET <bartosz.cichocki@mudita.com>
2020-11-19 13:02:06 +01:00
jimmorrisson
70126e07ac [EGD-4439] New filesystem handling - module audio. (#1037)
[EGD-4439] Taglib revision update
2020-11-19 10:18:24 +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
Piotr Tanski
57c7672f8f [EGD-4366] Global data cleanup. (#999) 2020-11-13 10:16:40 +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
Radoslaw Wicik
b96313b158 [EGD-4215] Convert service-bluetooth to library 2020-11-10 09:56:06 +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
486d21af0e [EGD-4288] refactor global data (#959)
Reduce firmware size by refactoring global data defined in public
headers.

Each global variable which require runtime initialization adds
initialization code to every translation unit which includes the header
where the variable is defined and declared.
2020-11-04 18:24:39 +01:00
Lucjan Bryndza
0a407135e5 [EGD-4181] move taglib from audio (#932)
* [EGD-4181] Move submodule taglib to utils

* [EGD-4181] LibTag moved to util lib.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-10-30 12:41:46 +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
Lucjan Bryndza
bf2609524c [EGD-4075] Use FATFS in the Linux builds (#843)
* [EGD-4075] Use FAT fs in the emulator

Add script for genrate base phone image

* [EGD-4075] Use FreeRTOS-FAT in emulator initial commit

* [EGD-4075] Thread local storage fix

Fixing thread local storage when running on the
Linux platform in the test mode

* [EGD-4075] Improve image generation

Improve image generation script on the linux platform

* [EGD-4075] Fix all test with FAT fs image

Fix all tests with fatfs image

* [EGD-4075] Fix calculator utility test

* [EGD-4075] Image dependencies fix

* Remove uneeded comments

* Missing headers in CR

* [EGD-4075] Fixed whitespaces

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-10-22 10:34:12 +02:00
Bartosz Cichocki
061479780b [EGD-4011] added BT audio device with A2DP playback (#870)
Co-authored-by: SP2FET <bartosz.cichocki@mudita.com>
2020-10-22 09:59:13 +02:00
Radosław Wicik
1d62ecd942 [EGD-3852] Add missing virtual destructor (#876) 2020-10-21 11:34:30 +02:00
Hubert Chrzaniuk
4c22ef5107 [EGD-4099] BT set stream (#846) 2020-10-20 13:43:53 +02:00
Przemyslaw Brudny
e131dae68f [EGD-3743] Removed old doxygen copyright statements from project. 2020-10-20 12:55:10 +02:00
Radoslaw Wicik
2276ceed67 [EGD-3743] Update copyrights in fies 2020-10-20 12:55:10 +02:00
Marcin Smoczyński
2635367efb [EGD-4003] audio: fix workers destroying (#806)
Improve workers destroying by replacing sudden death with a gentle close
request.

Make (De)Init static - when creating second instance of a codec there
was a situation when destructing one instance was causing first one to
stop working, because they share common hardware resources.
2020-10-20 11:02:40 +02:00
Hubert Chrzaniuk
4ad16d7ae2 [EGD-4125] Cumulative set of minor fixes for audio (#861)
* fixed choice of input for recording
* fixed vibration setting getter
* fixed response messages from a HandleStop
* improved style of using AudioMux APIs
2020-10-19 17:16:59 +02:00
Hubert Chrzaniuk
8c748a39b2 [EGD-4100] Fix playback restart on audio profile change (#848) 2020-10-16 13:53:57 +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
Bartek Cichocki
305d43a176 [EGD-3773] added A2DP playback backend 2020-10-14 09:23:53 +02:00
Hubert Chrzaniuk
b6e5969403 [EGD-4024] Fix audio files meta tags parsing (#817) 2020-10-13 19:34:58 +02:00
Adam Dobrowolski
7b4a706cd6 EGD-4036 Application windows - added register mechanism
* Moved ApplicationLauncher to separate files - declutering
* WindowsStore renamed to WindowsFactory - Store needs to be splitted toavoid antipattern
* Options window build dynamically onBeforeShow
* Dialog windows dynamically built
2020-10-13 17:46:10 +02:00
Hubert Chrzaniuk
9c7e4139db [EGD-3784] Add service audio non blocking API (#789) 2020-10-08 10:15:46 +02:00
Lucjan Bryndza
0014dae259 [EGD-3854] Removing goto's from the code (#797)
It is generic cleanup task for removing all goto files

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
2020-10-08 08:58:49 +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
17aa46bb90 [EGD-3871] Add vibration and playback enable/disable logic (#765) 2020-10-05 17:28:29 +02:00