Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Linux


Reply
 
Share Thread Tools Display Modes
Old 02-20-2007, 10:31 PM   #61
Newbie
 
Join Date: Feb 2007
Location: NJ
Posts: 7
L2SHO is an unknown quantity at this point
Can you set up a CVS repository for your code? I've been hacking around with handsfree, I managed to get it to not segfault on me, and now I'm trying to get the audio link decoding working properly. If your making good progress then I'd like to use your code as a base instead of the sloppy handsfree code.
L2SHO is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 02-20-2007, 11:34 PM   #62
Low Bitrate
 
Join Date: Sep 2005
Posts: 82
gentoocar is on a distinguished road
Quote: Originally Posted by L2SHO View Post
Can you set up a CVS repository for your code? I've been hacking around with handsfree, I managed to get it to not segfault on me, and now I'm trying to get the audio link decoding working properly. If your making good progress then I'd like to use your code as a base instead of the sloppy handsfree code.

I'd love to, but currently I'm using some utility classes from work, and it won't compile without them. My company is giving me permission to release them, so I'm just waiting for them to review it all and provide a copyright notice for the top. Hopefully I'll be able to set it all up this week sometime.
gentoocar is offline   Reply With Quote
Old 02-21-2007, 11:32 AM   #63
Low Bitrate
 
Join Date: Sep 2005
Posts: 82
gentoocar is on a distinguished road
FYI the "sounder" indicator is set to 1 if the phone is in silent mode, and set to 0 if in regular mode according to Sony Ericsson's AT command guide. Still no explanation why I don't get some of those indicators.
gentoocar is offline   Reply With Quote
Old 02-21-2007, 03:55 PM   #64
Newbie
 
Zimans's Avatar
 
Join Date: Jan 2006
Posts: 38
Zimans is on a distinguished road
Quote: Originally Posted by gentoocar View Post
Yup. Although + codes have an OK or ERROR if they are responses, just to be confusing

Technically the +CIND, etc. is not a response to a command. AT+CIND? is the command, OK is the response. +CIND is unsolicited. I just treat all + codes as unsolicited and do susequent commands once I get the OK.


Quote: Originally Posted by gentoocar View Post
OK, after a little more testing I see that I DO get +CIEV's for call, callsetup, sounder, and message, but NOT for battchg or signal (I left my phone connected overnight so that the battery state did change from 5 to 4, but no CIEV for it).

I would think that if the phone says it supports certain indicators (and gives you the correct values when you send an AT+CIND?) that it would send you CIEV's for them. I suppose a crude hack for this would be to poll for signal strength and battery every second or so, and as soon as I receive a CIEV for them then stop polling. Or I could look into getting that info from a different profile (but are all phones that support handsfree guaranteed to provide a dial-up networking or generic serial port profile?) And what bugs me is that I have no way of knowing programatically which phones have busted signal indicators and which don't, so I guess I'd want to do that for everyone.

I'd poll every 30 seconds to a minute, as your phone probably doesn't update it's signal strength any sooner than that. Dunno why it doesn't send the battery and signal event codes, Have you tried different values for at+BSFR=... ?

--Zims
__________________
--------------------------------------------------------------------------------
Now, Where are my Pants?
Zimans is offline   Reply With Quote
Old 02-22-2007, 06:33 AM   #65
Newbie
 
Join Date: Feb 2007
Posts: 1
asma is an unknown quantity at this point
Need some help with handsfree

Hi,

I'm writing you to ask you some help with the package Handsfree. I've installed the version 040326 and I got some warnings but the handsfree does work. When I've tried to contact my Nokia N70 I got errors and I dont know what to do to resolve them. The output of the handsfree command is the following :

[root@ws12 handsfree]# ./handsfree 00:16:4E9:20:98 2
Voice setting: 0x0060
RFCOMM channel connected
sending.cmd AT+BRSF=31
poll descriptors count 1
poll descriptors count 1
opening control pipe - set to stdin: No such file or directory
>>AT+BRSF=31
>>
+BRSF: 47

