Announcement

Collapse
No announcement yet.

HFP for Linux Bluetooth Hands Free

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • HFP for Linux Bluetooth Hands Free

    I'm trying to put together support for Bluetooth Hands-Free Profile on Linux. We all know what a mess Bluetooth HFP is on Windows, and the lengths that some will go through to get it to work despite the fragmented infrastructure. Fortunately, on Linux, we are blessed with a single good standard of BlueZ. One would think that it could only be easier to create a good HFP implementation on Linux. I hope to prove that to be the case.

    Recently posted on SourceForge, in the subversion repository:

    http://nohands.sourceforge.net/

    This package aims to support a variety of relevant standards:
    • Bluetooth HFP 1.5, although presently only tested with Motorola handsets
    • ALSA and OSS sound drivers
    • libspeexdsp for noise reduction/echo cancelation
    • D-Bus for environmental integration and external control
    • PyGTK and Qt GUIs

    With luck, this package will make its humble debut as a plugin for tripzero's nGhost 2.1 platform, due to be released within a month.

    Any code/testing/interest is appreciated!

    Attached Files

  • #2
    hi,

    i get this errors:
    [[email protected] nohands-20081022]$ ./configure --prefix=/usr
    ./configure: line 1817: AM_MAINTAINER_MODE: command not found
    ./configure: line 1819: syntax error near unexpected token `ON'
    ./configure: line 1819: `DX_HTML_FEATURE(ON)'

    do you have any advices?
    I'm using linux in my car? (www.archlinux.org)

    Comment


    • #3
      Wow.. I give all my support, but i'm not a great programmer.. i hope that someone join this project, because I was looking for this feature for so much time...

      Comment


      • #4
        does it auto connect? that'll be a super feature !

        Comment


        • #5
          hi,

          i get this errors:
          [[email protected] nohands-20081022]$ ./configure --prefix=/usr
          ./configure: line 1817: AM_MAINTAINER_MODE: command not found
          ./configure: line 1819: syntax error near unexpected token `ON'
          ./configure: line 1819: `DX_HTML_FEATURE(ON)'

          do you have any advices?
          I'm using linux in my car (www.archlinux.org)

          Comment


          • #6
            hi,



            i get this errors:

            [[email protected] nohands-20081022]$ ./configure --prefix=/usr

            ./configure: line 1817: AM_MAINTAINER_MODE: command not found

            ./configure: line 1819: syntax error near unexpected token `ON'

            ./configure: line 1819: `DX_HTML_FEATURE(ON)'



            do you have any advices?

            I'm using archlinux in my car (www.archlinux.org)

            Comment


            • #7
              Originally posted by Malo View Post
              Wow.. I give all my support, but i'm not a great programmer.. i hope that someone join this project, because I was looking for this feature for so much time...
              Thanks Malo, I hope so too.

              You don't need to be able to program to help. If you can build it on your machine, or even try to build it and tell me why it won't build, this helps. If you can get as far as to test it with your phone, that helps a lot more.

              Originally posted by Punky View Post
              does it auto connect? that'll be a super feature !
              Hi Punky. What do you mean by auto-connection?

              Auto-connection of _known_ devices, at least, is an implemented feature! It has also been tweaked to work following resume-from-hibernate, so if you leave hfconsole running with the phone attached when hibernating the PC, the phone is automatically re-attached when the PC is powered back on. It's a quick process too.

              One of these days I'll post an action video on YouTube, but as soon as the user interface components are better integrated with nGhost.

              Comment


              • #8
                I'll give it a go building this on my setup (Gentoo AMD64 2.6.27), and report back if it works or not

                **update**

                Compiled fine, but...

                Code:
                ** OpLatency: primary open took 40ms
                Create SCO socket: 93
                Bluetooth Failure, hub shut down
                Create SCO socket: 93
                Bluetooth just refuses to work full stop...

                Comment


                • #9
                  Originally posted by ertnec View Post
                  Code:
                  ** OpLatency: primary open took 40ms
                  Create SCO socket: 93
                  Bluetooth Failure, hub shut down
                  Create SCO socket: 93
                  Bluetooth just refuses to work full stop...
                  Hm. Is your kernel built with SCO socket support? Gotta have that for the audio to work.

                  The error reporting is a bit lame right now, I'll see about having it make this condition more obvious.

                  Comment


                  • #10
                    Oh this is looking good, linux is finally picking up momentum, and hopefully we'll have a carpc dedicated linux soon. Great job!

                    Comment


                    • #11
                      Oh Man! You are a GOD Wonderful Just compiled

                      I've got a Nokia 6680.. I start standalone and scan.. My mobile it's recognise. Then, i try to dial a number and.. Suprise The call start

                      Only one thing.. I can only hear noise, no real voice.. Only noise
                      But great job! It's like i've got bad amplification for the sound.. I'm sure it's only a little problem of configuration..

                      Comment


                      • #12
                        And as your project page suggest.. My config is Archlinux 2.6.26 32bit on amd64.. And my usb dongle is D-Link Corp. DBT-122 Bluetooth adapter..

                        Comment


                        • #13
                          Originally posted by Malo View Post
                          Only one thing.. I can only hear noise, no real voice.. Only noise
                          But great job! It's like i've got bad amplification for the sound.. I'm sure it's only a little problem of configuration..
                          Hi Malo,

                          I'm glad it sorta worked for you! Sorry the audio quality is stinking. Have you tried running the feedback test mode or the DSP test mode?

                          Comment


                          • #14
                            I made some tests.. I set up my pc audio level with the feedback test mode, i can speak into the micropone (mic line source) and hear myself in the speakers. Then i tried to make a call (a free call to my GSM service provider ) but i still hear only noise from the speaker. I'm not english, so it's difficult for me explain exactly what I get.. I know that when I call my service provider there is a recorded voice that tell me some information.. When I use the pc as headset, i only hear bass tone, noise and I can understand only some pieces of the recorded voice. Any suggestion?

                            I can tell you also that i hear noise when I press the mobile phone button.. The pc doesn't reproduce correctly digit tones.. Everything that i should hear from the headset it's.. like crappy, broken. I hope you understand me

                            Then i tried to have a call where I spoke into the microphone of the pc and hear from another phone that a was calling.. I get no sound . It's like what i spoke into the mic is not send to mobile micropone..

                            And I notice others minor bugs.. When I call the mobile the caller number is showed correctly, but when I dial a new number from the QT interfaces, the last recevied called number is displayed, otherwise the telefone dial the correct number.
                            I don't know if it's a bug only of the QT interface or of the rest of the backend.

                            Also, if I hadn't recevied call with the QT interfaces connected, when i dial a number nothing is displayed next to "dialing". I think that the bug it's related with what i wrote before.

                            And another little bug is that I can't reject incaming call.. I click reject, but nothing appens. Otherwise, if i make a call and press "Hang Up", it works

                            Another thing.. It could be possible to see a sort of "history" of associated phones, and the name of the telephones.. Having something like "MyMobileBTName (AA:BB:CCD:EE)". I cheked "auto-reconnect" option in the settings, and it's listed last connected mobile. Having a history of mobile i can try to connect to the one listed also when the mobile is in hidden bluetooth mode.

                            Last, i have other suggestion, but they are a very minor thing. A sort of integration, into nghost, with GAMMU to get my telephone phonebook (contacts) and SMS?
                            But i thik that it could be a feature that i want only after a stable version of this HFP plugin.

                            Again.. Nice job man . This project it's looking so interesting
                            I hope i can call soon someone trought my pc

                            Comment


                            • #15
                              Originally posted by Malo View Post
                              I made some tests.. I set up my pc audio level with the feedback test mode, i can speak into the micropone (mic line source) and hear myself in the speakers. Then i tried to make a call (a free call to my GSM service provider ) but i still hear only noise from the speaker. I'm not english, so it's difficult for me explain exactly what I get.. I know that when I call my service provider there is a recorded voice that tell me some information.. When I use the pc as headset, i only hear bass tone, noise and I can understand only some pieces of the recorded voice. Any suggestion?

                              I can tell you also that i hear noise when I press the mobile phone button.. The pc doesn't reproduce correctly digit tones.. Everything that i should hear from the headset it's.. like crappy, broken. I hope you understand me

                              Then i tried to have a call where I spoke into the microphone of the pc and hear from another phone that a was calling.. I get no sound . It's like what i spoke into the mic is not send to mobile micropone..
                              Hmm.

                              The last time I had a problem where the test modes would work, but audio to and from the phone wouldn't, it was because the audio buffering parameters were unsuitable. The buffer fill level data is used for rate matching and to decide when to drop data or add silence padding. What console output do you get immediately after you attach the mobile phone audio? There should be a table like this:

                              Code:
                              Pump: packet size = 24
                              Pump: input max fill = 340
                              Pump: bot packet size = 170
                              Pump: bot min fill = 320
                              Pump: bot max fill = 490
                              Pump: top packet size = 24
                              Pump: top min fill = 320
                              Pump: top max fill = 400
                              Pump: watchdog timeout = 500
                              If the "bot packet size" is < 100 samples, you might consider increasing the packet size and output buffer settings in the audio device tab of the configuration screen. In general, tweaking those parameters can help a _lot_. I'd rather it be more automatic than it currently is though. :-(

                              Another possibility that I have not yet had to explore has to do with your Bluetooth module's voice coding configuration. When you run (as root) the hciconfig command as below, what do you get?

                              Code:
                              ricer trunk # hciconfig hci0 voice
                              hci0:	Type: USB
                              	BD Address: 00:16:CB:0B:DA:D7 ACL MTU: 384:8 SCO MTU: 64:8
                              	Voice setting: 0x0060 (Default Condition)
                              	Input Coding: Linear
                              	Input Data Format: 2's complement
                              	Input Sample Size: 16 bit
                              	# of bits padding at MSB: 0
                              	Air Coding Format: CVSD
                              If the input format is not 2's complement and 16-bit, then we might have issues. The HFP app needs to ask the HCI and verify this stuff by itself, but I've never encountered a situation where it hasn't been configured this way from the beginning.

                              Originally posted by Malo View Post
                              And I notice others minor bugs.. When I call the mobile the caller number is showed correctly, but when I dial a new number from the QT interfaces, the last recevied called number is displayed, otherwise the telefone dial the correct number.
                              I don't know if it's a bug only of the QT interface or of the rest of the backend.

                              Also, if I hadn't recevied call with the QT interfaces connected, when i dial a number nothing is displayed next to "dialing". I think that the bug it's related with what i wrote before.

                              And another little bug is that I can't reject incaming call.. I click reject, but nothing appens. Otherwise, if i make a call and press "Hang Up", it works
                              The Qt GUI isn't meant to be the main interface. Instead, what you ought to do is 'make install' and then run hfconsole. It does require Python and a few Python binding packages, but it's the designated path forward right now.

                              As for phone number display, the Qt GUI most certainly has some bugs. However, the way that the backend manages caller ID and outbound phone number information needs to be revised a little bit.

                              As for the reject call feature in the Qt GUI, it is hard coded to use the AT+CHLD=0 command, a.k.a. User Declare User Busy, which may or may not be supported by your phone. This is certainly a bug, and there is a more commonly used way to reject calls that it should be using instead. I think I may have put that in there to test the UDUB command.

                              Originally posted by Malo View Post
                              Another thing.. It could be possible to see a sort of "history" of associated phones, and the name of the telephones.. Having something like "MyMobileBTName (AA:BB:CCD:EE)". I cheked "auto-reconnect" option in the settings, and it's listed last connected mobile. Having a history of mobile i can try to connect to the one listed also when the mobile is in hidden bluetooth mode.

                              Last, i have other suggestion, but they are a very minor thing. A sort of integration, into nghost, with GAMMU to get my telephone phonebook (contacts) and SMS?
                              But i thik that it could be a feature that i want only after a stable version of this HFP plugin.
                              These are both very good ideas. I'll need to spend some time learning how Gammu works, but having an off-the-shelf package to do contacts and SMS like that is going to lead to something that's pretty cool.

                              Unless somebody else wants to volunteer to do this integration?

                              The hfconsole program is written in Python, and uses D-Bus to control hfpd. It is very high level, but has a part in configuring just about every aspect of the hands-free profile service, including the audio pipeline. It could be easily extended with Gammu's Python bindings, and should have enough control, if needed, to disconnect the HFP link while the SPP link is open to perform Gammu tasks.

                              Originally posted by Malo View Post
                              Again.. Nice job man . This project it's looking so interesting
                              I hope i can call soon someone trought my pc
                              Thank you for your kind words. Personally, the lack of a good hands-free is frustrating. Parrot devices are really high quality, but they don't do anything we shouldn't already be able to do with a (more capable) PC loaded with the right software.

                              Comment

                              Working...
                              X