|
 |
|
04-07-2007, 10:25 PM
|
#91
|
|
Newbie
Join Date: Mar 2007
Posts: 17
|
I found the SF project page: http://sourceforge.net/projects/Bluehands/
Nicely done
I found out that my K750i has the same issue you had before: it 'hangs' for a bit before answering some commands and as the handsfree application has no form of buffering (whatsoevah), I keep locking up the setup sequence... Actually I'm sort of surprised the demo application tries to read the return code in the first place as it doesn't actually do anything with it... Well nuff ranting about that.
Hows the library coming along? Anything that sorta compiles and I can try to hook into with Java/JNI/Exec? Would be cool to start testing
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
04-08-2007, 09:16 AM
|
#92
|
|
VENDOR - Centrafuse
Join Date: Mar 2007
Location: Detroit, MI
Posts: 392
|
Hello, good work on your project, I know first hand how difficult bt application programming and debugging can be  Just an FYI here, in the coming months my company may release it's bluetooth sdk under open source license and it will be available on SF (with BlueZ adaption layer among others). There's working handsfree/headset, irmcsync, streaming audio, DUN, and PIM management interface. You probably can use this for your project once it is released (all written in C though)... I'll repost if this should happen...
Last edited by smeesseman; 04-08-2007 at 09:20 AM.
|
|
|
04-11-2007, 10:18 AM
|
#93
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 82
|
Quote: Originally Posted by cyberwizzard 
Thanks! I was going to post the link once I had something somewhat working  But everybody feel free to checkout the CVS source and poke around, everything up there *should* be working/tested, it's just missing some important files (that I'm still working on).
Quote: Originally Posted by cyberwizzard 
I found out that my K750i has the same issue you had before: it 'hangs' for a bit before answering some commands and as the handsfree application has no form of buffering (whatsoevah), I keep locking up the setup sequence... Actually I'm sort of surprised the demo application tries to read the return code in the first place as it doesn't actually do anything with it... Well nuff ranting about that.
You mean the OK vs ERROR strings it returns? Well even if you don't care whether it says OK or ERROR, you should still use either of those strings to know when the phone has finished processing the command and is ready for the next one. I don't remember if the old handsfree app does that or not, but I thought it did.
Quote: Originally Posted by cyberwizzard 
Hows the library coming along? Anything that sorta compiles and I can try to hook into with Java/JNI/Exec? Would be cool to start testing 
I am getting very close. Life keeps getting in the way of hobbies so I haven't worked on it in a few weeks  I know I've said this before, but hopefully in a few days...
Quote: Originally Posted by smeesseman 
Hello, good work on your project, I know first hand how difficult bt application programming and debugging can be  Just an FYI here, in the coming months my company may release it's bluetooth sdk under open source license and it will be available on SF (with BlueZ adaption layer among others). There's working handsfree/headset, irmcsync, streaming audio, DUN, and PIM management interface. You probably can use this for your project once it is released (all written in C though)... I'll repost if this should happen...
That would be terrific! I'll keep working on this in parallel, but it would be great to see what you guys come up with.
|
|
|
04-14-2007, 05:52 PM
|
#94
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 82
|
I released something!
Hi everyone,
I have a very basic version packaged and uploaded here:
http://sourceforge.net/projects/bluehands/
It is not useful yet (no audio, just RFCOMM connect/disconnect) but I would really appreciate it if everyone could try it out and let me know how it behaves with your phone (if it does something weird, please include debug output). Try normal stuff (connecting, making sure it stays connected for a long period, disconnecting nicely) as well as abusing it a bit (hit cancel in the middle of a connection or a negotiation, etc.) Oh and when reporting back, let me know the make/model of the phone as well as the BT adapter. And if you're really feeling ambitious, what version of bluez you've got (try hcitool --help, it should say in the first line... I *think* that's the bluez version).
I'm sorry the file release is so large, that is because it is compiled in debug mode. It's not bloat, it will shrink, don't worry
|
|
|
04-21-2007, 08:39 AM
|
#95
|
|
Newbie
Join Date: Mar 2007
Posts: 17
|
Awesome! As soon as I can I'll download it and test it with my SE K750i and a Motorola V600 :-)
Any chance I can tap into the audio feed anytime soon? I was playing with some echo cancellation algoritms
|
|
|
04-22-2007, 05:32 PM
|
#96
|
|
Newbie
Join Date: Mar 2007
Posts: 17
|
Tested it - no dice...
First off: the java command refers to jbluehands in a different directory while the release uses the same dir for all files.
Second: I'm running 64-bit Gentoo, I tried putting the *.so files in /lib32 and /lib64 but I keep ending up the same way:
Code:
localhost bluehands_0.01 # java -cp LookMaNoHands.jar:jbluehands.jar:. org.bluehands.lookMaNoHands.Main
Warning: Cannot convert string "-b&h-luxi sans-medium-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jbluehands in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at org.bluehands.Bluehands.getInstance(Bluehands.java:42)
at org.bluehands.lookMaNoHands.DisconnectedPanel.<init>(DisconnectedPanel.java:75)
at org.bluehands.lookMaNoHands.MainWindow.getDisconnectedPanel(MainWindow.java:162)
at org.bluehands.lookMaNoHands.MainWindow.getCurrentPagePanel(MainWindow.java:154)
at org.bluehands.lookMaNoHands.MainWindow.getMainContentPanel(MainWindow.java:118)
at org.bluehands.lookMaNoHands.MainWindow.<init>(MainWindow.java:69)
at org.bluehands.lookMaNoHands.Main.main(Main.java:31)
Could be a problem with the 64-bit thing but even putting it in the 32-bit library directory didn't help. (Yes, I ran ldconfig)
|
|
|
04-24-2007, 11:06 AM
|
#97
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 82
|
Quote: Originally Posted by cyberwizzard 
Tested it - no dice...
First off: the java command refers to jbluehands in a different directory while the release uses the same dir for all files.
Second: I'm running 64-bit Gentoo, I tried putting the *.so files in /lib32 and /lib64 but I keep ending up the same way:
Code:
localhost bluehands_0.01 # java -cp LookMaNoHands.jar:jbluehands.jar:. org.bluehands.lookMaNoHands.Main
Warning: Cannot convert string "-b&h-luxi sans-medium-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jbluehands in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at org.bluehands.Bluehands.getInstance(Bluehands.java:42)
at org.bluehands.lookMaNoHands.DisconnectedPanel.<init>(DisconnectedPanel.java:75)
at org.bluehands.lookMaNoHands.MainWindow.getDisconnectedPanel(MainWindow.java:162)
at org.bluehands.lookMaNoHands.MainWindow.getCurrentPagePanel(MainWindow.java:154)
at org.bluehands.lookMaNoHands.MainWindow.getMainContentPanel(MainWindow.java:118)
at org.bluehands.lookMaNoHands.MainWindow.<init>(MainWindow.java:69)
at org.bluehands.lookMaNoHands.Main.main(Main.java:31)
Could be a problem with the 64-bit thing but even putting it in the 32-bit library directory didn't help. (Yes, I ran ldconfig)
Ah. Well I think you can safely ignore the font warning. As for the library path, I haven't written an installer or anything, so after compiling the libs (or downloading) you need to move them someplace appropriate... I've been using /usr/lib, so that's where the path is hardcoded in the runLookMaNoHands script. I believe you would add -Djava.library.path=/lib32 or something (off the top of my head)
|
|
|
04-24-2007, 11:32 AM
|
#98
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 82
|
Quote: Originally Posted by cyberwizzard 
Any chance I can tap into the audio feed anytime soon? I was playing with some echo cancellation algoritms 
After I finish the connection management (right now I'm working on auto-detecting what channel to connect to and listen on) then I will go for the audio. I'm still trying to figure out how to output the audio... I'm thinking JACK maybe. I don't want to just play it straight to alsa or whatever, because I want people to be able to route it to the speakers they want, add echo cancellation, mix it with their music for cross-fading, etc. Do you have any other output ideas?
I'm stoked that you're trying out some EC. I have a few links to some papers about EC algorithms on my work computer, I'll post them when I'm back at work (monday).
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
04-25-2007, 11:48 AM
|
#99
|
|
Newbie
Join Date: Jan 2006
Posts: 38
|
How about handling the audio via a pipe. Then the end user can process the audio as they see fit. (And since it is an FD, they can sit on it and wait for data to arrive).
Another option would be to provide a base class that the user needs to implement to handle read/write of audio data, then leave the responsibility of thread safety and actual implementation to the end user :P You couls always provide some generic interfaces, such as ALSA/JACK/OpenAL/etc. for the lazy.
Of course this is thinking from the c++ side of things, dunno about java.
--Zims
__________________
--------------------------------------------------------------------------------
Now, Where are my Pants?
|
|
|
04-27-2007, 12:54 PM
|
#100
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 82
|
Hey I like the idea of extending a class - that would be the way to do it in Java. How would that work in plain C (not ++)? I want to make my API compatible with both C and C++. For right now my whole public API is just plain functions that should be usable from both, but I plan to object-orient-ify it a bit, and provide 2 parallel APIs like JNI. So for example, you could have:
phone->GetName (); // C++
or Phone_GetName (phone); // C
So for right now I'm thinking of making everybody register a callback that will get audio data as it comes in. And I'd like to provide some generic "lazy" callbacks you can use if you just want some sound without anything fancy. Maybe later on I can OO-ify it if I can think of a compelling reason.
Here are the EC links I promised:
http://www.embeddedstar.com/articles...0030720-7.html
http://en.wikipedia.org/wiki/Least_mean_squares
http://web.archive.org/web/200605040...aft-aec-03.txt
(that last one is via the wayback machine, since it has been removed). But it gives actual source code! So it should be useful.
|
|
|
04-27-2007, 03:57 PM
|
#101
|
|
Newbie
Join Date: Jan 2006
Posts: 38
|
Quote: Originally Posted by gentoocar 
Hey I like the idea of extending a class - that would be the way to do it in Java. How would that work in plain C (not ++)? I want to make my API compatible with both C and C++. For right now my whole public API is just plain functions that should be usable from both, but I plan to object-orient-ify it a bit, and provide 2 parallel APIs like JNI. So for example, you could have:
phone->GetName (); // C++
or Phone_GetName (phone); // C
There's two ways you could do it in C, callbacks with structs, or callbacks without structs.
Basically you use a callback. You have a Read and a Write prototype that the callers will have to use and fill in, then the caller registers those two functions with the lib. From that point on your lib calls those two functions anytime it wants to read/write data. libJPG (and libPNG) i believe use this mechanism to allow the caller to provide data to the decoding algorithms. By default, they use fread/fwrite/etc. But by supplying a callback that confomrs to the fread/fwrite parameters you can provide your own funcs for reading/writing.
Callbacks with structs is the same idea, but you have a struct with members that are pointers to functions, so the caller points these members to his/her functions, then provides the struct to the lib. Basically it's classes in C, sorta. Winamp 2.0 plugins work this way. Winamp calls a single func from th eplugin Dll that returns a struct filled with function pointers, then calls these functions to make stuff happen.
Callbacks would be the best way to go, as structs of callbacks is more appropriate for plugin architectures where you have a common struct but different functions pointed to. Although internaly you'd just be assigning members fo your state struct to point to the supplied functions.
--Zims
__________________
--------------------------------------------------------------------------------
Now, Where are my Pants?
|
|
|
04-28-2007, 05:48 PM
|
#102
|
|
Newbie
Join Date: Mar 2007
Posts: 17
|
Update from my end:
Code:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /lib64/libjbluehands.so: Can't load IA 32-bit .so on a AMD 64-bit platform
And an update for the update:
Code:
localhost libbluehands # make release
Compiling src/io/InterruptSockets.cpp
Compiling src/io/SocketHelpers.cpp
src/io/SocketHelpers.cpp: In function 'bool WaitForSockets(std::list<int, std::allocator<int> >*, std::list<int, std::allocator<int> >*, std::list<int, std::allocator<int> >*, timeval*)':
src/io/SocketHelpers.cpp:462: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:255: note: candidates are: bool std::_List_const_iterator<_Tp>::operator!=(const std::_List_const_iterator<_Tp>&) const [with _Tp = int]
src/io/SocketHelpers.cpp:478: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:255: note: candidates are: bool std::_List_const_iterator<_Tp>::operator!=(const std::_List_const_iterator<_Tp>&) const [with _Tp = int]
src/io/SocketHelpers.cpp:494: error: no match for 'operator!=' in 'it != 0l'
This is one of the reasons I stay away from C coding: this is whats not allowed:
Code:
while (it != NULL && it != pReadList->end())
I don't get it, whats not allowed with != in that line?? Any thought how I can get it to compile on x64? (I could also send you the 64-bit binaries to put up on sf  )
Last edited by cyberwizzard; 04-28-2007 at 06:05 PM.
|
|
|
05-01-2007, 08:59 AM
|
#103
|
|
Low Bitrate
Join Date: Sep 2005
Posts: 82
|
Hey cyberwizzard...
Try changing
Code:
while (it != NULL && it != pReadList->end())
tp
Code:
while (it != NULL && it != (list<int>::const_iterator) pReadList->end())
I really hope that works, I don't know what they would have changed in the amd-64 gcc to break stl iteration!
When we get this compiled, I would love copies of the binaries for sf
|
|
|
05-01-2007, 06:23 PM
|
#104
|
|
Newbie
Join Date: Mar 2007
Posts: 17
|
Nope, no dice, sorry
Code:
localhost libbluehands # make release
Compiling src/io/SocketHelpers.cpp
src/io/SocketHelpers.cpp: In function 'bool WaitForSockets(std::list<int, std::allocator<int> >*, std::list<int, std::
allocator<int> >*, std::list<int, std::allocator<int> >*, timeval*)':
src/io/SocketHelpers.cpp:462: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:255: note: candidates are: bool std::_List_const
_iterator<_Tp>::operator!=(const std::_List_const_iterator<_Tp>&) const [with _Tp = int]
src/io/SocketHelpers.cpp:478: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:255: note: candidates are: bool std::_List_const _iterator<_Tp>::operator!=(const std::_List_const_iterator<_Tp>&) const [with _Tp = int]
src/io/SocketHelpers.cpp:494: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:255: note: candidates are: bool std::_List_const _iterator<_Tp>::operator!=(const std::_List_const_iterator<_Tp>&) const [with _Tp = int]
src/io/SocketHelpers.cpp:519: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:173: note: candidates are: bool std::_List_itera tor<_Tp>::operator!=(const std::_List_iterator<_Tp>&) const [with _Tp = int]
src/io/SocketHelpers.cpp:536: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:173: note: candidates are: bool std::_List_itera tor<_Tp>::operator!=(const std::_List_iterator<_Tp>&) const [with _Tp = int]
src/io/SocketHelpers.cpp:553: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:173: note: candidates are: bool std::_List_itera tor<_Tp>::operator!=(const std::_List_iterator<_Tp>&) const [with _Tp = int]
src/io/../utilities/ListHelpers.inl: In function 'bool ListContains(std::list<T, std::allocator<_CharT> >*, T) [with T = int]':
src/io/SocketHelpers.cpp:140: instantiated from here
src/io/../utilities/ListHelpers.inl:41: error: no match for 'operator!=' in 'it != 0l'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/include/g++-v4/bits/stl_list.h:255: note: candidates are: bool std::_List_const _iterator<_Tp>::operator!=(const std::_List_const_iterator<_Tp>&) const [with _Tp = int]
make: *** [src/io/SocketHelpers.o] Error 1
The compiler I'm using:
Code:
localhost libbluehands # gcc --version
gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3)
Perhaps we could exchange email addresses using PM? That way we could try to debunk it for 64-bit.
|
|
|
05-06-2007, 07:33 PM
|
#105
|
|
Newbie
Join Date: Mar 2007
Posts: 17
|
As I mailed, I managed to get it working on 64-bit. I tested with my S-E K750i and the application says "unsupported handsfree version". I think this has something to do with invalid response codes rather than actually lacking support:
Code:
(05/07/2007 - 01:31:58) INFO: RFCOMMConnectorThread::Connect - Connecting to 00:0E:07:B9:3E:F4, channel 3
(05/07/2007 - 01:31:58) INFO: RFCOMMConnector::DoWork_ReceiveConnection_i - Interrupted while waiting for a connection.
(05/07/2007 - 01:31:58) INFO: BluehandsInstance::RFCOMMConnectionStateChanged - Broadcasting RFCOMM connection state change to RFCOMM_CONNECTION_TRYING
(05/07/2007 - 01:31:58) INFO: RFCOMMConnectorThread::DoWork_InitiateConnection_i - Initiating RFCOMM Connection to 00:0E:07:B9:3E:F4 channel 3
(05/07/2007 - 01:31:59) INFO: RFCOMMConnectorThread::DoWork_InitiateConnection_i - Created connection successfully
(05/07/2007 - 01:31:59) INFO: BluehandsInstance::RFCOMMConnectionStateChanged - Broadcasting RFCOMM connection state change to RFCOMM_CONNECTION_NEGOTIATING
(05/07/2007 - 01:31:59) INFO: RFCOMMConnectionHandler::EstablishServiceLevelConnection - Phone supports: 3-way calling, EC/NR, voice recognition, attach voice to number, call reject
(05/07/2007 - 01:32:00) WARNING: RFCOMMConnectionHandler::EstablishServiceLevelConnection - Phone returned an unexpected line "" while reading indicator names
(05/07/2007 - 01:32:00) INFO: RFCOMMConnectionHandler::ParseCIND - names - Succesfully parsed 10 indicators
(05/07/2007 - 01:32:00) WARNING: RFCOMMConnectionHandler::EstablishServiceLevelConnection - Phone returned an unexpected line "" while reading indicator names
(05/07/2007 - 01:32:00) ERROR: RFCOMMConnectionHandler::EstablishServiceLevelConnection - Phone did not provide all required indicators
(05/07/2007 - 01:32:00) INFO: BluehandsInstance::RFCOMMConnectionErrorOccured - Broadcasting RFCOMM connection error ERROR_PROTOCOL
(05/07/2007 - 01:32:02) INFO: BluehandsInstance::RFCOMMConnectionStateChanged - Broadcasting RFCOMM connection state change to RFCOMM_CONNECTION_DISCONNECTING
(05/07/2007 - 01:32:02) INFO: RFCOMMConnector::DoWork_CloseSocketSync_i - Closing the connection (may take a few moments)
(05/07/2007 - 01:32:02) INFO: BluehandsInstance::RFCOMMConnectionStateChanged - Broadcasting RFCOMM connection state change to RFCOMM_CONNECTION_DISCONNECTED
(05/07/2007 - 01:32:02) INFO: RFCOMMConnector::DoWork_ReceiveConnection_i - Listening set up on RFCOMM channel 6
Any thoughts?
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| 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-02-2005 12:11 AM |
All times are GMT -5. The time now is 11:05 PM.
| |