2005-05-05 18:58:14

by Florian Echtler

[permalink] [raw]
Subject: [Bluez-devel] some btsco hacks

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everyone,

I finally got time to investigate the issues with my headset. Sometimes
after SCO connection establishment, the microphone produces only noise,
and a reconnect is necessary to fix this. The attached patch is against
btsco.c v1.22 from CVS, and does two things:

1. installs a handler for SIGUSR2 which automatically disconnects the
SCO channel when connected and reconnects it after a short delay

2. allows the command string in .btscorc to contain '%d', which will
be replaced with the current SCO connection status (0 or 1) upon
command execution.

1. may be not really useful to most people - as mentioned, my headset
is obviously somewhat buggy and needs a kind of reset sometimes, which
this patch provides (actually, I wrote a shell script which samples
1 second of audio data from the headset, runs it through gzip to determine
whether it's noise and sends SIGUSR2 accordingly - talk about evil hacks ;)

2. was included because I want certain actions to happen only when
the connection is established, and not when it's shutting down.

Brad: if you think this could be useful otherwise, then feel free to
include the patch into CVS.

Yours, Florian
- --
Preserve wildlife - pickle a squirrel today!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCemzI7CzyshGvatgRArpWAJ4g4j5sgUjj3ulgVwxORICyjYdyHgCg5qpr
gE4T1Cniprq057+KD2i79kE=
=jha8
-----END PGP SIGNATURE-----


Attachments:
diff (2.75 kB)

2005-05-09 23:11:51

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] Re: some btsco hacks

thanks Florian. applied.

Florian Echtler wrote:
>>In keeping with \0 \1 for backrefs in the regexp and \p for pid, the headset
>>state should be \s instead of %d. Would you be willing to make that change (or
>>I could)?
>
> No problem, see attached patch.


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-05-09 22:14:38

by Florian Echtler

[permalink] [raw]
Subject: Re: [Bluez-devel] Re: some btsco hacks

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> > Back references to what/where?
> backrefs are parts of the regexp surrounded by (). the matching expression is
> remembered and can be placed in the command string, by \0 \1 etc it turns out.
> I figured them out & noted in the docs.
Ah, I see - I had overlooked that part of the code.

> In keeping with \0 \1 for backrefs in the regexp and \p for pid, the headset
> state should be \s instead of %d. Would you be willing to make that change (or
> I could)?
No problem, see attached patch.

Another question: has anyone experienced the same problem as I have
(the microphone input sometimes generates only noise) or is that
strictly a bug of my headset?

Yours, Florian
- --
Preserve wildlife - pickle a squirrel today!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCf+DS7CzyshGvatgRAmBVAKDfFJndw9pvwYxeENUCDj7gVyTLhwCfXBBS
LXVG5Iht3y0zFJp7REc3VeE=
=r6pM
-----END PGP SIGNATURE-----


Attachments:
diff (1.01 kB)

2005-05-09 05:16:10

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] Re: some btsco hacks

Florian

> I noticed that there was a small bug left in my patch (the value of
> force_sco was overwritten when a reconnect was requested). This small
> additional patch should fix that.

ok, applied.

> Well, my .btscorc currently looks like this:
>
> AT\+CKPD=200
> sco-toggle on off
> AT\+CKPD=200
> system /home/echtler/bin/headset %d &
>
>>do you know what the syntax of 'back references' is in .btscorc?
>
> Back references to what/where?

backrefs are parts of the regexp surrounded by (). the matching
expression is remembered and can be placed in the command string, by \0
\1 etc it turns out.

I figured them out & noted in the docs.

In keeping with \0 \1 for backrefs in the regexp and \p for pid, the
headset state should be \s instead of %d. Would you be willing to make
that change (or I could)?

thanks
Brad


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-05-06 20:52:53

by Florian Echtler

[permalink] [raw]
Subject: Re: [Bluez-devel] Re: some btsco hacks

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Brad,

I noticed that there was a small bug left in my patch (the value of
force_sco was overwritten when a reconnect was requested). This small
additional patch should fix that.

> could you give me some examples from your .btscorc?

Well, my .btscorc currently looks like this:

AT\+CKPD=200
sco-toggle on off
AT\+CKPD=200
system /home/echtler/bin/headset %d &

> do you know what the syntax of 'back references' is in .btscorc?
Back references to what/where?

Yours, Florian
- --
Preserve wildlife - pickle a squirrel today!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCe9ks7CzyshGvatgRAkoxAKDxCwtRZKTHSujGXyrqRdaNEL43/wCfbPjd
D0q3ebE9/sMYojjLzaZFMug=
=4Wfl
-----END PGP SIGNATURE-----


Attachments:
diff (1.50 kB)

2005-05-05 21:09:19

by Brad Midgley

[permalink] [raw]
Subject: [Bluez-devel] Re: some btsco hacks

Florian

> 2. allows the command string in .btscorc to contain '%d', which will
> be replaced with the current SCO connection status (0 or 1) upon
> command execution.

the patch looks fine.

could you give me some examples from your .btscorc?

do you know what the syntax of 'back references' is in .btscorc?

brad


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel