Commit Graph

6 Commits

Author SHA1 Message Date
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
Marcin Smoczyński
8b21df135c [EGD-5742] Add audio format checking
Check if decoder's file format is supported by the sink audio device
before playing the sound. Add list of supported formats to each of audio
devices.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-04-12 10:00:00 +02: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
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