2005-08-27 19:31:54

by Andreas Beck

[permalink] [raw]
Subject: [Bluez-devel] skype_bt_hijacker released/updated

Hi folks,

I've played around with integrating skype and btsco a little further,
and now it starts making some sense to publish the current state:

First of all, I updated the skype_pickup script at

http://www.acs.uni-duesseldorf.de/~becka/download/skype/skype_pickup.py

It features better parsing of the call IDs (thanks to Whoopie for the
idea) and cooperation with the skype_bt_hijacker library at

http://www.acs.uni-duesseldorf.de/~becka/download/skype/skype_bt_hijacker-0.1b.tgz

it is included in this tarball as well, so no need to download both.


Now what does that stuff do?

I wanted to use my headset as a handsfree unit for skype. Actually
this works, without any extra software, but it has some inconveniences
for me.

First of all, I don't want to wear the headset all day, just when using
it. Thus I want skype to ring on the speakers, and then switch it over
to the headset when I want to.

Secondly, I don't even want to leave the headset on all the time. So I
need something that connects the headset when it is available and also
tells the rest of the system about that.

Third I'd like to pick up and hang up calls using the headset buttons.

Forth skype has a nasty programming glitch, which will occasionally hang
it, as it forgets to close down the audio device.


Now how does the skype_bt_hijacker stuff overcome these obstacles?

1. There is a btscorunner script that will in a loop try to find
a known headset (most headsets are undiscoverable, unless explicitly
set to pairing mode) and start up btsco if it does.
As btsco terminates, if it looses connection, the loop will then
again seek for the headset.
I know btsco has the reconnect mode, but that defeats autodetection
of the channel. Maybe that should be done there.
Or maybe it should be done via some kind of Plug'n'Play stuff.
Comments welcome.

2. A patch to btsco which will create a file for as long as the headset
is available. This should probably rather be integrated in the
"action" stuff. I'd suggest to push some fixed strings into the
action parser (which should be put into its own function for this
to work nicely) that will cause "system" commands being run via
.btscorc. This is easier to customize and more generic than my
simplistic patch.
I can probably work out a patch for this, but I'd like to hear, if
you think it's a worthwhile addition.

3. A LD_PRELOAD-able library that will intercept skype calls to open,
close, ioctl and write will fix the skype bug and will also allow
to switch the audio device by just creating or removing a file.
and running scripts when skype opens or closes its audio device.

4. Skype_pickup, which will be run by .btscorc will handle switching
the audio device, picking up and hanging up calls.


All in all, it causes the following behaviour:

You just start btscorunner and the skype_bt_hijacker (which starts
skype).

If the configured headset is turned on, btscorunner will fire up btsco
to link it up.

If skype originates or receives a call, the headset will play a short
ringtone and then skype continues ringing on the main audio device.
You can use it normally there.

However if you press a button on the headset, skype_pickup will either
cause skype to pick up the call and transfer it to the headset, or just
do the latter, if the call is already in progress.

If you press the button again, Skype will be instructed to hang up the
call. If you want to transfer back, you need to remove a file. So if you
have more than one working button on the headset, you can map that
action there as easily.

So if you like that, go ahead, get it, test it, have fun.


CU, Andy

PS: The wrapper might work with other OSS apps, too. So test that, if
you like.

--
= Andreas Beck | Email : <[email protected]> =


Attachments:
(No filename) (3.77 kB)
btsco.diff (6.00 kB)
Download all attachments

2005-08-28 05:58:27

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] skype_bt_hijacker released/updated

Andreas

What an impressive hack to intercept open/close. I personally just
discovered alsa-oss which does something similar for making apps like
realplay use alsa.

Does skype know about the problem you're fixing or your other changes to
its behavior?

Be sure you get a unified (-u) diff for submissions.

I've used skype on my pocketpc but clearly I need to get it working on
my linux laptop to try this out.

Brad


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-09-15 11:57:12

by AndreasBeckbecka-bzdvl

[permalink] [raw]
Subject: Re: [Bluez-devel] skype_bt_hijacker released/updated

Hi Brad,
> > I've played around with integrating skype and btsco a little further,
> > and now it starts making some sense to publish the current state:
> I put this in contrib/ in our btsco cvs and modified/applied your patch.
> I tweaked a couple of things, so can you make sure it looks good?

Looks great. The -s switch is a good idea. I wonder if one should make
it take the lockfile path as a parameter.

I've seen you also added the AGC/LostByte fixup. Looks fine, too.

I'll update my package to reflect your Changes for those that grab it
from my site and put a pointer there, that it has been integrated into
the contrib dir and will be maintained there.

If I have major changes (don't think so, works like a charm for me, but
maybe users have some ideas on how to enhance it), I'll send them to
you, or you can give me (ggibecka on sf) CVS write to the
contrib/skype_bt_hijacker subdir.


Thanks and CU, Andy

--
= Andreas Beck | Email : <[email protected]> =


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-09-14 04:56:58

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] skype_bt_hijacker released/updated

Andreas,

> I've played around with integrating skype and btsco a little further,
> and now it starts making some sense to publish the current state:
...

I put this in contrib/ in our btsco cvs and modified/applied your patch.
I tweaked a couple of things, so can you make sure it looks good?

Brad


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel