Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Use headsets with Bluez 5 mini HowTo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 820
Location: Montréal

PostPosted: Wed Apr 30, 2014 12:19 pm    Post subject: Use headsets with Bluez 5 mini HowTo Reply with quote

I play presently with Bluetooth headsets and Bluez 5. It work. However, I see at least one confusing situation that must be tell. I will do all the process to use them step by step.

I put that line in the general section of the /etc/bluetooth/audio.conf file to modify the Bluetooth service configuration
Code:
[General]
Enable=Control,Gateway,Headset,Media,Sink,Socket,Source

Some enabled services of the line and the line itself may not be mandatory, but it work with. So, after this change the Bluetooth service must be start or restart.
Code:
rc-service bluetooth start

For the communication with Dbus, a normal user must be in the plugdev or lp group. See /etc/dbus-1/system.d/bluetooth.conf. Than, as a normal user, I open Bluetoothctl and execute all those commands
Code:
$ bluetoothctl

[bluetooth]# power on
[bluetooth]# pairable on
[bluetooth]# discoverable on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# scan on

At this point, I put my headsets in discoverable mode and they are detected fast by Bluetoothctl. I can see them with the devices command. Then I am ready to pair the host and remote headsets devices.
Code:
[bluetooth]# devices
Device A0:E9:DB:41:4F:B7 HeadRush 8003763
[bluetooth]# pair A0:E9:DB:41:4F:B7

The pairing is successfull, but I cannot see my headsets as paired device when I execute the paired-devices command. I cannot connect to my headsets too. I have been blocked for some time, trying unsuccessfull ideas that can make the whole process abort, making me tired and think things do not work with Bluez 5.

I finally realised that I have to restart Bluetoothctl to make it considere that my headsets are paired with my host Bluetooth device. This is the point of the confusion I encounter. I cannot say why, but restarting Bluetoothctl seem's to be mandatory to complete the pairing process of a remote Bluetooth device.
Code:
[bluetooth]# paired-devices
[bluetooth]# exit

$ bluetoothctl

[bluetooth]# paired-devices
Device A0:E9:DB:41:4F:B7 HeadRush 8003763

Now that my headsets are officially paired, I can connect to them. It's mandatory if I want ot use them. The connexion can be initiated by the headsets or by the host.
Code:
[bluetooth]# connect A0:E9:DB:41:4F:B7

The configuration of the Bluetooth host and remote devices can be see at any time with the show and info commands.
Code:
[bluetooth]# show
[bluetooth]# info A0:E9:DB:41:4F:B7

From the moment that the headsets are paired and connected with the host, Pulseaudio see them (A2DP sink profile). I can use my headsets for Gentoo audio output with Pavucontrol. I just have to use Pulseaudio as the default Alsa output device. Most of the audio applications use Alsa by default. In /etc/asound.conf (system) and/or in $HOME/.asoundrc (user) I write
Code:
pcm.pulse {
    type pulse
}

ctl.pulse {
    type pulse
}

pcm.!default {
    type pulse
}

ctl.!default {
    type pulse
}


Because Alsa do not support Bluez version 5 for the moment, Pulseaudio is mandatory for Bluetooth audio with Bluez 5.
_________________
Paul
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 820
Location: Montréal

PostPosted: Sat May 10, 2014 9:54 pm    Post subject: Reply with quote

For the moment, Pavucontrol cannot connect to the Pulseaudio server. It have problem with the root X11 window. I tried pax11publish with no change. So I tried the Gnome Control Center. It's Bluetooth utility can pair and connect to the headsets with Bluez 5. It replace well Blueman.

The sound utility of the Gnome Control Center can control which audio output will be use and the headsets volume. It need Pulseaudio server, but replace Pavucontrol well.

So, it should be always possible to use Bluetooth with headsets.
_________________
Paul
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 820
Location: Montréal

PostPosted: Thu May 29, 2014 5:30 pm    Post subject: Reply with quote

Logicien wrote:
For the moment, Pavucontrol cannot connect to the Pulseaudio server. It have problem with the root X11 window. I tried pax11publish with no change.

