summaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-core-ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/alsa/alsa-core-ctl.c')
-rw-r--r--plugins/alsa/alsa-core-ctl.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/alsa/alsa-core-ctl.c b/plugins/alsa/alsa-core-ctl.c
index d128b6c..01e560f 100644
--- a/plugins/alsa/alsa-core-ctl.c
+++ b/plugins/alsa/alsa-core-ctl.c
@@ -25,6 +25,8 @@ for the specific language governing permissions and
#define _GNU_SOURCE // needed for vasprintf
#include "alsa-softmixer.h"
+#include "alsa-bluez.h"
+
#include <pthread.h>
#include <sys/syscall.h>
@@ -279,12 +281,22 @@ OnErrorExit:
// Clone of AlsaLib snd_card_load2 static function
-PUBLIC snd_ctl_card_info_t *AlsaCtlGetInfo(SoftMixerT *mixer, const char *cardid) {
+PUBLIC snd_ctl_card_info_t *AlsaCtlGetCardInfo(SoftMixerT *mixer, const char *cardid) {
int error;
snd_ctl_t *ctl;
AFB_ApiNotice(mixer->api, "Looking for card '%s'", cardid);
+ /* "bluealsa" is the name of the control external plugin
+ * (https://www.alsa-project.org/alsa-doc/alsa-lib/ctl_external_plugins.html)
+ */
+ if (strstr(cardid, "bluealsa")) {
+ cardid="bluealsa";
+ alsa_bluez_init();
+ }
+
+ AFB_ApiNotice(mixer->api, "Opening card control '%s'", cardid);
+
if ((error = snd_ctl_open(&ctl, cardid, SND_CTL_READONLY)) < 0) {
cardid = "Not Defined";
goto OnErrorExit;
@@ -627,6 +639,8 @@ OnErrorExit:
PUBLIC int AlsaCtlRegister(SoftMixerT *mixer, AlsaSndCtlT *sndcard, AlsaPcmCtlT *pcmdev, RegistryNumidT type, int numid) {
int index;
+ AFB_ApiInfo(mixer->api,"%s: %d!\n", __func__, numid);
+
for (index = 0; index < sndcard->rcount; index++) {
if (!sndcard->registry[index]) break;
}