From e0f57e523112e1bc73a04e8615d7a21355f0ce0e Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Tue, 4 Dec 2018 23:11:20 +0100 Subject: Add support for bluetooth telephony This adds support for bluetooth telephony. A big rework in the softmixer internals has been mandatory, in order to support dynamic streams creation and deletions. Bluetooth telephony relies on the recent evolutions of bluez-alsa, the most important one being the support of HFP over Ofono. The softmixer opens PCM ioplugs provided by bluez-alsa. Bluetooth SCO needs 2 streams, one for listening and the other for talking. These streams are created upon requests sent by the hal-manager. The hal manager subscribes for bluez-alsa events and request the list of availalble transports. For each "attach" transaction verb, the softmixer maintains a list of the all created objects (sources, sinks, zones, ramps, streams, and more) Additionnally, it creates a new verb when the attach succeeds, that verb is typically something like "sco_XX:XX:XX:XX:XX:XX", and the only supported action at the present time is {"action":"remove"}, that performs all the cleanup of the registered objects. Change-Id: I1b119e6c079e60daf771e63c083a1ef33a39f379 Signed-off-by: Thierry Bultel --- plugins/alsa/alsa-ringbuf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/alsa/alsa-ringbuf.c') diff --git a/plugins/alsa/alsa-ringbuf.c b/plugins/alsa/alsa-ringbuf.c index 476222c..2dd1d0d 100644 --- a/plugins/alsa/alsa-ringbuf.c +++ b/plugins/alsa/alsa-ringbuf.c @@ -3,8 +3,14 @@ alsa_ringbuf_t * alsa_ringbuf_new(snd_pcm_uframes_t capacity, size_t frameSize) { alsa_ringbuf_t * rb = malloc(sizeof(alsa_ringbuf_t)); + if (!rb) + goto fail; + rb->rbuf = ringbuf_new(capacity*frameSize); + if (!rb->rbuf) + goto fail; rb->frameSize = frameSize; +fail: return rb; } -- cgit 1.2.3-korg