All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH 0/3] RFC: prioritizing data over HCI
Date: Thu, 4 Aug 2011 11:20:51 +0300	[thread overview]
Message-ID: <CABBYNZ+ZLJd17xMS1LpMn92T04gGKr7xGxe6eMbWOa_3k+tFfQ@mail.gmail.com> (raw)
In-Reply-To: <1312406086.3358.187.camel@THOR>

Hi Peter,

On Thu, Aug 4, 2011 at 12:14 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
> Hi Luiz,
>
> On Wed, 2011-08-03 at 09:11 -0400, Luiz Augusto von Dentz wrote:
> ....
>> The main use case for this is A2DP, many people complained that when they
>> are using their HID devices (mouses) together with headset the mouse has
>> higher priority, which btw is not true since currently there is no
>> priority and connections receives the same quote.
>>
>> With this changes it may reduce the problem since PulseAudio already sets
>> A2DP socket as low latency (priority 6), which means audio packets will be
>> processed before the HID packets, but this only affects tx and there still
>> exist the problem of some HID not letting us being master.
>
> What packets are being transmitted _to_ the HID devices during audio
> streaming?  In all my captures of A2DP crackle/skips, there's not a
> single HID packet being transmitted out. Of course, I was carefully not
> to press any of the led-transition keys during the capture :).

Well with HID you will probably be only receiving, but that doesn't
change anything does it? I mean you still got less bandwidth to use
and we probably want low latency packets to be prioritized in any
case, besides there is probably some use case where HID transmit too,
see net/bluetooth/hidp/core.c:666(hidp_process_transmit).

> It's my belief that the incredibly complicated way that PulseAudio
> handles the stream indices and computed latency is really the issue (at
> least with A2DP).

Really, so you have a fix for that? I would be happy to see your
proposal and discussion on PulseAudio mailing list.

> For example, in several configuration I have, PulseAudio is rendering
> *too fast*. This is evidenced by the remote device sending STOP packets
> (which can flood the syslog as 0-length L2CAP packets) because its recv
> buffers are full! (Of course, these DM1 packets are eating up air time
> too -- which is slowing legitimate rx packets from the HID devices!)

But why the kernel is not stopping PulseAudio? I mean PA does use
POLLOUT to check if the socket is writable, it then writes as much as
possible and sleep, but without using guaranteed channels with proper
QoS support I don't this changing anytime soon.

> You should hear the 'skipping' when the sleep timer which delays the
> next block render is IFDEF'd out of the
> module-bluetooth-device.c/threadfn(). With other subsystems but not with
> Bluez, PulseAudio uses a 'smoother' to fine-tune when to render the next
> block.

This can be fixed, the source already uses the smoother anyway, but Im
afraid this can cause bad effects like much frequent wakeups and even
auto of sync with some headsets.

> My point here is I think it's premature to conclude that PulseAudio
> doesn't have a part to play.

It probably does, but it doesn't change the fact the prioritization is
pretty much needed, actually it will probably make such problems more
visible than ever.

-- 
Luiz Augusto von Dentz

  reply	other threads:[~2011-08-04  8:20 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 13:11 [PATCH 0/3] RFC: prioritizing data over HCI Luiz Augusto von Dentz
2011-08-03 13:11 ` [RFC 1/3] Bluetooth: " Luiz Augusto von Dentz
2011-08-03 16:25   ` Peter Hurley
2011-08-03 17:49     ` Luiz Augusto von Dentz
2011-08-03 20:44       ` Gustavo Padovan
2011-08-03 20:53       ` Peter Hurley
2011-08-04  9:04         ` Luiz Augusto von Dentz
2011-08-03 13:11 ` [RFC 2/3] Bluetooth: set skbuffer priority based on L2CAP socket priority Luiz Augusto von Dentz
2011-08-03 13:11 ` [RFC 3/3] Bluetooth: make use sk_priority to priritize RFCOMM packets Luiz Augusto von Dentz
2011-08-03 21:14 ` [PATCH 0/3] RFC: prioritizing data over HCI Peter Hurley
2011-08-04  8:20   ` Luiz Augusto von Dentz [this message]
2011-08-04 12:55     ` Peter Hurley
2011-08-04 17:37 ` Mat Martineau
2011-08-04 23:09   ` Peter Hurley
2011-08-05 19:12     ` Gustavo Padovan
2011-08-08 23:29       ` Mat Martineau
2011-08-09  4:32         ` Gustavo Padovan
2011-08-10 17:38           ` Mat Martineau
2011-08-10 18:16             ` Luiz Augusto von Dentz
2011-08-10 22:15               ` Mat Martineau
2011-08-10 19:43             ` Peter Hurley
2011-08-11  0:18             ` Marcel Holtmann
2011-08-05  6:09   ` Luiz Augusto von Dentz
2011-08-05 19:14     ` Gustavo Padovan
2011-08-05 22:49       ` Luiz Augusto von Dentz
2011-08-06 18:53         ` Gustavo Padovan

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=CABBYNZ+ZLJd17xMS1LpMn92T04gGKr7xGxe6eMbWOa_3k+tFfQ@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.