aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/alsa/alsa-api-loop.c11
-rw-r--r--plugins/alsa/alsa-transaction.c21
-rw-r--r--plugins/alsa/alsa-transaction.h1
3 files changed, 30 insertions, 3 deletions
diff --git a/plugins/alsa/alsa-api-loop.c b/plugins/alsa/alsa-api-loop.c
index 7949c63..a4595dc 100644
--- a/plugins/alsa/alsa-api-loop.c
+++ b/plugins/alsa/alsa-api-loop.c
@@ -159,7 +159,7 @@ STATIC AlsaLoopSubdevT *ProcessOneAvirtSubdev(SoftMixerT *mixer, AlsaSndLoopT *l
}
error = snd_avirt_stream_new(uid, zone->ccount,
- SND_PCM_STREAM_PLAYBACK, "ap_loopback");
+ SND_PCM_STREAM_PLAYBACK, "ap_loopback", false);
if (error < 0) {
AFB_API_ERROR(mixer->api,
"%s: mixer=%s stream=%s could not create AVIRT stream [errno=%d]",
@@ -364,7 +364,7 @@ STATIC AlsaSndLoopT *AttachOneLoop(SoftMixerT *mixer, const char *uid, json_obje
goto fail_snd_card;
}
- snd_avirt_card_seal();
+ snd_avirt_card_configure();
// try to open sound card control interface
loop->sndcard->ctl = AlsaByPathOpenCtl(mixer, loop->uid, loop->sndcard);
@@ -414,6 +414,10 @@ static void loopDestroy(SoftMixerT * mixer, void* arg) {
mixer->nbLoops--;
cds_list_del(&loop->list);
+
+ if (loop->avirt)
+ snd_avirt_card_unconfigure();
+
free(loop);
AFB_API_DEBUG(mixer->api, "DONE !");
@@ -428,7 +432,8 @@ static AlsaSndLoopT * loopCreate(SoftMixerT *mixer, const char *uid, json_object
mixer->nbLoops++;
cds_list_add(&newLoop->list, &mixer->loops.list);
- AlsaMixerTransactionObjectAdd(mixer->transaction, newLoop, loopDestroy);
+ /* We need the loops to be at the end of the list, so that they are destroyed last */
+ AlsaMixerTransactionObjectAddTail(mixer->transaction, newLoop, loopDestroy);
loopsDisplay(mixer);
diff --git a/plugins/alsa/alsa-transaction.c b/plugins/alsa/alsa-transaction.c
index c35ea81..f8affa6 100644
--- a/plugins/alsa/alsa-transaction.c
+++ b/plugins/alsa/alsa-transaction.c
@@ -71,6 +71,27 @@ fail:
}
+bool AlsaMixerTransactionObjectAddTail(AlsaMixerTransaction* list, void* object, AlsaTransactionDestructor destructor) {
+ bool ret = false;
+ AlsaMixerTransactionDataItem * newItem = NULL;
+ if (!list)
+ goto fail;
+
+ newItem = (AlsaMixerTransactionDataItem *) malloc(sizeof(AlsaMixerTransactionDataItem));
+ if (newItem == NULL)
+ goto fail;
+
+ CDS_INIT_LIST_HEAD(&newItem->list_entry);
+ newItem->object = object;
+ newItem->destructor = destructor;
+ cds_list_add_tail(&newItem->list_entry, &list->item_list);
+
+ ret = true;
+fail:
+ return ret;
+
+}
+
static void AlsaMixerTransactionDoCleanup(AlsaMixerTransaction* transaction) {
AlsaMixerTransactionDataItem * item, *sav;
diff --git a/plugins/alsa/alsa-transaction.h b/plugins/alsa/alsa-transaction.h
index 6bb5d92..048447d 100644
--- a/plugins/alsa/alsa-transaction.h
+++ b/plugins/alsa/alsa-transaction.h
@@ -30,6 +30,7 @@ extern void AlsaMixerTransactionDelete(AlsaMixerTransaction * transaction);
extern void AlsaMixerTransactionDataListDestroy(AlsaMixerTransaction*);
extern bool AlsaMixerTransactionObjectAdd(AlsaMixerTransaction*, void * object, AlsaTransactionDestructor destructor);
+extern bool AlsaMixerTransactionObjectAddTail(AlsaMixerTransaction* list, void* object, AlsaTransactionDestructor destructor);
extern void AlsaMixerTransactionObjectDelete(AlsaMixerTransaction* list, void * object, bool destructor);
gl-devel" path="meta-agl-devel"/> <project name="AGL/meta-agl-extra" path="meta-agl-extra"/> <project name="AGL/meta-renesas" path="meta-renesas"/> <project name="AGL/meta-renesas-rcar-gen3" path="meta-renesas-rcar-gen3" revision="4fa88fc2e452dd1ca5992cb605b3cd1823ee5316" upstream="morty_bsp_2.19"/> <project name="Freescale/meta-freescale" path="meta-freescale" remote="github" revision="fa774ad7fb797957601a8c9fee45af453fea34b7" upstream="morty"/> <project name="Freescale/meta-freescale-3rdparty" path="meta-freescale-3rdparty" remote="github" revision="1879485e63ce369292c89b5902ff6df13509090b" upstream="morty"/> <project name="Freescale/meta-freescale-distro" path="meta-freescale-distro" remote="github" revision="cd5c7a2539f40004f74126e9fdf08254fd9a6390" upstream="morty"/> <project name="advancedtelematic/meta-updater" path="meta-updater" remote="github" revision="45c155a67d3532ad32342fc512e8bf6341ab9e5d"/> <project name="boundarydevices/meta-boundary" path="meta-boundary" remote="github" revision="d44ee8f58d841cf13fbe63dab271344e2b9ba6db" upstream="morty"/> <project name="kraj/meta-altera" path="meta-altera" remote="github" revision="4364dbfcb600da82ecdfc4797f112d187e40f1c3"/> <project name="meta-intel" remote="yocto" revision="6add41510412ca196efb3e4f949d403a8b6f35d7" upstream="morty"/> <project name="meta-oic" remote="yocto" revision="028a5c234fb9fe51b39db339f7d4250fba978198" upstream="1.2.0"/> <project name="meta-openembedded" remote="openembedded" revision="fe5c83312de11e80b85680ef237f8acb04b4b26e" upstream="morty"/> <project name="meta-qcom" remote="yocto" revision="26380970fbe5e8a04efe8c1098ad45acae0d87e4" upstream="morty"/> <project name="meta-qt5/meta-qt5" path="meta-qt5" remote="github" revision="5f837b47f5c3e462f24cd5abf58ff6ef1dd04932"/> <project name="meta-raspberrypi" remote="yocto" revision="28d4404f89eb59d406b4976c0e3f5ca19137ba74"/> <project name="meta-rust/meta-rust" path="meta-rust" remote="github" revision="a506df4ba4b186e311117d5bdc6a54844583a4fd"/> <project name="meta-ti" remote="yocto" revision="460ce7d0473b88d20fcb3fed3aa0f3acc37c78c9" upstream="master"/> <project name="poky" remote="yocto" revision="fd7f2d644a94bbb951c0bed11af7deb35f1cfb22" upstream="morty"/> </manifest>