aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-plug-vol.c
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2018-12-04 23:11:20 +0100
committerThierry Bultel <thierry.bultel@iot.bzh>2018-12-19 23:09:21 +0100
commite0f57e523112e1bc73a04e8615d7a21355f0ce0e (patch)
tree19198c38d7433862cee733fde3efca8170228279 /plugins/alsa/alsa-plug-vol.c
parent7df040a3742af8d800852dd39f8e921cd82a4cf2 (diff)
Add support for bluetooth telephonyguppy_6.99.3guppy/6.99.36.99.3
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 <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins/alsa/alsa-plug-vol.c')
-rw-r--r--plugins/alsa/alsa-plug-vol.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/plugins/alsa/alsa-plug-vol.c b/plugins/alsa/alsa-plug-vol.c
index ce4627a..67400a5 100644
--- a/plugins/alsa/alsa-plug-vol.c
+++ b/plugins/alsa/alsa-plug-vol.c
@@ -22,16 +22,27 @@
ALSA_PLUG_PROTO(softvol); // stream uses softvol plugin
+PUBLIC void AlsaDeleteSoftvol(SoftMixerT *mixer, AlsaPcmCtlT * ctl) {
+
+}
+
PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *stream, char* slaveid, AlsaSndCtlT *sndcard, char* ctlName, int max, int open) {
snd_config_t *streamConfig, *elemConfig, *slaveConfig, *controlConfig,*pcmConfig;
- AlsaPcmCtlT *pcmVol= calloc(1,sizeof(AlsaPcmCtlT));
+ char *cardid = NULL;
int error = 0;
-
- AFB_ApiInfo(mixer->api, "%s create SOFTVOL on %s", __func__, slaveid);
+ AlsaPcmCtlT *pcmVol = NULL;
- char *cardid = NULL;
- if (asprintf(&cardid, "softvol-%s", stream->uid) == -1)
+ AFB_ApiDebug(mixer->api, "%s create SOFTVOL on %s", __func__, slaveid);
+ if (asprintf(&cardid, "softvol-%s", stream->uid) == -1) {
+ SOFTMIXER_NOMEM(mixer->api);
goto OnErrorExit;
+ }
+
+ pcmVol = AlsaPcmCtlNew(mixer, cardid);
+ if (pcmVol == NULL) {
+ SOFTMIXER_NOMEM(mixer->api);
+ goto OnErrorExit;
+ }
pcmVol->cid.cardid = (const char *) cardid;
@@ -82,6 +93,8 @@ PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *strea
goto OnErrorExit;
}
+ stream->softvolConfig = streamConfig;
+
// Debug config & pcm
//AlsaDumpCtlConfig (mixer, "plug-config", pcmConfig, 1);
AlsaDumpCtlConfig(mixer, "plug-softvol", streamConfig, 1);