* [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other @ 2004-02-15 1:20 Marc-Andre Laverdiere-Papineau 2004-02-15 14:31 ` Marcel Holtmann 0 siblings, 1 reply; 8+ messages in thread From: Marc-Andre Laverdiere-Papineau @ 2004-02-15 1:20 UTC (permalink / raw) To: jawbt, bluez-users Hello all! I'm working on an application where every Bluetooth device is trying to scan for every other one around, and check if it runs my custom service. At the same time, said service is running in another thread, waiting to be connected to. I am using Rococo with Bluez. Kernel RH2.4.28, latest version of BlueZ. Belkin FT003 dongles. When I have one computer having the service opened+performing the scan, while the other just performs the scan, things go fine. The scans are timely and I can send a message. However, then I have both computers running the service+the service scan, things slow down to a crawl. Actually, it depends on its mood. It can take a full minute to have a device scan and a service scan completing, or less than 20 seconds! Sometimes, computer a will be able to detect computer b, while B still shows no sign of life. On top of things, if I manage to get it to send a message to its peer, the peer will get an Exception :( I was able to fix this by preventing the application from doing a service scan at the moment it would send, but that didn't fix the weird behaviour on service discovery. This hackaround is not sturdy and I don't like it as a general thing. Has such thing ever happened to any of you? What can I do to fix it? It looks like Bluetooth won't let me open a connection while doing a service scan. Is there limitations on what can be running simultaneously? It looks like service scan + opening connections is no good. Should I know other ones like that? Thanks MA ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other 2004-02-15 1:20 [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other Marc-Andre Laverdiere-Papineau @ 2004-02-15 14:31 ` Marcel Holtmann [not found] ` <1076900027.403030bbba48f@alcor.concordia.ca> 0 siblings, 1 reply; 8+ messages in thread From: Marcel Holtmann @ 2004-02-15 14:31 UTC (permalink / raw) To: Marc-Andre Laverdiere-Papineau; +Cc: jawbt, BlueZ Mailing List Hi Marc-Andre, > I'm working on an application where every Bluetooth device is trying to > scan for every other one around, and check if it runs my custom service. > At the same time, said service is running in another thread, waiting to be > connected to. > > I am using Rococo with Bluez. Kernel RH2.4.28, latest version of BlueZ. > Belkin FT003 dongles. > > When I have one computer having the service opened+performing the scan, > while the other just performs the scan, things go fine. The scans are > timely and I can send a message. > > However, then I have both computers running the service+the service scan, > things slow down to a crawl. Actually, it depends on its mood. > It can take a full minute to have a device scan and a service scan > completing, or less than 20 seconds! Sometimes, computer a will be able > to detect computer b, while B still shows no sign of life. > > On top of things, if I manage to get it to send a message to its peer, the > peer will get an Exception :( I was able to fix this by preventing the > application from doing a service scan at the moment it would send, but > that didn't fix the weird behaviour on service discovery. This hackaround > is not sturdy and I don't like it as a general thing. > > Has such thing ever happened to any of you? What can I do to fix it? > > It looks like Bluetooth won't let me open a connection while doing a > service scan. Is there limitations on what can be running simultaneously? > It looks like service scan + opening connections is no good. Should I > know other ones like that? please speak in terms of the Bluetooth specification. What are you doing? Inquiry, page, service discovery or what? Regards Marcel ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <1076900027.403030bbba48f@alcor.concordia.ca>]
* Re: [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other [not found] ` <1076900027.403030bbba48f@alcor.concordia.ca> @ 2004-02-16 8:58 ` Marcel Holtmann 2004-02-16 20:17 ` Marc-Andre Laverdiere-Papineau 0 siblings, 1 reply; 8+ messages in thread From: Marcel Holtmann @ 2004-02-16 8:58 UTC (permalink / raw) To: Marc-André Laverdière; +Cc: BlueZ Mailing List Hi Marc-Andre, > Each system is perpetually running the following: > 1- Device discovery (on a constant basis) > 2- Service discovery on detected devices (for one particular service) > (I made a quick hack not to scan already scanned devices. So this is not > 'perpetually running' per se) > 3- A L2CAP service > > and they might try to open a connection to send data to the other one, etc. > I'm using default BlueZ settings, so I do not know if there are options for > each > of those that might change anything. so it is possible that you run an inquiry while you page another device. Actually I don't know if this is supported by any Bluetooth chips on the market. And you run an inquiry while you have an ACL link opened. This works with most devices that supports scatternet, but is not one of the best ideas and can decrease your performance. What does "hciconfig -a" say about your devices? Regards Marcel ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other 2004-02-16 8:58 ` Marcel Holtmann @ 2004-02-16 20:17 ` Marc-Andre Laverdiere-Papineau 2004-02-17 12:52 ` Marcel Holtmann 0 siblings, 1 reply; 8+ messages in thread From: Marc-Andre Laverdiere-Papineau @ 2004-02-16 20:17 UTC (permalink / raw) To: Marcel Holtmann; +Cc: BlueZ Mailing List Thanks Marcel for the help! I'm not following all the terminology, since I'm working with Java. I was wondering what you would suggest that would be better for performance. This project is about ad-hoc networking and so the devices need to be constantly looking out for others that can be part of the network. The design wasn't built thinking that performance would be so hit. Do you have any idea why those two scenarios are different? Scenario 1: Device A: Device Discovery, Service Discovery, connects to Device B and sends data Device B: Device Discovery, Service Discovery, L2CAP service This works super well. In this context the Service Discovery for Device B never finds anything. I don't know if that makes a difference or not. Scenario 2: Device A: Device Discovery, Service Discovery, L2CAP service, connects to Device B and sends data Device B: Device Discovery, Service Discovery, L2CAP service This makes me wish I never got in this project :( On Mon, 16 Feb 2004, Marcel Holtmann wrote: <snip> > so it is possible that you run an inquiry while you page another device. Actually, in the current situation, we have only 2 'devices', so they boringly scan each other and that's it. Hciconfig shows a few options for page scan (device discovery?) and inquiry scan (service discovery?). Should I consider tweaking those? > Actually I don't know if this is supported by any Bluetooth chips on the > market. And you run an inquiry while you have an ACL link opened. This > works with most devices that supports scatternet, but is not one of the > best ideas and can decrease your performance. What does "hciconfig -a" > say about your devices? <snip> It says: # hciconfig hci0 up # sdpd # hciconfig -a hci0: Type: USB BD Address: 00:0A:3A:50:9C:DA ACL MTU: 192:8 SCO MTU: 64:8 UP RUNNING PSCAN ISCAN RX bytes:69 acl:0 sco:0 events:8 errors:0 TX bytes:27 acl:0 sco:0 commands:7 errors:0 Features: 0xff 0xff 0x0b 0x00 0x00 0x00 0x00 0x00 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: Link mode: SLAVE ACCEPT Name: 'BlueZ (0)' Class: 0x000000 Service Classes: Unspecified Device Class: Miscellaneous, HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d Manufacturer: Cambridge Silicon Radio (10) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other 2004-02-16 20:17 ` Marc-Andre Laverdiere-Papineau @ 2004-02-17 12:52 ` Marcel Holtmann [not found] ` <1077033023.4032383f0b3d3@alcor.concordia.ca> 0 siblings, 1 reply; 8+ messages in thread From: Marcel Holtmann @ 2004-02-17 12:52 UTC (permalink / raw) To: Marc-Andre Laverdiere-Papineau; +Cc: BlueZ Mailing List Hi Marc-Andre, > I'm not following all the terminology, since > I'm working with Java. I was wondering what you would suggest that would > be better for performance. even if you work with Java you should follow the Bluetooth terminology, because otherwise it can be possible that we speak of different things. > Hciconfig shows a few options for page scan (device discovery?) and > inquiry scan (service discovery?). Should I consider tweaking those? No, you should read the Bluetooth specification and understand what these two means, because you got them wrong. Regards Marcel ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <1077033023.4032383f0b3d3@alcor.concordia.ca>]
* Re: [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other [not found] ` <1077033023.4032383f0b3d3@alcor.concordia.ca> @ 2004-02-17 16:10 ` Marcel Holtmann 2004-02-20 20:42 ` Marc-André Laverdière 0 siblings, 1 reply; 8+ messages in thread From: Marcel Holtmann @ 2004-02-17 16:10 UTC (permalink / raw) To: Marc-André Laverdière; +Cc: BlueZ Mailing List Hi Marc-Andre, > Only the 1.2 spec is available for people not from member companies. I hope > this > version is OK. this version is almost fine. > I'll get the non-Java terminology right and I'll write an understandable report > then. This is frustrating. I don't think so. inquiry scan -> device is visible page scan -> device is connectable inquiry -> search for other devices page -> connect to another device SDP connection -> service discovery (includes page) Regards Marcel ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other 2004-02-17 16:10 ` Marcel Holtmann @ 2004-02-20 20:42 ` Marc-André Laverdière 2004-02-20 23:14 ` Marcel Holtmann 0 siblings, 1 reply; 8+ messages in thread From: Marc-André Laverdière @ 2004-02-20 20:42 UTC (permalink / raw) To: Marcel Holtmann; +Cc: BlueZ Mailing List I read the parts allowing me to have some kind of understanding of what's going on :) Sorry for the delay, I had a hard deadline for a report. Here's the situation in more Bluetooth-compliant terms: Configuration: Belkin FT0003 USB dongles RedHat 9 with kernel 2.4.28, from RedHat Running with latest released versions of BlueZ Running Impronto 1.18 Running Java SDK 1.4.2.3 Bluetooth activity (all happening in Java): Implicit: Inquiry Scan [device is set as GIAC] Thread 1: Inquiry [aka Device Discovery] [runs perpetually, with some sleeping between each iteration] Thread 2: Page Scan [opening a service and waiting for clients with acceptAndOpen()] Thread 3: SDP Paging + Connection [Service Discovery] [does so when new devices are found, could happen anytime. Sleeps most of the time] Thread 4: Paging + Connection [L2CAP Connection as a slave] [happens at user's input] Computer A and Computer B are running this configuration Planned Test: Start program on both computers Wait for both Computer A and Computer B to discover each other via Inquiry User prompts Computer A to send a message to Computer B [creating a L2CAP connection] Computer B reads the message and closes the connection Both shut down their services and exit cleanly What happens: Inconsistent behaviour. Service discovery can happen promptly on Computer A and never finish on Computer B. Sometimes, service discovery completes around 20 seconds for both systems. The L2CAP connection may not establish itself. Behaviour varies at every test's run, but generally the results look like a deadlock has occured somewhere. Very low Bluetooth performance compared to the speed of other configurations. I hope this makes more sense. I have to read more about the Bluetooth spec, see what I'm doing wrong Bluetooth-wise. Any sections particularly? I'm also considering adjusting the settings of hciconfig as well as upgrading to kernel 2.6 (I was told that it generally had a huge improvement I/O-wise) -- Marc-André Laverdière () Étudiant coop. en génie logiciel - Software Engineering Co-Op Student Université Concordia - Concordia University /"\ \ / ASCII Ribbon Campaign X against HTML e-mail / \ Selon Marcel Holtmann <marcel@holtmann.org>: > Hi Marc-Andre, > > > Only the 1.2 spec is available for people not from member companies. I > hope > > this > > version is OK. > > this version is almost fine. > > > I'll get the non-Java terminology right and I'll write an understandable > report > > then. This is frustrating. > > I don't think so. > > inquiry scan -> device is visible > page scan -> device is connectable > > inquiry -> search for other devices > page -> connect to another device > > SDP connection -> service discovery (includes page) > > Regards > > Marcel > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other 2004-02-20 20:42 ` Marc-André Laverdière @ 2004-02-20 23:14 ` Marcel Holtmann 0 siblings, 0 replies; 8+ messages in thread From: Marcel Holtmann @ 2004-02-20 23:14 UTC (permalink / raw) To: Marc-André Laverdière; +Cc: BlueZ Mailing List Hi Marc-Andre, > Here's the situation in more Bluetooth-compliant terms: > Configuration: > Belkin FT0003 USB dongles > RedHat 9 with kernel 2.4.28, from RedHat > Running with latest released versions of BlueZ > Running Impronto 1.18 > Running Java SDK 1.4.2.3 I can't tell you anything about the Java part, but the kernel version that you are using don't exists ;) > Bluetooth activity (all happening in Java): > > Implicit: Inquiry Scan [device is set as GIAC] > Thread 1: Inquiry [aka Device Discovery] [runs perpetually, with some sleeping > between each iteration] > Thread 2: Page Scan [opening a service and waiting for clients with > acceptAndOpen()] > Thread 3: SDP Paging + Connection [Service Discovery] [does so when new devices > are found, could happen anytime. Sleeps most of the time] > Thread 4: Paging + Connection [L2CAP Connection as a slave] [happens at user's > input] > > Computer A and Computer B are running this configuration > Planned Test: > Start program on both computers > Wait for both Computer A and Computer B to discover each other via Inquiry > User prompts Computer A to send a message to Computer B [creating a L2CAP > connection] > Computer B reads the message and closes the connection > Both shut down their services and exit cleanly > > What happens: > Inconsistent behaviour. Service discovery can happen promptly on Computer A and > never finish on Computer B. Sometimes, service discovery completes around 20 > seconds for both systems. > The L2CAP connection may not establish itself. Behaviour varies at every test's > run, but generally the results look like a deadlock has occured somewhere. > Very low Bluetooth performance compared to the speed of other configurations. > > I hope this makes more sense. I have to read more about the Bluetooth spec, see > what I'm doing wrong Bluetooth-wise. Any sections particularly? The problem that I see is that if device A runs an inquiry and device B tries to page device A at the same time, this will fail. But this is a topic for baseband experts and not for me. You can try to disable page scan before you run an inquiry and re-enable it when your are finished. Same goes for the inquiry scan. Regards Marcel ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-02-20 23:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-15 1:20 [Bluez-users] Major slowdown when service discovery+opening a service happens on two systems trying to talk to each other Marc-Andre Laverdiere-Papineau
2004-02-15 14:31 ` Marcel Holtmann
[not found] ` <1076900027.403030bbba48f@alcor.concordia.ca>
2004-02-16 8:58 ` Marcel Holtmann
2004-02-16 20:17 ` Marc-Andre Laverdiere-Papineau
2004-02-17 12:52 ` Marcel Holtmann
[not found] ` <1077033023.4032383f0b3d3@alcor.concordia.ca>
2004-02-17 16:10 ` Marcel Holtmann
2004-02-20 20:42 ` Marc-André Laverdière
2004-02-20 23:14 ` Marcel Holtmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox