You are not logged in.

#1 2016-03-10 17:40:59

red-lichtie
Member
Registered: 2015-03-08
Posts: 46

How do I get a bluetooth headset with microphone to work ?

In Bluetooth headset it states

Currently, Arch Linux supports the A2DP profile (Audio Sink) for remote audio playback with the default installation.

And I can listen to audio without too much of a problem but I can't figure out how to use the microphone as an audio source.

As far as I can tell, I need the "HSP/HFP" profile and that seems to only be available with the combination of PulseAudio and Bluez4.

The problem I have is that I need BTLE for the development work I am doing and that is only available with Bluez5.

I don't know why the telephony profile was dropped in Bluez5 but there must have been a massive reason to drop support completely :-/

Does the latest and greatest PulseAudio and Bluez5 out of the AUR do it? Is there another module/package/product that can be added to enable it?

Is there any reasonable way to get a Bluetooth headset microphone working together with Bluez5 ?


Doing it the Linux way since 1997 and Arch way since 2015 (and loving it!)
Platforms: Intel, ARMv6 (Raspberry Pi), ARMv7 (BeagleBone Black)
Languages: C, C++, ASM, Pascal & Java

Offline

#2 2017-02-18 11:17:39

red-lichtie
Member
Registered: 2015-03-08
Posts: 46

Re: How do I get a bluetooth headset with microphone to work ?

I have now analysed my problem a bit more and have found out some interesting details about PulseAudio and my headset, even though I still can't get it to work hmm

TL:DR

  1. PulseAudio >= 6.0 supports Bluetooth Headset Profile

  2. HSP/HFP are 2 distinct profiles, PulseAudio doesn't natively support the Bluetooth Handsfree Profile

  3. HFP support should be available by using oFono

  4. HSP and HFP are currently mutually exclusive in PulseAudio

  5. It still doesn't work as a headset


The developers reintroduced support for bluetooth headsets in PulseAudio 6.0, Arch is currently at 10.0 (see: PulseAudio 6.0 Release Notes).

Now looking at my system I thought that is great news, there must be something that I missed.

$ pacmd list-cards
3 card(s) available.
    index: 0
    ....
    index: 1
    ....
    index: 2
    name: <bluez_card.00_0D_44_DE_0B_1F>
    driver: <module-bluez5-device.c>
    owner module: 26
    properties:
        device.description = "H800 Logitech Headset"
        device.string = "00:0D:44:DE:0B:1F"
        device.api = "bluez"
        device.class = "sound"
        device.bus = "bluetooth"
        device.form_factor = "headset"
        bluez.path = "/org/bluez/hci0/dev_00_0D_44_DE_0B_1F"
        bluez.class = "0x240404"
        bluez.alias = "H800 Logitech Headset"
        device.icon_name = "audio-headset-bluetooth"
        device.intended_roles = "phone"
    profiles:
        a2dp_sink: High Fidelity Playback (A2DP Sink) (priority 10, available: unknown)
        headset_head_unit: Headset Head Unit (HSP/HFP) (priority 20, available: no)
        off: Off (priority 0, available: yes)
    active profile: <a2dp_sink>
    sinks:
        bluez_sink.00_0D_44_DE_0B_1F.a2dp_sink/#2: H800 Logitech Headset
    sources:
        bluez_sink.00_0D_44_DE_0B_1F.a2dp_sink.monitor/#3: Monitor of H800 Logitech Headset
    ports:
        headset-output: Headset (priority 0, latency offset 0 usec, available: unknown)
            properties:
               
        headset-input: Headset (priority 0, latency offset 0 usec, available: no)
            properties:

So my headset is being detected but the HSP/HFP is not available??

I checked out the bluetooth information to see if everything is right there:

$ bluetoothctl
[NEW] Controller 00:15:00:EC:B4:35 turbine [default]
[NEW] Device 00:0D:44:DE:0B:1F H800 Logitech Headset
[NEW] Device F0:65:DD:A4:34:3F HP Bluetooth Mouse X4000b
[H800 Logitech Headset]# info 00:0D:44:DE:0B:1F
Device 00:0D:44:DE:0B:1F
    Name: H800 Logitech Headset
    Alias: H800 Logitech Headset
    Class: 0x240404
    Icon: audio-card
    Paired: yes
    Trusted: no
    Blocked: no
    Connected: yes
    LegacyPairing: no
    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)
[H800 Logitech Headset]#

There it is, Handsfree, so why isn't it working...

I have now found out that the "HSP/HFP profile" is not one profile but actually they are actually two profiles:

  • HSP - Headset Protocol    (UUID=00001108-0000-1000-8000-00805F9B34FB)

  • HFP - Handsfree Protocol (UUID=0000111E-0000-1000-8000-00805F9B34FB)

That is the core problem with my headset,  PulseAudio only added HSP support and my headset only provides Handsfree.

Now that I know the problem the question is how can I get it to work?

Going back to the PulseAudio 6 release notes I now read (und understood) this:

  • BlueZ 5 native HSP (headset) support

  • BlueZ 5 HFP (hands-free) profile support via oFono

...

Notes for Packagers

When building PulseAudio, it's possible to choose between "native" and "ofono" BlueZ 5 headset backends. They can be both enabled, but only one can be used at runtime. If you only need to support a bluetooth audio stack with oFono, then it's advisable to disable the native backend when building PulseAudio. Similarly, if you don't need to support oFono, then it's best to disable the oFono backend. If you need to support both alternatives, then you have to enable both. The runtime decision which to use is done via the "headset" argument of module-bluetooth-discover.

The native HSP backend for BlueZ 5 depends on libbluetooth. It's a header dependency only, so the actual library doesn't need to be present at runtime.

The oFono HFP backend for BlueZ 5 naturally introduces a runtime dependency on oFono. The minimum supported oFono version is 1.13.

Good news, oFono 1.19 is available in the AUR (the page says 1.18-1 but the build currently delivers 1.19-1).

oFono built and installed, ofono.service enabled and started but still no success.

The journal shows that it is registering the HFP profile:

Feb 18 10:53:14 turbine ofonod[803]: plugins/hfp_hf_bluez5.c:connect_handler() Registering External Profile handler ...
Feb 18 10:53:14 turbine ofonod[803]: plugins/bluez5.c:bt_register_profile() Bluetooth: Registering 0000111e-0000-1000-8000-00805f9b34fb (hfp_hf) profile


I then rebuilt pulseaudio with the abs and adding "--enable-bluez5-ofono-headset" to the configure call but it still doesn't work.


Delving deeper in it: PulseAudio Documentation - Bluetooth

PulseAudio depends on BlueZ for all Bluetooth functionality, and additionally oFono is required for HFP support.

...

HFP

PulseAudio supports HFP only in the hands-free unit role (opposite to the situation with HSP), so PulseAudio can connect to a mobile phone, but not to headsets and other hands-free devices. With the "Headset Audio Gateway (HSP/HFP)" card profile selected, PulseAudio will create a sink and a source that applications can use to play back and record audio - or more commonly, the bluetooth sink and source will be connected with module-loopback to speakers and a microphone device. Note that the "Headset Audio Gateway (HSP/HFP)" card profile is typically automatically activated by module-bluetooth-policy when the phone initiates audio streaming.

As mentioned in the HSP section, support for HFP and HSP are currently mutually exclusive. HFP support is enabled by passing argument "headset=ofono" to module-bluetooth-discover in /etc/pulse/default.pa.

The audio gateway role will hopefully be supported too in the future, as well as simultaneous support for HSP and HFP. Simon Fels has done some work on both of these things: https://github.com/morphis/pulseaudio/c … r-bt-fixes. Those patches have not yet been submitted to upstream, however.

James Bottomley submitted different patches for supporting HFP headsets, which don't use oFono: https://www.mail-archive.com/pulseaudio … 16443.html. The patches need some work, but nothing has happened for a long time. Someone else could relatively easily finish off the work - just read the review discussion, and address the points raised.

I don't have/need another headset so I added the above "headset=ofono" option and ... I still can't get it to work.


Doing it the Linux way since 1997 and Arch way since 2015 (and loving it!)
Platforms: Intel, ARMv6 (Raspberry Pi), ARMv7 (BeagleBone Black)
Languages: C, C++, ASM, Pascal & Java

Offline

#3 2017-02-18 12:12:52

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 870

Re: How do I get a bluetooth headset with microphone to work ?

Hi, did you check pavucontrol , open TAB configuration and check 'Headset Head Unit HSP/HFP' ? You didn't mention it.

Offline

#4 2017-02-18 12:55:13

red-lichtie
Member
Registered: 2015-03-08
Posts: 46

Re: How do I get a bluetooth headset with microphone to work ?

qinohe wrote:

Hi, did you check pavucontrol , open TAB configuration and check 'Headset Head Unit HSP/HFP' ? You didn't mention it.

The headset works in A2DP just not as a Headset with Mic.
Attempting to switch results in the error message:

Feb 18 13:37:17 turbine pulseaudio[29613]: W: [pulseaudio] module-bluez5-device.c: Refused to switch profile to headset_head_unit: Not connected

The same is true if I try doing it with pacmd:

$ pacmd set-card-profile bluez_card.00_0D_44_DE_0B_1F headset_head_unit
Failed to set card profile to 'headset_head_unit'.

Without HFP support it isn't going anywhere hmm

I am now looking at the details of this patch: https://www.mail-archive.com/pulseaudio … 16443.html


Doing it the Linux way since 1997 and Arch way since 2015 (and loving it!)
Platforms: Intel, ARMv6 (Raspberry Pi), ARMv7 (BeagleBone Black)
Languages: C, C++, ASM, Pascal & Java

Offline

#5 2017-02-18 13:27:44

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 870

Re: How do I get a bluetooth headset with microphone to work ?

I have no idea how to exactly troubleshout this issue, the only thing I see different from my own is you didn't trust the device, but, don't know if that's leading to your problem.
What packages did you install to get it working?

Offline

#6 2017-02-18 13:37:56

red-lichtie
Member
Registered: 2015-03-08
Posts: 46

Re: How do I get a bluetooth headset with microphone to work ?

qinohe wrote:

I have no idea how to exactly troubleshout this issue, the only thing I see different from my own is you didn't trust the device, but, don't know if that's leading to your problem.
What packages did you install to get it working?

If you have a headset that has both HSP and HFP then HSP will work, but my headset only has HSF and I can't get it to work as PA doesn't support it yet.

I am looking into the patch set here (https://lists.freedesktop.org/archives/ … 26762.html) which will (should?) add native HFP support to PA.


Doing it the Linux way since 1997 and Arch way since 2015 (and loving it!)
Platforms: Intel, ARMv6 (Raspberry Pi), ARMv7 (BeagleBone Black)
Languages: C, C++, ASM, Pascal & Java

Offline

#7 2017-02-18 13:55:25

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 870

Re: How do I get a bluetooth headset with microphone to work ?

Ah, I get it, well I'm sorry I can't be more helpfull ..
Curious how this evolves, would be nice to have it working. goodluck patching your bluetooth.

Offline

#8 2017-02-18 15:01:14

red-lichtie
Member
Registered: 2015-03-08
Posts: 46

Re: How do I get a bluetooth headset with microphone to work ?

Success!

I spoke on IRC with one of the maintainers (Tanu Kaskinen) and he pointed me to a git repository where he had already applied the patch.

It worked, now I have my headset working and using the Handsfree profile! smile

A HUGE thanks to James Bottomley for providing the patch and Tanu Kaskinen for making a patched version available.

I've uploaded my PKGBUILD file here: https://gist.github.com/anonymous/546cd … 9ed04805c2.

Maybe this patch will be included in the master branch at some point in the future.


Doing it the Linux way since 1997 and Arch way since 2015 (and loving it!)
Platforms: Intel, ARMv6 (Raspberry Pi), ARMv7 (BeagleBone Black)
Languages: C, C++, ASM, Pascal & Java

Offline

#9 2017-02-18 15:21:53

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 870

Re: How do I get a bluetooth headset with microphone to work ?

That is very nice, maybe you can add a tip to the headset wiki, refering to this thread, until it's solved.., thans for sharing.

Offline

#10 2017-08-06 05:47:27

b1mt3
Member
From: Tokyo
Registered: 2017-02-07
Posts: 2
Website

Re: How do I get a bluetooth headset with microphone to work ?

red-lichtie wrote:

Success!

I spoke on IRC with one of the maintainers (Tanu Kaskinen) and he pointed me to a git repository where he had already applied the patch.

It worked, now I have my headset working and using the Handsfree profile! smile

A HUGE thanks to James Bottomley for providing the patch and Tanu Kaskinen for making a patched version available.

I've uploaded my PKGBUILD file here: https://gist.github.com/anonymous/546cd … 9ed04805c2.

Maybe this patch will be included in the master branch at some point in the future.

Due to the API changes of openSSL in 1.1.0 this PKGBUILD won't execute successfully.
So please before building set the environmental variables as follows:
    export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig
    export CFLAGS="-Wno-error"

See this link for reference: https://github.com/grpc/grpc/issues/10589

Offline

#11 2018-08-05 08:35:25

alizain
Member
Registered: 2018-08-05
Posts: 1

Re: How do I get a bluetooth headset with microphone to work ?

red-lichtie wrote:
qinohe wrote:

I have no idea how to exactly troubleshout this issue, the only thing I see different from my own is you didn't trust the device, but, don't know if that's leading to your problem.
What packages did you install to get it working?

If you have a headset that has both HSP and HFP then HSP will work, but my headset only has HSF and I can't get it to work as PA doesn't support it yet.

I am looking into the patch set here (https://lists.freedesktop.org/archives/ … 26762.html) which will (should?) add native HFP support to PA.



pi@raspberrypi:~ $ sudo nano /etc/pulse/default.pa
pi@raspberrypi:~ $ bluetoothctl
[NEW] Controller B8:27:EB:07:F0:9C raspberrypi [default]
[NEW] Device 30:21:69:A8:98:57 TM-019
[NEW] Device 30:21:93:54:70:1C S740T
[NEW] Device 14:1F:78:06:1A:B6 Galaxy J7 Prime
[TM-019]# info
Device 30:21:69:A8:98:57
    Name: TM-019
    Alias: TM-019
    Class: 0x240408
    Icon: audio-card
    Paired: yes
    Trusted: yes
    Blocked: no
    Connected: yes
    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)
[TM-019]#

see i have  both hsp and hfp but still mu headset with mic is not working

Offline

#12 2018-08-05 10:36:58

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,867
Website

Re: How do I get a bluetooth headset with microphone to work ?

Please do not necrobump. Please also note that, as the rules you agreed to when you signed up state, we don't support anything other than Arch Linux here. Please ask for support from the support channels of your chosen distribution.

https://wiki.archlinux.org/index.php/Co … bumping.22
https://bbs.archlinux.org/misc.php?action=rules

Closing.


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

Board footer

Powered by FluxBB