[Bug 1466347] Re: After resume bluedevil doesn't find bluetooth adapter

Bug Watch Updater 1466347 at bugs.launchpad.net
Sun Dec 13 21:38:38 UTC 2015


Launchpad has imported 78 comments from the remote bug at
https://bugs.kde.org/show_bug.cgi?id=314356.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2013-02-03T14:41:37+00:00 Ilya Basin wrote:

After I suspend and wake my PC, the bluetooth tray icon vanishes and I'm unable to browse devices/send files over bluetooth.
Programs that use BT directly, like smartcam and obexfs are not affected.

Reproducible: Always



* package version(s)
bluedevil 1.3-1
libbluedevil 1.9.2-1
bluez 4.101-1
KDE 4.9.5-1

$ lsusb
Bus 003 Device 002: ID 0a5c:2121 Broadcom Corp. BCM2210 Bluetooth

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/0

------------------------------------------------------------------------
On 2013-02-14T09:16:15+00:00 Ilya Basin wrote:

please help

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/1

------------------------------------------------------------------------
On 2013-02-21T22:13:44+00:00 Alex Fiestas wrote:

does it help restarting bluetooth service?

Can you give me the output of qdbus --system org.bluez  ?

Thanks and sorry for the delay on answering

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/2

------------------------------------------------------------------------
On 2013-02-23T11:25:49+00:00 Ilya Basin wrote:

> does it help restarting bluetooth service?
Yes

> Can you give me the output of qdbus --system org.bluez ?
$ qdbus --system org.bluez
/
/org
/org/bluez
/org/bluez/404
/org/bluez/404/any
/org/bluez/404/hci0
/org/bluez/404/hci0/dev_A8_7E_33_D7_29_DB
/org/bluez/test

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/3

------------------------------------------------------------------------
On 2013-02-24T13:29:44+00:00 Alex Fiestas wrote:

In Archlinux I can reproduce this, will investigate and fix.

thanks for the report !

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/4

------------------------------------------------------------------------
On 2013-03-08T21:02:57+00:00 Alex Fiestas wrote:

Can you reproduce this all the time? I have been trying to reproduce
this today and so far no luck.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/5

------------------------------------------------------------------------
On 2013-03-09T06:59:43+00:00 Ilya Basin wrote:

Yes.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/6

------------------------------------------------------------------------
On 2013-03-10T16:25:48+00:00 Alex Fiestas wrote:

Can you attach the following information?

Go into a termnial and do:
killall -9 kded4; sleep 5; kded4 --nofork > /tmp/kded4.txt

Then wait a few seconds, suspend, resume (to reproduce the problem) and
attach the kded4.txt

Thanks !

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/7

------------------------------------------------------------------------
On 2013-03-10T17:08:14+00:00 Ilya Basin wrote:

Created attachment 77916
x

actually, it prints to stderr

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/8

------------------------------------------------------------------------
On 2013-03-10T17:40:09+00:00 Alex Fiestas wrote:

Oh indeed, can you add stderr too please?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/9

------------------------------------------------------------------------
On 2013-03-10T17:43:43+00:00 Ilya Basin wrote:

it is stderr ^

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/10

------------------------------------------------------------------------
On 2013-03-10T18:08:22+00:00 Alex Fiestas wrote:

Oh then, open "debugdialog", enable everything with the word "KDED" on
it, and try again.

You are missing a lot of debug info, for example KDED saying "loading
module bluedevil".

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/11

------------------------------------------------------------------------
On 2013-03-10T18:15:05+00:00 Ilya Basin wrote:

What debugdialog ? Don't find this command in $PATH or in Desktop search

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/12

------------------------------------------------------------------------
On 2013-03-10T18:25:15+00:00 Ilya Basin wrote:

Created attachment 77917
kded4-5.txt

never mind, found it. See the attached file

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/13

------------------------------------------------------------------------
On 2013-03-10T19:07:13+00:00 Alex Fiestas wrote:

Created attachment 77921
Usa usableAdapter instead of default

Sometimes BlueZ won't emit "defaultAdapterChange", it never worked 100%
perfect and it has been removed in BlueZ5...

So instead of it use "usableAdapter", which do not relay on BlueZ and
should work just fine.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/14

------------------------------------------------------------------------
On 2013-03-10T19:07:48+00:00 Alex Fiestas wrote:

Haven't test the patch, but should fix the issue, can you test it
please?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/15

------------------------------------------------------------------------
On 2013-03-10T19:45:14+00:00 Ilya Basin wrote:

The bluetooth icon now reappears after suspend, but "browse files"
doesn't work as before, until I restart the bluetooth service or
relogin.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/16

------------------------------------------------------------------------
On 2013-03-10T19:50:05+00:00 Ilya Basin wrote:

Created attachment 77922
kded4-9.txt: browse files, suspend, then try browse again

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/17

------------------------------------------------------------------------
On 2013-03-10T21:50:31+00:00 Alex Fiestas wrote:

Same patch could be almost applied to browse files, will do some testing
and push the patch.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/18

------------------------------------------------------------------------
On 2013-03-10T22:10:44+00:00 Alex Fiestas wrote:

Git commit 61e35f00d7f571166ff9a5139a74b510af279c5e by Àlex Fiestas.
Committed on 10/03/2013 at 23:07.
Pushed by afiestas into branch 'master'.

Added missing emit defaultChanged

M  +1    -0    bluedevil/bluedevilmanager.cpp

http://commits.kde.org/libbluedevil/61e35f00d7f571166ff9a5139a74b510af279c5e

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/19

------------------------------------------------------------------------
On 2013-03-10T22:11:43+00:00 Alex Fiestas wrote:

That should fix this, anyway I will switch to usableAdapter in most of
the places.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/20

------------------------------------------------------------------------
On 2013-03-10T22:40:27+00:00 Alex Fiestas wrote:

Git commit 52bd6afb50e70171d99f792f70dd4542ac0a056f by Àlex Fiestas.
Committed on 10/03/2013 at 23:36.
Pushed by afiestas into branch 'master'.

Use usableAdapter instead of defaultAdapter

defaultAdapter has been removed from BlueZ5 because it was problematic,
we had our share of problems with it so we implemented usableAdapter
which basically does what defaultAdapter does but additionally checks
isPowered.

M  +2    -2    src/actionplugins/audio/helper/audiohelper.cpp
M  +2    -2    src/actionplugins/input/helper/inputhelper.cpp
M  +2    -2    src/actionplugins/networkdun/helper/networkdunhelper.cpp
M  +2    -2    src/actionplugins/networkpanu/helper/networkpanuhelper.cpp
M  +7    -7    src/actionplugins/sendfile/helper/discoverwidget.cpp
M  +1    -1    src/actionplugins/sendfile/helper/pages/connectingpage.cpp
M  +3    -3    src/actionplugins/sendfile/helper/sendfilewizard.cpp
M  +1    -1    src/daemon/helpers/authorize/authorize.cpp
M  +1    -1    src/daemon/helpers/filereceiver/openobex/serversession.cpp
M  +3    -3    src/daemon/helpers/filereceiver/service.cpp
M  +10   -10   src/daemon/kded/BlueDevilDaemon.cpp
M  +1    -1    src/daemon/kded/BlueDevilDaemon.h
M  +4    -4    src/daemon/kded/bluezagent.cpp
M  +4    -4    src/daemon/obexftpkded/ObexFtpDaemon.cpp
M  +1    -1    src/daemon/obexftpkded/ObexFtpDaemon.h
M  +2    -2    src/fileitemactionplugin/sendfileitemaction.cpp
M  +8    -8    src/kcmodule/bluedeviladapters.cpp
M  +1    -1    src/kcmodule/bluedeviladapters.h
M  +14   -14   src/kcmodule/bluedevildevices.cpp
M  +1    -1    src/kcmodule/bluedevildevices.h
M  +6    -6    src/kcmodule/bluedeviltransfer.cpp
M  +1    -1    src/kcmodule/bluedeviltransfer.h
M  +5    -5    src/kcmodule/systemcheck.cpp
M  +2    -2    src/kio/bluetooth/kiobluetooth.cpp
M  +0    -2    src/kio/bluetooth/kiobluetooth.h
M  +16   -16   src/monolithic/monolithic.cpp
M  +1    -1    src/wizard/bluewizard.cpp
M  +7    -7    src/wizard/pages/discoverpage.cpp
M  +1    -1    src/wizard/pages/fail.cpp
M  +1    -1    src/wizard/pages/keyboardpairing.cpp
M  +1    -1    src/wizard/pages/legacypairing.cpp
M  +1    -1    src/wizard/pages/legacypairingdatabase.cpp
M  +2    -2    src/wizard/pages/nopairing.cpp
M  +1    -1    src/wizard/pages/servicespage.cpp
M  +3    -3    src/wizard/pages/ssppairing.cpp

http://commits.kde.org/bluedevil/52bd6afb50e70171d99f792f70dd4542ac0a056f

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/21

------------------------------------------------------------------------
On 2013-03-11T06:56:07+00:00 Ilya Basin wrote:

Created attachment 77937
kded4-12.txt: suspend multiple times

Applied your patches. The icon now vanishes after ~3 suspends. See
attached file.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/22

------------------------------------------------------------------------
On 2013-03-11T07:37:39+00:00 Ilya Basin wrote:

Same problem with git head

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/23

------------------------------------------------------------------------
On 2013-03-11T09:16:43+00:00 Alex Fiestas wrote:

Damn it... I can see another problem in your log, I kind of know how to
fix it, working on it.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/24

------------------------------------------------------------------------
On 2013-03-11T09:33:22+00:00 Alex Fiestas wrote:

Created attachment 77940
Clean the object on unregistered, emit changed on initialize and added some debug

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/25

------------------------------------------------------------------------
On 2013-03-11T09:34:01+00:00 Alex Fiestas wrote:

This patch cleans the object and emits defaultChanged and usableChanged
when initialize is called again, we where missing both things though the
later I suspect is the one causing the problems.

Please, test again and let's see if we fixed it for good this time !

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/26

------------------------------------------------------------------------
On 2013-03-11T10:20:00+00:00 Ilya Basin wrote:

Created attachment 77945
kded4-17.txt

Applied your patch to libbluetooth. It didn't help. I don't see the new messages in kded4 output.
See the attached file.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/27

------------------------------------------------------------------------
On 2013-03-11T10:58:02+00:00 Alex Fiestas wrote:

Ok, so at least the Daemon seems to be working fine and the double
"Added" or "Removed" events we were getting before are gone (the patch
works).

Now the problem seems to be only in monolithic (the thing that appears
in the systray), you can check in the log "it probably crashed".

Going to try to reproduce and cook a patch.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/28

------------------------------------------------------------------------
On 2013-03-11T11:06:33+00:00 Alex Fiestas wrote:

Git commit 8559a0d2436da9792611a6bf9446b8a58fe55917 by Àlex Fiestas.
Committed on 11/03/2013 at 12:03.
Pushed by afiestas into branch 'master'.

Emit defaultAdapterChanged and usableAdapterChanged on initialize

After all this is the first time they change, from 0 to *

M  +3    -0    bluedevil/bluedevilmanager.cpp

http://commits.kde.org/libbluedevil/8559a0d2436da9792611a6bf9446b8a58fe55917

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/29

------------------------------------------------------------------------
On 2013-03-11T11:06:33+00:00 Alex Fiestas wrote:

Git commit 19792c0085ed11c877e34d268b51c576b80215ef by Àlex Fiestas.
Committed on 11/03/2013 at 12:02.
Pushed by afiestas into branch 'master'.

Properly clean the object when the service is unregistered

M  +21   -17   bluedevil/bluedevilmanager.cpp

http://commits.kde.org/libbluedevil/19792c0085ed11c877e34d268b51c576b80215ef

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/30

------------------------------------------------------------------------
On 2013-03-11T11:27:45+00:00 Ilya Basin wrote:

