|
1 |
| -My Monoprice 22 almost works with Aidyw's Bosto 22HD driver: https://github.com/aidyw/bosto-2g-linux-kernel-module. According to Aidyw, his Bosto's USB device id is identical to my Monoprice (0b57:9016 via lsusb). But the x-y range is much bigger, for some reason. I also had some issues with the driver (no disrespect intended, mostly because I just can't figure out why things are done the way they are done). |
| 1 | +This is an experimental driver for Monoprice 22 |
2 | 2 |
|
3 |
| -This repo is my take on the driver. I tried to work to https://www.kernel.org/doc/Documentation/input/event-codes.txt |
| 3 | +Current status: stable as of 11 Nov 2016. Please open issues for any bugs you find. |
4 | 4 |
|
5 |
| -The dirver now does the following: |
6 | 5 | - BTN_TOOL_PEN and BUTTON_TOOL_RUBBER are signaled as soon as they are in hover range;
|
7 | 6 | - BTN_TOUCH is set when stylus or rubber touch the screen;
|
8 |
| - - BTN_STYLUS is set while button pressed; |
9 |
| - - Initialization has been reworked; |
10 |
| - - packet decoder keeps no state, much more compact |
11 |
| - - GIMP and KRITA work, but eraser is not recognized...TODO... |
12 |
| - - absolute valuator 3 used to report the tool, removed. |
13 |
| - |
14 |
| -This is highly experimental, and I know very little about Linux drivers. It seems stable and inserting/removing is very easy with `sudo make uninstall` |
15 |
| - |
16 |
| - |
17 |
| -Aidyw's readme follows |
18 |
| -====================== |
19 |
| - |
20 |
| -This is a Linux driver for the 2nd generation Bosto Kingtee 22HD and Bosto Kingtee 14WA tablets. |
21 |
| -These tablets were released around November 2013. |
22 |
| - |
23 |
| -Using this driver requires some manual work but is definitely possible right now. We are |
24 |
| -working to get the drivers to a point where using these tablets under Linux will be automatic |
25 |
| -and convenient. |
26 |
| - |
27 |
| -Multiple drivers |
28 |
| -================ |
29 |
| - |
30 |
| -The 14WA tablet requires two different drivers, one for the pen and one for the keys. |
31 |
| -The pen driver works quite well (with proper tracking and pressure support) but key support |
32 |
| -is handled by the USBHID driver which treats the tablet like a keyboard. This means the keys |
33 |
| -emulate numbers and letters. We are working to improve this. |
34 |
| -The pen driver has a landing spot in a switch statement to handle buttons events from the tablet. This is a work in progress. |
35 |
| -Hardware needed such as 22HD+ with tablet buttons. |
36 |
| - |
37 |
| -Current Status |
38 |
| -============== |
39 |
| - |
40 |
| -* Pen pressure: working (pressure magnified by pen tool button. Usage: Ignore the right click response, maintain the button pressed, and continue to draw with magnified pressure sensitivity.) |
41 |
| -* Pen tracking: working |
42 |
| -* Keys: produce numbers like a numeric keypad |
43 |
| -* Scroll wheels: produce 'a', 'b', 'c', 'd' like a keyboard |
44 |
| -* Removed fuzz factor from driver when reporting absolute position x & y. This is not a joystick and we should have negligable jitter on the reported position. |
45 |
| -* ~~Added delay before pressure reports when tool is presented for the first time.~~ |
46 |
| -* Added conditional for origin 0,0, and don't report. This prevents lines drawn to the absolute origin when pen first in or when stylus button presses during contact. We loose one pixel. I'm not loosing any sleep. |
47 |
| - |
48 |
| -**Tested programs** |
49 |
| - |
50 |
| -Tracking and pressure sensitivity working on: |
51 |
| - |
52 |
| -* GIMP 2.8 |
53 |
| -* MyPaint 1.1.0 |
54 |
| -* Inkscape 0.48 |
55 |
| -* Synfig 0.64.1 |
56 |
| -* Krita 2.9.7 (Nov 2016 this is the distro version on Ubuntu) |
57 |
| -* Blender 2.76b |
58 |
| - |
59 |
| -In each program, you will need to find the "Input Devices" configuration and select the Bosto (change 'disabled' to 'screen') and you might need to map axis 3 to pressure (but that's usually the default). |
60 |
| - |
61 |
| -* Krita 2.7.2 has tracking but it's unknown right now whether pressure works. |
62 |
| -* Krita 2.8.1 doesn't seem to work at all. |
63 |
| -* Krita 3+ works without pressure. Working on this with krita guys? |
64 |
| - |
65 |
| -**Distributions** |
66 |
| - |
67 |
| -The installation has been tested on Ubuntu 13.10, 14.04, 16.04 LTS. Please let us know your experiences on other distributions. |
68 |
| - |
69 |
| - |
70 |
| -In each program, you will need to find the "Input Devices" configuration and select the Bosto (change 'disabled' to 'screen') and you might need to map axis 3 to pressure (but that's usually the default). |
71 |
| - |
72 |
| -Krita 2.8.1 doesn't seem to work properly, though a newer version is known to work. Later versions 3+ have major rework within Krita, its broken something. We're looking into it. |
| 7 | + - BTN_STYLUS2 is set while button pressed; |
| 8 | + - GIMP and KRITA work, but eraser is not recognized, as in all drivers I've seen |
73 | 9 |
|
74 | 10 | Installation
|
75 | 11 | ============
|
76 | 12 |
|
77 |
| -**Build and install the driver** |
| 13 | +To install: |
| 14 | +- verify that your computer sees your Monoprice. `lsusb` should show 'ID 0b57:9016 Beijing HanwangTechnology Co., Ltd'; |
| 15 | +- `make` to build the driver; |
| 16 | +- `sudo make install` to install the driver. |
78 | 17 |
|
79 |
| -```bash |
80 |
| -sudo apt-get install libusb-1.0.0-dev build-essential linux-headers-generic git # install requirements |
81 |
| -cd ~ |
82 |
| -git clone https://github.com/aidyw/bosto-2g-linux-kernel-module.git |
83 |
| -cd bosto-2g-linux-kernel-module |
84 |
| -git checkout <branch> # only if you want to change the branch |
85 |
| -make clean && make |
86 |
| -sudo make install |
87 |
| -``` |
88 |
| - |
89 |
| -**Load the module** |
90 |
| -Now if you plug in the tablet, the pen should work right away. If not, please post an issue and we'll try to improve the code. |
91 |
| - |
92 |
| -If you have a multiscreen setup you can automagically! adjust the transform matrix on X using the wonderful little script written by Leslie 'inputtransform'. |
93 |
| -This helps you identify the Tablet monitor and adjust accordingly. |
94 |
| - |
95 |
| -The "git checkout" to change the branch allows you to select a different stream of development. |
96 |
| -The "master" branch is the default and should be the right choice for the official release version. |
97 |
| -Keep an eye on "testing" any modifications are happening here and will merge as appropriate into master. |
98 |
| - |
99 |
| - |
100 |
| -TODO |
101 |
| -==== |
102 |
| - |
103 |
| -1. Make the pen driver load automatically when the tablet is plugged in <-- done (22HD (master branch) now uses usblib based userspace code to detach the generic kernel module. 14WA using unbind. |
104 |
| -2. Write another or configure USBHID driver to allow remapping of keys and scroll wheels |
105 |
| -3. Try to get the driver updated in the kernel tree so no installation is required in future |
106 |
| -4. Understand and improve the mapping of the rubber tool, to a working software interface. Krita etc ? Probably need to report each tool as a different device? |
107 |
| -5. Consider implementing fuzz factor for the position reports when eraser tool is presented. The eraser tool currently reports with a great deal of jitter. (Hardware) |
108 |
| - |
109 |
| -Diagnostics |
110 |
| -=========== |
111 |
| - |
112 |
| -After running modprobe, check if the module was loaded properly with dmesg. |
113 |
| -"Bosto 2nd Generation USB Driver module being initialised." should appear in the listing. |
| 18 | +At this point you should be able to use the stylus as the mouse and with GIMP or Krita, etc. |
114 | 19 |
|
115 |
| -lsmod should also contain `bosto_2g` in its listing: lsmod | grep bosto_2g |
116 |
| - |
117 |
| -Debug ouput now pattern matched to entries in the /sys/kernel/debug/dynamic_debug/control file |
118 |
| - |
119 |
| - |
120 |
| -For example to see each time the driver detects a TOOL event, echo the following: |
121 |
| - |
122 |
| -echo -n 'format "Bosto TOOL" +p' > /sys/kernel/debug/dynamic_debug/control |
123 |
| - |
124 |
| -Then view the debug output in syslog. To switch debug output off again: |
125 |
| - |
126 |
| -echo -n 'format "Bosto TOOL" -p' > /sys/kernel/debug/dynamic_debug/control |
127 |
| - |
128 |
| -check the 'dev_dbg' lines in bosto_2g.c for other debug pattern matches that are possible. |
| 20 | +To uninstall, of course |
| 21 | +``` |
| 22 | +sudo make uninstall |
| 23 | +``` |
129 | 24 |
|
130 |
| -Another possibility based on per line number in the source file. |
131 |
| -(See https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt ) |
132 |
| -echo -n 'file ./<path to source>/bosto_2g.ko line 230 +p' > <debugfs>/control |
| 25 | +Troubleshooting |
| 26 | +=============== |
133 | 27 |
|
134 |
| -Known Hardware Issues |
135 |
| -===================== |
| 28 | +If your stylus is not responsive after hybernation, type `sudo /usr/local/bin/load_mono_22.sh`. This is a known issue. |
136 | 29 |
|
137 |
| -The Bosto 22HD (v1) Shipped with a firmware issue. If the USB port is detached and then re-attached, the data coming from the tablet becomes corrupted when pressure exceeds a certain level. |
138 |
| -To resolve the issue it is necessary to power cycle the tablet totally, removing both power input and USB cable, in some cases even a DVI connector. |
139 |
| -The tablet will remain internally powered from any available source and all power sources need to be removed to make the USB firmware reboot. |
| 30 | +You can try checking |
| 31 | +- `lsusb` for 0b57:9016; |
| 32 | +- `lsmod | grep mono` for mono_22 |
| 33 | +- `cat /proc/bus/input/devices` to see where your device is attached |
| 34 | +With xinput, you can look try |
| 35 | +- `xinput` and look for 'Monoprice 22' |
| 36 | +- `xinput list --long "Monoprice 22"` |
| 37 | +- `while :; do xinput --query-state "Monoprice 22"; sleep 1; done` |
| 38 | +- `xinput test "Monoprice 22"` |
| 39 | +also, |
| 40 | +- `evtest` |
140 | 41 |
|
141 |
| -Feedback |
142 |
| -======== |
| 42 | +Hacking |
| 43 | +======= |
| 44 | +Obviously, sudo make uninstall and make clean as needed... |
| 45 | +See aidyw's repo for more information about debugging the driver. |
143 | 46 |
|
144 |
| -The best place for feedback is probably the Bosto community Google Group: |
145 |
| -https://groups.google.com/forum/#!categories/bosto-user-group/mac--linux-discussion |
146 | 47 |
|
0 commit comments