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@xxxxxx> 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