From 67299f948f40afc2d506ba92e78d7066ea925485 Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Wed, 16 Jan 2019 14:07:21 +0100 Subject: bluetooth sco: fixed the softvol open error This fixes #SPEC-2125. The fix consists in specifying the number of channels in the softvol pcm configuration. When it is not set, the libasound detects a configuration mismatch (the default number of channels being 2), and attempts to remove the sotfvol control, which for unknown reason, (broken support on kernel side ?) randomly fails. Change-Id: I816b623715e413452e6793ee519e97fac6fdde43 Signed-off-by: Thierry Bultel --- plugins/alsa/alsa-plug-vol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/alsa/alsa-plug-vol.c') diff --git a/plugins/alsa/alsa-plug-vol.c b/plugins/alsa/alsa-plug-vol.c index 67400a5..09025c4 100644 --- a/plugins/alsa/alsa-plug-vol.c +++ b/plugins/alsa/alsa-plug-vol.c @@ -32,7 +32,7 @@ PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *strea int error = 0; AlsaPcmCtlT *pcmVol = NULL; - AFB_ApiDebug(mixer->api, "%s create SOFTVOL on %s", __func__, slaveid); + AFB_ApiDebug(mixer->api, "%s create SOFTVOL on %s (nb channels=%d)", __func__, slaveid, stream->params->channels); if (asprintf(&cardid, "softvol-%s", stream->uid) == -1) { SOFTMIXER_NOMEM(mixer->api); goto OnErrorExit; @@ -70,6 +70,8 @@ PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *strea error += snd_config_add(controlConfig, elemConfig); error += snd_config_imake_integer(&elemConfig, "card", sndcard->cid.cardidx); error += snd_config_add(controlConfig, elemConfig); + error += snd_config_imake_integer(&elemConfig, "count", stream->params->channels); + error += snd_config_add(controlConfig, elemConfig); error += snd_config_add(streamConfig, controlConfig); if (error) goto OnErrorExit; -- cgit 1.2.3-korg