linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] bluetoothd: add option to automatically power on the first adapter found
Date: Mon, 13 Apr 2015 21:08:03 +0200	[thread overview]
Message-ID: <552C1413.1000504@ahsoftware.de> (raw)
In-Reply-To: <B8F6B143-DA86-4F06-B4C8-FA2790AA33B3@holtmann.org>

Am 13.04.2015 um 16:32 schrieb Marcel Holtmann:

>>>> As said, this (currently) needs that dbus is ready and bluetoothctl can communicate with bluetoothd. And on a reasonable fast machine (4 core x86_64 2ghz+) this needs more than 4 seconds after startup here (invoked through /etc/rc.d/rc.local on f21).
>>>
>>> Szymon send an example on how to add wait-for-adapter in bluetoothctl. Together with that and a proper systemd unit, I bet you that this does not take 4 seconds.
>>>
>>> If you insist on doing old fashion rc.local stuff, then I can not help you. You can look into systemd target definitions, but I am pretty sure it ends up being started after something else happened.
>>
>> At least that old fashioned stuff worked. I even still have bt-alsa-devices on systems where I stick to bluez 4.0.
>>
>> And it would make me extremly wonder, if it would be any faster when using a systemd unit. Remember, I did in rc.local:
>>
>> sleep 4
>> echo "power on" | /bin/bluetoothctl
>>
>> And if that fails, then how could a systemd unit which calls bluetoothctl be faster? There is absolutely nothing in those 2 lines which slows down the necessary prerequisits for bluetoothctl.
>
> except the sleep 4 that you put in. So you are going on for rant this takes 4 seconds and the reason it takes 4 seconds since you put a sleep 4 in there. Szymon gave you a simple solution for removing the sleep and we are still discussing this.

I've run into the problem, because those 4 second weren't enough after 
an update of bluez. I then had to use 6 seconds, otherwise that 
construct failed. And because that ugly sleep was just an extremly ugly 
workaround for the missing easy-to-use knob to reliable turn on bt on 
Linux with bluez 5.x, I've now written that patch.

But it's senseless trying to discuss further. If you think people have 
to write udev-rules or systemd units in order to use bluetooth on Linux, 
there is just nothing I could add to such a discussion.

And you might want to decide if you want a configuration less bluez 
(something I think I've read several times and which is likely the 
reason that make install doesn't install at least an example for 
configuration), or if you still want to support some configuration as 
mentioned in the comment in regard to a [policy] section.

Alexander Holler

  reply	other threads:[~2015-04-13 19:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 16:57 [PATCH] bluetoothd: add option to automatically power on the first adapter found Alexander Holler
2015-04-10 17:10 ` Marcel Holtmann
2015-04-10 17:15   ` Alexander Holler
2015-04-11  4:06     ` Alexander Holler
2015-04-11  5:07       ` Alexander Holler
2015-04-11 16:48         ` Alexander Holler
2015-04-11 17:55           ` Marcel Holtmann
2015-04-12  9:23             ` Alexander Holler
2015-04-12 18:50               ` Marcel Holtmann
2015-04-13  9:10                 ` Alexander Holler
2015-04-13 14:32                   ` Marcel Holtmann
2015-04-13 19:08                     ` Alexander Holler [this message]
2015-04-13 20:22                       ` Marcel Holtmann
2015-04-14  8:33                         ` Alexander Holler
2015-04-14 13:50                           ` Marcel Holtmann
2015-04-14 14:14                             ` Szymon Janc
2015-04-14 15:56                               ` Szymon Janc
2015-04-15 17:59                             ` Alexander Holler
2015-04-25 10:26                               ` Alexander Holler
2015-04-27  4:40                                 ` Marcel Holtmann
2015-04-27  9:11                                   ` Alexander Holler
2015-04-27 18:53                                     ` Marcel Holtmann
2015-04-27 20:36                                       ` Alexander Holler
2015-04-10 17:15   ` Szymon Janc

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=552C1413.1000504@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.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;
as well as URLs for NNTP newsgroup(s).