OK

boo.
sending.cmd AT+CIND=?
>>AT+CIND=?
>>
+CIND: ("call",(0,1)),("service",(0,1)),("call_setup", (0-3)),("callsetup",(0-3))

OK

sending.cmd AT+CIND?
>>AT+CIND?
>>
+CIND: 0,1,0,0

OK

sending.cmd AT+CMER=3,0,0,1
>>AT+CMER=3,0,0,1
>>
OK

sending.cmd AT+CMER=3,0,0,1
>>AT+CMER=3,0,0,1
>>
OK

sending.cmd AT+CLIP=1
>>AT+CLIP=1
sending.cmd AT+NREC=0
>>
OK

sending.cmd AT+CHLD=?
>>AT+NREC=0
>>
ERROR

Error
can't grok [
ERROR
]Error: Error in state_conn - ignoring
>>AT+CHLD=?
]>>'t grok [AT+CHLD=?
+CHLD: (0,1,1x,2,2x,3,4)

OK


I hope you'll help me with this problem because I need to make it works. I've already installed the latest versions of bluez 'bluez-utils-3.9, bluez-libs-3.9, bluez-hcidump-1.33 and bluez-firmware-1.2' under Mandriva 2006 and I can establish a connection between my pc and my nokia N70. I want to have the handsfree option available so I add it with :
sdptool add --channel=2 HF
(the channel for handsfree on N70 is the number 1) and the test seems to work fine since I had an icon on my nokia when I launch :

rfcomm connect /dev/rfcomm0 00:16:4E9:20:98 2

The connection lasts only few secondes then terminate. So I make :
rfcomm listen /dev/rfcomm0 2

and try to call the nokia N70 from another phone. The N70 contact the pc via bluetooth and I enter the PIN in both sides and the connection is done but when I hangup the sound doesn't came from the pc's headspeaker but from N70's one.

I thought I need to install the bluetooth-alsa to make it work. So I do, I installed btsco-0.5, plugz and sbc and I tried to add snd-bt-sco module :

[root@ws12 btsco-0.5]# cd kernel/

[root@ws12 kernel]# make
make[1]: Entering directory `/usr/src/linux-2.6.12-12mdk'
Building modules, stage 2.
MODPOST
*** Warning: "snd_hidden_kmalloc" [/root/confhandsfree/btsco-0.5/kernel/snd-bt-sco.ko] undefined!
*** Warning: "snd_verbose_printk" [/root/confhandsfree/btsco-0.5/kernel/snd-bt-sco.ko] undefined!
*** Warning: "snd_hidden_kfree" [/root/confhandsfree/btsco-0.5/kernel/snd-bt-sco.ko] undefined!
make[1]: Leaving directory `/usr/src/linux-2.6.12-12mdk'

[root@ws12 kernel]# make install
make[1]: Entering directory `/usr/src/linux-2.6.12-12mdk'
INSTALL /root/confhandsfree/btsco-0.5/kernel/snd-bt-sco.ko
make[1]: Leaving directory `/usr/src/linux-2.6.12-12mdk'

[root@ws12 kernel]# depmod -eav | grep snd-bt-sco
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_ctl_add": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_pcm_new": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-pcm.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_card_register": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_card_free": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_ctl_new1": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_card_new": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_pcm_lib_ioctl": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-pcm.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_hwdep_new": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-hwdep.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_ctl_notify": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_malloc_pages": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-page-alloc.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_pcm_set_ops": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-pcm.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_pcm_period_elapsed": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-pcm.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_free_pages": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-page-alloc.ko.gz
/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko needs "snd_pcm_format_width": /lib/modules/2.6.12-12mdk/kernel/sound/core/snd-pcm.ko.gz

[root@ws12 kernel]# modprobe snd-bt-sco
FATAL: Error inserting snd-bt-sco (/lib/modules/2.6.12-12mdk/extra/snd-bt-sco.ko): Invalid module format

Otherwise, I tried to connect my bluetooth dongle 'belkin' and I got :

[root@localhost confhandsfree]# btsco 00:0A:3A:50:27:84 2
Error: hwdep next device (hw:0): Operation not permitted
Error: control open (hw:1): No such device
Error: Can't find device. Bail

I hope that you'll help me I need to make this work as soon as possible and I'm lost

Thanks a lot.
asma is offline   Reply With Quote
Old 02-24-2007, 01:44 AM   #66
Constant Bitrate
 
Join Date: Jun 2006
Location: Chicago, IL
Posts: 143
dupa2 is an unknown quantity at this point
Quote: Originally Posted by gentoocar View Post
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.

I get similar scenario for my balckberry pearl phone, I mean SEGFAULT once audio appears. I can hear like few miliseconds of audio, then it fails. I'm not even certain that sound what I can hear is real (it can be also some digital noise - just like random data sent to dsp device). I'm sure it's sound system failure. The only comment on that is the app(handsfreee) fails when I get ringer on my telephone, or I play music (mp3 from SD card), but when I use keyboard, it will not fail, but it will neither send key sounds to PC, nor play it using telephone audio as usually. I think it's my telephone firmware's bug.

Anybody knows what really causes SEGFAULT in handsfree program? I have no experience in programming ALSA , so I can't get past this problem easilly.
__________________
EPIA TC 1G 256MB 60GB Linux,WindowMaker, Roadnav, Xine, XMMS, iGuidance3
Lilliput 8", Pharos i360, WUSB11v2.6 WiFi

Last edited by dupa2; 02-24-2007 at 01:46 AM.
dupa2 is offline   Reply With Quote
Old 02-25-2007, 06:54 PM   #67
Newbie
 
Join Date: Feb 2007
Location: NJ
Posts: 7
L2SHO is an unknown quantity at this point
Quote: Originally Posted by dupa2 View Post
I get similar scenario for my balckberry pearl phone, I mean SEGFAULT once audio appears. I can hear like few miliseconds of audio, then it fails. I'm not even certain that sound what I can hear is real (it can be also some digital noise - just like random data sent to dsp device). I'm sure it's sound system failure. The only comment on that is the app(handsfreee) fails when I get ringer on my telephone, or I play music (mp3 from SD card), but when I use keyboard, it will not fail, but it will neither send key sounds to PC, nor play it using telephone audio as usually. I think it's my telephone firmware's bug.

Anybody knows what really causes SEGFAULT in handsfree program? I have no experience in programming ALSA , so I can't get past this problem easilly.

I think the segfualts have something to do with the len/=2 lines in sound.c. I forget exactly what I did, but I started stripping out code that I thought was irrelivent and managed to get handsfree to not segfault, but the audio output from my speakers is horrendus. handsfree doesn't do any decoding of the audio channel. After reading the bluetooth spec I'm begining to realize that this may not be as easy as I thought at first. First I need to figure out how to detect what format my phone is sending over there air, than write some kind of decoder for it.
L2SHO is offline   Reply With Quote
Old 02-26-2007, 12:27 AM   #68
Low Bitrate
 
Join Date: Sep 2005
Posts: 82
gentoocar is on a distinguished road
Quote: Originally Posted by L2SHO View Post
handsfree doesn't do any decoding of the audio channel. After reading the bluetooth spec I'm begining to realize that this may not be as easy as I thought at first. First I need to figure out how to detect what format my phone is sending over there air, than write some kind of decoder for it.

If I save the raw audio from the handsfree app, sometimes I get usable sound in S16_LE format (signed 16-bit little endian I believe, in case anyone was wondering), and sometimes I get some really awful noise. So I assume phones can choose between different formats to send?

Can you point me towards which document has the specs for the sco audio data? I can't find any of that stuff in the handsfree specs.

I'd love to try and integrate the audio decoding/conversion into my handsfree app, so that I always output the same format.
gentoocar is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 02-26-2007, 11:41 AM   #69
Newbie
 
