Fix for the loudspeaker becomes active again when a headset is unplugged
if it was on while the headset was connected to the phone.
Fix typo in Bluetooth in EventType enum.
Fix of the issue that connecting or
disconnecting BT device while call
was in progress resulted in no sound
being heard anywhere due to audio
routing being stopped when HFP device
disconnected.
Additionally minor code cleanup.
Now, both profiles can operate separately. Additonally, minor
fixes has been applied to allow calling via car audio system.
Some infotainment systems still don't work though.
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>
Adapted both codec and HFP profile to be able to work together.
Now it's possible to stream 2-way audio via HFP profile, but it
has to be integrated properly with EGD-7405
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>
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>
Fix microphone mute during the phone call.
Previously phone would unmute on:
- connecting/disconnecting a jack
- turning loudspeaker on/off
- switching to the bt 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>
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.
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.
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.
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>
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.