You are not logged in.

#1 2014-05-08 04:40:04

felipe
Member
Registered: 2013-06-29
Posts: 70

Question about gnome bluetooth, bluetooth headset and autoconnect

Does gnome bluetooth autoconnect to the bluetooth headsets once they are in range? The icon of the bluetooth appears 1 second and then disappear, is failing to autoconnect.
My bluetooth headset(A2DP) device works fine but is not autoconnected. In older versions of pulseaudio/bluez it does automatic connected. 
In bluetoothctl i get this.

[felipe@MiPc ~]$ bluetoothctl
[NEW] Controller 00:10:60:D1:CD:7E MiPc [default]
[NEW] Device 03:01:1B:00:A1:85 Nokia BH-503
[CHG] Device 03:01:1B:00:A1:85 Connected: yes
[CHG] Device 03:01:1B:00:A1:85 Connected: no


[felipe@MiPc ~]$ systemctl status bluetooth -l
● bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled)
   Active: active (running) since jue 2014-05-08 00:47:03 ART; 12min ago
     Docs: man:bluetoothd(8)
 Main PID: 235 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─235 /usr/lib/bluetooth/bluetoothd

may 08 00:47:03 MiPc bluetoothd[235]: Bluetooth management interface 1.4 initialized
may 08 00:47:12 MiPc bluetoothd[235]: Endpoint registered: sender=:1.20 path=/MediaEndpoint/A2DPSource
may 08 00:47:12 MiPc bluetoothd[235]: Endpoint registered: sender=:1.20 path=/MediaEndpoint/A2DPSink
may 08 00:47:22 MiPc bluetoothd[235]: Endpoint registered: sender=:1.38 path=/MediaEndpoint/A2DPSource
may 08 00:47:22 MiPc bluetoothd[235]: Endpoint registered: sender=:1.38 path=/MediaEndpoint/A2DPSink
may 08 00:47:41 MiPc bluetoothd[235]: Endpoint unregistered: sender=:1.20 path=/MediaEndpoint/A2DPSource
may 08 00:47:41 MiPc bluetoothd[235]: Endpoint unregistered: sender=:1.20 path=/MediaEndpoint/A2DPSink
may 08 00:48:10 MiPc bluetoothd[235]: /org/bluez/hci0/dev_03_01_1B_00_A1_85/fd0: fd(22) ready
may 08 00:48:10 MiPc bluetoothd[235]: Control: Refusing unexpected connect
may 08 00:48:10 MiPc bluetoothd[235]: connect error: Connection refused (111)

The device is trusted.

[bluetooth]# info 03:01:1B:00:A1:85
Device 03:01:1B:00:A1:85
	Name: Nokia BH-503
	Alias: Nokia BH-503
	Class: 0x240404
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)

I have followed the wiki but still the device is not autoconnected.

To have your headset auto connect you need to enable PulseAudio's switch-on-connect module. Add the following:

/etc/pulse/default.pa

# automatically switch to newly-connected devices
load-module module-switch-on-connect



journalctl

may 08 00:48:10 MiPc rtkit-daemon[462]: Supervising 4 threads of 1 processes of 1 users.
may 08 00:48:10 MiPc bluetoothd[235]: Control: Refusing unexpected connect
may 08 00:48:10 MiPc bluetoothd[235]: connect error: Connection refused (111)
may 08 00:48:12 MiPc gnome-bluetooth-panel.desktop[713]: *** BUG ***
may 08 00:48:12 MiPc gnome-bluetooth-panel.desktop[713]: In pixman_region32_init_rect: Invalid rectangle passed
may 08 00:48:12 MiPc gnome-bluetooth-panel.desktop[713]: Set a breakpoint on '_pixman_log_error' to debug
may 08 00:48:12 MiPc gnome-session[575]: Advertencia del gestor de ventanas: last_focus_time (78365) is greater than comparison timestamp (78362).  This most likely repres
may 08 00:48:12 MiPc gnome-session[575]: Advertencia del gestor de ventanas: Log level 16: STACK_OP_RAISE_ABOVE: sibling window 0x40028a not in stack
may 08 00:48:16 MiPc gnome-session[575]: Advertencia del gestor de ventanas: last_focus_time (82156) is greater than comparison timestamp (82155).  This most likely repres
may 08 00:48:38 MiPc dbus[238]: [system] Rejected send message, 3 matched rules; type="method_return", sender=":1.38" (uid=1000 pid=626 comm="/usr/bin/pulseaudio --start "
may 08 00:48:38 MiPc gnome-session[575]: (gnome-settings-daemon:607): media-keys-plugin-WARNING **: Unable to get default sink
may 08 00:48:43 MiPc firefox.desktop[736]: (process:736): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
may 08 00:48:44 MiPc dbus[238]: [system] Activating via systemd: service name='org.freedesktop.NetworkManager' unit='dbus-org.freedesktop.NetworkManager.service'
may 08 00:48:44 MiPc dbus[238]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.NetworkManager.service': Unit dbus-org.freedesktop.NetworkManager.ser
may 08 00:58:23 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Failed to parse translated string 'visible-name\u0004'Unnamed'' for key 'vi
may 08 00:58:23 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Using untranslated default instead.
may 08 00:58:24 MiPc gnome-session[575]: Advertencia del gestor de ventanas: Log level 16: AT-SPI: Error in GetItems, sender=org.freedesktop.DBus, error=The name :1.9 was 
may 08 00:58:56 MiPc org.gnome.Nautilus.SearchProvider[589]: ** (nautilus:845): WARNING **: Could not establish a connection to Tracker: GDBus.Error:org.freedesktop.DBus.E
may 08 00:58:56 MiPc org.gnome.Nautilus.SearchProvider[589]: ** (nautilus:845): WARNING **: Could not establish a connection to Tracker: GDBus.Error:org.freedesktop.DBus.E
may 08 00:59:12 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Failed to parse translated string 'visible-name\u0004'Unnamed'' for key 'vi
may 08 00:59:12 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Using untranslated default instead.
may 08 01:01:56 MiPc systemd[1]: Starting Cleanup of Temporary Directories...
may 08 01:01:56 MiPc systemd[1]: Started Cleanup of Temporary Directories.
lines 34030-34052/34052 (END)
may 08 00:48:10 MiPc rtkit-daemon[462]: Supervising 4 threads of 1 processes of 1 users.
may 08 00:48:10 MiPc bluetoothd[235]: Control: Refusing unexpected connect
may 08 00:48:10 MiPc bluetoothd[235]: connect error: Connection refused (111)
may 08 00:48:12 MiPc gnome-bluetooth-panel.desktop[713]: *** BUG ***
may 08 00:48:12 MiPc gnome-bluetooth-panel.desktop[713]: In pixman_region32_init_rect: Invalid rectangle passed
may 08 00:48:12 MiPc gnome-bluetooth-panel.desktop[713]: Set a breakpoint on '_pixman_log_error' to debug
may 08 00:48:12 MiPc gnome-session[575]: Advertencia del gestor de ventanas: last_focus_time (78365) is greater than comparison timestamp (78362).  This most likely represe
may 08 00:48:12 MiPc gnome-session[575]: Advertencia del gestor de ventanas: Log level 16: STACK_OP_RAISE_ABOVE: sibling window 0x40028a not in stack
may 08 00:48:16 MiPc gnome-session[575]: Advertencia del gestor de ventanas: last_focus_time (82156) is greater than comparison timestamp (82155).  This most likely represe
may 08 00:48:38 MiPc dbus[238]: [system] Rejected send message, 3 matched rules; type="method_return", sender=":1.38" (uid=1000 pid=626 comm="/usr/bin/pulseaudio --start ")
may 08 00:48:38 MiPc gnome-session[575]: (gnome-settings-daemon:607): media-keys-plugin-WARNING **: Unable to get default sink
may 08 00:48:43 MiPc firefox.desktop[736]: (process:736): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
may 08 00:48:44 MiPc dbus[238]: [system] Activating via systemd: service name='org.freedesktop.NetworkManager' unit='dbus-org.freedesktop.NetworkManager.service'
may 08 00:48:44 MiPc dbus[238]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.NetworkManager.service': Unit dbus-org.freedesktop.NetworkManager.serv
may 08 00:58:23 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Failed to parse translated string 'visible-name\u0004'Unnamed'' for key 'vis
may 08 00:58:23 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Using untranslated default instead.
may 08 00:58:24 MiPc gnome-session[575]: Advertencia del gestor de ventanas: Log level 16: AT-SPI: Error in GetItems, sender=org.freedesktop.DBus, error=The name :1.9 was n
may 08 00:58:56 MiPc org.gnome.Nautilus.SearchProvider[589]: ** (nautilus:845): WARNING **: Could not establish a connection to Tracker: GDBus.Error:org.freedesktop.DBus.Er
may 08 00:58:56 MiPc org.gnome.Nautilus.SearchProvider[589]: ** (nautilus:845): WARNING **: Could not establish a connection to Tracker: GDBus.Error:org.freedesktop.DBus.Er
may 08 00:59:12 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Failed to parse translated string 'visible-name\u0004'Unnamed'' for key 'vis
may 08 00:59:12 MiPc org.gnome.Terminal[589]: (gnome-terminal-server:832): GLib-GIO-WARNING **: Using untranslated default instead.
may 08 01:01:56 MiPc systemd[1]: Starting Cleanup of Temporary Directories...

I have seen in the wiki this but i'm not sure if is useful for autoconnect:

Headset and Alsa Devices

1. First if you have not already, install bluez from the official repositories.

2. Scan for your device

$ hcitool (-i <optional hci#>***) scan

3. Pair your headset with your device:

$ bluez-simple-agent (optional hci# ***) XX:XX:XX:XX:XX:XX

and put in your pin (0000 or 1234, etc)

4. Make sure your /etc/bluetooth/audio.conf allows A2DP Audio Sinks. Place this line just bellow the [Genera] heading:

Enable=Source,Sink,Media,Socket

5. Add this to your /etc/asound.conf file:

#/etc/asound.conf

pcm.btheadset {
   type plug
   slave {
       pcm {
           type bluetooth
           device XX:XX:XX:XX:XX:XX
           profile "auto"
       }   
   }   
   hint {
       show on
       description "BT Headset"
   }   
}
ctl.btheadset {
  type bluetooth
} 

6. Check to see if it has been added to alsa devices

$ aplay -L

7. Now play with aplay:

$ aplay -D btheadset /path/to/audio/file

or Mplayer:

$ mplayer -ao alsa:device=btheadset /path/to/audio/or/video/file

Tip: To find hci# for a usb dongle, type in

$ hcitool dev



There are some files in .config/pulse

[felipe@MiPc ~]$ ls .config/pulse/
0766e0e68b6d47b19df4f042e4a766df-card-database.tdb
0766e0e68b6d47b19df4f042e4a766df-default-sink
0766e0e68b6d47b19df4f042e4a766df-default-source
0766e0e68b6d47b19df4f042e4a766df-device-volumes.tdb
0766e0e68b6d47b19df4f042e4a766df-stream-volumes.tdb
cookie

[felipe@MiPc ~]$ cat .config/pulse/0766e0e68b6d47b19df4f042e4a766df-default-sink 
alsa_output.pci-0000_00_07.0.analog-stereo
[felipe@MiPc ~]$ cat .config/pulse/0766e0e68b6d47b19df4f042e4a766df-default-source
alsa_input.pci-0000_01_08.0.analog-stereo

But  those files are about the default card and will be next trouble after  i get the autoconnect works wink i guess

Last edited by felipe (2014-05-08 04:48:31)

Offline

#2 2014-05-09 08:30:02

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Question about gnome bluetooth, bluetooth headset and autoconnect

There seems to be a problem with bluez5 when it comes to connecting bluetooth devices: https://bugs.archlinux.org/task/39885?s … &closedto=

Last edited by Chazza (2014-05-09 08:32:24)

Offline

#3 2014-06-15 13:24:59

colorprint
Member
Registered: 2014-06-13
Posts: 18

Re: Question about gnome bluetooth, bluetooth headset and autoconnect

Is your bluetooth device is visible in audio settings and can you get the sound with it?
My headset connects fine but there is no A2DPsink visible and I can't select it as audio output...

Last edited by colorprint (2014-06-15 13:25:15)

Offline

Board footer

Powered by FluxBB