* Fix of the issue that 'File has been
deleted' popup would show in Relaxation
app at the end of playback if the
playback was paused at least once,
even though the file wasn't actually
deleted.
* Added very basic audio decoder error
handling and propagation mechanism.
* Minor refactor around several
audio-related parts.
Fix of the issue that caused system crash when
trying to play 96kHz FLAC file with USB cable
connected. The reason of the issue was the lack
of FreeRTOS heap space left, what caused
pvPortMalloc() to fail when allocating
memory for stream buffer.
Additionally minor code cleanup.
Increasd io stream buffers:
- 64kB for big files with short lifetime scope
- 16kB for big files with long lifetime scope
- 1kB - dont changes default forr the rest
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>
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>
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>
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>
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>
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.
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>