All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v3 0/8] Add 'broadcasting' state
@ 2024-07-30 10:53 Vlad Pruteanu
  2024-07-30 10:53 ` [PATCH BlueZ v3 1/8] doc/media: Add 'broadcasting' state and 'select' method Vlad Pruteanu
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Vlad Pruteanu @ 2024-07-30 10:53 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, iulia.tanasescu, andrei.istodorescu,
	luiz.dentz, pav, Vlad Pruteanu

This series adds a new 'broadcasting' state for transports created by
the Broadcast Sink device as a result of scanning a Broadcast Source.
Such transports will remain  in the 'idle' state until the user
selects them, at which point they will be moved to 'broadcasting'.
PipeWire detects these transports and automatically acquires them.

The transport selection is done using the 'transport.select' method,
that this series implements. This allows the user to select the desired
stream when running the setup with PipeWire since it acquires any
transport that is broadcasting.

Termination of the sync to a BIS is done using the 'transport.unselect'
method, that also involves a 2 step process. The first step is the call
to this method, which changes the transport's state to idle, with the
second step being done by the audio server which detects this change
and releases the transport.

Vlad Pruteanu (8):
  doc/media: Add 'broadcasting' state and 'select' method
  transport: Add 'broadcasting' state
  transport: Add "select" method
  client/player: Expose transport "select" method to the user
  transport: Broadcast sink: wait for user to select transport
  doc/media: Add 'unselect' method
  transport: Add "unselect" method
  client/player: Expose transport "unselect" method to the user

 client/player.c                  | 100 +++++++++++++++++++++++++++++++
 doc/org.bluez.MediaTransport.rst |  31 +++++++++-
 profiles/audio/transport.c       |  90 ++++++++++++++++++++++++----
 3 files changed, 207 insertions(+), 14 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH BlueZ v5 1/8] doc/media: Add 'broadcasting' state and 'Select' method
@ 2024-07-31  6:17 Vlad Pruteanu
  2024-07-31 11:12 ` Add 'broadcasting' state bluez.test.bot
  0 siblings, 1 reply; 14+ messages in thread
From: Vlad Pruteanu @ 2024-07-31  6:17 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, iulia.tanasescu, andrei.istodorescu,
	luiz.dentz, pav, Vlad Pruteanu

This adds a new state for transports created by the Broadcast
Sink. Such transports will remain  in the 'idle' state until the
user calls 'Select' on them, at which point they will be moved to
'broadcasting'. This allows the user to select the desired BIS as
the audio server automatically acquires transports that are in this
state.
---
 doc/org.bluez.MediaTransport.rst | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/doc/org.bluez.MediaTransport.rst b/doc/org.bluez.MediaTransport.rst
index 6e95df8f2..c8aca0223 100644
--- a/doc/org.bluez.MediaTransport.rst
+++ b/doc/org.bluez.MediaTransport.rst
@@ -7,7 +7,7 @@ BlueZ D-Bus MediaTransport API documentation
 --------------------------------------------
 
 :Version: BlueZ
-:Date: September 2023
+:Date: July 2024
 :Manual section: 5
 :Manual group: Linux System Administration
 
@@ -51,6 +51,20 @@ void Release()
 
 	Releases file descriptor.
 
+void Select()
+`````````````
+
+	Applicable only for transports created by a broadcast sink. This moves
+	the transport from 'idle' to 'broadcasting'. This allows the user to
+	select which BISes he wishes to sync to via a 2 step process:
+	1) the user calls this method, changing the transport's state to idle
+	2) the audio server detects that the transport is in the 'broadcasting'
+	state and automatically acquires it
+
+	Possible Errors:
+
+	:org.bluez.Error.NotAuthorized:
+
 Properties
 ----------
 
@@ -84,6 +98,8 @@ string State [readonly]
 
 	:"idle": not streaming
 	:"pending": streaming but not acquired
+	:"broadcasting": streaming but not acquired, applicable only for transports
+		created by a broadcast sink
 	:"active": streaming and acquired
 
 uint16 Delay [readwrite, optional]
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH BlueZ v4 1/8] doc/media: Add 'broadcasting' state and 'select' method
@ 2024-07-30 14:09 Vlad Pruteanu
  2024-07-30 18:47 ` Add 'broadcasting' state bluez.test.bot
  0 siblings, 1 reply; 14+ messages in thread
From: Vlad Pruteanu @ 2024-07-30 14:09 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, iulia.tanasescu, andrei.istodorescu,
	luiz.dentz, pav, Vlad Pruteanu

This adds a new state for transports created by the Broadcast
Sink. Such transports will remain  in the 'idle' state until the
user calls 'select' on them, at which point they will be moved to
'broadcasting'. This allows the user to select the desired BIS as
the audio server automatically acquires transports that are in this
state.
---
 doc/org.bluez.MediaTransport.rst | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/doc/org.bluez.MediaTransport.rst b/doc/org.bluez.MediaTransport.rst
index 6e95df8f2..c23d1f59f 100644
--- a/doc/org.bluez.MediaTransport.rst
+++ b/doc/org.bluez.MediaTransport.rst
@@ -7,7 +7,7 @@ BlueZ D-Bus MediaTransport API documentation
 --------------------------------------------
 
 :Version: BlueZ
-:Date: September 2023
+:Date: July 2024
 :Manual section: 5
 :Manual group: Linux System Administration
 
@@ -51,6 +51,20 @@ void Release()
 
 	Releases file descriptor.
 
+void Select_transport()
+```````````````````````
+
+	Applicable only for transports created by a broadcast sink. This moves
+	the transport from 'idle' to 'broadcasting'. This allows the user to
+	select which BISes he wishes to sync to via a 2 step process:
+	1) the user calls this method, changing the transport's state to idle
+	2) the audio server detects that the transport is in the 'broadcasting'
+	state and automatically acquires it
+
+	Possible Errors:
+
+	:org.bluez.Error.NotAuthorized:
+
 Properties
 ----------
 
@@ -84,6 +98,8 @@ string State [readonly]
 
 	:"idle": not streaming
 	:"pending": streaming but not acquired
+	:"broadcasting": streaming but not acquired, applicable only for transports
+		created by a broadcast sink
 	:"active": streaming and acquired
 
 uint16 Delay [readwrite, optional]
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH BlueZ v2 1/5] doc/media: Add 'broadcasting' state and 'Select' method
@ 2024-07-25 11:58 Vlad Pruteanu
  2024-07-25 15:39 ` Add 'broadcasting' state bluez.test.bot
  0 siblings, 1 reply; 14+ messages in thread
From: Vlad Pruteanu @ 2024-07-25 11:58 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, iulia.tanasescu, andrei.istodorescu,
	luiz.dentz, pav, Vlad Pruteanu

This adds a new state for transports created by the Broadcast
Sink. Such transports will remain  in the 'idle' state until the
user calls 'Select' on them, at which point they will be moved to
'broadcasting'. This allows the user to select the desired BIS as
the audio server automatically acquires transports that are in this
state.
---
 doc/org.bluez.MediaTransport.rst | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/doc/org.bluez.MediaTransport.rst b/doc/org.bluez.MediaTransport.rst
index 6e95df8f2..47346d36b 100644
--- a/doc/org.bluez.MediaTransport.rst
+++ b/doc/org.bluez.MediaTransport.rst
@@ -7,7 +7,7 @@ BlueZ D-Bus MediaTransport API documentation
 --------------------------------------------
 
 :Version: BlueZ
-:Date: September 2023
+:Date: July 2024
 :Manual section: 5
 :Manual group: Linux System Administration
 
@@ -51,6 +51,18 @@ void Release()
 
 	Releases file descriptor.
 
+void Select()
+``````````````
+
+	Applicable only for transports created by a broadcast sink. This moves
+	the transport from 'idle' to 'broadcasting'. Since the audio server
+	automatically acquires transports that are in this state, the user can
+	thus select which BISes he wishes to sync to.
+
+	Possible Errors:
+
+	:org.bluez.Error.NotAuthorized:
+
 Properties
 ----------
 
@@ -84,6 +96,8 @@ string State [readonly]
 
 	:"idle": not streaming
 	:"pending": streaming but not acquired
+	:"broadcasting": streaming but not acquired, applicable only for transports
+		created by a broadcast sink
 	:"active": streaming and acquired
 
 uint16 Delay [readwrite, optional]
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH BlueZ 1/4] transport: Add 'broadcasting' state
@ 2024-07-24 14:34 Vlad Pruteanu
  2024-07-24 16:09 ` bluez.test.bot
  0 siblings, 1 reply; 14+ messages in thread
From: Vlad Pruteanu @ 2024-07-24 14:34 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: mihai-octavian.urzica, iulia.tanasescu, andrei.istodorescu,
	luiz.dentz, pav, Vlad Pruteanu

This adds a new state for transports created by the Broadcast
Sink device as a result of scanning a Broadcast Source. Such
transports will remain  in the 'idle' state until the user
selects them using 'transport.select', at which point they will
be moved to 'broadcasting'.
---
 profiles/audio/transport.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index 922911cf3..017e60fe9 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -51,6 +51,7 @@
 typedef enum {
 	TRANSPORT_STATE_IDLE,		/* Not acquired and suspended */
 	TRANSPORT_STATE_PENDING,	/* Playing but not acquired */
+	TRANSPORT_STATE_BROADCASTING,/* Bcast source waiting to be selected */
 	TRANSPORT_STATE_REQUESTING,	/* Acquire in progress */
 	TRANSPORT_STATE_ACTIVE,		/* Acquired and playing */
 	TRANSPORT_STATE_SUSPENDING,     /* Release in progress */
@@ -59,6 +60,7 @@ typedef enum {
 static const char *str_state[] = {
 	"TRANSPORT_STATE_IDLE",
 	"TRANSPORT_STATE_PENDING",
+	"TRANSPORT_STATE_BROADCASTING",
 	"TRANSPORT_STATE_REQUESTING",
 	"TRANSPORT_STATE_ACTIVE",
 	"TRANSPORT_STATE_SUSPENDING",
@@ -139,6 +141,8 @@ static const char *state2str(transport_state_t state)
 		return "idle";
 	case TRANSPORT_STATE_PENDING:
 		return "pending";
+	case TRANSPORT_STATE_BROADCASTING:
+		return "broadcasting";
 	case TRANSPORT_STATE_ACTIVE:
 	case TRANSPORT_STATE_SUSPENDING:
 		return "active";
@@ -679,7 +683,8 @@ static DBusMessage *try_acquire(DBusConnection *conn, DBusMessage *msg,
 	if (transport->state >= TRANSPORT_STATE_REQUESTING)
 		return btd_error_not_authorized(msg);
 
-	if (transport->state != TRANSPORT_STATE_PENDING)
+	if ((transport->state != TRANSPORT_STATE_PENDING) &&
+		(transport->state != TRANSPORT_STATE_BROADCASTING))
 		return btd_error_not_available(msg);
 
 	owner = media_owner_create(msg);
@@ -1281,7 +1286,8 @@ static void transport_update_playing(struct media_transport *transport,
 					str_state[transport->state], playing);
 
 	if (playing == FALSE) {
-		if (transport->state == TRANSPORT_STATE_PENDING)
+		if ((transport->state == TRANSPORT_STATE_PENDING) ||
+			(transport->state == TRANSPORT_STATE_BROADCASTING))
 			transport_set_state(transport, TRANSPORT_STATE_IDLE);
 		else if (transport->state == TRANSPORT_STATE_ACTIVE) {
 			/* Remove owner */
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-07-31 11:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 10:53 [PATCH BlueZ v3 0/8] Add 'broadcasting' state Vlad Pruteanu
2024-07-30 10:53 ` [PATCH BlueZ v3 1/8] doc/media: Add 'broadcasting' state and 'select' method Vlad Pruteanu
2024-07-30 12:37   ` Add 'broadcasting' state bluez.test.bot
2024-07-30 10:53 ` [PATCH BlueZ v3 2/8] transport: " Vlad Pruteanu
2024-07-30 10:53 ` [PATCH BlueZ v3 3/8] transport: Add "select" method Vlad Pruteanu
2024-07-30 10:53 ` [PATCH BlueZ v3 4/8] client/player: Expose transport "select" method to the user Vlad Pruteanu
2024-07-30 10:53 ` [PATCH BlueZ v3 5/8] transport: Broadcast sink: wait for user to select transport Vlad Pruteanu
2024-07-30 10:53 ` [PATCH BlueZ v3 6/8] doc/media: Add 'unselect' method Vlad Pruteanu
2024-07-30 10:53 ` [PATCH BlueZ v3 7/8] transport: Add "unselect" method Vlad Pruteanu
2024-07-30 10:53 ` [PATCH BlueZ v3 8/8] client/player: Expose transport "unselect" method to the user Vlad Pruteanu
  -- strict thread matches above, loose matches on Subject: below --
2024-07-31  6:17 [PATCH BlueZ v5 1/8] doc/media: Add 'broadcasting' state and 'Select' method Vlad Pruteanu
2024-07-31 11:12 ` Add 'broadcasting' state bluez.test.bot
2024-07-30 14:09 [PATCH BlueZ v4 1/8] doc/media: Add 'broadcasting' state and 'select' method Vlad Pruteanu
2024-07-30 18:47 ` Add 'broadcasting' state bluez.test.bot
2024-07-25 11:58 [PATCH BlueZ v2 1/5] doc/media: Add 'broadcasting' state and 'Select' method Vlad Pruteanu
2024-07-25 15:39 ` Add 'broadcasting' state bluez.test.bot
2024-07-24 14:34 [PATCH BlueZ 1/4] transport: " Vlad Pruteanu
2024-07-24 16:09 ` bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.