Zimans's Avatar
 
Join Date: Jan 2006
Posts: 38
Zimans is on a distinguished road
Quote: Originally Posted by gentoocar View Post
If I save the raw audio from the handsfree app, sometimes I get usable sound in S16_LE format (signed 16-bit little endian I believe, in case anyone was wondering), and sometimes I get some really awful noise. So I assume phones can choose between different formats to send?

Can you point me towards which document has the specs for the sco audio data? I can't find any of that stuff in the handsfree specs.

I'd love to try and integrate the audio decoding/conversion into my handsfree app, so that I always output the same format.

This is a a phenomenon i've encountered before, and it just seemed to go away. What I suspected is happening is that a byte is getting lost somewhere. If you open the resultant raw file, but offset by 1 byte, it should play fine. I dunno if this was caused by not reading fast enough, not sending bytes regularly enough or what, but as my code became more stable and less of a hack it seemed to go away.

Now my problem is that audio will drop out after awhile. I can here the person on the other end, but they can no longer here me. I haven't taken the time to look into this yet, so dunno what is going on.

--Zims
__________________
--------------------------------------------------------------------------------
Now, Where are my Pants?
Zimans is offline   Reply With Quote
Old 02-26-2007, 03:03 PM   #70
Newbie
 
Join Date: Feb 2007
Location: NJ
Posts: 7
L2SHO is an unknown quantity at this point
Quote: Originally Posted by gentoocar View Post
If I save the raw audio from the handsfree app, sometimes I get usable sound in S16_LE format (signed 16-bit little endian I believe, in case anyone was wondering), and sometimes I get some really awful noise. So I assume phones can choose between different formats to send?

Can you point me towards which document has the specs for the sco audio data? I can't find any of that stuff in the handsfree specs.

I'd love to try and integrate the audio decoding/conversion into my handsfree app, so that I always output the same format.

I downloaded the bluetooth 2.0 +EDR spec from bluetooth.com, the audio section is in Volume 2, Part B, Chapter 9. It seems that bluetooth audio can be sent over the air in either A-law, mu-law, or CVSD formats. I haven't gotten around to figuring out how to set, or figure out which format my phone is connecting in. It's be nice if BlueZ was actually documented.
L2SHO is offline   Reply With Quote
Old 02-26-2007, 10:13 PM   #71
Newbie
 
Join Date: Feb 2007
Location: NJ
Posts: 7
L2SHO is an unknown quantity at this point
http://bluetooth-alsa.sourceforge.net has some good code for working with SCO links, the aim of the project is getting bluetooth headsets working through alsa, which is kind of the opposite of what we are trying to do, but they have some good sco libraries. It actually looks like some of the source in handsfree was taken directly from the btsco project.
L2SHO is offline   Reply With Quote
Old 02-26-2007, 11:36 PM   #72
Constant Bitrate
 
Join Date: Jun 2006
Location: Chicago, IL
Posts: 143
dupa2 is an unknown quantity at this point
this is C/P from bluetooth specs (HFP1.5_SPEC):
---------------cut---------------------------
Synchronous Connection Interoperability Requirements
Synchronous connections may be realized by a SCO or by an eSCO logical transport. Only the support for SCO logical transports is mandated.
The remainder of this section relates to devices supporting eSCO logical transports. Here, “initiating” and “responding” refers to the initiating and responding (i.e. accept or reject) role in setting up the synchronous connection.
Table 5.6 defines eSCO configuration parameter sets S1, S2 and S3. HCI level parameters are given as a reference. On systems not incorporating HCI, values for LMP level eSCO parameters TeSCO, WeSCO and packet length shall be associated that correspond to these HCI parameters and fall into the mandatory parameter ranges for these packet types as given in the LMP specification, and the Voice Setting parameter translates into the air mode parameter of LMP.
Code:
eSCO parameter S1 S2 S3 Packet type EV3 2-EV3 2-EV3 Bandwidth 8000 8000 8000 Voice_Setting CVSD CVSD CVSD Max_Latency 7 ms 7 ms 10ms Retrans_Effort 0x01 0x01 0x01

---------------------------------cut--------------------------

all 3 modes show CVSD format, that apparently is mandatory in SCO
at least I would concentrate on it.

If you need this document, I can post it (PDF), it explains all the communications required to set up HF.
__________________
EPIA TC 1G 256MB 60GB Linux,WindowMaker, Roadnav, Xine, XMMS, iGuidance3
Lilliput 8", Pharos i360, WUSB11v2.6 WiFi

Last edited by dupa2; 02-26-2007 at 11:39 PM.
dupa2 is offline   Reply With Quote
Old 02-26-2007, 11:46 PM   #73
Newbie
 
Join Date: Feb 2007
Location: NJ
Posts: 7
L2SHO is an unknown quantity at this point
Quote: Originally Posted by dupa2 View Post
this is C/P from bluetooth specs (HFP1.5_SPEC):
---------------cut---------------------------
Synchronous Connection Interoperability Requirements
Synchronous connections may be realized by a SCO or by an eSCO logical transport. Only the support for SCO logical transports is mandated.
The remainder of this section relates to devices supporting eSCO logical transports. Here, “initiating” and “responding” refers to the initiating and responding (i.e. accept or reject) role in setting up the synchronous connection.
Table 5.6 defines eSCO configuration parameter sets S1, S2 and S3. HCI level parameters are given as a reference. On systems not incorporating HCI, values for LMP level eSCO parameters TeSCO, WeSCO and packet length shall be associated that correspond to these HCI parameters and fall into the mandatory parameter ranges for these packet types as given in the LMP specification, and the Voice Setting parameter translates into the air mode parameter of LMP.
Code:
eSCO parameter S1 S2 S3 Packet type EV3 2-EV3 2-EV3 Bandwidth 8000 8000 8000 Voice_Setting CVSD CVSD CVSD Max_Latency 7 ms 7 ms 10ms Retrans_Effort 0x01 0x01 0x01

---------------------------------cut--------------------------

all 3 modes show CVSD format, that apparently is mandatory in SCO
at least I would concentrate on it.

If you need this document, I can post it (PDF), it explains all the communications required to set up HF.

That table is for eSCO links, not SCO links, and only SCO links are mandated by the handsfree spec. You can find all the audio specs for SCO in the "Core v2.0 + EDR.pdf" spec.
L2SHO is offline   Reply With Quote
Old 02-27-2007, 06:50 PM   #74
Maximum Bitrate
 
Join Date: Aug 2004
Location: at home
Posts: 588
kraft is on a distinguished road
I've been successfull with a Motorola RAZR V3 on main functions, only the microphone was weak and on the other side people were hearing me like a bit far away from the phone, anyway it was working fine, including signal and battery levels with bluetooth libs corresponding to the mandriva 10.0 (i think but i don't remember exactely maybe 10.1 or 9.2 ?), since alsa merged inside the kernel everything simply collapsed and is not working anymore.
It was also able to display the called name when existing in the phonebook otherwise it was simply displaying caller number...
Now that the Bmw is offering a simple snap-in system for the RAZR V3, no more need to search in this way.

So ok, no code, only blah blah will you say but maybe it could give some directions to where or what search for...
kraft is offline   Reply With Quote
Old 02-27-2007, 11:54 PM   #75
Newbie
 
Join Date: Feb 2007
Location: NJ
Posts: 7
L2SHO is an unknown quantity at this point
Actually, after re-reading the HFP1.5 spec, is seems that CVSD is required. So I guess thats's that. We just have to make sure that when we set up our SCO link that it's set to transmit and recieve using CVSD.
L2SHO is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bluetooth woes! daveg360 Wireless Communications 1 10-02-2005 12:11 AM



All times are GMT -5. The time now is 10:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics