All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] org.bluez.Media: add SupportedFeatures
@ 2025-04-21 11:04 Pauli Virtanen
  2025-04-21 11:04 ` [PATCH BlueZ 2/2] media: implement SupportedFeatures property Pauli Virtanen
  2025-04-24 17:08 ` [BlueZ,1/2] org.bluez.Media: add SupportedFeatures bluez.test.bot
  0 siblings, 2 replies; 5+ messages in thread
From: Pauli Virtanen @ 2025-04-21 11:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add SupportedFeatures property for feature information that applications
cannot find otherwise.

Add feature tx-timestamping. Applications cannot enable it on old BlueZ
versions without that feature, as it requires special handling on BlueZ
side.
---
 doc/org.bluez.Media.rst | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/org.bluez.Media.rst b/doc/org.bluez.Media.rst
index ecd982652..d41329ccb 100644
--- a/doc/org.bluez.Media.rst
+++ b/doc/org.bluez.Media.rst
@@ -7,7 +7,7 @@ BlueZ D-Bus Media API documentation
 -----------------------------------
 
 :Version: BlueZ
-:Date: September 2023
+:Date: April 2025
 :Manual section: 5
 :Manual group: Linux System Administration
 
@@ -131,3 +131,14 @@ array{string} SupportedUUIDs [readonly]
 
 	List of 128-bit UUIDs that represents the supported Endpoint
 	registration.
+
+array{string} SupportedFeatures [readonly]
+``````````````````````````````````````````
+
+	List of strings that represent supported special features.
+	Possible values:
+
+	:"tx-timestamping":
+
+		Media applications are allowed to enable kernel TX
+		timestamping for acquired fds.
-- 
2.49.0


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

* [PATCH BlueZ 2/2] media: implement SupportedFeatures property
  2025-04-21 11:04 [PATCH BlueZ 1/2] org.bluez.Media: add SupportedFeatures Pauli Virtanen
@ 2025-04-21 11:04 ` Pauli Virtanen
  2025-04-21 14:37   ` Luiz Augusto von Dentz
  2025-04-24 17:08 ` [BlueZ,1/2] org.bluez.Media: add SupportedFeatures bluez.test.bot
  1 sibling, 1 reply; 5+ messages in thread
From: Pauli Virtanen @ 2025-04-21 11:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add org.bluez.Media.SupportedFeatures. The value tx-timestamping is
hardcoded as it is currently always enabled.
---
 profiles/audio/media.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 69c6dc671..df36bc2df 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -3340,8 +3340,28 @@ static gboolean supported_uuids(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean supported_features(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	static const char * const features[] = { "tx-timestamping" };
+	DBusMessageIter entry;
+	size_t i;
+
+	dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+				DBUS_TYPE_STRING_AS_STRING, &entry);
+
+	for (i = 0; i < ARRAY_SIZE(features); ++i)
+		dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
+							&features[i]);
+
+	dbus_message_iter_close_container(iter, &entry);
+
+	return TRUE;
+}
+
 static const GDBusPropertyTable media_properties[] = {
 	{ "SupportedUUIDs", "as", supported_uuids },
+	{ "SupportedFeatures", "as", supported_features },
 	{ }
 };
 
-- 
2.49.0


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

* Re: [PATCH BlueZ 2/2] media: implement SupportedFeatures property
  2025-04-21 11:04 ` [PATCH BlueZ 2/2] media: implement SupportedFeatures property Pauli Virtanen
@ 2025-04-21 14:37   ` Luiz Augusto von Dentz
  2025-04-21 15:42     ` Pauli Virtanen
  0 siblings, 1 reply; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2025-04-21 14:37 UTC (permalink / raw)
  To: Pauli Virtanen; +Cc: linux-bluetooth

Hi Pauli,

On Mon, Apr 21, 2025 at 7:05 AM Pauli Virtanen <pav@iki.fi> wrote:
>
> Add org.bluez.Media.SupportedFeatures. The value tx-timestamping is
> hardcoded as it is currently always enabled.
> ---
>  profiles/audio/media.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index 69c6dc671..df36bc2df 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -3340,8 +3340,28 @@ static gboolean supported_uuids(const GDBusPropertyTable *property,
>         return TRUE;
>  }
>
> +static gboolean supported_features(const GDBusPropertyTable *property,
> +                                       DBusMessageIter *iter, void *data)
> +{
> +       static const char * const features[] = { "tx-timestamping" };
> +       DBusMessageIter entry;
> +       size_t i;
> +
> +       dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
> +                               DBUS_TYPE_STRING_AS_STRING, &entry);
> +
> +       for (i = 0; i < ARRAY_SIZE(features); ++i)
> +               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
> +                                                       &features[i]);

That doesn't really handle if the kernel doesn't support it or setting
SO_TIMESTAMPING fails in case the kernel is too old? We might need to
have a MGMT flag indicating that kernel has support for it otherwise,
that said perhaps it would actually be better to have a socket option
since for the likes of SCO sockets we actually need hardware support
as well.

> +       dbus_message_iter_close_container(iter, &entry);
> +
> +       return TRUE;
> +}
> +
>  static const GDBusPropertyTable media_properties[] = {
>         { "SupportedUUIDs", "as", supported_uuids },
> +       { "SupportedFeatures", "as", supported_features },
>         { }
>  };
>
> --
> 2.49.0
>
>


-- 
Luiz Augusto von Dentz

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

* Re: [PATCH BlueZ 2/2] media: implement SupportedFeatures property
  2025-04-21 14:37   ` Luiz Augusto von Dentz
@ 2025-04-21 15:42     ` Pauli Virtanen
  0 siblings, 0 replies; 5+ messages in thread
From: Pauli Virtanen @ 2025-04-21 15:42 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi,

ma, 2025-04-21 kello 10:37 -0400, Luiz Augusto von Dentz kirjoitti:
> Hi Pauli,
> 
> On Mon, Apr 21, 2025 at 7:05 AM Pauli Virtanen <pav@iki.fi> wrote:
> > 
> > Add org.bluez.Media.SupportedFeatures. The value tx-timestamping is
> > hardcoded as it is currently always enabled.
> > ---
> >  profiles/audio/media.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> > 
> > diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> > index 69c6dc671..df36bc2df 100644
> > --- a/profiles/audio/media.c
> > +++ b/profiles/audio/media.c
> > @@ -3340,8 +3340,28 @@ static gboolean supported_uuids(const GDBusPropertyTable *property,
> >         return TRUE;
> >  }
> > 
> > +static gboolean supported_features(const GDBusPropertyTable *property,
> > +                                       DBusMessageIter *iter, void *data)
> > +{
> > +       static const char * const features[] = { "tx-timestamping" };
> > +       DBusMessageIter entry;
> > +       size_t i;
> > +
> > +       dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
> > +                               DBUS_TYPE_STRING_AS_STRING, &entry);
> > +
> > +       for (i = 0; i < ARRAY_SIZE(features); ++i)
> > +               dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
> > +                                                       &features[i]);
> 
> That doesn't really handle if the kernel doesn't support it or setting
> SO_TIMESTAMPING fails in case the kernel is too old? We might need to
> have a MGMT flag indicating that kernel has support for it otherwise,
> that said perhaps it would actually be better to have a socket option
> since for the likes of SCO sockets we actually need hardware support
> as well.

I was thinking the application itself can do necessary kernel checks.

I see now application can now also find running BlueZ version from
adapter modalias, so this is then not so urgently needed.

netdev has some way to indicate supported timestamping flags, it may be
it's not applicable to bluetooth, but probably would be good to check
first if that can be used before adding new MGMT flags.

> 
> > +       dbus_message_iter_close_container(iter, &entry);
> > +
> > +       return TRUE;
> > +}
> > +
> >  static const GDBusPropertyTable media_properties[] = {
> >         { "SupportedUUIDs", "as", supported_uuids },
> > +       { "SupportedFeatures", "as", supported_features },
> >         { }
> >  };
> > 
> > --
> > 2.49.0
> > 
> > 
> 

-- 
Pauli Virtanen

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

* RE: [BlueZ,1/2] org.bluez.Media: add SupportedFeatures
  2025-04-21 11:04 [PATCH BlueZ 1/2] org.bluez.Media: add SupportedFeatures Pauli Virtanen
  2025-04-21 11:04 ` [PATCH BlueZ 2/2] media: implement SupportedFeatures property Pauli Virtanen
@ 2025-04-24 17:08 ` bluez.test.bot
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-04-24 17:08 UTC (permalink / raw)
  To: linux-bluetooth, pav

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=955284

---Test result---

Test Summary:
CheckPatch                    PENDING   0.38 seconds
GitLint                       PENDING   0.28 seconds
BuildEll                      PASS      21.61 seconds
BluezMake                     PASS      3048.67 seconds
MakeCheck                     PASS      20.51 seconds
MakeDistcheck                 PASS      207.32 seconds
CheckValgrind                 PASS      280.12 seconds
CheckSmatch                   PASS      309.45 seconds
bluezmakeextell               PASS      131.69 seconds
IncrementalBuild              PENDING   0.36 seconds
ScanBuild                     PASS      958.45 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2025-04-24 17:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-21 11:04 [PATCH BlueZ 1/2] org.bluez.Media: add SupportedFeatures Pauli Virtanen
2025-04-21 11:04 ` [PATCH BlueZ 2/2] media: implement SupportedFeatures property Pauli Virtanen
2025-04-21 14:37   ` Luiz Augusto von Dentz
2025-04-21 15:42     ` Pauli Virtanen
2025-04-24 17:08 ` [BlueZ,1/2] org.bluez.Media: add SupportedFeatures 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.