2004-03-10 10:02:00

by Frederic Detienne

[permalink] [raw]
Subject: [Bluez-users] Logitech MX900 oddities and solutions

Hello,

I have a Logitech MX900 (purchased in Belgium) whose hub I want to use
in Bluetooth mode. It has a CSR chip that boots in USB-HID mode and must
be switched to HCI mode through a Bluez tool called hid2hci. I want to
report my experience as this was not as easy as it seemed and also would
like to report some issues.

Before I start, thanks a lot to the Bluez developers for bringing this
great thing to Linux!! I will stop the kudos straight here but just to
let you know there is no offense in what I will say below; just
feedback.

Credits: I have found a lot of info on this mailing list and under the
two following links:

http://www.bueche.ch/comp/mx900/mx900.html
http://www.bueche.ch/comp/mx900/feedback/ghisoli_alexandre_mx900_with_hub.txt

Obviously my mileage varied and here is the delta.

Diclaimer: I am a total Bluetooth idiot; forgive and correct errors I
made please.

For starters, I patched a stock 2.6.3 Linux kernel with the -mh4 patch,
then I downloaded and installed bluez-libs2 and bluez-utils2 from CVS in
order to obtain hid2hci. First problem is that the "compat" tools
Makefile (including hcitool) needed to be compiled separately. This is
sad since hcitool is very useful to ensure your hub is really alive.

Second problem is that hid2hci needs to pass multibyte commands to the
USB-BT hub and the -mh4 patch does not support that. I had to manually
overpatch the kernel with instructions found here:

http://sourceforge.net/mailarchive/forum.php?thread_id=3803086&forum_id=1883

I would have expected this patch to be part of -mh4 (that is what I
remember having read) but it was not there. It should! :-) I can't wait
to have the patches synced to the 2.6 kernel tree.

Third problem is that hid2hci did not recognize my Logitech hub. Looking
through the code showed that the vendor/product id's are hardcoded
(that's fair) but my device was not in the list. Here is an excerpt of
lsusb:

Bus 001 Device 009: ID 046d:c705 Logitech, Inc.
^
|
culprit ------------------+

So I patched hid2hci to recognize 046d:c705 as a Logitech thingy. Beware
that I bought the mouse in Belgium and there may be more unknown ID's in
the world wild wireless mess (wireMess?).

Running the fixed hid2hci effectively switched the base station into a
recognized Bluetooth "hub".

Here we go! This is where the technical part ends and the esoteric part
begins.

I then used bthid to have the mouse recognized. It worked but not quite
fine: the mouse was jaggy or jumpy. I do not know how to explain... it
seemed like the events were queued and delayed somewhere, causing the
mouse to move slower than it should have (lagging behind), then all
those messages would be released in a burst and the mouse would jump
forward, suddenly reaching the position it would have had if it had not
lagged behind. This made the mouse hardly usable (very imprecise).

I tried the other bthid from here:

http://www.visi.com/~pmk/msbtkb-linux.html

with no more success; I had to patch it to work with the compat Bluez
library, and that new bthid worked but the problem was the same. The
various options of that bthid are rather interesting, though.

Well... I stopped and restarted bthid (both versions) a gazillion times
with various options, disconnected all my wireless stuff at home to rule
out interferences, re-paired the mouse,... without success; the mouse
was still jumpy. Until this morning when I compiled hcid (from util2
compat), launched it and restarted bthid. The mouse movement was super
fine! I am dumb wrt/ Bluetooth but I did not understand. So I stopped
hcid and bthid and restarted bthid alone (the Bluez one) and the mouse
still worked perfectly.

Sounds like spraying chicken blood on the keyboard or doing the magic
dance. I am looking for an explanation... what has hcid got to do with
that ?

At the moment, my MX900 works like a charm in BT mode and the Logitech
hub sees my Nokia phone too. I will play more with that when I have
time.

thanks and regards,

fred




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2004-03-11 08:25:56

by Alexandre Ghisoli

[permalink] [raw]
Subject: Re: [Bluez-users] Logitech MX900 oddities and solutions

Marcel,

Le mer 10/03/2004 =E0 12:11, Marcel Holtmann a =E9crit :
> Hi Alexandre,
> > > If you start the hcid it will modifiy your link policy settings and=
it
> > > is important that RSWITCH and SNIFF is on.
> >=20
> > Mine is working fine ... without any mod or blood :-)
>=20
> What does "hciconfig hci0 lp" say?

hci0: Type: USB
BD Address: 00:07:61:08:76:70 ACL MTU: 192:8 SCO MTU: 64:8
Link policy: HOLD SNIFF PARK

And my hcid.conf:
lp hold,sniff,hold,park;


So, what is the exact mean for RSWITCH ?

> > Maybe the next thing to do is to have a correct encryption link, of
> > course for the keyboard ( I don't think that mouse mouvements are ver=
y
> > important ...).
>=20
> If the HID device is a keyboard we must simply send and authentication
> request and then activate the encryption. Patches are welcome.

Huh, it's a good job for me, need some spare time ... :-(
Maybe in same time that the modification of bthid parser to have
function keys working for the keyboard.

best regards,=20

--Alexandre



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2004-03-10 11:39:50

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Logitech MX900 oddities and solutions

Hi Frederic,

> I forgot to say that. The problem is that it did not compile anything
> (Make says there is "nothing to make for all"). I may have done dirty
> things while fiddling around. I will try downloading again from CVS and
> do it cleanly.

I checked it again and if you give --enable-compat to libs2 and utils2
configure everything will be compiled.

> Don't you thing hcitool should be made current and not just "compat" ?
> It is a precious tool...

Actually my replacement for hcitool which uses the new Bluetooth library
is not ready and every code in compat uses the old library.

> You mean the multibyte stuff, right ? What about the -mh4 patch, util2
> and lib2 ? Will they be made grand public soon ?

Sending in the multi-byte patch is job of the input guys. Everything
from -mh4 is already present in 2.6.4-rcX. The libs2 and utils2 will
take some time before they go real public.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2004-03-10 11:18:29

by Frederic Detienne

[permalink] [raw]
Subject: Re: [Bluez-users] Logitech MX900 oddities and solutions

On Wed, 2004-03-10 at 11:43, Marcel Holtmann wrote:

> you can enable it with the --enable-compat switch for configure, but by
> default this is not on.

I forgot to say that. The problem is that it did not compile anything
(Make says there is "nothing to make for all"). I may have done dirty
things while fiddling around. I will try downloading again from CVS and
do it cleanly.

Don't you thing hcitool should be made current and not just "compat" ?
It is a precious tool...

> > http://sourceforge.net/mailarchive/forum.php?thread_id=3803086&forum_id=1883
> >
> > I would have expected this patch to be part of -mh4 (that is what I
> > remember having read) but it was not there. It should! :-) I can't wait
> > to have the patches synced to the 2.6 kernel tree.
>
> I never said that I include the multi-byte patch into -mh4. It seems
> that some people assume this, but this is not true. Use diffstat to
> check the patch and you will see that it only changes Bluetooth stuff.

I realized that after debugging hid2hci :-) So the multibyte fix is
intentionally not part of -mh4. It is good that you confirm that fact.

> However Vojtech Pavlik told me that he will push these patches for
> mainline integration.

You mean the multibyte stuff, right ? What about the -mh4 patch, util2
and lib2 ? Will they be made grand public soon ?

> I add your device ID to the CVS.

thanks!

> If you start the hcid it will modifiy your link policy settings and it
> is important that RSWITCH and SNIFF is on.

slap me! that's exactly what is in /etc/bluetooth/hcid.conf. I guess
I'll have to learn more about BT now that I can experiment with it.

Pseudo-mistery solved.

thanks again!

fred

2004-03-10 11:11:41

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Logitech MX900 oddities and solutions

Hi Alexandre,

> > I never said that I include the multi-byte patch into -mh4. It seems
> > that some people assume this, but this is not true. Use diffstat to
> > check the patch and you will see that it only changes Bluetooth stuff.
>
> Strange ... with my 2.6.3 I don't use any other path for this .. :-)

you must used another one. At least the -mm patch.

> > I add your device ID to the CVS.
>
> Huh, Logitech has many device ID for same hardware ?
> Maybe we need some clarification from Logitech .. :-)

This is normal stuff ;)

> > If you start the hcid it will modifiy your link policy settings and it
> > is important that RSWITCH and SNIFF is on.
>
> Mine is working fine ... without any mod or blood :-)

What does "hciconfig hci0 lp" say?

> Maybe the next thing to do is to have a correct encryption link, of
> course for the keyboard ( I don't think that mouse mouvements are very
> important ...).

If the HID device is a keyboard we must simply send and authentication
request and then activate the encryption. Patches are welcome.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2004-03-10 11:02:39

by Alexandre Ghisoli

[permalink] [raw]
Subject: Re: [Bluez-users] Logitech MX900 oddities and solutions

Le mer 10/03/2004 =E0 11:43, Marcel Holtmann a =E9crit :

> > Second problem is that hid2hci needs to pass multibyte commands to th=
e
> > USB-BT hub and the -mh4 patch does not support that. I had to manuall=
y
> > overpatch the kernel with instructions found here:
> >=20
> > http://sourceforge.net/mailarchive/forum.php?thread_id=3D3803086&foru=
m_id=3D1883
> >=20
> > I would have expected this patch to be part of -mh4 (that is what I
> > remember having read) but it was not there. It should! :-) I can't wa=
it
> > to have the patches synced to the 2.6 kernel tree.
>=20
> I never said that I include the multi-byte patch into -mh4. It seems
> that some people assume this, but this is not true. Use diffstat to
> check the patch and you will see that it only changes Bluetooth stuff.

Strange ... with my 2.6.3 I don't use any other path for this .. :-)

> > Third problem is that hid2hci did not recognize my Logitech hub. Look=
ing
> > through the code showed that the vendor/product id's are hardcoded
> > (that's fair) but my device was not in the list. Here is an excerpt o=
f
> > lsusb:
> >=20
> > Bus 001 Device 009: ID 046d:c705 Logitech, Inc.
> > ^
> > |
> > culprit ------------------+
> >=20
> > So I patched hid2hci to recognize 046d:c705 as a Logitech thingy. Bew=
are
> > that I bought the mouse in Belgium and there may be more unknown ID's=
in
> > the world wild wireless mess (wireMess?).
>=20
> I add your device ID to the CVS.

Huh, Logitech has many device ID for same hardware ?
Maybe we need some clarification from Logitech .. :-)


> > Well... I stopped and restarted bthid (both versions) a gazillion tim=
es
> > with various options, disconnected all my wireless stuff at home to r=
ule
> > out interferences, re-paired the mouse,... without success; the mouse
> > was still jumpy. Until this morning when I compiled hcid (from util2
> > compat), launched it and restarted bthid. The mouse movement was supe=
r
> > fine! I am dumb wrt/ Bluetooth but I did not understand. So I stopped
> > hcid and bthid and restarted bthid alone (the Bluez one) and the mous=
e
> > still worked perfectly.
> >=20
> > Sounds like spraying chicken blood on the keyboard or doing the magic
> > dance. I am looking for an explanation... what has hcid got to do wit=
h
> > that ?
>=20
> If you start the hcid it will modifiy your link policy settings and it
> is important that RSWITCH and SNIFF is on.
>=20

Mine is working fine ... without any mod or blood :-)

Maybe the next thing to do is to have a correct encryption link, of
course for the keyboard ( I don't think that mouse mouvements are very
important ...).

regards,=20

--Alexandre




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2004-03-10 10:43:21

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Logitech MX900 oddities and solutions

Hi Frederic,

> For starters, I patched a stock 2.6.3 Linux kernel with the -mh4 patch,
> then I downloaded and installed bluez-libs2 and bluez-utils2 from CVS in
> order to obtain hid2hci. First problem is that the "compat" tools
> Makefile (including hcitool) needed to be compiled separately. This is
> sad since hcitool is very useful to ensure your hub is really alive.

you can enable it with the --enable-compat switch for configure, but by
default this is not on.

> Second problem is that hid2hci needs to pass multibyte commands to the
> USB-BT hub and the -mh4 patch does not support that. I had to manually
> overpatch the kernel with instructions found here:
>
> http://sourceforge.net/mailarchive/forum.php?thread_id=3803086&forum_id=1883
>
> I would have expected this patch to be part of -mh4 (that is what I
> remember having read) but it was not there. It should! :-) I can't wait
> to have the patches synced to the 2.6 kernel tree.

I never said that I include the multi-byte patch into -mh4. It seems
that some people assume this, but this is not true. Use diffstat to
check the patch and you will see that it only changes Bluetooth stuff.

However Vojtech Pavlik told me that he will push these patches for
mainline integration.

> Third problem is that hid2hci did not recognize my Logitech hub. Looking
> through the code showed that the vendor/product id's are hardcoded
> (that's fair) but my device was not in the list. Here is an excerpt of
> lsusb:
>
> Bus 001 Device 009: ID 046d:c705 Logitech, Inc.
> ^
> |
> culprit ------------------+
>
> So I patched hid2hci to recognize 046d:c705 as a Logitech thingy. Beware
> that I bought the mouse in Belgium and there may be more unknown ID's in
> the world wild wireless mess (wireMess?).

I add your device ID to the CVS.

> Well... I stopped and restarted bthid (both versions) a gazillion times
> with various options, disconnected all my wireless stuff at home to rule
> out interferences, re-paired the mouse,... without success; the mouse
> was still jumpy. Until this morning when I compiled hcid (from util2
> compat), launched it and restarted bthid. The mouse movement was super
> fine! I am dumb wrt/ Bluetooth but I did not understand. So I stopped
> hcid and bthid and restarted bthid alone (the Bluez one) and the mouse
> still worked perfectly.
>
> Sounds like spraying chicken blood on the keyboard or doing the magic
> dance. I am looking for an explanation... what has hcid got to do with
> that ?

If you start the hcid it will modifiy your link policy settings and it
is important that RSWITCH and SNIFF is on.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users