mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
bluez5: Add LE Audio BAP broadcast source support
Once Pipewire is started it will try to register a BAP broadcast source media endpoint on UUID 00001852-0000-1000-8000-00805f9b34fb if the media codec that supports BAP and the adapter indicates LE Audio is supported. When the endpoint is detected (over DBus) by Pipewire and it has a broadcast sink UUID, a new device will be created with the address 00:00:00:00:00:00. This device will be our simulated remote device. This is done because a broadcast source emitting device does not need any connection to start transmitting the audio. This device is set as connected. When the SetConfiguration DBus method is called and the spa_bt_transport structure with the profile BAP broadcast source is created we switch the device from the one read from DBus to the one created by us. This is done because in BlueZ, when the transport is created, at the Device property, BlueZ sets the adapter as the device that the transport is connected to. Here the device will have the newly created SPA_BT_PROFILE_BAP_BROADCAST_SINK profile connected. Added code that allows to create a node in the graph for a device connected to the SPA_BT_PROFILE_BAP_BROADCAST_SINK profile.
This commit is contained in:
parent
b54f7fe90d
commit
ef3fac401d
4 changed files with 247 additions and 24 deletions
|
|
@ -125,6 +125,8 @@ extern "C" {
|
|||
#define SPA_BT_UUID_PACS "00001850-0000-1000-8000-00805f9b34fb"
|
||||
#define SPA_BT_UUID_BAP_SINK "00002bc9-0000-1000-8000-00805f9b34fb"
|
||||
#define SPA_BT_UUID_BAP_SOURCE "00002bcb-0000-1000-8000-00805f9b34fb"
|
||||
#define SPA_BT_UUID_BAP_BROADCAST_SOURCE "00001852-0000-1000-8000-00805f9b34fb"
|
||||
#define SPA_BT_UUID_BAP_BROADCAST_SINK "00001851-0000-1000-8000-00805f9b34fb"
|
||||
|
||||
#define PROFILE_HSP_AG "/Profile/HSPAG"
|
||||
#define PROFILE_HSP_HS "/Profile/HSPHS"
|
||||
|
|
@ -149,6 +151,8 @@ extern "C" {
|
|||
#define BAP_OBJECT_MANAGER_PATH "/MediaEndpointLE"
|
||||
#define BAP_SINK_ENDPOINT BAP_OBJECT_MANAGER_PATH "/BAPSink"
|
||||
#define BAP_SOURCE_ENDPOINT BAP_OBJECT_MANAGER_PATH "/BAPSource"
|
||||
#define BAP_BROADCAST_SOURCE_ENDPOINT BAP_OBJECT_MANAGER_PATH "/BAPBroadcastSource"
|
||||
#define BAP_BROADCAST_SINK_ENDPOINT BAP_OBJECT_MANAGER_PATH "/BAPBroadcastSink"
|
||||
|
||||
#define SPA_BT_UNKNOWN_DELAY 0
|
||||
|
||||
|
|
@ -163,6 +167,8 @@ extern "C" {
|
|||
enum spa_bt_media_direction {
|
||||
SPA_BT_MEDIA_SOURCE,
|
||||
SPA_BT_MEDIA_SINK,
|
||||
SPA_BT_MEDIA_SOURCE_BROADCAST,
|
||||
SPA_BT_MEDIA_SINK_BROADCAST,
|
||||
};
|
||||
|
||||
enum spa_bt_profile {
|
||||
|
|
@ -175,6 +181,8 @@ enum spa_bt_profile {
|
|||
SPA_BT_PROFILE_HSP_AG = (1 << 5),
|
||||
SPA_BT_PROFILE_HFP_HF = (1 << 6),
|
||||
SPA_BT_PROFILE_HFP_AG = (1 << 7),
|
||||
SPA_BT_PROFILE_BAP_BROADCAST_SOURCE = (1 << 8),
|
||||
SPA_BT_PROFILE_BAP_BROADCAST_SINK = (1 << 9),
|
||||
|
||||
SPA_BT_PROFILE_A2DP_DUPLEX = (SPA_BT_PROFILE_A2DP_SINK | SPA_BT_PROFILE_A2DP_SOURCE),
|
||||
SPA_BT_PROFILE_BAP_DUPLEX = (SPA_BT_PROFILE_BAP_SINK | SPA_BT_PROFILE_BAP_SOURCE),
|
||||
|
|
@ -182,8 +190,10 @@ enum spa_bt_profile {
|
|||
SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY = (SPA_BT_PROFILE_HSP_AG | SPA_BT_PROFILE_HFP_AG),
|
||||
SPA_BT_PROFILE_HEADSET_AUDIO = (SPA_BT_PROFILE_HEADSET_HEAD_UNIT | SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY),
|
||||
|
||||
SPA_BT_PROFILE_MEDIA_SINK = (SPA_BT_PROFILE_A2DP_SINK | SPA_BT_PROFILE_BAP_SINK),
|
||||
SPA_BT_PROFILE_MEDIA_SOURCE = (SPA_BT_PROFILE_A2DP_SOURCE | SPA_BT_PROFILE_BAP_SOURCE),
|
||||
SPA_BT_PROFILE_MEDIA_SINK = (SPA_BT_PROFILE_A2DP_SINK | SPA_BT_PROFILE_BAP_SINK |
|
||||
SPA_BT_PROFILE_BAP_BROADCAST_SINK),
|
||||
SPA_BT_PROFILE_MEDIA_SOURCE = (SPA_BT_PROFILE_A2DP_SOURCE | SPA_BT_PROFILE_BAP_SOURCE |
|
||||
SPA_BT_PROFILE_BAP_BROADCAST_SOURCE),
|
||||
};
|
||||
|
||||
static inline enum spa_bt_profile spa_bt_profile_from_uuid(const char *uuid)
|
||||
|
|
@ -206,6 +216,10 @@ static inline enum spa_bt_profile spa_bt_profile_from_uuid(const char *uuid)
|
|||
return SPA_BT_PROFILE_BAP_SINK;
|
||||
else if (strcasecmp(uuid, SPA_BT_UUID_BAP_SOURCE) == 0)
|
||||
return SPA_BT_PROFILE_BAP_SOURCE;
|
||||
else if (strcasecmp(uuid, SPA_BT_UUID_BAP_BROADCAST_SOURCE) == 0)
|
||||
return SPA_BT_PROFILE_BAP_BROADCAST_SOURCE;
|
||||
else if (strcasecmp(uuid, SPA_BT_UUID_BAP_BROADCAST_SINK) == 0)
|
||||
return SPA_BT_PROFILE_BAP_BROADCAST_SINK;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -307,8 +321,10 @@ static inline const char *spa_bt_profile_name (enum spa_bt_profile profile) {
|
|||
case SPA_BT_PROFILE_HEADSET_AUDIO:
|
||||
return "headset-audio";
|
||||
case SPA_BT_PROFILE_BAP_SOURCE:
|
||||
case SPA_BT_PROFILE_BAP_BROADCAST_SOURCE:
|
||||
return "bap-source";
|
||||
case SPA_BT_PROFILE_BAP_SINK:
|
||||
case SPA_BT_PROFILE_BAP_BROADCAST_SINK:
|
||||
return "bap-sink";
|
||||
case SPA_BT_PROFILE_BAP_DUPLEX:
|
||||
return "bap-duplex";
|
||||
|
|
@ -630,6 +646,8 @@ struct spa_bt_transport {
|
|||
unsigned int latency_us;
|
||||
uint8_t bap_cig;
|
||||
uint8_t bap_cis;
|
||||
uint8_t bap_big;
|
||||
uint8_t bap_bis;
|
||||
uint32_t bap_interval;
|
||||
|
||||
struct spa_bt_iso_io *iso_io;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue