aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa
diff options
context:
space:
mode:
authorFrederic Marec <frederic.marec@iot.bzh>2019-05-22 15:20:47 +0200
committerWalt Miner <walt@linux.com>2019-05-24 13:48:19 +0000
commit40aa428a3dff2c8d731d27d0867ff96e95dec938 (patch)
treecd84a73c6efa0d6eaf3122430e3cc9bbae356296 /plugins/alsa
parent8929f4ec3744b9cc1ff5facdb0ff15ea9dd2aca1 (diff)
4a-softmixer: remove AVIRT dependencieshalibut_7.99.1halibut/7.99.17.99.1
Remove AVIRT dependencies when you build on host Bug-AGL: SPEC-2443 Change-Id: I4bf8f39e843d552337fafcdbebe4c82a2290b24e Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
Diffstat (limited to 'plugins/alsa')
-rw-r--r--plugins/alsa/alsa-api-loop.c12
-rw-r--r--plugins/alsa/alsa-api-streams.c1
2 files changed, 10 insertions, 3 deletions
diff --git a/plugins/alsa/alsa-api-loop.c b/plugins/alsa/alsa-api-loop.c
index a4595dc..b3b96ed 100644
--- a/plugins/alsa/alsa-api-loop.c
+++ b/plugins/alsa/alsa-api-loop.c
@@ -19,7 +19,11 @@
#define _GNU_SOURCE // needed for vasprintf
#include "alsa-softmixer.h"
+
+#ifdef HAVE_AVIRT
#include <avirt/avirt.h>
+#endif
+
#include <string.h>
#define UID_AVIRT_LOOP "AVIRT-Loopback"
@@ -157,7 +161,7 @@ STATIC AlsaLoopSubdevT *ProcessOneAvirtSubdev(SoftMixerT *mixer, AlsaSndLoopT *l
AFB_API_ERROR(mixer->api, "%s: No zones defined!", __func__);
goto OnErrorExit;
}
-
+#ifdef HAVE_AVIRT
error = snd_avirt_stream_new(uid, zone->ccount,
SND_PCM_STREAM_PLAYBACK, "ap_loopback", false);
if (error < 0) {
@@ -166,7 +170,7 @@ STATIC AlsaLoopSubdevT *ProcessOneAvirtSubdev(SoftMixerT *mixer, AlsaSndLoopT *l
__func__, mixer->uid, uid, error);
return NULL;
}
-
+#endif
AlsaLoopSubdevT *subdev = calloc(1, sizeof (AlsaPcmCtlT));
subdev->uid = NULL;
subdev->index = index;
@@ -331,6 +335,7 @@ STATIC AlsaSndLoopT *AttachOneLoop(SoftMixerT *mixer, const char *uid, json_obje
goto fail_snd_card_ctl;
}
} else { // loop->avirt == true
+#ifdef HAVE_AVIRT
AFB_API_NOTICE(mixer->api, "nbStreams: %d max.streams: %d", mixer->nbStreams, mixer->max.streams);
if (mixer->nbStreams >= mixer->max.streams)
@@ -373,6 +378,7 @@ STATIC AlsaSndLoopT *AttachOneLoop(SoftMixerT *mixer, const char *uid, json_obje
__func__, mixer->uid, uid, loop->uid, loop->sndcard->cid.devpath, loop->sndcard->cid.cardid);
goto fail_snd_card;
}
+#endif
}
AFB_API_NOTICE(mixer->api, "%s, uid %s DONE", __func__, uid);
@@ -415,8 +421,10 @@ static void loopDestroy(SoftMixerT * mixer, void* arg) {
mixer->nbLoops--;
cds_list_del(&loop->list);
+#ifdef HAVE_AVIRT
if (loop->avirt)
snd_avirt_card_unconfigure();
+#endif
free(loop);
AFB_API_DEBUG(mixer->api, "DONE !");
diff --git a/plugins/alsa/alsa-api-streams.c b/plugins/alsa/alsa-api-streams.c
index 21e36eb..326efa4 100644
--- a/plugins/alsa/alsa-api-streams.c
+++ b/plugins/alsa/alsa-api-streams.c
@@ -19,7 +19,6 @@
#define _GNU_SOURCE // needed for vasprintf
#include "alsa-softmixer.h"
-#include <avirt/avirt.h>
#include <string.h>
#include <stdbool.h>