Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2607059rdg; Mon, 16 Oct 2023 09:13:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+eymHn95bNUoGR5njJV5xOWYXwKoayGFsWrl5Mg+Z7lZLhbMAtH6yV+TEtrphlusPrufI X-Received: by 2002:a05:6a00:3a1e:b0:690:ce36:8b00 with SMTP id fj30-20020a056a003a1e00b00690ce368b00mr40110367pfb.2.1697472835821; Mon, 16 Oct 2023 09:13:55 -0700 (PDT) Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id b25-20020a056a0002d900b0068e3f550763si109191pft.101.2023.10.16.09.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:13:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail header.i=@iki.fi header.s=lahtoruutu header.b=ShhjgVxz; arc=fail (signature failed); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 0ADE2804A73D; Mon, 16 Oct 2023 09:13:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229501AbjJPQNu (ORCPT + 99 others); Mon, 16 Oct 2023 12:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233425AbjJPQNt (ORCPT ); Mon, 16 Oct 2023 12:13:49 -0400 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14E25EA for ; Mon, 16 Oct 2023 09:13:47 -0700 (PDT) Received: from [192.168.1.195] (unknown [IPv6:2a02:ed04:3581:4::d001]) (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@iki.fi) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4S8Mc80YYDz49Q67; Mon, 16 Oct 2023 19:13:40 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1697472824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=qdwKOgh/lQDkrDsjScObQFWifoAGyvlX/ub3dihGpPI=; b=ShhjgVxzx6ZmtXyw0dto4y8oVycyFg/l1ANrmcl+p+fJ1DPxqZkH0NL9hyBMil1tXkxJ4v aQWlQlohkStlpgAC4O/L2gyet8kW/gOpAQLdswEVcx5kFx0vMugZt28qZQwGULE5oAjgoU kPQvWXcYSoNoiMog/3GxW6gLIsEDqAbYw2KkOBJ5vT9YUtj93H9lS3ZYwGf4XAb6BpqpYc KhEODg1A4wfHdC/J+mcF5MnNRvwrP0ots7EOnj20ny2uDDlKuvAcr1wuQHurdGAfwfwdWv Gyu96yScjfFPT/0TshqAQI4Tek8xShzWPG6z2GCPz2l3m31kh208VCoKJ2X7hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1697472824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=qdwKOgh/lQDkrDsjScObQFWifoAGyvlX/ub3dihGpPI=; b=tmpwLHYSXsvyN06nDOG+lKll1WpLqVszMtvehq2gtYcz93Ri+0JmTMhVcP9S/4dqcXP5PS LY81SB56C0wdn5NoknAw0ljhbDXxUsGmnoNQe3HYmsT3UBd/s02f4e7XpzxVhlsfSELQ0m q40NHf5mqXGIbOJGhyDle5bIpyWrZxVJmjOMc5+hdQZhSt63aQtujDK8aer7vQW+9bipkT /9VszMvesDNXoVUCxd9xuDO7/eaEb1yRPod6cbwNVssKcjnPXANUECz+emV+vUm+oYQ+z5 R9BMs4Gvb03Dr8nCQqXWev/XZcV8VFuA5UYjxGnh7yzABwRP32ot8W9DxCvgRQ== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1697472824; a=rsa-sha256; cv=none; b=cFJMjE38L09ok3dkhIYhZY1mVasgX6l0w5l4arj44vBX8XktWUO3z6JK3VEK7XHq/JcyVj QrQoupVXlLsf9d3p/mNe22Cal86HSi0UrkCQhbvDdwuNiN9ewSsqqZ2i7skso6RUxVf5mF vKNKEe2WO6065jgRLJ8oKIciFhqWtLuJH+gfWQ/NDlC4R9tn54wc2fJuKq+YdNMu9Ns1U9 dudLpgAZnEOI+vUsKDkkqt0tGCPqU2qqidONNomdUaQn+mTQUch7RFtURlqQF60DeZzmwL 1F6/V2ZpbROIB4KBzpbWmsbYtYfeeJ76xzKgjm49AtT2MADPTSbDxxxHSxg0Fw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav@iki.fi smtp.mailfrom=pav@iki.fi Message-ID: Subject: Re: [PATCH 1/2] profiles: Add support for Audio Locations From: Pauli Virtanen To: Kiran K , linux-bluetooth@vger.kernel.org Date: Mon, 16 Oct 2023 19:13:40 +0300 In-Reply-To: <20231016065228.424400-1-kiran.k@intel.com> References: <20231016065228.424400-1-kiran.k@intel.com> Autocrypt: addr=pav@iki.fi; prefer-encrypt=mutual; keydata=mQGiBDuWd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4ajInkIIvtOBmRqbvTPkJjcH84o7b84rP10DSO2Q2ooP8WYQ85y9RkF00yndR01VwNnURt7XmjVuoy8el0WUMv0q7evGTWSmXDPtUMq8e5DKt1uHWdkjV3uhHXjUTlI2gdMrxzbzxPYIWVWg4eE9jEdQvvGaYhDfFpmqF/ZSQT9jUCuWXMMpscy8NrmHnJtTvHBEfmaSgOQPnI7D7AA62q6mAVWEjcfKpgEs0Z2SK75P5yHmD2yEdZy+wSD8zheY1YDqvL50rx+l3mqoONmBwiW7R5dkMInqgQ156Uf8yMc8vv5exARr8WhJV61R2mSeHfxTFMMXaFG//NTHNX7ZpP0tECyePbu+IB32oa7P45EoNRZnLDG2KDOFsoUuy+CzQYPku5Gz8aqcgP7k8wb4J3QPPfiaAYrRJ9XOoiLUDodnWnPW9zLA1yWMnarzilEFPVmBztx6JKxlbFxnOfO6u5ry+uXZC4w= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.0 (3.50.0-1.fc39) MIME-Version: 1.0 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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 09:13:51 -0700 (PDT) Hi, ma, 2023-10-16 kello 12:22 +0530, Kiran K kirjoitti: > This adds support to provide Audio Locations for BAP Sink and Source Endp= oints > --- > profiles/audio/media.c | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) >=20 > diff --git a/profiles/audio/media.c b/profiles/audio/media.c > index 1d98ac5a1a70..51e3ab65d12d 100644 > --- a/profiles/audio/media.c > +++ b/profiles/audio/media.c > @@ -99,6 +99,7 @@ struct media_endpoint { > size_t size; /* Endpoint capabilities size */ > uint8_t *metadata; /* Endpoint property metadata *= / > size_t metadata_size; /* Endpoint metadata size */ > + uint32_t location; /* Endpoint location */ > guint hs_watch; > guint ag_watch; > guint watch; > @@ -1445,6 +1446,7 @@ media_endpoint_create(struct media_adapter *adapter= , > int size, > uint8_t *metadata, > int metadata_size, > + uint32_t location, > int *err) > { > struct media_endpoint *endpoint; > @@ -1460,6 +1462,7 @@ media_endpoint_create(struct media_adapter *adapter= , > endpoint->cid =3D cid; > endpoint->vid =3D vid; > endpoint->delay_reporting =3D delay_reporting; > + endpoint->location =3D location; > =20 > if (qos) > endpoint->qos =3D *qos; > @@ -1525,7 +1528,8 @@ static int parse_properties(DBusMessageIter *props,= const char **uuid, > uint16_t *cid, uint16_t *vid, > struct bt_bap_pac_qos *qos, > uint8_t **capabilities, int *size, > - uint8_t **metadata, int *metadata_size) > + uint8_t **metadata, int *metadata_size, > + uint32_t *location) > { > gboolean has_uuid =3D FALSE; > gboolean has_codec =3D FALSE; > @@ -1609,6 +1613,10 @@ static int parse_properties(DBusMessageIter *props= , const char **uuid, > if (var !=3D DBUS_TYPE_UINT16) > return -EINVAL; > dbus_message_iter_get_basic(&value, &qos->ppd_max); > + } else if (strcasecmp(key, "Location") =3D=3D 0) { This should be "Locations" to match the documented endpoint property names. Maybe also the variable names. The bitmap can contain multiple supported locations, the client will selects in Config Codec which ones it wants. > + if (var !=3D DBUS_TYPE_UINT32) > + return -EINVAL; > + dbus_message_iter_get_basic(&value, location); > } > =20 > dbus_message_iter_next(props); > @@ -1633,6 +1641,7 @@ static DBusMessage *register_endpoint(DBusConnectio= n *conn, DBusMessage *msg, > int size =3D 0; > int metadata_size =3D 0; > int err; > + uint32_t location; > =20 > sender =3D dbus_message_get_sender(msg); > =20 > @@ -1650,12 +1659,12 @@ static DBusMessage *register_endpoint(DBusConnect= ion *conn, DBusMessage *msg, > =20 > if (parse_properties(&props, &uuid, &delay_reporting, &codec, &cid, > &vid, &qos, &capabilities, &size, &metadata, > - &metadata_size) < 0) > + &metadata_size, &location) < 0) > return btd_error_invalid_args(msg); > =20 > if (media_endpoint_create(adapter, sender, path, uuid, delay_reporting, > codec, cid, vid, &qos, capabilities, > - size, metadata, metadata_size, > + size, metadata, metadata_size, location, > &err) =3D=3D NULL) { > if (err =3D=3D -EPROTONOSUPPORT) > return btd_error_not_supported(msg); > @@ -2688,6 +2697,7 @@ static void app_register_endpoint(void *data, void = *user_data) > int size =3D 0; > uint8_t *metadata =3D NULL; > int metadata_size =3D 0; > + uint32_t location; > DBusMessageIter iter, array; > struct media_endpoint *endpoint; > =20 > @@ -2748,6 +2758,13 @@ static void app_register_endpoint(void *data, void= *user_data) > &metadata_size); > } > =20 > + if (g_dbus_proxy_get_property(proxy, "Location", &iter)) { Same here. > + if (dbus_message_iter_get_arg_type(&iter) !=3D DBUS_TYPE_UINT32) > + goto fail; > + > + dbus_message_iter_get_basic(&iter, &location); > + } > + > /* Parse QoS preferences */ > memset(&qos, 0, sizeof(qos)); > if (g_dbus_proxy_get_property(proxy, "Framing", &iter)) { > @@ -2804,7 +2821,7 @@ static void app_register_endpoint(void *data, void = *user_data) > vendor.cid, vendor.vid, &qos, > capabilities, size, > metadata, metadata_size, > - &app->err); > + location, &app->err); > if (!endpoint) { > error("Unable to register endpoint %s:%s: %s", app->sender, > path, strerror(-app->err));