Fix of the issue that the device would crash
when entering alarm sound selection list
after deleting selected file during alarm
ringing, but only when file's format was
WAV.
Fix of the issue that improper check
of dr_mp3 library initialization
success could result in double-free
of library internals in case
initialization was unsuccessful.
* 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 when trying to play
files with large ID3V2 metadata the
playback would start with significant
delay of several seconds. It was also
possible to leave relaxation progress
window without stopping the playback.
Since a currently played file is deleted, the player
goes to the next file from the list. A special case:
if the deleted file is the last one, the playback
stops (and can be resumed by the user).
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.
Fix of the issue that after disconnecting
BT A2DP device during music playback
and reconnecting it without leaving
music player app the sound was not
audible anywhere.
Additionally unified behaviour of music
playback on connection/disconnection
of audio devices.
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
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>
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>
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>
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>
Verify stack usage of:
- ServiceAudio
- application music player
- decoder worker
Change if possible to a realistic value keeping a 30% margin.
Stack usage reduction is limited due to an extensive stack usage of
every call to the filesystem, which uses around 2 kB of stack.
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>
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.
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>
* 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
* Timers now are Application thread safe
* Timers now have consistent API independend of Application (no more c style timers)
* Timers can have either: callback or override onTimer() method - this
way we can create more complicated timers or just use existing ones
* gui::Timer added via adapter class GuiTimer to decouple sys::Timer
with gui::Timer
* Fixed race in wrapper
* Updated docs
* fixed using std and cpp_freertos and DataReceivedHandler hidden in Application.hpp