All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] emporia/mega-Headset and btsco problems
@ 2005-07-02 15:26 Andreas Böhler
  2005-07-02 21:26 ` Brad Midgley
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Böhler @ 2005-07-02 15:26 UTC (permalink / raw)
  To: bluez-devel

Hi!

I recently purchased a Mega BT-Headset and fetched, compiled and installed =
btsco from bluetooth-alsa.sf.net.=20
Pairing works fine and sending and receiving audio from and to the headset =
also works - for a while.=20
My problem is, that the headset disconnects after a very short time if no a=
udio is transmitted!
I think that this is the same problem as with the Jabra BT-110: "Jabra BT11=
0 (will turn off very soon after the last audio packets have been transmitt=
ed and btsco will quit with "RFCOMM channel lost")" -> quote from bluetooth=
-alsa.sf.net main page.
I'm wondering if someone has solved this problem? Isn't it possible that bt=
sco simply reconnects to the headset? Or that it transmits empty or quiet a=
udio-frames just to keep the connection alive?
I tried what is done using Windows: When you connect the headset, it rings =
as if the phone was ringing and you have to pick it up (headset-button), th=
en the connection is established. I wonder if this would also work under Li=
nux? Or is this the implementation of the Hands-Free profile and not the He=
adset-Profile?

Any help is appreciated,=20

thanks,

Andreas B=F6hler

PS: I'm using Linux 2.6.12, custom compilation, D-Link DBT-120 (or Digitus =
DN-3008), SoL-Linux 18.00, BlueZ-stack and Mega BTHS-6023-F (manufacturer i=
s Emporia, www.emporia.at)

--=20
Andreas B=F6hler
andy.boehler@gmx.at
www.klasseonline.tk


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] emporia/mega-Headset and btsco problems
  2005-07-02 15:26 [Bluez-devel] emporia/mega-Headset and btsco problems Andreas Böhler
@ 2005-07-02 21:26 ` Brad Midgley
  2005-07-02 22:47   ` Andreas Böhler
  0 siblings, 1 reply; 6+ messages in thread
From: Brad Midgley @ 2005-07-02 21:26 UTC (permalink / raw)
  To: bluez-devel

Andreas,

This is an unintended consequence of a change a few months ago to make 
the sco connection fire up only on demand.

One thing we have needed to do for a long time that would help this is 
to rebuild the rfcomm connection when it goes bad (or even make it 
happen on demand). With other headsets, the rfcomm connection only goes 
bad if the headset goes out of range. Holding the rfcomm connection open 
isn't great anyway because I think it prevents a laptop from suspending.

As far as I can tell, phones hold the rfcomm connection open and only 
fire up sco on demand. I wonder if they have to accommodate this too...

Brad

Andreas Böhler wrote:
> Hi!
> 
> I recently purchased a Mega BT-Headset and fetched, compiled and installed btsco from bluetooth-alsa.sf.net. 
> Pairing works fine and sending and receiving audio from and to the headset also works - for a while. 
> My problem is, that the headset disconnects after a very short time if no audio is transmitted!
> I think that this is the same problem as with the Jabra BT-110: "Jabra BT110 (will turn off very soon after the last audio packets have been transmitted and btsco will quit with "RFCOMM channel lost")" -> quote from bluetooth-alsa.sf.net main page.
> I'm wondering if someone has solved this problem? Isn't it possible that btsco simply reconnects to the headset? Or that it transmits empty or quiet audio-frames just to keep the connection alive?
> I tried what is done using Windows: When you connect the headset, it rings as if the phone was ringing and you have to pick it up (headset-button), then the connection is established. I wonder if this would also work under Linux? Or is this the implementation of the Hands-Free profile and not the Headset-Profile?
> 
> Any help is appreciated, 
> 
> thanks,
> 
> Andreas Böhler
> 
> PS: I'm using Linux 2.6.12, custom compilation, D-Link DBT-120 (or Digitus DN-3008), SoL-Linux 18.00, BlueZ-stack and Mega BTHS-6023-F (manufacturer is Emporia, www.emporia.at)
> 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] emporia/mega-Headset and btsco problems
  2005-07-02 21:26 ` Brad Midgley
@ 2005-07-02 22:47   ` Andreas Böhler
  2005-07-03  8:35     ` Brad Midgley
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Böhler @ 2005-07-02 22:47 UTC (permalink / raw)
  To: bluez-devel

Hi, thanks for the quick reply;

> One thing we have needed to do for a long time that would help this is=20
> to rebuild the rfcomm connection when it goes bad (or even make it=20
> happen on demand). With other headsets, the rfcomm connection only goes=20
> bad if the headset goes out of range. Holding the rfcomm connection open=
=20
> isn't great anyway because I think it prevents a laptop from suspending.

yeah, the best way to handle my particular headset would be if btsco reconn=
ects the rfcomm-channel after it is lost!
May I ask someone if it is possible to supply such a patch? I would really =
do it myself, if I had the necessary C-skills....

thanks,=20

andy

--=20
Andreas B=F6hler
andy (dot) boehler (at) gmx (dot) at
www.klasseonline.tk


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] emporia/mega-Headset and btsco problems
  2005-07-02 22:47   ` Andreas Böhler
@ 2005-07-03  8:35     ` Brad Midgley
  2005-07-03 16:02       ` Andreas Böhler
  0 siblings, 1 reply; 6+ messages in thread
From: Brad Midgley @ 2005-07-03  8:35 UTC (permalink / raw)
  To: bluez-devel

maybe something like this... i wish the whole thing wasn't such a big 
ugly function...

diff -u -b -B -w -p -r1.28 btsco.c
--- btsco.c     17 Jun 2005 15:57:42 -0000      1.28
+++ btsco.c     3 Jul 2005 08:27:12 -0000
@@ -80,7 +80,7 @@ struct action {
         char *cmd;
  };

-static volatile int terminate = 0, ring = 0, hupped = 0, reconnect = 0;
+static volatile int terminate = 0, ring = 0, hupped = 0, reconnect = 0, 
rfreconnect = 0;
  static int verbose = 0;

  static void sig_term(int sig)
@@ -589,6 +589,8 @@ int main(int argc, char *argv[])
         sigaction(SIGCHLD, &sa, NULL);
         sigaction(SIGPIPE, &sa, NULL);

+       do {
+
         /* connect rfcomm control channel */
         if ((rd = rfcomm_connect(&local, &bdaddr, channel)) < 0) {
                 perror("Can't connect RFCOMM channel");
@@ -682,6 +684,7 @@ int main(int argc, char *argv[])
                                         fflush(stdout);
                                 }
                                 terminate = 1;
+                               rfreconnect = 1;
                         }

                         // control transmission events for volume and 
channel control
@@ -890,6 +893,11 @@ int main(int argc, char *argv[])
                         hupped = 0;
                 }
         }
+       if(rfreconnect) {
+               rfreconnect = 0;
+               terminate = 0;
+       }
+       } while(!terminate);

         if (sco_mode == CONNECTED) {
                 close(sd);


Andreas Böhler wrote:
> Hi, thanks for the quick reply;
> 
> 
>>One thing we have needed to do for a long time that would help this is 
>>to rebuild the rfcomm connection when it goes bad (or even make it 
>>happen on demand). With other headsets, the rfcomm connection only goes 
>>bad if the headset goes out of range. Holding the rfcomm connection open 
>>isn't great anyway because I think it prevents a laptop from suspending.
> 
> 
> yeah, the best way to handle my particular headset would be if btsco reconnects the rfcomm-channel after it is lost!
> May I ask someone if it is possible to supply such a patch? I would really do it myself, if I had the necessary C-skills....
> 
> thanks, 
> 
> andy
> 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] emporia/mega-Headset and btsco problems
  2005-07-03  8:35     ` Brad Midgley
@ 2005-07-03 16:02       ` Andreas Böhler
  2005-07-04  3:29         ` Brad Midgley
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Böhler @ 2005-07-03 16:02 UTC (permalink / raw)
  To: bluez-devel

Thank you, Brad, thank you!

> maybe something like this... i wish the whole thing wasn't such a big=20
> ugly function...

...but it works exactly the way I wanted it to! Ugly or not, it does what i=
t should, my headset is now much more comfortable to use than before!

I slightly modified your patch and added it as a command-line option "-r" t=
o force the reconnection upon lost rfcomm-channel!=20

greetings,=20

andy


diff -puN btsco.c.old btsco.c
--- btsco.c.old	2005-06-17 17:57:42.000000000 +0200
+++ btsco.c	2005-07-03 17:57:45.000000000 +0200
@@ -80,8 +80,8 @@ struct action {
 	char *cmd;
 };
=20
-static volatile int terminate =3D 0, ring =3D 0, hupped =3D 0, reconnect =
=3D 0;
-static int verbose =3D 0;
+static volatile int terminate =3D 0, ring =3D 0, hupped =3D 0, reconnect =
=3D 0, rfreconnect =3D 0;
+static int verbose =3D 0, auto_reconn =3D 0;
=20
 static void sig_term(int sig)
 {
@@ -279,6 +279,7 @@ static void usage(void)
 	printf("Usage:\n" "\tbtsco [options] <bdaddr> [channel]\n");
 	printf("Options:\n");
 	printf(" -v print verbose output\n");
+	printf(" -r automatically reconnect upon lost rfcomm channel\n");
 	printf(" -f fork and run as a daemon\n");
 	printf(" -c clear filehandle and exit\n");
 	printf(" -h print this usage and exit\n");
@@ -479,7 +480,7 @@ int main(int argc, char *argv[])
=20
 	fork =3D 0;
 	clear =3D 0;
-	while((i =3D getopt(argc, argv, "fcvh")) >=3D 0) {
+	while((i =3D getopt(argc, argv, "fcvhr")) >=3D 0) {
 		switch(i) {
 		case 'v':
 			verbose++;
@@ -489,7 +490,10 @@ int main(int argc, char *argv[])
 			break;
 		case 'c':
 			clear =3D 1;
-			break;
+		        break;
+		case 'r':
+		        auto_reconn =3D 1;
+		        break;
 		case 'h':
 		case '?':
 		case ':':
@@ -588,7 +592,8 @@ int main(int argc, char *argv[])
 	sa.sa_handler =3D SIG_IGN;
 	sigaction(SIGCHLD, &sa, NULL);
 	sigaction(SIGPIPE, &sa, NULL);
-
+    do {
+       =20
 	/* connect rfcomm control channel */
 	if ((rd =3D rfcomm_connect(&local, &bdaddr, channel)) < 0) {
 		perror("Can't connect RFCOMM channel");
@@ -682,6 +687,9 @@ int main(int argc, char *argv[])
 					fflush(stdout);
 				}
 				terminate =3D 1;
+				if(auto_reconn) {
+				  rfreconnect =3D 1;
+				}
 			}
 		=09
 			// control transmission events for volume and channel control
@@ -890,6 +898,11 @@ int main(int argc, char *argv[])
 			hupped =3D 0;
 		}
 	}
+    if(rfreconnect) {
+        rfreconnect =3D 0;
+        terminate =3D 0;
+    }
+    } while (!terminate);
=20
 	if (sco_mode =3D=3D CONNECTED) {
 		close(sd);


--=20
Andreas B=F6hler
andy (dot) boehler (at) gmx (dot) at
www.klasseonline.tk


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] emporia/mega-Headset and btsco problems
  2005-07-03 16:02       ` Andreas Böhler
@ 2005-07-04  3:29         ` Brad Midgley
  0 siblings, 0 replies; 6+ messages in thread
From: Brad Midgley @ 2005-07-04  3:29 UTC (permalink / raw)
  To: bluez-devel

Andreas

Thanks for making it an option. It makes our ugliest function even 
deeper but I applied it anyway (sigh :)

Brad


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-07-04  3:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-02 15:26 [Bluez-devel] emporia/mega-Headset and btsco problems Andreas Böhler
2005-07-02 21:26 ` Brad Midgley
2005-07-02 22:47   ` Andreas Böhler
2005-07-03  8:35     ` Brad Midgley
2005-07-03 16:02       ` Andreas Böhler
2005-07-04  3:29         ` Brad Midgley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.