ports/166012: [patch] multimedia/webcamd: attach to input devices, e.g. wacom
Jan Beich
jbeich at tormail.net
Tue Mar 13 16:20:01 UTC 2012
>Number: 166012
>Category: ports
>Synopsis: [patch] multimedia/webcamd: attach to input devices, e.g. wacom
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Mar 13 16:20:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Jan Beich
>Release: FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
$ sudo usbconfig -d 3.2 dump_curr_config_desc
ugen3.2: <CTH-470 Wacom Co.,Ltd.> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
Configuration index 0
bLength = 0x0009
bDescriptorType = 0x0002
wTotalLength = 0x003b
bNumInterfaces = 0x0002
bConfigurationValue = 0x0001
iConfiguration = 0x0000 <no string>
bmAttributes = 0x0080
bMaxPower = 0x00f9
Interface 0
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0000
bAlternateSetting = 0x0000
bNumEndpoints = 0x0001
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0001
bInterfaceProtocol = 0x0002
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x10
RAW dump:
0x00 | 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, 0xb8,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0081 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x000a
bInterval = 0x0002
bRefresh = 0x0000
bSynchAddress = 0x0000
Interface 1
bLength = 0x0009
bDescriptorType = 0x0004
bInterfaceNumber = 0x0001
bAlternateSetting = 0x0000
bNumEndpoints = 0x0001
bInterfaceClass = 0x0003
bInterfaceSubClass = 0x0000
bInterfaceProtocol = 0x0000
iInterface = 0x0000 <no string>
Additional Descriptor
bLength = 0x09
bDescriptorType = 0x21
bDescriptorSubType = 0x10
RAW dump:
0x00 | 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, 0x1d,
0x08 | 0x00
Endpoint 0
bLength = 0x0007
bDescriptorType = 0x0005
bEndpointAddress = 0x0082 <IN>
bmAttributes = 0x0003 <INTERRUPT>
wMaxPacketSize = 0x0040
bInterval = 0x0002
bRefresh = 0x0000
bSynchAddress = 0x0000
$ cat /usr/local/etc/X11/xorg.conf
Section "InputDevice"
Identifier "stylus"
Driver "wacom"
Option "Type" "stylus"
Option "Device" "/dev/input/event0"
Option "Protocol" "USB"
Option "AutoServerLayout" "true"
EndSection
Section "InputDevice"
Identifier "eraser"
Driver "wacom"
Option "Type" "eraser"
Option "Device" "/dev/input/event0"
Option "Protocol" "USB"
Option "AutoServerLayout" "true"
EndSection
Section "InputDevice"
Identifier "touch"
Driver "wacom"
Option "Type" "touch"
Option "Device" "/dev/input/event8"
Option "Protocol" "USB"
Option "AutoServerLayout" "true"
EndSection
Section "InputDevice"
Identifier "pad"
Driver "wacom"
Option "Type" "pad"
Option "Device" "/dev/input/event8"
Option "Protocol" "USB"
Option "AutoServerLayout" "true"
EndSection
>Description:
Make webcamd(8) probe USB input devices and try to attach to every
interface within them, actually up to 3 by default. Based on threads
http://lists.freebsd.org/pipermail/freebsd-usb/2011-October/010681.html
http://lists.freebsd.org/pipermail/freebsd-usb/2012-January/010975.html
which apparently avoid describing how to configure touch/pad.
>How-To-Repeat:
>Fix:
--- input.diff begins here ---
Index: multimedia/webcamd/files/webcamd.conf.in
===================================================================
RCS file: /a/.csup/ports/multimedia/webcamd/files/webcamd.conf.in,v
retrieving revision 1.7
diff -u -p -r1.7 webcamd.conf.in
--- multimedia/webcamd/files/webcamd.conf.in 16 Jul 2011 13:54:12 -0000 1.7
+++ multimedia/webcamd/files/webcamd.conf.in 13 Feb 2012 20:23:59 -0000
@@ -24,3 +24,14 @@ notify 100 {
match "intclass" "0x00";
action "env LD_PRELOAD=%%LIBHAL%%%%LIBCUSE%% %%PREFIX%%/etc/rc.d/webcamd start $cdev";
};
+
+# Generic USB input devices.
+notify 100 {
+ match "system" "USB";
+ match "subsystem" "INTERFACE";
+ match "type" "ATTACH";
+ match "intclass" "0x03";
+ action "env LD_PRELOAD=%%LIBHAL%%%%LIBCUSE%% %%PREFIX%%/etc/rc.d/webcamd start $cdev";
+ action "env LD_PRELOAD=%%LIBHAL%%%%LIBCUSE%% %%PREFIX%%/etc/rc.d/webcamd start $cdev 1";
+ action "env LD_PRELOAD=%%LIBHAL%%%%LIBCUSE%% %%PREFIX%%/etc/rc.d/webcamd start $cdev 2";
+};
Index: multimedia/webcamd/files/webcamd.in
===================================================================
RCS file: /a/.csup/ports/multimedia/webcamd/files/webcamd.in,v
retrieving revision 1.8
diff -u -p -r1.8 webcamd.in
--- multimedia/webcamd/files/webcamd.in 16 Jan 2012 19:55:32 -0000 1.8
+++ multimedia/webcamd/files/webcamd.in 13 Feb 2012 20:24:12 -0000
@@ -16,6 +16,7 @@ hald_enable=${hald_enable-"NO"}
name=webcamd
rcvar=webcamd_enable
+iface=${3-0}
command=%%PREFIX%%/sbin/webcamd
command_args="-B -U webcamd -G webcamd"
@@ -28,7 +29,7 @@ webcamd_prestart()
fi
}
-pidfile="/var/run/webcamd.*.0.pid"
+pidfile="/var/run/webcamd.*.$iface.pid"
load_rc_config $name
@@ -42,7 +43,7 @@ fi
if [ $# -gt 1 ]; then
pidfile="webcamd.dummy"
- command_args="$command_args -d $2 -i 0"
+ command_args="$command_args -d $2 -i $iface"
# Only run the rc command if the appropriate arguments are specified:
run_rc_command $1
fi
--- input.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list