After resume bluedevil doesn't find bluetooth adapter
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KDE Bluetooth Framework |
Fix Released
|
Medium
|
|||
bluedevil (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
After a suspend/resume the bluetooth icon is greyed out and clicking on it the message is (localized) "cannot find adapter".
Killing the "bluedevil-
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: bluedevil 2.0~rc1really1.
ProcVersionSign
Uname: Linux 3.19.0-21-generic x86_64
NonfreeKernelMo
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: KDE
Date: Thu Jun 18 08:49:05 2015
SourcePackage: bluedevil
UpgradeStatus: No upgrade log present (probably fresh install)
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #5 |
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #6 |
please help
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #7 |
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
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #8 |
> 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/
/org/bluez/test
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #9 |
In Archlinux I can reproduce this, will investigate and fix.
thanks for the report !
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #10 |
Can you reproduce this all the time? I have been trying to reproduce this today and so far no luck.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #11 |
Yes.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #12 |
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 !
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #13 |
Created attachment 77916
x
actually, it prints to stderr
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #14 |
Oh indeed, can you add stderr too please?
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #15 |
it is stderr ^
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #16 |
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".
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #17 |
What debugdialog ? Don't find this command in $PATH or in Desktop search
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #18 |
Created attachment 77917
kded4-5.txt
never mind, found it. See the attached file
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #19 |
Created attachment 77921
Usa usableAdapter instead of default
Sometimes BlueZ won't emit "defaultAdapter
So instead of it use "usableAdapter", which do not relay on BlueZ and should work just fine.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #20 |
Haven't test the patch, but should fix the issue, can you test it please?
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #21 |
The bluetooth icon now reappears after suspend, but "browse files" doesn't work as before, until I restart the bluetooth service or relogin.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #22 |
Created attachment 77922
kded4-9.txt: browse files, suspend, then try browse again
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #23 |
Same patch could be almost applied to browse files, will do some testing and push the patch.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #24 |
Git commit 61e35f00d7f5711
Committed on 10/03/2013 at 23:07.
Pushed by afiestas into branch 'master'.
Added missing emit defaultChanged
M +1 -0 bluedevil/
http://
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #25 |
That should fix this, anyway I will switch to usableAdapter in most of the places.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #26 |
Git commit 52bd6afb50e7017
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/actionplugi
M +2 -2 src/actionplugi
M +2 -2 src/actionplugi
M +2 -2 src/actionplugi
M +7 -7 src/actionplugi
M +1 -1 src/actionplugi
M +3 -3 src/actionplugi
M +1 -1 src/daemon/
M +1 -1 src/daemon/
M +3 -3 src/daemon/
M +10 -10 src/daemon/
M +1 -1 src/daemon/
M +4 -4 src/daemon/
M +4 -4 src/daemon/
M +1 -1 src/daemon/
M +2 -2 src/fileitemact
M +8 -8 src/kcmodule/
M +1 -1 src/kcmodule/
M +14 -14 src/kcmodule/
M +1 -1 src/kcmodule/
M +6 -6 src/kcmodule/
M +1 -1 src/kcmodule/
M +5 -5 src/kcmodule/
M +2 -2 src/kio/
M +0 -2 src/kio/
M +16 -16 src/monolithic/
M +1 -1 src/wizard/
M +7 -7 src/wizard/
M +1 -1 src/wizard/
M +1 -1 src/wizard/
M +1 -1 src/wizard/
M +1 -1 src/wizard/
M +2 -2 src/wizard/
M +1 -1 src/wizard/
M +3 -3 src/wizard/
http://
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #27 |
Created attachment 77937
kded4-12.txt: suspend multiple times
Applied your patches. The icon now vanishes after ~3 suspends. See attached file.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #28 |
Same problem with git head
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #29 |
Damn it... I can see another problem in your log, I kind of know how to fix it, working on it.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #30 |
Created attachment 77940
Clean the object on unregistered, emit changed on initialize and added some debug
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #31 |
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 !
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #32 |
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.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #33 |
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.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #34 |
Git commit 8559a0d2436da97
Committed on 11/03/2013 at 12:03.
Pushed by afiestas into branch 'master'.
Emit defaultAdapterC
After all this is the first time they change, from 0 to *
M +3 -0 bluedevil/
http://
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #35 |
Git commit 19792c0085ed11c
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/
http://
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #36 |
should I try yet?
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #37 |
Try updating both, bluedevil and libbluedevil.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #38 |
Created attachment 77947
kded4-21.txt
> bluedevilmonoli
It's still there
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #39 |
Created attachment 77955
output process info
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #40 |
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.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #41 |
Additionally you can try to reproduce this with the branch: betterMonolithi
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #42 |
Created attachment 77960
kded4-25.txt: with the process.txt patch
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #43 |
Should kded4 now print anything if I kill bluedevil-
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #44 |
Ups, forgot to push some debugs, can you try again?
Thanks for all the testing btw.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #45 |
Created attachment 77964
kded4-29.txt
Switched to betterMonolithi
No problem with the icon after 7 suspends.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #46 |
Created attachment 77965
kded4-30.txt icon vanish again
Nope, the problem's still there
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #47 |
Update libbluedevil and try again (314c139e701d56
Thanks for all the feedback.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #48 |
Created attachment 78053
kded4-32.txt
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #49 |
It could be a bug in or misuse of KUniqueApplication. What do you think?
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #50 |
Is bluedevil-
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #51 |
> Is bluedevil-
OK, I see where it's killed.
Now, although bluedevil-
The flag m_monolithicStarted is never set.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #52 |
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
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #53 |
Hehe you are completely right, gonna push the change.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #54 |
Git commit af6b207ab400c71
Committed on 15/03/2013 at 01:52.
Pushed by afiestas into branch 'betterMonolith
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/
M +1 -1 src/daemon/
http://
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #55 |
Because bluedevil-
Both BlueDevilDaemon
I suspect that after processing the "quit" message bluedevil-
If it's true, bluedevil-
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #56 |
Wait for my patch
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #57 |
Created attachment 78090
0001-more-
This is for branch betterMonolithi
But don't push it yet: I got an advice to use QDBusServiceWat
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #58 |
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.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #59 |
Created attachment 78093
0001-BlueDevilD
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 betterMonolithi
$ git diff --stat master betterMonolithi
src/daemon/
src/daemon/
2 files changed, 92 insertions(+), 11 deletions(-)
$ git diff --stat master betterMonolithi
src/daemon/
src/daemon/
2 files changed, 58 insertions(+), 11 deletions(-)
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #60 |
Created attachment 78094
kded4-41-
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.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #61 |
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
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #62 |
Git commit 8d771c35f2b4f0e
Committed on 15/03/2013 at 10:51.
Pushed by afiestas into branch 'master'.
BlueDevilDaemon
M +53 -11 src/daemon/
M +5 -0 src/daemon/
http://
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #63 |
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 !
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #64 |
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/
grep -i "monolith\
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #65 |
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.
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #66 |
Created attachment 78220
adding some debug
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #67 |
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.
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #68 |
Created attachment 78254
bluedevil-
Today monolithic crashed in Monolithic:
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #69 |
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) ..."
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #70 |
I got the proof.
At first _k_adapterAdded() called, only then the property "Powered" is set to true:
void BlueDevil:
void BlueDevil:
BlueDevil::Adapter* BlueDevil:
BlueDevil::Adapter* BlueDevil:
void BlueDevil:
BlueDevil::Adapter* BlueDevil:
QList<BlueDevil
QList<BlueDevil
BlueDevil::Adapter* BlueDevil:
BlueDevil::Adapter* BlueDevil:
BlueDevil::Adapter* BlueDevil:
void BlueDevil:
void BlueDevil:
void BlueDevil:
void BlueDevil:
void BlueDevil:
void BlueDevil:
void BlueDevil:
void BlueDevil:
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #71 |
Git commit 0fa1e2bebe56c04
Committed on 24/03/2013 at 18:12.
Pushed by afiestas into branch 'master'.
On Adapter:
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/
M +1 -0 bluedevil/
http://
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #72 |
Git commit 014cc0b890a8232
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 usableAdapterCh
the code waay simpler, but since we are close to release let's not
modify too much code.
M +1 -1 src/monolithic/
http://
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #73 |
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:
Later is called _k_adapterPower
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_propertyChan
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_adapterPower
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #74 |
Git commit 47bc8b9bce111e9
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/
http://
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #75 |
Indeed we were not checking if we already had an adapter for that dbusPath.
is the bug gone with the latest patch (014cc0b890a82) ?
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #76 |
I think m_bluezManagerI
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #77 |
Created attachment 78671
0001-don-
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #78 |
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 !
In KDE Bug Tracking System #314356, Alex Fiestas (afiestas) wrote : | #79 |
Can you check this patch as well?
http://
In KDE Bug Tracking System #314356, Ilya Basin (basinilya) wrote : | #80 |
Please give me some time to remember. I haven't used that PC for a while.
In KDE Bug Tracking System #314356, Peter (auxsvr-gmail) wrote : | #81 |
Bluetooth on KDE 4.14.2 is always on after suspend, even though I set it to off beforehand.
In KDE Bug Tracking System #314356, David Rosca (nowrep) wrote : | #82 |
Git commit 38f78cae2e67562
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/
M +2 -0 src/daemon/
http://
Luca Olivetti (olivluca) wrote : | #1 |
- Dependencies.txt Edit (18.4 KiB, text/plain; charset="utf-8")
- JournalErrors.txt Edit (484.1 KiB, text/plain; charset="utf-8")
- ProcEnviron.txt Edit (98 bytes, text/plain; charset="utf-8")
Luca Olivetti (olivluca) wrote : | #2 |
I was going to report it upstream but looking at kde bug
https:/
the version of bluedevil released in kubuntu is unmaintained.
Launchpad Janitor (janitor) wrote : | #3 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in bluedevil (Ubuntu): | |
status: | New → Confirmed |
Changed in bluedevil (Ubuntu): | |
importance: | Undecided → Medium |
Ian Turner (vectro) wrote : | #4 |
There is a patch available in this other KDE bug report: https:/
I think all we need to do is apply this patch to the Kubuntu version:
https:/
As a workaround, you can restore the adapter power after suspend with these commands:
sudo rfkill unblock bluetooth
sudo hciconfig hci0 up
Changed in kde-bluetooth: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
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