Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5638155pxv; Wed, 21 Jul 2021 10:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi7/Xw9Lp6CUuLLadCPeJqQCAh+gL+T4CyTeLt7MtcuTjBZz9jiuBF1XWQC6/H0HpWU/Oa X-Received: by 2002:a17:906:8a67:: with SMTP id hy7mr39317979ejc.421.1626887204621; Wed, 21 Jul 2021 10:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626887204; cv=none; d=google.com; s=arc-20160816; b=yggoJxTIAPaCLt0BXd0D1OXZ3Kxz5qajquJpkx2FhHbIU0soUrNKhgh09Orp3rbRBh BMDOoz4LKr6veJefxLUfL5C3PAHnoQSGkxmbgid8Epqqjkp4wHx/lpE5nu+mpjAbeOC1 5UQfKrrbAwyXbBKoYZXz6VW/ytHEhrDS7KsxCtau5FLiOsyshNsLk9Cw8kkcyxwweUdt 5A0ZcYuyliKcEZMY3+SjA4F/oKN5T0tuLg1YOAYpqdszkMStyRuLD90H0qt0WWPyx5CC 7oVixaSJwlwwXvwyLJk3AGR5tyssDtnCzucqFNqDWhishskuht2jiauOAAbAo/Ss2LOR ug4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XlZdtU+nvlMAAp5qHOT9VWsJ+J7fUvqXuNoKxMEFEcA=; b=fKQVdsCHznXc7q5KgQ4E/GqK7lLcXOqWNVItLOxwcAMmbAhmxF/DNisVo7Dep1R8IL o2EDS5MCrs6LDEELCE5wx2/yejm7k1Wm7joRCBmX70Ky/StAvTFNGmPDHaChse7fa2SF rdzXBExSa10/Ic12/2rRNpsZMcU7o9mqt8d9HCqhyKHMWDPn1nl5oL5WBKDcyCi01Ah7 Ns9H1oIapM4Jo9j9H32iL6a9BLdIjUsLZ5pWPOEPIoXtpOskHTODM/HALwy9ujHpNeTu vYijYJPuo8QBAizyYUv2HA/6oHCwMYrB80wBZbrZL3BuYOZJkucYAyRJ+PFKuIIjQoy/ wNVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CaU9WaKm; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si28763568edr.456.2021.07.21.10.06.03; Wed, 21 Jul 2021 10:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CaU9WaKm; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236413AbhGUQWf (ORCPT + 99 others); Wed, 21 Jul 2021 12:22:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234061AbhGUQWe (ORCPT ); Wed, 21 Jul 2021 12:22:34 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2B93C061575 for ; Wed, 21 Jul 2021 10:03:09 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id r135so1177845ybc.0 for ; Wed, 21 Jul 2021 10:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XlZdtU+nvlMAAp5qHOT9VWsJ+J7fUvqXuNoKxMEFEcA=; b=CaU9WaKmqxzW2pzuQWQiXcetOD3sYkroe/Jr2si6RdqFS9F+HMhndALYfDsyUKGw3B ZcbLJnHGNbMrYfxaMeBVTqF/izAF5GByUHanCJoQWBgdxQrSp/TmhvIwjLYnEu4TT9hK rPleXlF4xpIoI6lcLE8LmrrpJpR6i3Y3I4lf53EhhdwQEc7Xocjbcwb1pCgkz0jKzCWR 44mSJyVk5AlWIKfPiXL4wCP2X9NglzN9OsaRGi4cb5rqDyaIi6YJyyKkm0oH1VDsfSeh SnIiyT5Fiqc4okJwE5myfiTzrg7Hb9pXaggX4tyEmsw5ycKWomECSlbbliDR9+JqDwhA gIIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XlZdtU+nvlMAAp5qHOT9VWsJ+J7fUvqXuNoKxMEFEcA=; b=NfYEQHNwVkJw47y89tHi1RVGjMCdP7TtnqKzYrn+b0CKUpuM/FqhPg74S+mExPmTlm Uitnieba7dNwuEMjuQfO2guP9AgnQAkMM3smee/ekWeiUAjZ36OSFNPN8YiDM9voli2O m7dBOudw8ccQRnOZfhks83lfufd0XI6pwgIzjGibehmPCDCcI3IMNlP2XOpDoEmB2HQ2 HPhOhg0372s0aN38xqgfKTUy4Zxb0adjyyWwRZZePH1CQlXqF9sJd+yuCvzP2O0YSI3G qHe+tIXTHb7bNFajynih9U5zmhhq67XLML+aCDzDUluxUZUy4HRjv/3KFE3vGlmaF7Aw FbWg== X-Gm-Message-State: AOAM533+Eu2h/72RyDRgCu7PewxPyR/1RlEWjcHrxh8KNCVg5fqwviNm jaaXSPtHhse+cVNJg08WCOhKFOmX/QlfZ4IDNPU= X-Received: by 2002:a25:b741:: with SMTP id e1mr47644650ybm.347.1626886989071; Wed, 21 Jul 2021 10:03:09 -0700 (PDT) MIME-Version: 1.0 References: <20210721091727.177872-1-sviande@gmail.com> In-Reply-To: <20210721091727.177872-1-sviande@gmail.com> From: Luiz Augusto von Dentz Date: Wed, 21 Jul 2021 10:02:58 -0700 Message-ID: Subject: Re: [PATCH BlueZ] [BlueZ] audio/a2dp: refcount To: =?UTF-8?Q?S=C3=A9bastien_Viande?= Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi S=C3=A9bastien, On Wed, Jul 21, 2021 at 2:29 AM S=C3=A9bastien Viande w= rote: > > Fix a2dp setup. > > I'm not the initial author of the code you can find the source on > https://patches.linaro.org/patch/285268/ If you read the comments we actually made some different changes to address that, are you still having similar issues even with those changes? It maybe some configuration not working, so perhaps you can describe the problem or better yet create a github issue with the logs. > This patch fix my problem the a2dp source not available there was only > HSP/HFP. > --- > profiles/audio/a2dp.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c > index 86bc02994..be707edda 100644 > --- a/profiles/audio/a2dp.c > +++ b/profiles/audio/a2dp.c > @@ -1568,6 +1568,8 @@ static void channel_free(void *data) > } > > avdtp_remove_state_cb(chan->state_id); > + if (chan->session) > + avdtp_unref(chan->session); > > queue_destroy(chan->seps, remove_remote_sep); > free(chan->last_used); > @@ -2149,7 +2151,7 @@ static void avdtp_state_cb(struct btd_device *dev, = struct avdtp *session, > break; > case AVDTP_SESSION_STATE_CONNECTED: > if (!chan->session) > - chan->session =3D session; > + chan->session =3D avdtp_ref(session); > load_remote_seps(chan); > break; > } > @@ -2229,6 +2231,7 @@ found: > channel_remove(chan); > return NULL; > } > + avdtp_ref(chan->session); > > return avdtp_ref(chan->session); > } > @@ -2249,6 +2252,7 @@ static void connect_cb(GIOChannel *io, GError *err,= gpointer user_data) > error("Unable to create AVDTP session"); > goto fail; > } > + avdtp_ref(chan->session); > } > > g_io_channel_unref(chan->io); > -- > 2.32.0 > --=20 Luiz Augusto von Dentz