should I try yet?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/31

------------------------------------------------------------------------
On 2013-03-11T11:29:55+00:00 Alex Fiestas wrote:

Try updating both, bluedevil and libbluedevil.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/32

------------------------------------------------------------------------
On 2013-03-11T12:20:14+00:00 Ilya Basin wrote:

Created attachment 77947
kded4-21.txt

> bluedevilmonolithic(19846): Communication problem with  "bluedevilmonolithic" , it probably crashed. 
It's still there

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/33

------------------------------------------------------------------------
On 2013-03-11T14:52:39+00:00 Alex Fiestas wrote:

Created attachment 77955
output process info

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/34

------------------------------------------------------------------------
On 2013-03-11T14:53:32+00:00 Alex Fiestas wrote:

Same deal, compile (bluedevil this time) with the applied patch, restart
kded, reproduce add info.

This time the patch only adds some more debug.

I have an idea of how to fix this, but provide the info just to be sure.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/35

------------------------------------------------------------------------
On 2013-03-11T15:21:20+00:00 Alex Fiestas wrote:

Additionally you can try to reproduce this with the branch:
betterMonolithicHandling let's se if we are lucky :p

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/36

------------------------------------------------------------------------
On 2013-03-11T17:29:49+00:00 Ilya Basin wrote:

Created attachment 77960
kded4-25.txt: with the process.txt patch

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/37

------------------------------------------------------------------------
On 2013-03-11T17:34:22+00:00 Ilya Basin wrote:

Should kded4 now print anything if I kill bluedevil-monolithic ? Well it
doesn't.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/38

------------------------------------------------------------------------
On 2013-03-11T19:12:34+00:00 Alex Fiestas wrote:

Ups, forgot to push some debugs, can you try again?

Thanks for all the testing btw.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/39

------------------------------------------------------------------------
On 2013-03-11T19:47:47+00:00 Ilya Basin wrote:

Created attachment 77964
kded4-29.txt

Switched to betterMonolithicHandling.
No problem with the icon after 7 suspends.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/40

------------------------------------------------------------------------
On 2013-03-11T19:54:14+00:00 Ilya Basin wrote:

Created attachment 77965
kded4-30.txt icon vanish again

Nope, the problem's still there

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/41

------------------------------------------------------------------------
On 2013-03-11T22:00:12+00:00 Alex Fiestas wrote:

Update libbluedevil and try again
(314c139e701d5619d8990638202f9593cbe9a6fb).

Thanks for all the feedback.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/42

------------------------------------------------------------------------
On 2013-03-14T05:26:23+00:00 Ilya Basin wrote:

Created attachment 78053
kded4-32.txt

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/43

------------------------------------------------------------------------
On 2013-03-14T06:08:35+00:00 Ilya Basin wrote:

It could be a bug in or misuse of KUniqueApplication. What do you think?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/44

------------------------------------------------------------------------
On 2013-03-14T07:23:07+00:00 Ilya Basin wrote:

Is bluedevil-monolithic supposed to restart on resume?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/45

------------------------------------------------------------------------
On 2013-03-14T14:04:45+00:00 Ilya Basin wrote:

> Is bluedevil-monolithic supposed to restart on resume?
OK, I see where it's killed.

Now, although bluedevil-monolithic is started, BlueDevilDaemon::monolithicStarted() is not called. I added kDebug() there and also set breakpoints with gdb.
The flag m_monolithicStarted is never set.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/46

------------------------------------------------------------------------
On 2013-03-14T17:53:44+00:00 Ilya Basin wrote:

I'm not a QT fan, but my tests show that:
- the started() and finished(int) events only work with QProcess::start(), not startDetached()
- For in-stack QProcess variables the finished(int) event is called on function return, not when the subprocess really dies

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/47

------------------------------------------------------------------------
On 2013-03-15T00:27:00+00:00 Alex Fiestas wrote:

Hehe you are completely right, gonna push the change.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/48

------------------------------------------------------------------------
On 2013-03-15T00:56:13+00:00 Alex Fiestas wrote:

