Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
02-05-2007, 01:09 PM
|
#16
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 80
|
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.
|
|
|
02-05-2007, 02:14 PM
|
#17
|
|
Newbie
Join Date: Jan 2006
Vehicle: 2004 Mazda 6s
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?
|
|
|
02-05-2007, 03:25 PM
|
#18
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 80
|
Quote: Originally Posted by Zimans 
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 
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 
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) 
|
|
|
02-05-2007, 07:29 PM
|
#19
|
|
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
|
|
|
02-06-2007, 07:22 AM
|
#20
|
|
Newbie
Join Date: Jan 2006
Vehicle: 2004 Mazda 6s
Posts: 38
|
Quote: Originally Posted by gentoocar 
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?
|
|
|
02-06-2007, 05:45 PM
|
#21
|
|
Newbie
Join Date: Feb 2007
Posts: 5
|
Zimans, could you tell me what I need to compile your app? Not sure if I have all the correct libs.
Do you possibly have a x86 binary?
Thanks in advance.
|
|
|
02-07-2007, 08:10 AM
|
#22
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 80
|
Zimans, how is latency with your prog? I have quite a bit of delay but I suspect that's because aplay might be buffering it a little before playing it. Or maybe the pipe is buffering it. Anybody know how to prevent a pipe from buffering?
|
|
|
02-07-2007, 09:17 AM
|
#23
|
|
Newbie
Join Date: Jan 2006
Vehicle: 2004 Mazda 6s
Posts: 38
|
Quote: Originally Posted by OLAS 
Zimans, could you tell me what I need to compile your app? Not sure if I have all the correct libs.
Do you possibly have a x86 binary?
Thanks in advance.
The lib you are probably missing is libiax. You need to get the version from svn at digium, as the released libiax is depreciated.
here is the svn link. (Or should be)
svn co http://svn.digium.com/svn/libiax2/trunk/
Also, I forgot to include an example conf file.
biax.conf
it looks for /usr/etc/biax.conf
Quote: Originally Posted by gentoocar 
Zimans, how is latency with your prog? I have quite a bit of delay but I suspect that's because aplay might be buffering it a little before playing it. Or maybe the pipe is buffering it. Anybody know how to prevent a pipe from buffering?
I can only guess, but I believe my app is pretty quick. Asterisk sends me 320 bytes at a time, so I buffer and send 320 bytes at a time in return. This makes asterisk happier than sending smaller chunks. 320 bytes = 50ms.
FYI Sco data comes in chunks of 48 bytes. I buffer what I get from asterisk and send 48 bytes for every 48 bytes I get from the phone. Asterisk really handles all the timing.
When I called my GF's phone using the setup, there was a delay between 0.5 and 1 second. But there are alot of sources of delay in the chain (PAP2, Asterisk, Phone Network, GSM network) WHen I make regular calls it really is no different then when I'm talking on the phone normally).
--Zims
__________________
--------------------------------------------------------------------------------
Now, Where are my Pants?
|
|
|
02-07-2007, 10:38 AM
|
#24
|
|
Newbie
Join Date: Feb 2007
Posts: 3
|
audio problems!!
Hey everybody!!
I am also interested in using my pc as a handsfree with bluetooth!!
So far i get connection with my mobile phone but my sound seems to have some kind of problems because i get the next result;
[root@wireless-10-12-9-46 handsfree]# ./handsfree 00:16:75:99:4d:61 8
Voice setting: 0x0060
RFCOMM channel connected
sending.cmd AT+BRSF=31
poll descriptors count 1
poll descriptors count 1
>>
+MBAN: Copyright 2000-2002 Motorola, Inc.
+BRSF: 63
OK
boo.
sending.cmd AT+CIND=?
>>
+CIND: ("Voice Mail",(0,1)),("service",(0,1)),("call",(0,1)),("Ro am",(0-2)),("signal",(0-5)),("callsetup",(0-3)),("smsfull",(0,1))
OK
sending.cmd AT+CIND?
>>
+CIND: 0,1,0,1,5,0,0
OK
sending.cmd AT+CMER=3,0,0,1
>>
OK
sending.cmd AT+CMER=3,0,0,1
>>
OK
sending.cmd AT+CLIP=1
>>
OK
sending.cmd AT+NREC=0
>>
OK
sending.cmd AT+CHLD=?
>>
+CHLD: (0,1,1x,2,2x,3,4)
OK
0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005 0005
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
maxbuf: 2730
0 0 0 0 0 0 0 0 960 0 0 0 0 0 0 0
indicator 0
check: total 960, middle 960, fraction 100 % val 1
adj=0
.run
write to audio interface failed (Too many open files)
.run
write to audio interface failed (Invalid cross-device link)
0 0 0 0 0 0 0 0 936 0 0 0 0 0 0 0
.run
write to audio interface failed (Invalid cross-device link)
.run
write to audio interface failed (Device or resource busy)
.run
write to audio interface failed (Not a directory)
.run
write to audio interface failed (Invalid cross-device link)
.run
write to audio interface failed (Not a directory)
.run
write to audio interface failed (Too many open files)
lost sco audio connection (-1 107)!
listening s set up.
At the end of this process i check my mobile phone and it is said that the phone is connected to a handsfree device. However if i make a phone call the only thing i get from the prompt is that i had a "Segmentation fault".
Any idea of what could be wrong? i am working with mandriva 2007 and i checked my alsa drivers.
|
|
|
02-07-2007, 05:58 PM
|
#25
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 80
|
Quote: Originally Posted by iban 
Hey everybody!!
I am also interested in using my pc as a handsfree with bluetooth!!
So far i get connection with my mobile phone but my sound seems to have some kind of problems because i get the next result;
Yes, that's exactly what I got. So I commented out all of the alsa-related calls and instead just wrote the sco data to /tmp/audioOut (which I created with mkfifo). Then I did aplay -f S16_LE /tmp/audioOut, and I can hear audio, albeit with some lag and random crashes.
Rewriting this may have to wait a few days, as I just got a new car yesterday (03 passat glx  ) and will have to play around with it a little...
|
|
|
02-08-2007, 12:05 AM
|
#26
|
|
Newbie
Join Date: Jun 2003
Vehicle: 1994 Acura Integra LS
Posts: 35
|
Thanks to you all, I have handsfree connecting to my phone now. It appears as though an active connection is required for 'hcitool con' to return any data for my phone. To be honest, I have not used handsfree since I had originally attempted back at the beginning of December. Now, after simply running 'handsfree [address] [channel]', my phone connected, Bluetooth icon appears on the phone. In terms of audio, I get tones (ie pressing buttons), but audio playback doesn't come through. Still looking into that.
To get this to work, all I did was place the command 'sdptool add hf' in my local initialization script, configured hcid.conf, and started the Bluetooth init script. Then simply executed handsfree as above.
I am using gentoo as well, with bluez-utils 2.25-r1, bluez-libs 2.25, and a 2.6.19-rc5 kernel. I am beginning to think an update to bluez is what got this to work better. I did not make any changes to the code, nor did I 'mkfifo /tmp/ctrl' yet. Also, it seems there is a lot of Bluetooth in the kernel now, and that the latest kernel patch is for 2.6.19, though I did a quick grep and think I don't have the latest patch. 2.6.20-rc6-mm3 does however have the latest patch, but I haven't compiled this kernel yet.
In the meantime, I've been attempting to setup DUN via Sprint, but haven't had enough time yet.
This is great how many people are interested in using Bluetooth on Linux, and the potential for progress seems great.
|
|
|
02-08-2007, 05:00 AM
|
#27
|
|
Newbie
Join Date: Feb 2007
Posts: 3
|
Thanks gentoocar!
I did mkfifo /tmp/audioOut and aplay -f U8 /tmp/audioOut but i still get the next result ( i am just posting the most relevant part so it is not too long):
sending.cmd AT+CHLD=?
>>
+CHLD: (0,1,1x,2,2x,3,4)
OK
fff7 fff8 fff8 fffb fffd ffff 0000 0001 0002 fff1 fff3 fff5 fff6 fff7 fff8 fffa fffc fffe 0000 0001 0002 fff0 fff2 fff4
-9 -8 -8 -5 -3 -1 0 1 2 -15 -13 -11 -10 -9 -8 -6 -4 -2 0 1 2 -16 -14 -12
maxbuf: 2730
0 0 0 0 0 0 0 0 960 0 0 0 0 0 0 0
indicator 0
check: total 960, middle 960, fraction 100 % val 1
adj=0
0 0 0 0 0 0 0 0 936 0 0 0 0 0 0 0
lost sco audio connection (-1 107)!
listening s set up.
I am using U8 because i think is the pcm code way of coding the audio. You used S16_LE, i also tried with this one but i even get more errors.
So any idea how to solve this lost sco sudio connection?
Thanks a lot !!
|
|
|
02-08-2007, 08:59 AM
|
#28
|
|
Newbie
Join Date: Jan 2006
Vehicle: 2004 Mazda 6s
Posts: 38
|
What Bluetooth chips are people using?
I have a Broadcom based adapter and I needed to patch the kernel to get SCO audio out to work. I could receive audio, but not send.
Just an FYI as people troubleshoot.
--Zims
__________________
--------------------------------------------------------------------------------
Now, Where are my Pants?
|
|
|
02-08-2007, 09:21 AM
|
#29
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 80
|
Quote: Originally Posted by iban 
lost sco audio connection (-1 107)!
listening s set up.
I am using U8 because i think is the pcm code way of coding the audio. You used S16_LE, i also tried with this one but i even get more errors.
So any idea how to solve this lost sco sudio connection?
The lost sco audio connection stuff is not an error, that is normal. You said when you used S16_LE you got even more errors... you mean from aplay? Also, without modifying the code /tmp/audioOut is not used at all... that's just something I added to mine.
|
|
|
02-08-2007, 09:22 AM
|
#30
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 80
|
It's great to see so many people interested in this. I think I will create a SF site tonight to host this project. Any ideas for a name? I was thinking "Handsfree 2" but that's a little lackluster...
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Bluetooth woes!
|
daveg360 |
Wireless Communications |
1 |
10-01-2005 11:11 PM |
All times are GMT -5. The time now is 02:52 PM.
|
|