Bluetooth problem still present... [Solved]

Issues Related to Networking (Wired and Wireless)

Moderator: Moderators

Bluetooth problem still present... [Solved]

Postby thenthenio » Sat Jul 18, 2009 21:30

Some months ago an update of Bluetooth stack (Bluez or kdebluetooth) had the result of Bluetooth device not being recognized any more.
To fix the problem I had to recover the old stack (I normally use Entropy):
Code: Select all
emerge bluez-libs bluez-utils bluez-hcidump

Since then all the times I do a software update my Bluetooth device stops working at the next boot.
So, all the times, after the update I need also to:
Code: Select all
emerge bluez-libs bluez-utils bluez-hcidump

This exact behaviour happens on both my 2 PCs (SL 4.2): a desktop (Asus MB with Bluetooth USB dongle) and an HP Compaq 8510w laptop with embedded Bluetooth.
If this Bluetooth problem has been fixed, how can I bail out from this loop (I mean configure the working version of Bluetooth stack)?
If this Bluetooth problem has not been fixed, is there something I can do to avoid the emerge step (I mean masking some packages or something similar), waiting for the problem to be fixed?

Thanks.
Mauro
thenthenio
Old Dear Hen
 
Posts: 522
Joined: Thu Mar 01, 2007 23:11
Location: Melegnano (MI) Italy

Re: Bluetooth problem still present...

Postby Fitzcarraldo » Sat Jul 18, 2009 21:36

It hasn't been fixed yet.

Try masking net-wireless/bluez
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7978
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Bluetooth problem still present...

Postby thenthenio » Sun Jul 19, 2009 16:38

Yes, I did that in:
Code: Select all
/etc/entropy/packages/package.mask

but seems not enough...
thenthenio
Old Dear Hen
 
Posts: 522
Joined: Thu Mar 01, 2007 23:11
Location: Melegnano (MI) Italy

Re: Bluetooth problem still present...

Postby Fitzcarraldo » Mon Jul 20, 2009 12:15

You could use the following command:

Code: Select all
equery depends bluez

to fnd the packages that depend on the package net-wireless/bluez, and mask and uninstall those too.

Code: Select all
$ equery depends bluez
[ Searching for packages depending on bluez... ]
app-mobilephone/gnokii-0.6.27-r2 (bluetooth? net-wireless/bluez)
app-mobilephone/obexftp-0.23 (bluetooth? net-wireless/bluez)
app-pda/pilot-link-0.12.3 (bluetooth? net-wireless/bluez)
dev-libs/openobex-1.5 (bluetooth? net-wireless/bluez)
gnome-base/gvfs-1.2.3 (bluetooth? net-wireless/bluez)
media-sound/pulseaudio-0.9.15-r1 (bluetooth? net-wireless/bluez)
media-video/totem-2.26.2 (bluetooth? net-wireless/bluez)
net-wireless/bluez-hcidump-1.42 (net-wireless/bluez)
net-wireless/kdebluetooth-1.0_beta8-r2 (net-wireless/bluez)
net-wireless/libbtctl-0.11.1 (>=net-wireless/bluez-4)

But first check the ebuilds of the packages that the equery depends command lists, because some of them depend on either bluez or bluez-libs, in which case they're OK to leave installed and unmasked. For example, the appmobilephone/obexftp-0.23-r1 ebuild contains the runtime dependency:

Code: Select all
bluetooth? ( || ( net-wireless/bluez net-wireless/bluez-libs ) )

which means that it is designed to work with either net-wireless/bluez installed or net-wireless/bluez-libs installed. As you know, the package net-wireless/bluez replaced the packages net-wireless/bluez-libs and net-wireless/bluez-utils although, as you also know, net-wireless/bluez doesn't work! Well, at least up to version net-wireless/bluez-4.40, which I tried on 2 June 2009 (I created the ebuild from a diff file in the Gentoo Bugzilla). I notice from the BlueZ Web site that the latest version of bluez is 4.46, released on 18 July 2009, so there is hope for us yet! Unfortunately the latest version of the bluez package in the main Portage tree is net-wireless/bluez-4.39, so we'll have to wait. There is an ebuild diff file for version 4.45 in the Gentoo Bugzilla (Gentoo Bug Report No. 270859), so you could easily create the ebuild for bluez-4.45 and merge it to see if it solves the problem. I don't have the time at the moment, otherwise I'd do it myself.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7978
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Bluetooth problem still present...

Postby Fitzcarraldo » Tue Jul 21, 2009 6:03

OK, I got net-wireless/bluez working under KDE 4.2.4 after a lot of reading, obtaining different pieces of the puzzle from different Web sites, and then hacking. I can now send files from my mobile phone to my laptop and vice versa. The following steps summarise the procedure, although I went through a series of iterations/failed merges before achieving success so I hope I have remembered everything and that the procedure described below reflects correctly what needs to be done.

First install bluez-4.45. To do this create the ebuild for bluez-4.45 by using the diff file from Gentoo Bugzilla Bug Report 270859 as follows. Save the diff file bluez-4.45.ebuild.diff and the patch file bluez-builds.patch from the Gentoo bug report to your Desktop. Google for the file cups-location.patch and save it to your Desktop too. Then do the following as root user, not forgetting to enter the command etc-update whenever a merge tells you a config file needs to be updated:

Code: Select all
# emerge --sync
# layman -S
# emerge -C bluez-utils bluez-libs
# emerge -1v =bluez-4.39
# cp /usr/portage/net-wireless/bluez/bluez-4.39.ebuild /usr/portage/net-wireless/bluez/bluez-4.45.ebuild
# patch /usr/portage/net-wireless/bluez/bluez-4.45.ebuild /home/fitzcarraldo/Desktop/bluez-4.45.ebuild.diff
# cp /home/fitzcarraldo/Desktop/bluez-builds.patch /usr/portage/net-wireless/bluez/files/
# cp /home/fitzcarraldo/Desktop/cups-location.patch /usr/portage/net-wireless/bluez/files/
# cp /usr/portage/net-wireless/bluez/files/4.34-conditional_libsbc.patch /usr/portage/net-wireless/bluez/files/conditional_libsbc.patch
# cd /usr/portage/net-wireless/bluez/
# ebuild bluez-4.45.ebuild manifest
# USE="consolekit" emerge -1v =bluez-4.45

(Obviously replace "fitzcarraldo" with your username.)

Then edit the file /etc/dbus-1/system.d/bluetooth.conf and add the plugdev group as a policy:

Code: Select all
<!-- This configuration file specifies the required security policies
     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">
    <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent"/>
  </policy>

  <policy at_console="true">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy group="plugdev">
    <allow send_destination="org.bluez"/>
  </policy>

  <policy context="default">
    <deny send_destination="org.bluez"/>
  </policy>

</busconfig>

(Actually I'm not sure if the above step is necessary and/or if it's a security risk; I'll have to investigate further.)

Then, to get access to an ebuild for kdebluetooth4-0.3, add the kde-testing overlay:

Code: Select all
# layman -a kde-testing

Then merge kdebluetooth4:

Code: Select all
# emerge -1v kdebluetooth4

Then reboot and enter the following command under your username:

Code: Select all
$ kbluetooth4

and the following command as the root user:

Code: Select all
# udevadm trigger --subsystem-match=bluetooth

which causes the KBluetooth4 icon to appear in the KDE Taskbar on the Panel. Right-click on it, select Settings > Bluetooth Adapters and change the Mode to "discoverable", and then you will be able to pair with your mobile phone and send files from your mobile phone to your PC and vice versa. Files uploaded to your PC are stored in the hidden directory /home/<username>/.kbluetooth4

I hate Linux and KDE 4! :wink: :clown: GNOME users just have to install Blueman, which apparently works out of the box. :roll:

(I did create an ebuild for bluez-4.46 too (BlueZ 4.46 was release on 18 July), which required another hack to get it to build, but I have not tested the built bluez-4.46 yet as bluez-4.45 seems to work and I want to play with it a bit first.)
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7978
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Bluetooth problem still present...

Postby thenthenio » Tue Jul 21, 2009 21:37

Ugh!
Too complex for me...
Besides I'm still on KDE 3.5.10.
I'll wait...

Thank you, I really appreciate your effort.
Mauro
thenthenio
Old Dear Hen
 
Posts: 522
Joined: Thu Mar 01, 2007 23:11
Location: Melegnano (MI) Italy

Re: Bluetooth problem still present...

Postby tyranny12 » Tue Aug 18, 2009 5:39

Just for the record, on bluetooth 4.39 just adding plugdev and running the udevadm command once as root worked. I didn't get the icon until reboot, but its now persistent. I did add kbluetooth4 to autostart, however.
tyranny12
Young Hen
 
Posts: 21
Joined: Tue Jan 08, 2008 3:17

Re: Bluetooth problem still present...

Postby thenthenio » Wed Aug 26, 2009 14:08

On holiday I did manage to go thtough your suggested procedure.
YES. IT WORKS!
I can also confirm what tyranny12 says: everything works with bluez 4.39!
I had some problems emerging kdebluetooth4 because of many blocking packages (various qt-extensions): I removed the blocking packages, emerged kdebluetooth4 and then reemerged the needed qt-extensions.
KDE was not starting any more, so, looking at .xsession-errors file I found that 2 more qt-extensions were needed: qt-webkit and qt-opengl after that KDE and kdebluetooth4 were running as expected and bluetooth is working now!!!

Many thanks fitzcarraldo and tyranny12.
Mauro
thenthenio
Old Dear Hen
 
Posts: 522
Joined: Thu Mar 01, 2007 23:11
Location: Melegnano (MI) Italy

Re: Bluetooth problem still present... [Solved]

Postby Fitzcarraldo » Wed Aug 26, 2009 14:43

Glad to hear you have it working again. Marking the thread Solved.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7978
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Bluetooth problem still present... [Solved]

Postby lxnay » Sat Sep 05, 2009 12:40

Thanks guys, I am fixing net-wireless/bluez in all the available repositories.
Image
Join us on IRC (chat.freenode.net #sabayon or WebChat)
Submit bugs to our Bug Tracker
Follow me on Twitter
Add me on Facebook
Add me on Google+
lxnay
Land Owner
 
Posts: 3595
Joined: Thu Oct 13, 2005 23:16
Location: Italy


Return to Networking and Wireless

Who is online

Users browsing this forum: No registered users and 2 guests

cron