This problem was caused by the fact that my users where in the audio group. This was not preventing Pavucontrol to work before. Removing my users (including the pulse user) from the audio group made Pavucontrol able to communicate with the Pulseaudio server and work again. So, just follow the PulseAudio - Gentoo Wiki should be Ok to use Bluetooth headsets with Bluez 5 and the Pulseaudio sound server.

Shame on me to have bypass the Gentoo wiki recommandations. :oops:

Removing my users from the audio group in Debian also resolv the communication problem of Pavucontrol with Pulseaudio. Debian use Bluez 4 again. To be able to use my headsets in Debian/Bluez 4/Pulseaudio, I have to edit the /etc/pulse/default.pa file to uncomment and edit the line
Code:
load-module module-alsa-sink device=cabps

to force the alsa-sink module to be load by Pulseaudio and use the device cabps who is an entry for my headsets in /etc/asound.conf:
Code:
pcm.cabps {
   type plug
         slave {
           pcm {
           type bluetooth
           device 00:1E:7C:22:14:4C
      profile "auto"
      }
   }
   hint {
      show on
      description "Casque Audio Bluetooth Philips SHB4000"
   }
}



The tricky thing of removing users from the audio group is that now permissions of the users for the audio group are managed by Consolekit or Systemd. If a user is not under Systemd and use for exemple the startx command to go in graphic mode, no Consolekit session for this user will be created and therefore, the audio devices in the audio group will not be available to him.

In that case, the user may have to create his own Consolekit session, here for Xfce4, in his $HOME/.xinitrc to access audio devices.
Code:
exec ck-launch-session dbus-launch --exit-with-session --sh-syntax startxfce4

Some display managers manage permissions using Consolekit when users open a graphic session, but, because Systemd supersede Consolekit, it's not garanteed if you use Openrc.

At the end, Bluetooth headsets have the tendancy to desynchronise if the data transfert suffer from lag. For video with voice it's pretty annoying.
_________________
Paul
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 820
Location: Montréal

PostPosted: Sun Jul 13, 2014 2:31 pm    Post subject: Reply with quote

I understand more precisely why Bluetooth headsets can give choppy sound, desynchronise and disconnect from their remote connexions.

Each Bluetooth device have a maximum operating distance from other remote Bluetooth devices. In plus, this maximum distance explicitly apply only in an open area for some devices. If the distance is longer and/or not open, the connexion can be lost. Simple and known.

This maximum distance vary from a Bluetooth device to an other. It's written in the specifications of the device, but not all show it. For example, I have not been able to find it for the integrated Bluetooth device of my HP Pavillion g6 2040ca Notebook. I can guest it by moving with my headset.

The specifications of my HeadRush 8003763 headset say that it can operate approximately inside 10 meters. It do not talk about open area.

I have an ASUS MINI BLUETOOTH USB-BT400 DONGLE USB. The specifications say that it can operate over 10 meters in free space. But, when I come in a close space within those 10 meters with my HeadRush headset, the sound become choppy and desynchonised with the video.

I have to reconnect the HeadRush headset and the Asus Bluetooth device to resynchronise the audio with the video.

This experience make my look for an Usb Bluetooth device that can operate inside a longer distance. I found two:

IOGEAR BLUETOOTH GBU321 CLASS1 100M USB that can operate inside a maximum of 100 meters in an open space and

TRENDNET BLUETOOTH TBW-106UB USB that can operate inside a maximum of 100 meters in an open space.

I bought the IOGEAR. Now, I can move in a close space with my HeadRush headset. The sound stay stable all the time. It never become choppy and do not desynchronise or disconnect from the Iogear Usb Bluetooth dongle.

For the moment, I have not make the test at a longer distance than 10 meters with this Iogear, but it's Transmission/Reception power is enough strong to pass through walls within this area.

So, integrated Bluetooth devices in laptops can be cheap. Bluetooth Usb dongles and headsets too. The specifications of Bluetooth devices must be read and understood to help to explain some sound behaviors with Bluetooth.

:D
_________________
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum