linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] [BlueZ] audio/a2dp: refcount
@ 2021-07-21  9:17 Sébastien Viande
  2021-07-21  9:58 ` [BlueZ,BlueZ] " bluez.test.bot
  2021-07-21 17:02 ` [PATCH BlueZ] [BlueZ] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: Sébastien Viande @ 2021-07-21  9:17 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sébastien Viande

Fix a2dp setup.

I'm not the initial author of the code you can find the source on
https://patches.linaro.org/patch/285268/

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 = session;
+			chan->session = 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


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

* RE: [BlueZ,BlueZ] audio/a2dp: refcount
  2021-07-21  9:17 [PATCH BlueZ] [BlueZ] audio/a2dp: refcount Sébastien Viande
@ 2021-07-21  9:58 ` bluez.test.bot
  2021-07-21 17:02 ` [PATCH BlueZ] [BlueZ] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2021-07-21  9:58 UTC (permalink / raw)
  To: linux-bluetooth, sviande

[-- Attachment #1: Type: text/plain, Size: 1953 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=518787

---Test result---

Test Summary:
CheckPatch                    PASS      0.29 seconds
GitLint                       PASS      0.11 seconds
Prep - Setup ELL              PASS      40.69 seconds
Build - Prep                  PASS      0.09 seconds
Build - Configure             PASS      7.11 seconds
Build - Make                  PASS      176.72 seconds
Make Check                    PASS      9.05 seconds
Make Distcheck                PASS      209.85 seconds
Build w/ext ELL - Configure   PASS      7.21 seconds
Build w/ext ELL - Make        PASS      166.28 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] [BlueZ] audio/a2dp: refcount
  2021-07-21  9:17 [PATCH BlueZ] [BlueZ] audio/a2dp: refcount Sébastien Viande
  2021-07-21  9:58 ` [BlueZ,BlueZ] " bluez.test.bot
@ 2021-07-21 17:02 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2021-07-21 17:02 UTC (permalink / raw)
  To: Sébastien Viande; +Cc: linux-bluetooth

Hi Sébastien,

On Wed, Jul 21, 2021 at 2:29 AM Sébastien Viande <sviande@gmail.com> wrote:
>
> 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 = session;
> +                       chan->session = 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
>


-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2021-07-21 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  9:17 [PATCH BlueZ] [BlueZ] audio/a2dp: refcount Sébastien Viande
2021-07-21  9:58 ` [BlueZ,BlueZ] " bluez.test.bot
2021-07-21 17:02 ` [PATCH BlueZ] [BlueZ] " Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).