Commit Graph

10 Commits

Author SHA1 Message Date
Lefucjusz
1d807644c9 [MOS-882] Fix heap fragmentation issue during playback
Fix of the heap fragmentation issue that caused
phone crash when trying to play music files
while connecting USB cable in a certain order.
Audio stream buffering length was slightly
reduced, so that smaller contiguous block of
heap is required to store audio buffer.
2023-01-25 13:24:36 +01:00
Lefucjusz
d28fdb6594 [MOS-882] Fix FLAC file playback with USB cable connected
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.
2023-01-20 10:50:06 +01:00
Mateusz Piesta
2f42cd5e73 [BH-1424] FreeRTOS update
Updated FreeRTOS source code to 10.4.6.
Moved FreeRTOS sources to the third-party directory.
Added necessary changes to the CMake configuration.
Split FreeRTOSConfig.h. From now, each board has its own.
Added missing log headers.
Minor refactor of the module-os cmake.
Fixed stack overflows in bell application main and time service.
2022-04-07 13:31:28 +02:00
Marcin Smoczyński
e993a0b928 [EGD-6857] Fix HSP audio quality
Fixed HSP sound quality issues:
 - fixed HF caused by invalid output block size during interpolation of
   the bluetooth input,
 - increased block size to increase time send interval to 8ms

Fixed issue with error handling when writing to overflowed stream.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-11-15 20:20:45 +01:00
Mateusz Grzegorzek
34a0d6109a [BH-393] Create separate math lib
Create separate math lib from Math.hpp file.
2021-06-14 11:36:19 +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
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
9cf397d192 [EGD-6497] Add audio transcoding framework
Add a mechanism to apply a data transform on the stream's input. An
example mono to stereo transform is provided.

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-04-23 07:29:18 +02:00
Marcin Smoczyński
b890bcd6e3 [EGD-5260] Add A2DP playback to audio
Add basic playback capability using Bluetooth A2DP profile.
Only stereo/44100/16bit files are supported at the moment

Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
2021-03-25 01:01:35 +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