summaryrefslogtreecommitdiffstats
path: root/plugins/lib/bluealsa/hal-bluealsa.c
AgeCommit message (Collapse)AuthorFilesLines
2019-02-18bluealsa plugin: do not do anything when the HAL is not readyThierry Bultel1-7/+21
Change-Id: Ifad933c3c5f574aad437a59708c01c6d674dc914 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-02-13bluealsa plugin: get the sampling rate from the transportThierry Bultel1-7/+28
The sampling rate, for both SCO and A2DP, had been harcoded for convenience. But this is not a constant, because it depends on the connected handset. This commit retrieves the sampling rate for each new transport and uses that information as a parameter for the stream creation in the softmixer. Change-Id: I4d30eccba9cc63d7f4e618c571719996a136b4f5 Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-02-07hal-bluealsa: fixes the abort due to sync call in io eventhalibut_7.90.0halibut/7.90.07.90.0Thierry Bultel1-17/+4
The binder does not accept that synchronous calls are performed in the context of a systemd event, it makes is abort. To solve that, synchronous calls for creating/deleting bluetooth streams in the softmixer are simply here replaced by asynchronous calls. BUG-AGL: SPEC-2162 Change-Id: I4916d11cc904622449930365c5c09f67fe74425f Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-01-29bluealsa plugin: monitor the state of service via dbusThierry Bultel1-24/+210
By monitoring the changes of names on dbus, and by asking dbus for the list of available names at startup, the bluealsa plugin can now be started at whatever time, and is also robust to bluealsa restarts. Moreover, since the bluealsa name has the HCI interface has a suffix (org.bluez-alsa.hci0, for instance), there is not need to hardcode the hci name. Even better, the plugin supports several instances of bluealsa (since the daemon needs one instace per hci device), and will add a watch for added transports for every instance it detects. Complete cleanup of the created streams in softmixer is done when one watched instance disappears. Finnaly, there is a new cmd line '-DWITHOUT_BLUEALSA' option to CMake, for developpers that want to use 4A on host, without the bluealsa library. Default build (SDK, bitbake) consider that the bluealsa shared library is always available. Notice that in the future, the bluealsa library might disappeared, to be replaced by a full dbus interface to bluealsa. BUG-AGL:SPEC-2126 Change-Id: I67fc6edf5147c71dc97f1fc1257d3dadbdde20fc Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
2019-01-28Migrate to newer application framework callsJonathan Aillet1-2/+2
Migrate from 'afb_api_call_sync_legacy' function to 'afb_api_call_sync' function, therefore, handle function return and response json differently from before. Change-Id: Ia7fb42188b8d41e22db2d824459a0d10ed6d6a8e Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2019-01-28Move from controller functions to afb functionsJonathan Aillet1-35/+35
Move from controller 'afb-definitions.h' functions to application framework 'afb/afb-binding.h' functions. Change-Id: I4cd62af881ef8ac949b082ede9dfcc4736d1e12c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
2018-12-20Adds support for bluetooth audio through bluez-alsaguppy_6.99.4guppy_6.99.3guppy/6.99.4guppy/6.99.36.99.46.99.3Thierry Bultel1-0/+723
Implements a new bluealsa plugin to the HAL manager, reacting to the changes of the available transports. This plugin is linked with the new bluealsa.so shared library. New transports (SCO & A2DP) result in softmixer invocations of the "attach" verb, that creates the new capture (eg, A2DP capture from bluealsa ioplug PCM, SCO microphone capture), playbacks (SCO playback to a softmixer zone, and SCO output to bluealsa iogplug PCM). When a transport disappears, the hal manager calls the transaction deletion verb that will tell the softmixer to remove the created streams and associated objects. Change-Id: I36037a4f14ef7fee38070fc0df66c40b4ce46e8b Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>