Git commit af6b207ab400c713d5b33ce3a35d9684f7c98d64 by Àlex Fiestas.
Committed on 15/03/2013 at 01:52.
Pushed by afiestas into branch 'betterMonolithicHandling'.

Proper usage of QProcess if we intend to use the signals

Use QProcess:start instead of detached, also move to QProcess instead
of KProcess since we do not need any of the things provided by the later

M  +9    -6    src/daemon/kded/BlueDevilDaemon.cpp
M  +1    -1    src/daemon/kded/BlueDevilDaemon.h

http://commits.kde.org/bluedevil/af6b207ab400c713d5b33ce3a35d9684f7c98d64

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/49

------------------------------------------------------------------------
On 2013-03-15T01:50:12+00:00 Ilya Basin wrote:

Because bluedevil-monolithic goes to background,
BlueDevilDaemon::finished triggers immediately.

Both BlueDevilDaemon::finished() and BlueDevilDaemon::monolithicQuit() were added in the same commit. monolithicQuit() is triggered on d-bus reply.
I suspect that after processing the "quit" message bluedevil-monolithic is still registered in dbus for some time and will prevent another instance. So this watcher is probably not needed.

If it's true, bluedevil-monolithic needs a flag to run in foreground.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/50

------------------------------------------------------------------------
On 2013-03-15T04:07:01+00:00 Ilya Basin wrote:

Wait for my patch

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/51

------------------------------------------------------------------------
On 2013-03-15T08:19:53+00:00 Ilya Basin wrote:

Created attachment 78090
0001-more-fixes-in-BlueDevilDaemon-monolithic.patch

This is for branch betterMonolithicHandling.
But don't push it yet: I got an advice to use QDBusServiceWatcher. This way we can wait for the monolithic process launched elsewhere and probably the implementation will be simpler

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/52

------------------------------------------------------------------------
On 2013-03-15T09:24:01+00:00 Alex Fiestas wrote:

Oks, if not probably next week I will have time to look into this and
fix it for once, as you can see in the timestamps I'm doing it late at
night before sleep so I'm not putting any thought on it :p

Thanks for all the feedback, really appreciated.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/53

------------------------------------------------------------------------
On 2013-03-15T10:28:55+00:00 Ilya Basin wrote:

Created attachment 78093
0001-BlueDevilDaemon-monolithic-fix-race-condition-use-QD.patch

This patch applies to master. It uses QDBusServiceWatcher to launch
monolithik when the service is unregistered. It's simpler than using
QProcess signals, I reverted to startDetached().

The new branch called betterMonolithicHandling2. Compare:

$ git diff --stat master betterMonolithicHandling
 src/daemon/kded/BlueDevilDaemon.cpp | 94 
 src/daemon/kded/BlueDevilDaemon.h   |  9 
 2 files changed, 92 insertions(+), 11 deletions(-)
$ git diff --stat master betterMonolithicHandling2
 src/daemon/kded/BlueDevilDaemon.cpp | 64 
 src/daemon/kded/BlueDevilDaemon.h   |  5 
 2 files changed, 58 insertions(+), 11 deletions(-)

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/54

------------------------------------------------------------------------
On 2013-03-15T10:33:32+00:00 Ilya Basin wrote:

Created attachment 78094
kded4-41-QDBusServiceWatcher.txt

The "it probably crashed" message is there, but now it's not fatal. We
could avoid it with some flag variables, but it would make it complex.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/55

------------------------------------------------------------------------
On 2013-03-17T05:32:00+00:00 Ilya Basin wrote:

Created attachment 78124
kded4-50.txt

Today BlueDevilDaemon didn't return to online mode after suspend, see the attached log.
I guess bluedevilmanager found it not usable

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/56

------------------------------------------------------------------------
On 2013-03-17T19:14:05+00:00 Alex Fiestas wrote:

Git commit 8d771c35f2b4f0e0f3ee7ebcf156d461a2dd5eb3 by Àlex Fiestas, on behalf of Ilya Basin.
Committed on 15/03/2013 at 10:51.
Pushed by afiestas into branch 'master'.

