Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315749 - net-wireless/bluez-4.63 - Dell bluetooth doesn't get initialized
Summary: net-wireless/bluez-4.63 - Dell bluetooth doesn't get initialized
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Pacho Ramos
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-17 15:24 UTC by Balazs Nemeth
Modified: 2010-07-04 12:58 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
output of lsusb -v (lsusb-output.txt,55.54 KB, text/plain)
2010-04-18 19:48 UTC, Balazs Nemeth
Details
dmesg before/after output (dmesg.txt,865 bytes, text/plain)
2010-04-19 16:37 UTC, Balazs Nemeth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Nemeth 2010-04-17 15:24:13 UTC
There is an udev rules script in the bluez's source which is not installed by the ebuild.
Named bluetooth-hid2hci.rules. It contains Dell specific rules to switch the bluetooth into HCI mode.

Older bluez ebuilds had a conf.d settings which made the bluetooth initscript to do this switch automatically. But now this support is missing from the ebuild. At least from 4.63. 

After using the following command manually, the device appears and ready to use.

hid2hci --method dell -v 413c -p 8158 --mode hci


Reproducible: Always

Steps to Reproduce:
1. emerge -av >net-wireless/bluez-4.39-r2
2. /ec/init.d/bluetooth start
3. hcitool scan

Actual Results:  
Device is not available: No such device

Expected Results:  
Scanning...
 <actual results of scanning>

emerge --info
Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.33-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.33-gentoo-r1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T8300_@_2.40GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 17 Apr 2010 13:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4-r1
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.8.5-r3, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Broadcom PUEL skype-eula dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/home/gentoo/distfiles"
FEATURES="assume-digests ccache distlocks fixpackages metadata-transfer news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch webrsync-gpg"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/ http://gentoo.osuosl.org/"
LANG="hu_HU.UTF-8"
LC_ALL="hu_HU.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="hu"
MAKEOPTS="-j3"
PKGDIR="/home/gentoo/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/home/gentoo/tmp"
PORTDIR="/home/gentoo/portage"
PORTDIR_OVERLAY="/home/gentoo/overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cxx dbus dri dts dvd dvdr emboss exif fam firefox flac ftp gdbm gif gstreamer hal iconv jpeg lcms libnotify mad mikmod mmx mmxext mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp pam pango pch pcre pdf perl png ppds pppd python qt3support readline reflection sdl session slang spl sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd tiff truetype unicode usb vorbis xcb xcomposite xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_dbd authn_default authn_file authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir env expires ext_filter filter headers ident imagemap include info log_config mem_cache mime mime_magic negotiation rewrite setenvif so speling status userdir usertrack unique_id vhost_alias suexec" APACHE2_MPMS="worker" CAMERAS="canon fuji ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hu" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa radeon" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Pacho Ramos gentoo-dev 2010-04-18 12:32:13 UTC
(In reply to comment #0)
> There is an udev rules script in the bluez's source which is not installed by
> the ebuild.
> Named bluetooth-hid2hci.rules. 

It's installed here:
/lib64/udev/rules.d/97-bluetooth-hid2hci.rules

Please provide "emerge -pv bluez"
Comment 2 Balazs Nemeth 2010-04-18 14:57:46 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > There is an udev rules script in the bluez's source which is not installed by
> > the ebuild.
> > Named bluetooth-hid2hci.rules. 
> 
> It's installed here:
> /lib64/udev/rules.d/97-bluetooth-hid2hci.rules
Hm I didn't notice. Then why doesn't it work?
> 
> Please provide "emerge -pv bluez"
> 

emerge -pv bluez

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] net-wireless/bluez-4.63  USE="alsa caps consolekit gstreamer usb -cups -debug -old-daemons -pcmcia -test-programs" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Let me know if I can provide anything usefull.
Comment 3 Pacho Ramos gentoo-dev 2010-04-18 17:50:55 UTC
Please attach "lsusb -v" output
Comment 4 Balazs Nemeth 2010-04-18 19:48:47 UTC
Created attachment 228325 [details]
output of lsusb -v

Here you are.
Comment 5 Pacho Ramos gentoo-dev 2010-04-19 15:37:38 UTC
Is it a mouse device? Can you try to connect and disconnect it and, then, check if any message is shown in /var/log/messages related with udev rules?

I don't see why the rule is not working ok :-(

# Variety of Dell Bluetooth devices
#
# it looks like a bit of an odd rule, because it is matching
# on a mouse device that is self powered, but that is where
# a HID report needs to be sent to switch modes.
#
# Known supported devices:
#   413c:8154
#   413c:8158
#   413c:8162
ACTION=="add", ENV{ID_VENDOR}=="413c", ENV{ID_CLASS}=="mouse", ATTRS{bmAttributes}=="e0", KERNEL=="mouse*", RUN+="/usr/sbin/hid2hci --method dell -v $env{ID_VENDOR} -p $env{ID_MODEL} --mode hci"
...
Comment 6 Balazs Nemeth 2010-04-19 16:37:06 UTC
Created attachment 228417 [details]
dmesg before/after output

There is a hardware switch on my laptop which turns on or off the wireless devices e.g wifi, bluetooth. It depends on what I set in the BIOS. Now it controls both.

Most of the Dell laptops' bluetooth device presents a fake mouse and a fake keyboard device.

"Those 2 USB devices you see are actually part of the bluetooth
 controller.  They can emulate a keyboard and mouse when the
 adapter is in HID mode.  That patch I was referring to switches
 the controller into HCI mode and back to HID mode.  It will always
 default to HID mode at boot.
"

http://lists.us.dell.com/pipermail/linux-desktops/2008-August/001814.html
http://www.avalpa.com/assets/andrea/studio15/debian_on_dell_studio15.html
Comment 7 Balazs Nemeth 2010-04-19 16:40:37 UTC
I almost forgot to mention, that I'm using udev-149.

[ebuild   R   ] sys-fs/udev-149  USE="devfs-compat -extras (-selinux) -test" 0 k
Comment 8 Pacho Ramos gentoo-dev 2010-04-19 16:56:55 UTC
What does occur if, just after booting, you manually run "udevadm trigger"? Do you still need to manually run "hid2hci --method dell -v 413c -p 8158 --mode hci"?
Comment 9 Balazs Nemeth 2010-04-20 19:31:04 UTC
(In reply to comment #8)
> What does occur if, just after booting, you manually run "udevadm trigger"? 
Nothing happens.

> Do you still need to manually run "hid2hci --method dell -v 413c -p 8158 --mode
> hci"?
> 

Yes I do.

This is what I got in /var/log/debug after I do these
1) /etc/init.d/bluetooth start
2) udevadm trigger (I ran i twice as you can see it in the log snippets)
3) hid2hci --method dell -v 413c -p 8158 --mode hci

Apr 20 21:26:53 gaia kernel: Bluetooth: Core ver 2.15
Apr 20 21:26:53 gaia kernel: NET: Registered protocol family 31
Apr 20 21:26:53 gaia kernel: Bluetooth: HCI device and connection manager initialized
Apr 20 21:26:53 gaia kernel: Bluetooth: HCI socket layer initialized
Apr 20 21:26:58 gaia udevd-work[5535]: error changing netif name wlan0 to wlan1: Device or resource busy
Apr 20 21:26:58 gaia /etc/init.d/net.eth0[5702]: net.eth0: not allowed to be hotplugged
Apr 20 21:27:05 gaia kernel: Bluetooth: L2CAP ver 2.14
Apr 20 21:27:05 gaia kernel: Bluetooth: L2CAP socket layer initialized
Apr 20 21:27:05 gaia kernel: Bluetooth: RFCOMM TTY layer initialized
Apr 20 21:27:05 gaia kernel: Bluetooth: RFCOMM socket layer initialized
Apr 20 21:27:05 gaia kernel: Bluetooth: RFCOMM ver 1.11
Apr 20 21:27:13 gaia udevd-work[5887]: error changing netif name wlan0 to wlan1: Device or resource busy
Apr 20 21:27:13 gaia /etc/init.d/net.eth0[6030]: net.eth0: not allowed to be hotplugged
Apr 20 21:27:39 gaia kernel: usb 3-1.3: new full speed USB device using uhci_hcd and address 5
Apr 20 21:27:39 gaia kernel: Bluetooth: Generic Bluetooth USB driver ver 0.6
Apr 20 21:27:39 gaia kernel: usbcore: registered new interface driver btusb
Apr 20 21:27:39 gaia bluetoothd[6269]: Bluetooth daemon 4.63
Apr 20 21:27:39 gaia bluetoothd[6270]: Starting SDP server
Apr 20 21:27:39 gaia bluetoothd[6270]: Starting experimental netlink support
Apr 20 21:27:39 gaia bluetoothd[6270]: Failed to find Bluetooth netlink family
Apr 20 21:27:39 gaia bluetoothd[6270]: Failed to init netlink plugin
Apr 20 21:27:39 gaia kernel: Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Apr 20 21:27:39 gaia kernel: Bluetooth: BNEP filters: protocol multicast
Apr 20 21:27:39 gaia bluetoothd[6270]: bridge pan0 created
Apr 20 21:27:39 gaia kernel: Bluetooth: SCO (Voice Link) ver 0.6
Apr 20 21:27:39 gaia kernel: Bluetooth: SCO socket layer initialized
Apr 20 21:27:39 gaia bluetoothd[6270]: HCI dev 0 registered
Apr 20 21:27:39 gaia bluetoothd[6270]: HCI dev 0 up
Apr 20 21:27:39 gaia bluetoothd[6270]: Starting security manager 0
Apr 20 21:27:39 gaia bluetoothd[6270]: Adapter /org/bluez/6269/hci0 has been enabled
Comment 10 Pacho Ramos gentoo-dev 2010-04-26 16:53:41 UTC
Udev team, could you please told me how could we know if 97-bluetooth-hid2hci.rules is really being executed by udev?

Thanks a lot for your help
Comment 11 Pacho Ramos gentoo-dev 2010-05-08 09:47:08 UTC
Sadly I have no idea what is causing this problem :-/ udev rule should work. Then, any help on this (like testing if it works on any other distribution, "googling") is highly appreciated. 

Gustavo, I will CC you since you helped me a lot in the past with bluez stuff and seems to work usually with upstream (I mailed some weeks ago to bluez mailing list asking for help on this but didn't get any reply)

Thanks a lot
Comment 12 Marcin Kryczek 2010-05-08 11:20:44 UTC
just for info: i had the same issue on fresh install of gentoo on latitude e6500. i was googling really long before i've found this bug. i've run the command proposed by Balazs and that was it!

but for me it just works after reboot. i do not need to run it again. 

what strange - i didn't have hid2hci in bluez-4.63, so i've dowgrade to 4.62. when i'll have more time (as i said - it's a fresh install, so i still have many things to configure...), i'll try to move back to 4.63 and test it again. 
Comment 13 Gustavo F. Padovan 2010-05-16 18:43:24 UTC
(In reply to comment #11)
> Gustavo, I will CC you since you helped me a lot in the past with bluez stuff
> and seems to work usually with upstream (I mailed some weeks ago to bluez
> mailing list asking for help on this but didn't get any reply)
> 

Pacho, I have no idea on that issue too. Looks more a udev issue than a bluez
one to me and I don't know too much about udev. :(
Comment 14 Marcin Kryczek 2010-05-17 22:08:49 UTC
i've tested it with the newest available varsion (4.64) and it works like a harm;)
Comment 15 Pacho Ramos gentoo-dev 2010-05-18 12:15:11 UTC
Great! :-D

Is it solved also for the rest of the people with 4.64?
Comment 16 Balazs Nemeth 2010-05-18 13:44:26 UTC
(In reply to comment #15)
> Great! :-D
> 
> Is it solved also for the rest of the people with 4.64?
> 

I opened this ticket, but I haven't tried 4.64 yet.
I am going to test is and report back here.
Comment 17 Laurento Frittella (mrfree) 2010-05-19 21:22:49 UTC
Using 4.64 on my Toshiba Tecra A10 bluetooth daemon doesn't start as expected... but if I *manually* run:

# udevadm trigger --subsystem-match=bluetooth

all works well
Comment 18 Laurento Frittella (mrfree) 2010-05-19 21:29:34 UTC
forget it... I was running "bluetoothd -n" in another terminal :)

The udevadm way doesn't work for me...
Comment 19 Balazs Nemeth 2010-05-20 17:25:16 UTC
(In reply to comment #16)
> (In reply to comment #15)
> > Great! :-D
> > 
> > Is it solved also for the rest of the people with 4.64?
> > 
> 
> I opened this ticket, but I haven't tried 4.64 yet.
> I am going to test is and report back here.
> 

Still doesn't work. Neither if I run udevadm manually, nor if I run with bluetooth start.
Comment 20 Robin Roevens 2010-05-27 21:14:54 UTC
I can confirm this problem:
I'm using a logitech dinovo mini BT adapter, and before it worked like a charm with the HID2HCI option in /etc/conf.d/bluetooth, but that seems to be removed.
My old udev rule I added myself also doesn't work anymore:
SUBSYSTEM=="usb", SYSFS{idVendor}=="046d", SYSFS{idProduct}=="c70c", RUN+="/usr/sbin/hid2hci"
 But I noticed hid2hci now needs the venderid, productid and mode as parameter, while it didn't before..So I changed my udev rule to:
SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c70c", RUN+="/usr/sbin/hid2hci -v $attr{idVendor} -p $attr{idProduct} -m logitech"

But it still doesn't work. It only works when I run the hid2hci command myself.
I'm using udev-149 and bluez-4.63
Comment 21 Laurento Frittella (mrfree) 2010-05-31 08:05:42 UTC
I noticed that after a suspend/resume cycle bluetooth comes up! I mean before suspend (tuxonice) it doesn't work but after resume the bluetooth icon appears in the tray
Comment 22 Marcin Kryczek 2010-05-31 08:13:59 UTC
just an idea: have you try to compile btusb and usb subsystem as modules and load them automatically at boot time? it works for me that way....
Comment 23 Pacho Ramos gentoo-dev 2010-06-11 10:18:40 UTC
Can you try with 4.65? Good luck!
Comment 24 Laurento Frittella (mrfree) 2010-06-13 12:36:50 UTC
(In reply to comment #23)
> Can you try with 4.65? Good luck!
> 

4.65 works for me :)
Comment 25 Robin Roevens 2010-06-17 20:52:59 UTC
4.65 gives me no change. Device is recognised as a USB HID device when inserted and udev doesn't seem to kick in and start hid2hci.. 
Comment 26 Balazs Nemeth 2010-06-19 12:44:38 UTC
(In reply to comment #25)
> 4.65 gives me no change. Device is recognised as a USB HID device when inserted
> and udev doesn't seem to kick in and start hid2hci.. 
> 

As I know the init script doesn't do anything just calls udevadm trigger. It doesn't start bluetoothd at all.
Not to mention the stop function which only does a simple print to the console.
Is it okay in this way?
Comment 27 Pacho Ramos gentoo-dev 2010-06-19 13:12:23 UTC
(In reply to comment #26)
> As I know the init script doesn't do anything just calls udevadm trigger. It
> doesn't start bluetoothd at all.
> Not to mention the stop function which only does a simple print to the console.
> Is it okay in this way?
> 

Yes, you can see that other distributions use similar scripts for doing the same. The intention is to let udev handle it, but we still require to run udevadm trigger due a different problem:
http://bugs.gentoo.org/show_bug.cgi?id=270859#c66
Comment 28 Balazs Nemeth 2010-06-19 14:41:26 UTC
(In reply to comment #27)
> (In reply to comment #26)
> > As I know the init script doesn't do anything just calls udevadm trigger. It
> > doesn't start bluetoothd at all.
> > Not to mention the stop function which only does a simple print to the console.
> > Is it okay in this way?
> > 
> 
> Yes, you can see that other distributions use similar scripts for doing the
> same. The intention is to let udev handle it, but we still require to run
> udevadm trigger due a different problem:
> http://bugs.gentoo.org/show_bug.cgi?id=270859#c66
> 

Thanks for the clarification.
So normally udev sould start bluetoothd? Then it looks like to me this is more like an udev problem right? Because bluetoothd doesn't start at all.

So the only working sceanrio currenty is to manually run hid2hci with the proper attributes.
Comment 29 Pacho Ramos gentoo-dev 2010-06-19 14:58:17 UTC
Yes, for some reason 97-bluetooth-hid2hci.rules is not enough for all cases :-|
Comment 30 Pacho Ramos gentoo-dev 2010-06-19 16:49:26 UTC
+*bluez-4.66-r1 (19 Jun 2010)
+
+  19 Jun 2010; Pacho Ramos <pacho@gentoo.org> +bluez-4.66-r1.ebuild:
+  Stop building hid2hci since it's replaced by >=sys-fs/udev-146[extras]
+  provided one. This should fix bug #315749 (reported by Balazs Nemeth,
+  Marcin Kryczek and others). Thanks a lot to Bastien Nocera for the tip in
+  linux-bluetooth mailing list.

This should fix this as it would stop conflicting with hid2hci (and its rules file) from udev. To test:
1. Upgrade to bluez-4.66-r1
2. Be sure to be running a new enough udev release with "extras" USE flag (bluez RDEPEND is already adjusted for it)
3. Reboot

Good luck!
Comment 31 Balazs Nemeth 2010-06-19 18:54:18 UTC
(In reply to comment #30)
> +*bluez-4.66-r1 (19 Jun 2010)
> +
> +  19 Jun 2010; Pacho Ramos <pacho@gentoo.org> +bluez-4.66-r1.ebuild:
> +  Stop building hid2hci since it's replaced by >=sys-fs/udev-146[extras]
> +  provided one. This should fix bug #315749 (reported by Balazs Nemeth,
> +  Marcin Kryczek and others). Thanks a lot to Bastien Nocera for the tip in
> +  linux-bluetooth mailing list.
> 
> This should fix this as it would stop conflicting with hid2hci (and its rules
> file) from udev. To test:
> 1. Upgrade to bluez-4.66-r1
> 2. Be sure to be running a new enough udev release with "extras" USE flag
> (bluez RDEPEND is already adjusted for it)
> 3. Reboot
> 
> Good luck!
> 

Wow! :)
I've just tested it and works. Thank you guys for the help!
Comment 32 emanuele 2010-07-04 08:18:33 UTC
need I to manually load the udev rule for dell? I ve upgraded udev to 158 with flag extras and bluez to 4.66-r1 but it still dosen't work ( cannot send files from laptop to mobile. viceversa it does work.)
thanks
Comment 33 Pacho Ramos gentoo-dev 2010-07-04 12:58:58 UTC
It looks like a different problem but, before sending a new bug report, please ask for help in forums.gentoo.org