public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Nick Pelly <npelly@google.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: What is the motivation for conn->power_save
Date: Tue, 12 Jan 2010 23:04:51 -0800	[thread overview]
Message-ID: <1263366291.922.5.camel@localhost.localdomain> (raw)
In-Reply-To: <35c90d961001122046o733c7e10nf28bfed9e7f5465@mail.gmail.com>

Hi Nick,

> >>> >> If I understand correctly, conn->power_save prevents the host stack
> >>> >> from requesting active mode if it was not the host stack that
> >>> >> requested sniff mode.
> >>> >>
> >>> >> I don't understand the motivation for this. If we have ACL data to
> >>> >> send, then it seems like a good idea for the host stack to explicitly
> >>> >> request active mode, regardless of the reason that we entered sniff
> >>> >> mode.
> >>> >>
> >>> >> We want to enter active mode more aggressively when setting up SCO
> >>> >> connections, to avoid a 5 second delay with certain sniff modes. But
> >>> >> the conn->power_save code is getting in the way and doesn't appear to
> >>> >> be useful in the first place.
> >>> >
> >>> > we have discussed this a few times. And if you lock through the code
> >>> > history then you see that initially we just took devices out of sniff
> >>> > mode if we had to send data. However with HID devices this falls flat on
> >>> > its face. They need to stay in control of sniff mode if they initiated
> >>> > it. Some of them crash and others just drain the battery. With sniff
> >>> > mode you can send small amounts of data even while in sniff and for HID
> >>> > that is sometimes used. So the remote side better not interfere.
> >>> >
> >>> > What we really need is a socket option where we can control this on a
> >>> > per socket basis if we take devices out of sniff mode. And one extra
> >>> > case might be when we try to establish a SCO channel, because then it is
> >>> > clearly not an HID device. However even A2DP has this sort of problems
> >>> > sometimes where the stream setup takes time.
> >>>
> >>> Makes sense. Thanks for the explanation.
> >>
> >> this means you will be working on a patch for this :)
> 
> Actually, I want to put a patch together for a socket option to not
> use power_save (so that we *always* exit sniff mode when sending ACL
> data). We're seeing this problem with the Plantronics Voyager 855
> which enters sniff mode during A2DP.
> 
> Given that power_save is just for HID devices, my preferred design is
> to disable power_save by default, and have an L2CAP socket option to
> turn on power_save that would be used by HID L2CAP sockets.
> Unfortunately this would require userspace HID code to use the new
> socket option to keep current behavior. But it seems preferable to the
> alternative of having every single other L2CAP socket use a new socket
> option just to disable power_save for the sake of HID.

actually you still mix up the meaning of the power_save option. From the
stack side, the automatic sniff mode is off by default. You have to
enable via sysfs first. The power_save option is just to control when
sniff mode is activated and the remote enters sniff mode, that we are
not getting out of it if we have ACL data.

In conclusion, I am fine with a socket option that allows to control
sniff mode (preferable with interval details) and sniff subrate details
so that we can use them for that ACL link.

So go ahead and work on this. We can fix userspace easily since a new
socket can be detected easily with newer kernels.

Regards

Marcel



  reply	other threads:[~2010-01-13  7:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13  0:39 What is the motivation for conn->power_save Nick Pelly
2009-11-13  3:14 ` Marcel Holtmann
2009-11-13  3:31   ` Nick Pelly
2009-11-13  3:52     ` Marcel Holtmann
2009-11-16 18:55       ` Nick Pelly
2010-02-03  2:15         ` Nick Pelly
2010-02-03 20:20         ` Marcel Holtmann
2010-02-04  0:59           ` Nick Pelly
2010-02-04  3:13             ` Marcel Holtmann
     [not found]       ` <35c90d960911131445w16076c70sa0473e9b459d7d15@mail.gmail.com>
2010-01-13  4:46         ` Nick Pelly
2010-01-13  7:04           ` Marcel Holtmann [this message]
2010-07-08 15:07             ` Andrei Emeltchenko
2010-07-08 18:37               ` Nick Pelly
2010-08-03  9:31                 ` Liang Bao
2010-08-03 16:16                   ` Nick Pelly
2010-08-03 16:20                   ` Nick Pelly
2010-08-03  9:32                 ` Liang Bao

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=1263366291.922.5.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=npelly@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox