Bluetooth Hands-Free Profile Service Library
The HFP for Linux package provides a low-level library, libhfp, that implements the smallest details of the hands-free side of the Bluetooth Hands-Free Profile. libhfp is written in C++, and is intended to be modular and independent of any specific application toolkit. libhfp can be integrated with the main event loop of Qt, glib, or any other toolkit with support for low-level events.
- hfpd, a D-Bus service daemon that uses libhfp and provides D-Bus APIs. Documentation for the D-Bus APIs is available in a separate document. hfpd is the backend for hfconsole, a PyGTK console application for controlling the D-Bus service daemon.
- hfstandalone, a demonstration monolithic speakerphone program built with libhfp and Trolltech Qt. hfstandalone uses its own instance of libhfp and operates independently of hfpd.
libhfp Features
- Supports device scanning, connection, disconnection, and automatic reconnection
- Supports multiple concurrently connected audio gateway devices
- Resilient to loss of Bluetooth service
- Modular, event-driven backend
- All APIs are single-threaded, libhfp does not force its clients to be concerned with threading and synchronization
- Audio handling components are completely asynchronous
- Supports the ALSA and OSS audio hardware interfaces
- Supports microphone input cleanup, including echo cancellation and noise reduction
- Supports simple recording and playback of stored audio files, e.g. for recording calls and playing ring tones
Software Requirements and Build Options
- libbluetooth and BlueZ, the Linux Bluetooth stack
- libasound, the ALSA user-level audio library optional
- The OSS kernel-level audio interface optional
- libaudiofile, the SGI audiofile library optional
- libspeexdsp, the Speex signal processing library optional
- libdbus for hfpd
- PyGTK and dbus-python for the hfconsole app
- Trolltech Qt 3.3 for the monolithic demonstration app
Generated on Fri Jan 9 05:58:35 2009 for libhfp by 1.5.4
Добавление поддержки bluetooth гарнитуры в Ubuntu 20.04
В попытке избавиться от проводов на рабочем столе, была приобретена bluetooth гарнитура JBL, для удобного проведения звонков через slack и zoom. Но с сожалением обнаружил, что Ubuntu не видит микрофон.
После недолгого гугления было найдено решение. Оказывается, что звуковой сервер PulseAudio, используемый в Ubuntu по умолчанию не поддерживает профили HSP (Handset Profile) /HFP (Hands-Free Profile). Чтобы всё работало, нужно заменить его на Pipewire.
Установка Pipewire в Ubuntu 20.04
sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream sudo apt update sudo apt install pipewire sudo apt install libspa-0.2-bluetooth sudo apt install pipewire-audio-client-libraries
Перезагрузка сервисов bluetooth и mas pulseaudio
systemctl --user daemon-reload systemctl --user --now disable pulseaudio.service pulseaudio.socket systemctl --user mask pulseaudio systemctl --user --now enable pipewire-media-session.service
Рестарт pipewaire и перезагрузка системы
systemctl --user restart pipewire sudo reboot
Теперь активирован профиль HSP/HFP и микрофон появился:
Ложка дёгтя
Всё бы хорошо, но вы же не думали что всё так просто? Включение профиля HSP/HFP означает, что bluetooth гарнитура будет работать в режиме моно и выдавать на редкость паршивый звук при воспроизведении музыки. Поэтому, если вы хотите ещё и слушать музыку, то придётся переключаться между режимами работы bluetooth гарнитуры. У себя я установил blueman
sudo apt-get install blueman
Теперь для гарнируты можно переключаться между режимами:
Linux bluetooth hands free
HFP for Linux is a Bluetooth Hands-Free Profile server.
It allows your Linux system to act as a speakerphone for your mobile phone. It aims to be a compliant Bluetooth HFP 1.5 Hands Free implementation, supporting all required commands and notifications, as well as streaming audio.
HFP for Linux was designed specifically for automotive computing applications, but it can be used just as well in a desktop environment.
- Supports device scanning, connection, disconnection, and automatic reconnection
- Supports multiple concurrently connected audio gateway devices
- Resilient to loss of Bluetooth service
- Supports the ALSA and OSS audio hardware interfaces
- Supports microphone input cleanup, including echo cancelation and noise reduction.
- libhfp, a modular, toolkit-independent backend library with rich C++ APIs. Online documentation is available for the libhfp C++ APIs.
- hfpd, a D-Bus service daemon providing D-Bus APIs. Online documentation is available for the D-Bus APIs.
- hfconsole, a PyGTK console application for controlling the D-Bus service daemon.
The HFP for Linux package also includes hfstandalone, a demonstration monolithic speakerphone program built with Trolltech Qt. hfstandalone uses its own instance of libhfp and operates independently of hfpd.
The developer of HFP for Linux believes that HFP is most useful in embedded devices, each with unique user interface requirements. Because of this, emphasis is placed on the internals and backend interfaces of libhfp, and the D-Bus interfaces of hfpd, so that it may be useful as a toolkit for building HFP applications and integrating HFP functionality into other applications.
Use Computer headset like a hands-free for cell phone
Is it possible (and how) to use a computer headset (or speakers+mic) as a hands-free device for my mobile? I bought a bluetooth-dongle but I couldn’t get it to work yet. I think I already set this up on an older version of Ubuntu on my laptop. I’m using Ubuntu 10.10, the phone is an android 2.2 (but I think this doesn’t matter) and the bluetooth device is a Integrated System Solution Corp. Bluetooth Device (according to lsusb). Output of lsusb -v EDIT: I found a project that seams to do just what I want: http://nohands.sourceforge.net. I tried to install it on my laptop but it didn’t work. I’ll try it again on my computer at home and post a description as soon as it works (or any of you guys could post a solution if you’re faster;) Edit2: I was able to connect my phone, but somehow the audio doesn’t work. I think the program has troubles with pulseaudio, as the soundtest fails. Any ideas? Edit3: I’m still trying to get this to work. I might buy another bluetooth dongle. ATM I’m able to dial numbers in hfconsole — that’s all. Somehow I’m shure there is a way to get this to work!
good question. I’m not clear on what’s the intended outcome here: does this mean you’d be able to use your computer headset simply connected to your android phone? And where does Ubuntu come into this equation? because if it’s not, this thread is posted in the wrong forum.
The headset can’t be connected to the phone directly. I want to use a bluetooth-connection between my phone and my computer that allows me to use my headset that’s directly connected to my PC.