From: Szymon Janc <szymon.janc@tieto.com>
To: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/client-av: Close audio output stream on a2dp disconnection
Date: Thu, 06 Feb 2014 15:12:49 +0100 [thread overview]
Message-ID: <1919933.3vRk5J1SY2@uw000953> (raw)
In-Reply-To: <1391677561-5522-1-git-send-email-jakub.tyszkowski@tieto.com>
Hi Jakub,
On Thursday 06 of February 2014 10:06:01 Jakub Tyszkowski wrote:
> This patch makes haltest's audio part aware of a2dp disconnection and
> closes audio output stream. This fixes the issue with CPU cycles being
> eaten up by playback thread still trying to send audio data after
> disconnection.
> ---
> android/client/if-av.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/android/client/if-av.c b/android/client/if-av.c
> index 8d1f69b..ef1d997 100644
> --- a/android/client/if-av.c
> +++ b/android/client/if-av.c
> @@ -41,6 +41,13 @@ static void connection_state(btav_connection_state_t state,
> haltest_info("%s: connection_state=%s remote_bd_addr=%s\n", __func__,
> btav_connection_state_t2str(state),
> bt_bdaddr_t2str(bd_addr, last_addr));
> +
> + if (state == BTAV_CONNECTION_STATE_DISCONNECTED) {
> + const struct method *m = get_interface_method("audio",
> + "close_output_stream");
> + if (m)
> + m->func(0, NULL);
> + }
> }
I think haltest should not be that smart and interaction of audio and av should
be handled by user (it is 'emulating' mediaserver, right?). I pushed fix for CPU
eating myself.
>
> static void audio_state(btav_audio_state_t state, bt_bdaddr_t *bd_addr)
>
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-02-06 14:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 9:06 [PATCH] android/client-av: Close audio output stream on a2dp disconnection Jakub Tyszkowski
2014-02-06 14:12 ` Szymon Janc [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1919933.3vRk5J1SY2@uw000953 \
--to=szymon.janc@tieto.com \
--cc=jakub.tyszkowski@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox