Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1801955rdh; Sat, 28 Oct 2023 07:42:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdZSoovO92yB6ibE4hSbJy8Ste24DMwHg9QqlV5PoG3s3CQBvqGumjpp6QcI5L+b+9xrC8 X-Received: by 2002:a17:902:d2ce:b0:1c9:dba6:417a with SMTP id n14-20020a170902d2ce00b001c9dba6417amr10877254plc.9.1698504148556; Sat, 28 Oct 2023 07:42:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698504148; cv=pass; d=google.com; s=arc-20160816; b=K/fQPcsGg+7OK5p28G/CH+Zt8SiKjWFoU7W59zmN5Ed9GqHHHM6ImzoK3Ht9W18KS6 eDv5pPT0IF7kAb41CyddkyHcl5YzyE8IRQjoCv8yRxn5nm24AndMSrtFa2vlGumd06PM ev8T/jTTwOfKFpVL86ikG2Yybog80/i5yUjVwNINFl2mEhJ7cibi5WeGN4zrYNtYsthG 5QX+bLw/YwxUOphxNkqi8P80XzA+CiNJ48rlmYU3rsiwkt+izOTtLsp0tdPGKAa7VAAz ZvRaxItJpb+htZgcYfJF1ikKY8WHAFLOsNosIWAXXtZ+2rc69wlWE1VXh+/4ykWlbVlp effA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1JoB0vBQeH9DHZhC/FVS19u5LaJyPeROD0zgzxDh1nc=; fh=ExGhjNQEFJgRqHmYATVc5UXZbS7abAmaHDitrfHKOuE=; b=KNgla5negg+0iObn9dGOR6xtYZP6zd4E3v4ZZLKiPIAkqgnnDqovta1If+HHN6H17L HaMzRb0MMSkhx7Dx5a0Rc+uGY6bicYio+lJKYrTbQQ/98yyd1f1OtWlGQKFzdWB5phNE e9vIIVU8bqiUSZRNVs78gdC2J4HuCN4AeWec4SUSLgSVxEKDT2NiFV4v3ktM3MotALbF RBOMR3F+m1KErHT75ySdDReXpqZqxnHvviPzjoxuOuENE5A0r4UOXiNGfBdUnn8rq1EH RLcEZgeDKID19kE49Id13v1LvwuJLkv0zbL4gIXht0jEhJbsx7xqjDSCZ47vhF395h+B sc4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=VCgcUmX3; arc=pass (i=1); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a72-20020a63904b000000b005b95fbb1750si1036817pge.113.2023.10.28.07.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 07:42:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=lahtoruutu header.b=VCgcUmX3; arc=pass (i=1); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6542D80942E6; Sat, 28 Oct 2023 07:42:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229449AbjJ1Ojk (ORCPT + 99 others); Sat, 28 Oct 2023 10:39:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjJ1Ojj (ORCPT ); Sat, 28 Oct 2023 10:39:39 -0400 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2FE9EB for ; Sat, 28 Oct 2023 07:39:36 -0700 (PDT) Received: from monolith.lan (unknown [185.77.218.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4SHhxx6CdJz49Q1r; Sat, 28 Oct 2023 17:39:30 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1698503974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1JoB0vBQeH9DHZhC/FVS19u5LaJyPeROD0zgzxDh1nc=; b=VCgcUmX3NmqD3k48nTLj4qWDAcNceco61J7KjjKPHupI2vNtwkwordaSjD/eBg8xwRuSfv PIn2BKrhK3KKGdwO5xSS6arBQMgktGqFSZGUPImdQkI8NVT9CGeK3+Bo367lmq+G29W0f+ UW3mWdQPx6iX7nW7AKGvgIpC8MLZIr9TM4+XQW8DgbeqcOvmp/3a2GUdx0L0nDEsPlETZX SmxlrI8RHkRJ0y+EKHMS1KkI0SIstMj8JJ8h0oWh54oarHGdOSRSYEWuy0OU9Fk6GjtqRY BZ8Zf2Bz7AdsbW+dedz1GOEGtcaSrgKLGe61Go1wx/rqfLJ1JMHFAEy7QL8r6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1698503974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=1JoB0vBQeH9DHZhC/FVS19u5LaJyPeROD0zgzxDh1nc=; b=mu2AZTSS1jd2DazkvUJET3+YorA0AAlqeLaPDOwamZZz5+PEcrg+iNN7AOihQDO48adywT ZVw9nOJl0rctVvKL2aHEFR+RrG8/2dWjvhnwewF+ohsHGKVevLHrr8uNDYIQMSWFbXN83e 2tpO1bWogfUov1c2kOMyuGUM0d6/6nUB+fLjaA9W5lS/yY7FaTaG9E9J+cUVPMf61xz1A6 T/2kp6wbCa+dJHr9e4jjjqeNErRPPYyB8NVsdEaVIzjgOuqJktu9BamNr2dH+dl+wyM5WO HZaB7d0UzMmxKpCbxIDp+DihIs2md/OMNROsQQEmJOb5KS7LZK+PHgv/wXQRKw== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1698503974; a=rsa-sha256; cv=none; b=J81bWAh04MB3FaiUU0MybGj18icyzjVrKZONqTFGYqrGjX/gZmE6OYPX+CapMkZhfQwMlp 6uv3p70JYWI7HeKPVSUz7EGH5ByFHlk0PeTSWsMDNvXPAp28tqriObH4DJZzN580uKRMFj SwKRj1lhwHp/ZkaX9l3QNNtMoEHKYEZgw0DP82jEhHnSaSodHvAB2MinvSj7vceQ6y+1bA UJFfCXf4E6wkt4Ka3Y08PZXUlij5Y9XnGUIB5+J0U+d3d4oHH+GFQt0faNT2n3KjV0qYqT gQlYbkFzNk4nLZaYH9C3k77VsxPAuK1jWEWTZAKT9k9ZUakLUwvEOZhPiK+pMw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 1/4] doc: extend MediaEndpoint1 API with SelectQoS Date: Sat, 28 Oct 2023 17:39:26 +0300 Message-ID: <6f03ad1eaaa00f84db8cd6a4a4b88ee83078951d.1698503903.git.pav@iki.fi> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 28 Oct 2023 07:42:25 -0700 (PDT) Change unicast BAP configuration to proceed as: 0. SelectProperties(endpoint) 1. ASCS Config Codec 2. ASCS Server notifies ASE 3. SelectQoS(configuration) [optional] 4. ASCS Config QoS 5. SetConfiguration(transport) Previously, SelectProperties had to return also the QoS configuration. However, it is impossible for it to provide it properly, because the values supported by the server are known only after ASCS Config Codec. This resolves the issue by adding a new method call, which is supposed to return suitable QoS values. Remove the QoS input parameter from the SelectProperties() call, as the server supported QoS settings may depend on the codec configuration, and are not known yet at that point. For convenience, e.g. when mandatory QoS presets are used, the endpoint does not need to implement SelectQoS(). In this case the QoS values returned by SelectProperties are used. --- Notes: Alternative to this is calling SelectProperties() twice at the two different stages of the ASE setup steps. However, if the second SelectProperties() call returns a different Capabilities configuration, we'd need to either (i) do Config Codec again or (ii) fail the configuration. Doing Config Codec again introduces a chance of getting stuck looping, if client is not behaving correctly, which doesn't sound like good design. Failing the configuration raises question why have the Capabilities as return parameters at all. So instead, make it a separate method. *** If two methods is too much, we could in principle get rid of the SelectProperties() call and leave only SelectQoS. Instead, the sound server would call SetConfiguration() on a remote endpoint it chooses, and provide the configuration parameters there. IIUC, this is how it is supposed to work for BAP Broadcast currently. This might need some sort of "Ready" property on the Device1 DBus object or elsewhere (e.g. the endpoints), so that it's simple for the sound server to wait until all endpoints have been exposed in DBus. This might also be preferable way to do it, since only the component closer to the user i.e. the sound server knows which endpoint the user wanted to use, and when BlueZ guesses wrong it avoids needing to tear down the old configuration and reconfigure (which we have to do for A2DP). *** This series was tested also vs. this https://gitlab.freedesktop.org/pvir/pipewire/-/commits/bap-selectqos doc/org.bluez.MediaEndpoint.rst | 66 +++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/doc/org.bluez.MediaEndpoint.rst b/doc/org.bluez.MediaEndpoint.rst index 6754d6e3b..4ffe6951c 100644 --- a/doc/org.bluez.MediaEndpoint.rst +++ b/doc/org.bluez.MediaEndpoint.rst @@ -66,6 +66,8 @@ array{byte} SelectConfiguration(array{byte} capabilities) Note: There is no need to cache the selected configuration since on success the configuration is send back as parameter of SetConfiguration. +.. _SelectProperties: + dict SelectProperties(dict capabilities) ```````````````````````````````````````` @@ -79,8 +81,58 @@ dict SelectProperties(dict capabilities) :uint32 Locations: + See `MediaEndpoint Properties`_ for their possible values. + + Returns a configuration which can be used to setup a transport: + + :array{byte} Capabilities: + + See **org.bluez.MediaTransport(5)**. + + :array{byte} Metadata [optional]: + + See **org.bluez.MediaTransport(5)**. + + :dict QoS: + + See **org.bluez.MediaTransport(5)**. + + The following fields shall be provided: + + :byte TargetLatency: + :byte PHY: + + If `SelectQoS`_ is not implemented, then values for + all other ``QoS`` fields are also determined by the + value returned here. + + Note: There is no need to cache the selected properties since + on success the configuration is sent back as parameter of + `SetConfiguration`_ and `SelectQoS`_. + +.. _SelectQoS: + +dict SelectQoS(dict configuration) +`````````````````````````````````` + + Select BAP unicast QoS to be used for a transport, based on + server capabilities and selected configuration. + + :object Endpoint: + + :array{byte} Capabilities: + + The configuration, as returned by `SelectProperties`_. + + :array{byte} Metadata [optional]: + + The metadata, as returned by `SelectProperties`_. + :dict QoS: + Server endpoint supported and preferred values. See + `MediaEndpoint Properties`_ for their possible values. + :byte Framing: :byte PHY: :uint16 MaximumLatency: @@ -89,18 +141,16 @@ dict SelectProperties(dict capabilities) :uint32 PreferredMinimumDelay: :uint32 PreferredMaximumDelay: - See `MediaEndpoint Properties`_ for their possible values. + Returns a QoS configuration which can be used to setup a transport: - Returns a configuration which can be used to setup a transport: - - :array{byte} Capabilities: - :array{byte} Metadata [optional]: :dict QoS: - See `SetConfiguration`_ for their possible values. + See **org.bluez.MediaTransport(5)** QoS property for + possible values. - Note: There is no need to cache the selected properties since on - success the configuration is send back as parameter of SetConfiguration. + Note: There is no need to cache the selected properties since + on success the configuration is sent back as parameter of + `SetConfiguration`_. void ClearConfiguration(object transport) ````````````````````````````````````````` -- 2.41.0