USB HID support for xf86-input-mouse (including digitizers and touchscreens)

2011-07-19 Thread Alexander Motin
Hi.

Looking on xf86-input-mouse, I've found that it includes some code to
support USB HID pointing devices directly using libusbhid library. But
that code seemed like newer worked (at least on FreeBSD) and is quite
limited. Same time that approach would allow us to override different
limitation, now imposed by sysmouse protocol. For example, to support
absolute coordinates, pressure force, multiple touches, etc. I've made a
patch, rewriting it to support wide range of pointing devices. I've
tested it with few mouses, digitizer and two touchscreens.

To use it, you may:
1. Update installed packages to have x11-drivers/xf86-input-mouse of the
version 1.6.0.
2. Download patch http://people.freebsd.org/~mav/patch-zz-input-mouse8
and put it into /usr/ports/x11-drivers/xf86-input-mouse/files
3. Rebuild and reinstall the driver.
4. Release the pointing device of ums driver, if needed (build kernel
without ums). Device should be reported as uhidX.
5. Add to Xorg configuration:
Section InputDevice
Identifier Panel1
Driver mouse
Option Protocol usb
Option Device /dev/uhidX
EndSection
...
Section ServerLayout
...
InputDevice Panel1
...
EndSection
Some HID devices provide several first-level logical collections
(subdevices), supported by the driver. In that case several of above
devices should be added with different Identifier but same
Device. For example, my Asus T101MT laptop's touchscreen has two usable
logical collections: multi-touch touchscreen and it's mouse emulation.
6. In different operation modes device may report events via different
of these collections. Due to present uhid(4) driver API limitation, it
is impossible for the driver to switch them now. The only way now is to
switch them directly via libusb with command line
usbconfig -u 1 -a 3 do_request 0x21 0x09 0x0305 0x 0x0002 0x05 0x0Z
where Z is value from 0 to 2, where 0 is a mouse emulation, 1 is a
single-touch touch-screen and 2 -- native mode. And 05 is a feature
report ID that includes the switch for my touchscreen.
7. Due to missing multitouch support in present Xorg (XInput 2.1
required), multiple touches are now mapped to right button press now. As
any other button, it can be mapped to mouse wheel emulation by adding
into the device section:
Option EmulateWheel on
Option EmulateWheelButton 3 - right button
Option EmulateWheelInertia 500  - this may be tuned
Option XAxisMapping 7 6
Option YAxisMapping 5 4
It allows to scroll with two fingers.
8. I was experimenting with a hack, mapping multiple touches into
different pointers, using Multi-Pointer X technology, added from present
Xinput 2.0. I indeed successfully had several separate pointers on
screen, so multitouch touch screen itself is working fine. But I haven't
found any practical use for it. If somebody heard about any application
that has some useful support for MPX -- tell me please.

I am not sure it will be the permanent solution and what are the chances
to commit it upstream now. I am thinking about further changes at kernel
level to implement it other way. But for existing systems I think it is
an acceptable way to go.

On any problems, send me Xorg.0.log and `usbhidctl -f /dev/uhidX -r`
outputs.

Thank you. Comments welcome.

-- 
Alexander Motin
___
freebsd-hardware@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hardware
To unsubscribe, send any mail to freebsd-hardware-unsubscr...@freebsd.org


Re: SiI 3132 goes crazy and marks both disks as Reserved after each reboot

2011-07-19 Thread Dieter BSD
 I've added SiI 3132-based controller with two SATA disks to system,
 and almost lost my sanity: gstripe configuration becomes lost after
 each reboot. After some investigation, I found, that after each reboot
 last sector of disk contains SiI meta-information instead of
 GEOM:STRIPE one.

I have a couple of SiI 3132 controllers (Masscool XWT-PCIE10) with
GPT partitioned disks, and the last sectors still appear to contain
the Sec GPT headers after several reboots.

 How to reset this state? And where SiI controller store information
 (additional to last sector)?

I suspect your card's BIOS code.  You could see if your mainboard
has an option to not run expansion card BIOS code.  You could see if
there is a better version of BIOS code available for your card.

KLUDGE
If all else fails, you could create a backup copy of the last sector
and have dd(1) restore it from rc.local or cron @reboot.
/KLUDGE
___
freebsd-hardware@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hardware
To unsubscribe, send any mail to freebsd-hardware-unsubscr...@freebsd.org


ahci.ko / geom_mirror / zfs hangs up system when one of HDDs fauilts.

2011-07-19 Thread Lev Serebryakov
Hello, Freebsd-hardware.

  I've have two identical live locks when HDD becomes broken on
8.2-STABLE system with two SATA HDDs withgmirror and ZFS on them.

  It is Hetzner-based server, so only access I have is LARA console,
but symptoms are identical in both cases: HDD becomes bad, ahci.ko
complains about timeouts, and after that server stops to respond on
high-level access attempts (ssh/HTTP/SMTP), but can be pinged both
with IPv4 and IPv6 addresses.

 HDDs are identical, and they are splitted into several (BSD)partions.
Some partitions are mirrired with geom_mirror and one pair of
partitions are added to (mirrored) ZFS pool like this (I proved output
on rebooted one-HDD-only system, but, I think, it is clear how it
looks when both HDDs are Ok):

===
# gmirror status
onlyone# gmirror status
NameStatus  Components
 mirror/root  DEGRADED  ada0s1a
  mirror/var  DEGRADED  ada0s1d
  mirror/tmp  DEGRADED  ada0s1e
  mirror/usr  DEGRADED  ada0s1f
mirror/databases  DEGRADED  ada0s1g
# zpool status
  pool: pool
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-2Q
 scrub: none requested
config:

NAME STATE READ WRITE CKSUM
pool DEGRADED 0 0 0
  mirror DEGRADED 0 0 0
ada0s1h  ONLINE   0 0 0
ada0s1h  UNAVAIL  0 0 0  cannot open

errors: No known data errors
===

 Screenshot of LARA console in such case is attached.

-- 
// Black Lion AKA Lev Serebryakov l...@freebsd.org___
freebsd-hardware@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hardware
To unsubscribe, send any mail to freebsd-hardware-unsubscr...@freebsd.org