0

I have an external USB-Bluetooth-Dongle plugged to my Pi and a Bluetooth Speaker (with microphone) that is connected via the dongle.

I manually compiled blueZ to version 5.50 and bluealsa to version 1.3.1

Currently my ~/.asoundrc file looks like this:

pcm.!default {
    type plug
    slave {
            pcm {
                    type bluealsa
                    device E4:22:A5:58:09:95
                    profile "a2dp"
            }
    }
    hint {
            show on
            description "Calisto"
    }
}
ctl.!default {
    type bluealsa
}

Connecting with the device and playing audio or recording audio do work when I am using aplay or arecord. As I configured the Bluetooth device to be the default device, I can do this by:

aplay soundfile.wav

Also setting the volume of the speakers works when using alsamixer and the BT-Speakers are set as default speakers.

My problems start when using Linphone. When using linphone v 3.6.1 I get some ALSA-related error messages at startup:

ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters 0
ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL default:0
ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters 1
ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL default:1

When showing the systems soundcards via soundcard list the output is:

0: ALSA: default device
1: ALSA: bcm2835 ALSA
2: PulseAudio: default

With soundcard use I tried to use index 0 and 1 as sounddevice, but in both cases I had no sound when someone was calling me. What I then did was to add a loopback-device via:

 sudo modprobe snd-aloop

And then changed my .asoundrc to:

pcm.looptest {
        type plug
        slave {
                pcm {
                        type bluealsa
                        device E4:22:A5:58:09:95
                        profile "a2dp"
                }
        }
        hint {
                show on
                description "Calisto"
        }
}
ctl.looptest {
        type bluealsa
}

defaults.pcm.card 1
defaults.pcm.device 0

Then I also start alsaloop -C "hw:Loopback,1,0" -P "looptest" -t 500000 in another console window.

The new loopback-device gets listed by linphones soundcard list

linphonec> soundcard list
0: ALSA: default device
1: ALSA: bcm2835 ALSA
2: ALSA: Loopback
3: PulseAudio: default

And when selecting the loopbackdevice as soundcard, and calling the Pi, the sound output with the Bluetooth speakers is working but no sound of the Pi is transmitted to the caller. This is obvious, as alsaloop is only configured to playback what was sent to the loopdevice. But when switching the sides and try using alsaloop -P "hw:Loopback,1,0" -C "looptest" -t 500000 I am getting the following error message:

../../../src/asound/../shared/ctl-client.c:107: Connecting to socket: /var/run/bluealsa/hci0
../../../src/asound/../shared/ctl-client.c:237: Getting transport for E4:22:A5:58:09:95 type 0x81
ALSA lib ../../../src/asound/bluealsa-pcm.c:679:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA transport: No such device or address
capture looptest open error: No such device or address
Loopback initialization failure.

How to solve this problem of transmitting the voice of my bluetooth device to the loopback device (or maybe there is another better way of doing this without alsaloop which I am not aware of?)? I found this question which seems to be somehow related to my problem, but I do not understand the answer (probably because my knowledge about sound in Linux is too bad...)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.