Wrong /var/lib/bluetooth/<BD address>/config prevents setting correct hci class

Bug #144544 reported by Jerzy Luszawski
4
Affects Status Importance Assigned to Milestone
bluez-utils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: bluez-utils

When entry 'class' exists in /var/lib/bluetooth/<BD address>/config it takes precedence over class settings in /etc/bluetooth/hcid.conf. When starting/restarting bluetooth, regardless of changes in /etc/bluetooth/hcid.conf hci class remains as saved in /var/lib/bluetooth/<BD address>/config.

I discovered it when trying to install the newest version of bluez-utils (3.19). It has "class 0x000100;" set in the default hcid.conf. After installation hciconfig -a showed:
        Class: 0x000100
        Service Classes: Unspecified
        Device Class: Computer, Uncategorized
 I adjusted the "class" entry in etc/bluetooth/hcid.conf and restarted bluetooth services, but nothing changed. I spent some time on it, and gave up, reverting to my old version of bluez-utils, which are in ubuntu feisty repository (3.9). Then i found out, that the problem persists, and I had no services on the device available!
I found out that removing the file /var/lib/bluetooth/<BD address>/config resolves the problem, as new file is created with no class entry, and data from /etc/bluetooth/hcid.conf are processed.

Steps to recreate the condition:
-----------------------------------------------------------------------------------------------
root@jl-desktop:~# cat /var/lib/bluetooth/00\:08\:1B\:02\:3B\:67/config
mode discoverable

(this is the only line in my properly working file)

root@jl-desktop:~# hciconfig -a
hci0: Type: USB
        BD Address: 00:08:1B:02:3B:67 ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:2750 acl:0 sco:0 events:57 errors:0
        TX bytes:1210 acl:0 sco:0 commands:56 errors:0
        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: HOLD SNIFF PARK
        Link mode: ACCEPT MASTER
        Name: 'JL-DESKTOP_(0)'
        Class: 0x3e0104
        Service Classes: Networking, Rendering, Capturing, Object Transfer, Audio
        Device Class: Computer, Desktop workstation
        HCI Ver: 1.1 (0x1) HCI Rev: 0x33d LMP Ver: 1.1 (0x1) LMP Subver: 0x33d
        Manufacturer: Cambridge Silicon Radio (10)

root@jl-desktop:~# echo class 0x000100 >> /var/lib/bluetooth/00\:08\:1B\:02\:3B\:67/config
root@jl-desktop:~# /etc/init.d/bluetooth restart
 * Restarting Bluetooth services [ OK ]
root@jl-desktop:~# hciconfig -a
hci0: Type: USB
        BD Address: 00:08:1B:02:3B:67 ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:3344 acl:0 sco:0 events:68 errors:0
        TX bytes:1502 acl:0 sco:0 commands:67 errors:0
        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: HOLD SNIFF PARK
        Link mode: ACCEPT MASTER
        Name: 'JL-DESKTOP_(0)'
        Class: 0x000100
        Service Classes: Unspecified
        Device Class: Computer, Uncategorized
        HCI Ver: 1.1 (0x1) HCI Rev: 0x33d LMP Ver: 1.1 (0x1) LMP Subver: 0x33d
        Manufacturer: Cambridge Silicon Radio (10)

root@jl-desktop:~# gedit /var/lib/bluetooth/00\:08\:1B\:02\:3B\:67/config
(I manually deleted the previously inserted line with class 0x000100)
root@jl-desktop:~# /etc/init.d/bluetooth restart
 * Restarting Bluetooth services [ OK ]
root@jl-desktop:~# hciconfig -a
hci0: Type: USB
        BD Address: 00:08:1B:02:3B:67 ACL MTU: 192:8 SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:3938 acl:0 sco:0 events:79 errors:0
        TX bytes:1794 acl:0 sco:0 commands:78 errors:0
        Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: HOLD SNIFF PARK
        Link mode: ACCEPT MASTER
        Name: 'JL-DESKTOP_(0)'
        Class: 0x3e0104
        Service Classes: Networking, Rendering, Capturing, Object Transfer, Audio
        Device Class: Computer, Desktop workstation
        HCI Ver: 1.1 (0x1) HCI Rev: 0x33d LMP Ver: 1.1 (0x1) LMP Subver: 0x33d
        Manufacturer: Cambridge Silicon Radio (10)
---------------------------------------------------------------------

I could not find any references to /var/lib/bluetooth/<BD address>/config, and tracking it down took me some time, so I file this as a bug.

Revision history for this message
Marcel Holtmann (holtmann) wrote :

Don't touch hcid.conf at all. The values from the /var/lib/bluetooth wll overwrite any settings done in hcid.conf and this is on purpose. If you wanna change your class of device, use the D-Bus methods or bluetooth-properties.

Revision history for this message
Jerzy Luszawski (dr-agon) wrote :

Tanks for the explanation.
I have bluetooth working OK. I was just surprised, that after installing the new bluez-utils version my device reported no available services, and it was before I started to play with any configuration files. All I wanted was my configuration to remain as with earlier version, and it seemed that it was spoiled by installing new version.

Revision history for this message
Marcel Holtmann (holtmann) wrote :

It has been like this for a while. Even in Feisty. With the new version we know enforce using D-Bus more and slowly reduce the importance and need of hcid.conf.

Revision history for this message
Jerzy Luszawski (dr-agon) wrote :

After the explanation it seems the problem doesn't matter any more. To clean up, I change the status to invalid.

Changed in bluez-utils:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.