Page 2 of 13 FirstFirst 123456789101112 ... LastLast
Results 11 to 20 of 122

Thread: bluetooth woes

  1. #11
    Newbie
    Join Date
    Feb 2007
    Posts
    5
    Made a little progress but nothing usable.

    With
    Code:
    ./handsfree [phone addr] 3
    I always hear something and occasionally the audio is sent - I made a call and heard the no answer message.

    After checking strace, I noticed the app. was trying to access /dev/snd/controlC* - 0 to 30, so I
    Code:
    mknod /dev/snd/controlC0 c 116 12;mknod /dev/snd/controlC1 c 116 12
    With that, it worked for a while before the "Write to audio interface failed (Too many files)" error popped up.

    This looked interesting; http://ubuntuforums.org/showthread.php?t=75978 but ultimately doesn't work, although the phone is recognised.

    gentoocar, your idea looks good, however if we can work out why the app/sco drops after a few seconds and fix that, I don't think much more coding will need to be done. That said, making the app stable and adding extra features would be good!

    Will keep bashing away at different configs and report back.

  2. #12
    Low Bitrate
    Join Date
    Sep 2005
    Posts
    82
    Quote Originally Posted by OLAS View Post
    gentoocar, your idea looks good, however if we can work out why the app/sco drops after a few seconds and fix that, I don't think much more coding will need to be done. That said, making the app stable and adding extra features would be good!
    The SCO link should drop out after a few seconds of silence, and come back up as soon as there is more audio (from the phone) (To save power?) I think also if there is audio from the pc it should come back up too, but I don't think there is anything in the code that will do that right now.

    If you keep making noise with the phone (the mic will be shut off, so keep pressing buttons or make a call and talk into the other phone), the sco link should stay active as long as you're making noise.

    I wish there were some way to disable that behavior. Maybe there's an AT command to do that?

    Anyways, stability is what I'm after here. Handsfree won't do me any good if I have to restart things while driving!

  3. #13
    Newbie Zimans's Avatar
    Join Date
    Jan 2006
    Posts
    38
    I wish I had seen this thread earlier.

    I have written an app that connects to my cell as a hands-free device
    and bridges it to my asterisk PBX. It's not finished, as it does have a
    few bugs still with states, and when there is more than one phone
    connected audio stops working, but it does work. I can pick up a phone
    elsewhere in the house and the call goes out through my cell phone (I do
    not have a POTS). As well as when a call comes in the phones in the
    house ring.

    When you scan the services on your phone you want the one that is "voice
    gateway" or some such. On my phone that is channel 8. This rfcomm channel
    only supports a subset of the at command set. This subset is laid out in
    the Handsfree Profile doc. The doc is pretty straight forward. (As opposed to teh USB spec, wich I still haven't made sense of yet)

    If you can find a program that simply listens for SCO connections
    irregardless and sends/receives audio you could use that in conjunction
    with another program that sends the at commands. SCO is channel-less. So
    aside from BDADDR there is no way to know one connection from another.

    I did not know that the bluez people had a handsfree program.

    The documentation you are looking for to work on this is

    http://bluetooth.com/NR/rdonlyres/94EAD32B-3E70-4AEC-9CD5-1E3F887A15F4/917/HFPSpecVersion1_0.pdf


    I'll put together a tar-ball of my code. The program is designed to
    connect to asterisk, and as I said above has a few quirks that I haven't
    taken the time to fix. But hopefully it would be a good reference for
    anyone trying to work on this. I'll post this soon.

    I've actually been writing my own front-end for linux. But I haven't
    gotten to the point of adding Handsfree support yet. (I intend to).

    Edit: Link
    biax-0.0.1.tar.bz2

    --Nate
    --------------------------------------------------------------------------------
    Now, Where are my Pants?

  4. #14
    Newbie Zimans's Avatar
    Join Date
    Jan 2006
    Posts
    38
    Quote Originally Posted by gentoocar View Post
    The SCO link should drop out after a few seconds of silence, and come back up as soon as there is more audio (from the phone) (To save power?) I think also if there is audio from the pc it should come back up too, but I don't think there is anything in the code that will do that right now.

    If you keep making noise with the phone (the mic will be shut off, so keep pressing buttons or make a call and talk into the other phone), the sco link should stay active as long as you're making noise.

    I wish there were some way to disable that behavior. Maybe there's an AT command to do that?

    Anyways, stability is what I'm after here. Handsfree won't do me any good if I have to restart things while driving!
    The Phone should not drop the SCO conection, audio or not. If you only have one device on your bluetooth link the phone will take over as master. When a call comes in, it will establish a SCO link to your client. If you have more than one device, your bt adapter will act as master, and then (i think) you will have to establish the sco connection to the phone.

    --Zims
    --------------------------------------------------------------------------------
    Now, Where are my Pants?

  5. #15
    Low Bitrate
    Join Date
    Sep 2005
    Posts
    82
    Hey, thanks for that info Zimans! Looks like I have some reading ahead of me.

    Quote Originally Posted by Zimans View Post
    The Phone should not drop the SCO conection, audio or not. If you only have one device on your bluetooth link the phone will take over as master. When a call comes in, it will establish a SCO link to your client. If you have more than one device, your bt adapter will act as master, and then (i think) you will have to establish the sco connection to the phone.
    Well, if you have a cell and a BT headset, give this a try. Connect to the headset, then make some noise with the keypad (on my phone i can hit up&down to scroll through the phonebook. It makes a beep every time you press those buttons). Now let it sit for a few seconds in silence. Now press those buttons again. The beginning of the first tone should be chopped off, as it has dropped the SCO connection and had to re-connect it. Having the SCO connection active drains the battery faster. Imagine you have your phone in your pocket connected to your earpiece, and you're not on the phone. If it sits that way for hours, you don't need that SCO channel active. Once you make some noise, it will reactivate itself. I'm not sure, but I'm guessing that during an actual call it wouldn't do that.

    Now, all of that is just what I've gathered from playing around and watching the SCO link drop and reconnect in response to silence/noise. I have yet to find any documentation that confirms that. But in any case, I don't think it will really be a problem.

  6. #16
    Low Bitrate
    Join Date
    Sep 2005
    Posts
    82
    Good news, everybody. It looks like my company is going to let me release some code as open source for use in this project. Don't get too excited, it is not bluetooth-related code, but just some thread/socket/audio related utility classes. This is good news because it will make it easier for me to develop this handsfree stuff now.

  7. #17
    Newbie Zimans's Avatar
    Join Date
    Jan 2006
    Posts
    38
    When you are pressing buttons are you currently in a call?

    With my phone (Samsung t629) when a call comes in it makes a SCO connection to my app. This SCO connection stays active for the duration of the call, silent or not.

    Also, I believe the Headset and Handsfree profile are two different profiles, so the phone can probably tell the difference between the two. It may do a power save mode for a headset, but not for a handsfree (External power source assumed?). When i'm mucking with the menu with my phone and my app connected it does not create a SCO connection. When a call comes in it creates the SCO link before it even starts ringing (spec says it should for in-band ring tones, but my phone doesn't do in-band))

    On a related but slightly different note:

    I don't think you can get phone book entries from this rfcomm link, I think you need to make a secondary connection to the serial port channel. I could be wrong as I haven't messed with it (Don't need phone book stuff for an asterisk bridge) AT least it doesn't say anything aside from memory dialing in the HF profile spec.

    --Zims
    --------------------------------------------------------------------------------
    Now, Where are my Pants?

  8. #18
    Low Bitrate
    Join Date
    Sep 2005
    Posts
    82
    Quote Originally Posted by Zimans View Post
    When you are pressing buttons are you currently in a call?

    With my phone (Samsung t629) when a call comes in it makes a SCO connection to my app. This SCO connection stays active for the duration of the call, silent or not.
    Ah. Mine works a little differently. When I'm pressing the buttons, I'm doing so without being in a call. It makes sense that it would keep the SCO link active while in a call but drop it during silence while not in a call. I think that's exactly what we want, right? I'll have to test whether it stays active during a call after work.

    Quote Originally Posted by Zimans View Post
    Also, I believe the Headset and Handsfree profile are two different profiles, so the phone can probably tell the difference between the two. It may do a power save mode for a headset, but not for a handsfree (External power source assumed?). When i'm mucking with the menu with my phone and my app connected it does not create a SCO connection. When a call comes in it creates the SCO link before it even starts ringing (spec says it should for in-band ring tones, but my phone doesn't do in-band))
    I see the same behavior no matter which profile's channel I connect to. I'm not sure what you mean about in-band, I've never heard that term.

    Quote Originally Posted by Zimans View Post
    I don't think you can get phone book entries from this rfcomm link, I think you need to make a secondary connection to the serial port channel. I could be wrong as I haven't messed with it (Don't need phone book stuff for an asterisk bridge) AT least it doesn't say anything aside from memory dialing in the HF profile spec.
    I've read that the headset profile does not support phonebook stuff but the handsfree profile does. In any case, if it doesn't I could always open a rfcomm channel to the serial port and get the phone book that way (I *know* that works since I've done it)

  9. #19
    oys
    oys is offline
    Newbie
    Join Date
    Feb 2007
    Posts
    1
    There is a patch for asterisk to get it to act as a handsfree for bluetooth phones so that it can be used to send/recieve calls. It is tested and working with the following:

    LG TU500
    RIM Blackberry 7250
    Nokia 6230i

    So far, it does not work with the Sony Ericsson T630

    Read more about it here:
    http://bugs.digium.com/view.php?id=8919

  10. #20
    Newbie Zimans's Avatar
    Join Date
    Jan 2006
    Posts
    38
    Quote Originally Posted by gentoocar View Post
    I see the same behavior no matter which profile's channel I connect to. I'm not sure what you mean about in-band, I've never heard that term.
    You know how when you call some people instead of a regular ring noise, you hear some audio clip (On your phone). That's in-band ring tones.

    --Zims
    --------------------------------------------------------------------------------
    Now, Where are my Pants?

Similar Threads

  1. Bluetooth woes!
    By daveg360 in forum Wireless Communications
    Replies: 1
    Last Post: 10-02-2005, 12:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •