Bluez multiple audio sources

bluetoothbluez

With the bluez stack, is it possible to connect multiple audio sources ? How ? If not is it possible by any other means ? If possible, is it possible to mix different bluetooth version like low-energy with old ones ?

If not possible, I think a (costy) solution is to plug multiple (physical) bluetooth receivers behind my (physical) audio mixer ^-^

Background: I'm trying to build a "media server", and I want phones to be able to stream audio to it, but I don't want to hear "please, can you disconnect your [not actually playing music] phone so I can connect mine".

Best Answer

  • There are reports that this should possible, in particular there's a mailing list response from the main developer stating that it can be done through audio.conf. But this file doesn't ship with BlueZ 5 anymore, and the current source code doesn't make any reference to the sections it used to contain (like "[A2DP]" or "[Headset]").

    This might be useful if you are running Bluez 4. This post on the maemo forums (maemo was the main sponsor of the bluetooth audio work in linux I believe) shows a sample audio.conf file with a SourceCount option set to 2. And this AskUbuntu answer says you must set SBCSources, MPEG12Sources and MaxConnected to a number higher than one.

    With BlueZ 5 and Pulseaudio, when I try to connect a second source, it immediately disconnects. Using hcidump, I can see that it all goes wrong with this packet, sent by the device receiving audio:

    < ACL data: handle 62 flags 0x00 dlen 10
        L2CAP(d): cid 0x0042 len 6 [psm 25]
          AVDTP(s): Discover rsp: transaction 0 nsp 0x00
            ACP SEID 1 - Audio Source
            ACP SEID 2 - Audio Sink (InUse)
    

    Notice how the sink is marked as InUse. After seeing this, the source disconnects.

    It's hard to tell where this configuration option has gone, BlueZ is notorious for its sparse documentation. With BlueZ 5, most of the audio responsibilities have been moved into other programs, such as Pulseaudio. They communicate over DBus, and Pulseaudio registers endpoints with BlueZ. Perhaps Pulseaudio is supposed to register multiple endpoints, but there doesn't seem to be any option about multiple sources in pulseaudio-module-bluetooth-discover.

  • Related Question