Page 7 of 13 FirstFirst 12345678910111213 LastLast
Results 61 to 70 of 122

Thread: bluetooth woes

  1. #61
    Newbie
    Join Date
    Feb 2007
    Location
    NJ
    Posts
    7
    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.

  2. #62
    Low Bitrate
    Join Date
    Sep 2005
    Posts
    82
    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.

  3. #63
    Low Bitrate
    Join Date
    Sep 2005
    Posts
    82
    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.

  4. #64
    Newbie Zimans's Avatar
    Join Date
    Jan 2006
    Posts
    38
    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?

  5. #65
    Newbie
    Join Date
    Feb 2007
    Posts
    1

    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.

  6. #66
    Constant Bitrate
    Join Date
    Jun 2006
    Location
    Chicago, IL
    Posts
    143
    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

  7. #67
    Newbie
    Join Date
    Feb 2007
    Location
    NJ
    Posts
    7
    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.

  8. #68
    Low Bitrate
    Join Date
    Sep 2005
    Posts
    82
    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.

  9. #69
    Newbie Zimans's Avatar
    Join Date
    Jan 2006
    Posts
    38
    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?

  10. #70
    Newbie
    Join Date
    Feb 2007
    Location
    NJ
    Posts
    7
    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.

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
  •