Handsfree HF role

Here at ProFUSION we’ve been helping people at BlueZ, oFono, and PulseAudio to add support for the Handsfree-unit role of the bluetooth Handsfree Profile to Linux. We had some nice progress this week that lead us to make a video showing what we have so far. It’s still not merged upstream, and definitely not user friendly. But hey, it works!

Kudos to Gustavo Padovan for implementing most of this support into BlueZ and oFono.

11 responses to “Handsfree HF role

  1. Hi João,

    Great demo! Congratulations.

    I tried to transform my computer in a headset some times ago:

    I hope in few months it will be possible using any Linux distro.

    Thank you,


  2. Any idea what versions would have this merged?
    At least another ubuntu user and myself would like to get this going, see http://brainstorm.ubuntu.com/idea/5588/

    Obrigado 🙂

  3. It’s on latest releases of BlueZ and oFono, but for PulseAudio you’ll need to get upstream development sources (aka code from git tree). Also, I see you are interested in more controls over bluetooth. Phonebook Access Profile is part of obexd, which is maintained by BlueZ developers but is a separate project, and Message Access Profile (for SMSes over bluetooth) is not implemented yet, but it might be on this years GSoC (also the DUN client, for accessing mobile broadband using your phone as a modem over bluetooth, might be done as a GSoC project).

    Now let’s hope coming phones supports all these features 🙂

  4. Any suggestions in where to look if I want to build a custom application using ofono HFP API?

    May be I am talking gibberish here, but, as far as I understand I should be able to use ofono API (which seems to be D-BUS based) for call control using one or more cell phones (assuming multiple bluetooth adapters)?

    How do I get the audio in my application? do I get raw access to the SCO socket? I’d like to write/read my own audio which may come from unknown sources (the audio card is one, but it can come from an RTP connection or even a regular FXO/FXS interface or something else).

  5. Hello!
    Great work, thanks!
    But I have a problem, can you help me?
    I used this HOWTO http://ofono.org/wiki/hands-free-profile
    I can connect to my phone via ophono, but there is no audio from speakers. When I play sound on my telephone (Nokia 2600c) I see this in bluetoothd log

    > bluetoothd[1865]: audio/main.c:sco_server_cb() Accepted SCO connection from 00:1E:A4:F5:42:82 > bluetoothd[1865]: audio/gateway.c:sco_io_cb() sco connection is released
    > bluetoothd[1865]: src/event.c:btd_event_disconn_complete() No matching connection found for handle 6

    And that’s all – no sound =(

    Maybe I need to configure pulseaudio?

    In your video you use pactl command, can you explain what it means?


  6. Libaoliu

    When the end of the call, why the disconnect HFP?


  7. Shaheer Shaikh

    Im trying to get Ofono HFP working on Ubuntu 11.04. I am able to successfully connect to HandsFreeGateway and place calls. But Im unable to hear any audio. PulseAudio doesnt detect any bluetooth card when im connected in HFP. Kindly, please suggest something on the same.

  8. Hello!
    Great job !

    I`m sorry my poor english.

    I found a little mistake in your commit.


    @@ -1434,7 +1435,7 @@ static void thread_func(void *userdata) { if (pollfd && (pollfd->revents & POLLIN)) {
    int n_read;

    – if (u->profile == PROFILE_HSP)
    + if (u->profile == PROFILE_HSP || PROFILE_HFGW)

    I think it’s correctly as follows:

    + if (u->profile == PROFILE_HSP || PROFILE_HFGW)



  9. oops!

    I think it’s correctly as follows:

    + if (u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW)

  10. I’m sorry I looked old source code …
    Please erase my post

  11. Greetings…I was wondering if any more became of this? It’s something I’ve been trying to do for years. I’ve tried a few different pieces of software over this time, with varied success. I used to have a Motorola RAZR in the time that samr7’s “nohands” software (http://nohands.sourceforge.net/) was still being developed and that functioned basically, although it seems to have been abandoned for a long time now (which seems to happen to every Bluetooth hands free profile-related project for Linux I’ve come across). This looks somewhat promising as it at least uses software layers that are readily available and part of major distributions, but I can’t get past pairing the phone with the computer. Is there a project related to this that can be followed? Thanks for your efforts!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s