BlueDevilDaemon/monolithic fix race condition, use QDBusServiceWatcher

M  +53   -11   src/daemon/kded/BlueDevilDaemon.cpp
M  +5    -0    src/daemon/kded/BlueDevilDaemon.h

http://commits.kde.org/bluedevil/8d771c35f2b4f0e0f3ee7ebcf156d461a2dd5eb3

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/57

------------------------------------------------------------------------
On 2013-03-17T19:17:28+00:00 Alex Fiestas wrote:

Last mode change in the log is to online, can't it be again monolithic
not getting executed ?

This week I will have time to deep test this and try to fix it once for
all.

Thanks for everything, really appreciated !

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/58

------------------------------------------------------------------------
On 2013-03-19T17:37:32+00:00 Ilya Basin wrote:

Created attachment 78213
kded4-52.txt

> can't it be again monolithic not getting executed ?
It's bluedevilmanager.
I added more logging there. Today it happened again.
According to the log, after wake _k_adapterRemoved() was called twice with "/org/bluez/426/hci0", then _k_adapterAdded() was called with the parameter "/org/bluez/426/hci0", then it called findUsableAdapter() and it returned NULL, so the server remained in offline mode.
grep -i "monolith\|bluedevil\|powerdevil" /tmp/kded4-51.txt > /tmp/kded4-52.txt

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/59

------------------------------------------------------------------------
On 2013-03-19T17:57:44+00:00 Ilya Basin wrote:

m_adaptersHash could not be empty. So the only reason is it wasn't powered.
But plain obex programs work now, so it is powered.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/60

------------------------------------------------------------------------
On 2013-03-19T22:43:48+00:00 Alex Fiestas wrote:

Created attachment 78220
adding some debug

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/61

------------------------------------------------------------------------
On 2013-03-19T22:45:49+00:00 Alex Fiestas wrote:

The other explanation will be that the service is still detected as
offline so Manager::Adapters will  return an empty list.

Add the debug in the last attached patch, if this is confirmed and our
logic is correct then we'll have to workaround this in deviceAdded.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/62

------------------------------------------------------------------------
On 2013-03-21T05:57:30+00:00 Ilya Basin wrote:

Created attachment 78254
bluedevil-monolithic-20130321-095003.kcrash

Today monolithic crashed in Monolithic::onlineMode(), because
Manager::self()->usableAdapter() returned NULL

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/63

------------------------------------------------------------------------
On 2013-03-21T06:10:40+00:00 Ilya Basin wrote:

service.patch> "qDebug()"
It's hard to grep for it. Do you know how to workaround the lack of kDebug ? I added this:
    #define myDebug() qDebug() << Q_FUNC_INFO << ": "
but I don't know how to add the process name and pid, like "kded(586) ..."

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/64

------------------------------------------------------------------------
On 2013-03-21T17:19:18+00:00 Ilya Basin wrote:

I got the proof.
At first _k_adapterAdded() called, only then the property "Powered" is set to true:

void BlueDevil::Manager::Private::_k_adapterAdded(const QDBusObjectPath&) :  Added:  "/org/bluez/412/hci0" 
void BlueDevil::Manager::Private::_k_adapterAdded(const QDBusObjectPath&) :  !m_usableAdapter 
BlueDevil::Adapter* BlueDevil::Manager::Private::findUsableAdapter() :  
BlueDevil::Adapter* BlueDevil::Manager::Private::findUsableAdapter() :  defAdapter =  0x2724110 
void BlueDevil::Adapter::Private::fetchProperties() :  this =  0x2839bf0  m_powered =  false 
BlueDevil::Adapter* BlueDevil::Manager::Private::findUsableAdapter() :  defAdapter->isPowered =  false 
QList<BlueDevil::Adapter*> BlueDevil::Manager::adapters() const :  
QList<BlueDevil::Adapter*> BlueDevil::Manager::adapters() const :  return d->m_adaptersHash.values() 
BlueDevil::Adapter* BlueDevil::Manager::Private::findUsableAdapter() :  adapter =  0x2724110 
BlueDevil::Adapter* BlueDevil::Manager::Private::findUsableAdapter() :  adapter->isPowered() =  false 
BlueDevil::Adapter* BlueDevil::Manager::Private::findUsableAdapter() :  return 0 
void BlueDevil::Manager::Private::_k_adapterAdded(const QDBusObjectPath&) :  m_usableAdapter =  0x0 
void BlueDevil::Manager::Private::_k_adapterAdded(const QDBusObjectPath&) :  m_oldUsableAdapter =  0x0 
void BlueDevil::Adapter::Private::_k_propertyChanged(const QString&, const QDBusVariant&) :  this =  0x2839bf0   "UUIDs"  =  "" 
void BlueDevil::Adapter::Private::_k_propertyChanged(const QString&, const QDBusVariant&) :  this =  0x2839bf0   "Pairable"  =  "true" 
void BlueDevil::Adapter::Private::_k_propertyChanged(const QString&, const QDBusVariant&) :  this =  0x2839bf0   "Powered"  =  "true" 
void BlueDevil::Adapter::Private::_k_propertyChanged(const QString&, const QDBusVariant&) :  this =  0x2839bf0  m_powered =  true 
void BlueDevil::Adapter::Private::_k_propertyChanged(const QString&, const QDBusVariant&) :  this =  0x2839bf0   "Pairable"  =  "true" 
void BlueDevil::Adapter::Private::_k_propertyChanged(const QString&, const QDBusVariant&) :  this =  0x2839bf0   "Discoverable"  =  "true"

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/65

------------------------------------------------------------------------
On 2013-03-24T17:17:28+00:00 Alex Fiestas wrote:

Git commit 0fa1e2bebe56c0409e8911537da0502b671b6ff2 by Àlex Fiestas.
Committed on 24/03/2013 at 18:12.
Pushed by afiestas into branch 'master'.

On Adapter::poweredChanged, check if we need to modify usableAdapter

One of the things we do in usableAdapter is check if the adapter is
powered, if it is not then we consider the adapter not usable.

It happens that an adaptor is added but it is not powered so we discaard
it as an usableAdapter. When that happens we have to make sure that we
are listening to "poweredChanged" and check if usableAdapter should be
changed when that happens (an adapter has become powered, use it in case
we do not have any usableAdapter).

this whole usableAdapter thing is a mess we have to revise for 2.0

M  +30   -0    bluedevil/bluedevilmanager.cpp
M  +1    -0    bluedevil/bluedevilmanager.h

http://commits.kde.org/libbluedevil/0fa1e2bebe56c0409e8911537da0502b671b6ff2

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/66

------------------------------------------------------------------------
On 2013-03-24T17:18:06+00:00 Alex Fiestas wrote:

Git commit 014cc0b890a8232f44fc6f231bb01b86cbaafb62 by Àlex Fiestas.
Committed on 24/03/2013 at 17:32.
Pushed by afiestas into branch 'master'.

Check if there is an usable adapter before going to onlineMode

An adapter can be added but it might no be usable (not powered) so we
have to be certain that there is an usableAdapter before going into
onlineMode.

In the future We should connect only to usableAdapterChanged to make
the code waay simpler, but since we are close to release let's not
modify too much code.

M  +1    -1    src/monolithic/monolithic.cpp

http://commits.kde.org/bluedevil/014cc0b890a8232f44fc6f231bb01b86cbaafb62

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/67

------------------------------------------------------------------------
On 2013-03-28T05:03:50+00:00 Ilya Basin wrote:

I think there's a leak of Adapter objects. I put qDebug into its constructor and destructor and after several suspends the constructor was called 10 times and the destructor only 4 times.
Of course, some objects wasn't destroyed at monolithic termination; it's normal.
But according to logs there was this case inside one monolithic instance:
Adapter 1 is created in Manager::Private::initialize(). It has powered = true
Later is called _k_adapterPoweredChanged(false) and sets m_defaultAdapter = 0
Later findUsableAdapter() calls defaultAdapter() that creates Adapter 2, because m_defaultAdapter == 0; Adapter 1 still exists, but not in the list anymore
_k_adapterRemoved() is called and destroys Adapter 2
Then findUsableAdapter() calls defaultAdapter() that creates Adapter 3
Then _k_adapterAdded() is called and creates Adapter 4
Then Adapter 1 _k_propertyChanged() is called with "Powered"  =  "true"

In the end we have Adapter 4 in the list and Adaper 1 and 3 lost. One
question: why set m_defaultAdapter = 0 in _k_adapterPoweredChanged?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/68

------------------------------------------------------------------------
On 2013-04-05T16:42:02+00:00 Alex Fiestas wrote:

Git commit 47bc8b9bce111e901aae6aba23a32d9828a4988e by Àlex Fiestas.
Committed on 05/04/2013 at 18:39.
Pushed by afiestas into branch 'master'.

Avoid creating Adapter objects for dbusPath that we already have

M  +6    -1    bluedevil/bluedevilmanager.cpp

http://commits.kde.org/libbluedevil/47bc8b9bce111e901aae6aba23a32d9828a4988e

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/69

------------------------------------------------------------------------
On 2013-04-05T16:43:46+00:00 Alex Fiestas wrote:

Indeed we were not checking if we already had an adapter for that
dbusPath.

is the bug gone with the latest patch (014cc0b890a82) ?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/70

------------------------------------------------------------------------
On 2013-04-06T04:48:20+00:00 Ilya Basin wrote:

I think m_bluezManagerInterface->DefaultAdapter() should be used only
during init and after that manager should rely only on events. This way
after _k_adapterRemoved() the call to Manager::defaultAdapter() will
return NULL which is correct.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/71

------------------------------------------------------------------------
On 2013-04-06T08:23:14+00:00 Ilya Basin wrote:

Created attachment 78671
0001-don-t-touch-m_defaultAdapter-on-adapterPoweredChange.patch

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/72

------------------------------------------------------------------------
On 2014-01-19T17:09:30+00:00 Alex Fiestas wrote:

Sorry for the huge delay replying to the bug :/

Going to check if the patch make sense and if it should be applied in
2.0 branch as well.

Will release new point releases if needed, thanks !

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/73

------------------------------------------------------------------------
On 2014-01-20T01:13:23+00:00 Alex Fiestas wrote:

Can you check this patch as well?
http://bugsfiles.kde.org/attachment.cgi?id=84736

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/74

------------------------------------------------------------------------
On 2014-01-26T11:10:58+00:00 Ilya Basin wrote:

Please give me some time to remember. I haven't used that PC for a
while.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/75

------------------------------------------------------------------------
On 2014-10-25T07:06:11+00:00 Peter wrote:

Bluetooth on KDE 4.14.2 is always on after suspend, even though I set it
to off beforehand.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/76

------------------------------------------------------------------------
On 2014-11-15T10:00:48+00:00 David Rosca wrote:

Git commit 38f78cae2e67562bb40640a87d9f34f8e1a4f200 by David Rosca.
Committed on 15/11/2014 at 09:58.
Pushed by drosca into branch 'master'.

Restore adapter powered state after wakeup from suspend

M  +45   -1    src/daemon/kded/BlueDevilDaemon.cpp
M  +2    -0    src/daemon/kded/BlueDevilDaemon.h

http://commits.kde.org/bluedevil/38f78cae2e67562bb40640a87d9f34f8e1a4f200

Reply at:
https://bugs.launchpad.net/ubuntu/+source/bluedevil/+bug/1466347/comments/77


** Changed in: kde-bluetooth
       Status: Unknown => Fix Released

** Changed in: kde-bluetooth
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to bluedevil in Ubuntu.
https://bugs.launchpad.net/bugs/1466347

Title:
  After resume bluedevil doesn't find bluetooth adapter

To manage notifications about this bug go to:
https://bugs.launchpad.net/kde-bluetooth/+bug/1466347/+subscriptions




More information about the kubuntu-bugs mailing list