glorang / nwfermi

NextWindow Touchscreen on Ubuntu 22.04
MIT License
20 stars 3 forks source link

errors running autogen.sh #4

Closed bselack closed 1 year ago

bselack commented 1 year ago

./configure: line 19726: --print-errors: command not found checking whether make supports nested variables... (cached) yes ./configure: line 19915: syntax error near unexpected token XORG,' ./configure: line 19915:PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)'

I did follow the steps and up to this point had no issues. Thanks

-nextwindow-0.3.4$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy

glorang commented 1 year ago

You're probably missing a dependency. Can you verify packages xserver-xorg-dev and pkg-config are installed?

bselack commented 1 year ago

Thank you. pkg-config was missing, you may want to add it to the installation instructions install.

Everything after that appeared to run fine. Unfortunately it did make the touchscreen work. I have a HP Compaq Elite 8300 Touch All-in-One PC with the NextWindow Touchscreen, so maybe just not supported by this. Any suggestions on additional things I should be looking for?

I ran this to see if in fact Ubuntu was seeing it, and it appears to see it. (what can I expect from old hardware :-) )

udevadm info --export-db | grep Touch E: ID_MODEL=Touchscreen E: ID_MODEL_ENC=Touchscreen E: ID_SERIAL=NextWindow_Touchscreen E: HID_NAME=NextWindow Touchscreen E: MODALIAS=dmi:bvnHewlett-Packard:bvrK01v03.08:bd04/10/2019:br3.8:svnHewlett-Packard:pnHPCompaqElite8300TouchAll-in-OnePC:pvr:rvnHewlett-Packard:rn3399:rvr:cvnHewlett-Packard:ct3:cvr:skuB2N29AV: E: ID_MODEL=HP Compaq Elite 8300 Touch All-in-One PC

and

Bus 002 Device 003: ID 1926:1846 NextWindow Touchscreen Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 0603:8b03 Novatek Microelectronics Corp. Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 003: ID 413c:3200 Dell Computer Corp. Mouse Bus 003 Device 002: ID 04f2:1717 Chicony Electronics Co., Ltd HP USB Keyboard Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ sudo dmesg | grep Next [ 1.427627] usb 2-1.6: Manufacturer: NextWindow [ 1.561382] hid-generic 0003:1926:1846.0001: hiddev0,hidraw0: USB HID v1.11 Device [NextWindow Touchscreen] on usb-0000:00:1d.0-1.6/input1

glorang commented 1 year ago

Yes, it's possible this device is not supported by the driver, in that case there's not much I can do.

Please see issue #2 for some more debug hints (evtest, log file)

bselack commented 1 year ago

Looking at nw-fermi.c ... I see these, { USB_DEVICE(0x1926, 0x1840) }, { USB_DEVICE(0x1926, 0x1847) },

but mine is 1926:1846 (so close)

glorang commented 1 year ago

This is interesting, it looks like HP actually has an updated Linux nwfermi driver for this model. HP Support or direct link sp63501

If you extract the RPM contents from nwfermi-0.7.0.1-1.1.src.rpm you'll get an updated nwfermi driver & daemon (version 0.7.0.1 while the latest on launchpad is 0.6.5) which definitely lists your model as supported:

# diff -ruN nwfermi-0.6.5.0/nw-fermi.c nwfermi-0.7.0.1/nw-fermi.c
--- nwfermi-0.6.5.0/nw-fermi.c 2022-08-23 13:02:57.716738061 +0200
+++ nwfermi-0.7.0.1/nw-fermi.c  2013-08-15 07:53:58.252382205 +0200

...

@@ -179,7 +182,15 @@
        { USB_DEVICE(0x1926, 0x183E) },
        { USB_DEVICE(0x1926, 0x183F) },
        { USB_DEVICE(0x1926, 0x1840) },
+       { USB_DEVICE(0x1926, 0x1841) },
+       { USB_DEVICE(0x1926, 0x1842) },
+       { USB_DEVICE(0x1926, 0x1843) },
+       { USB_DEVICE(0x1926, 0x1844) },
+       { USB_DEVICE(0x1926, 0x1845) },
+       { USB_DEVICE(0x1926, 0x1846) },

I guess if you get that file from HP and follow the procedure as described here you should get it up & running.

Good luck and let me know your outcome!

bselack commented 1 year ago

Unfortunately I can't build the 0.7.0.1 version.. and not very familiar with linux building

sudo dkms build nwfermi/0.7.0.1

Kernel preparation unnecessary for this kernel. Skipping...

Building module: cleaning build area... make -j4 KERNELRELEASE=5.15.0-56-generic module KERNDIR=/lib/modules/5.15.0-56-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.15.0-56-generic/build...(bad exit status: 2) ERROR (dkms apport): binary package for nwfermi: 0.7.0.1 not found Error! Bad return status for module build on kernel: 5.15.0-56-generic (x86_64) Consult /var/lib/dkms/nwfermi/0.7.0.1/build/make.log for more information.

cat more /var/lib/dkms/nwfermi/0.7.0.1/build/make.log

DKMS make.log for nwfermi-0.7.0.1 for kernel 5.15.0-56-generic (x86_64)
Tue Jan  3 08:03:43 PM EST 2023
make -C /lib/modules/5.15.0-56-generic/build M=/var/lib/dkms/nwfermi/0.7.0.1/build modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-56-generic'
  CC [M]  /var/lib/dkms/nwfermi/0.7.0.1/build/nw-fermi.o
In file included from ./include/linux/srcu.h:21,
                 from ./include/linux/notifier.h:16,
                 from ./arch/x86/include/asm/uprobes.h:13,
                 from ./include/linux/uprobes.h:49,
                 from ./include/linux/mm_types.h:14,
                 from ./include/linux/mmzone.h:21,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/slab.h:15,
                 from /var/lib/dkms/nwfermi/0.7.0.1/build/nw-fermi.c:18:
/var/lib/dkms/nwfermi/0.7.0.1/build/nw-fermi.c: In function ‘fermi_bulk_read_complete’:
./include/linux/workqueue.h:240:31: error: assignment to ‘work_func_t’ {aka ‘void (*)(struct work_struct *)’} from incompatible pointer type ‘void (*)(struct delayed_work *)’ [-Werror=incompatible-pointer-types]
  240 |                 (_work)->func = (_func);                                \
      |                               ^
./include/linux/workqueue.h:245:9: note: in expansion of macro ‘__INIT_WORK’
  245 |         __INIT_WORK((_work), (_func), 0)
      |         ^~~~~~~~~~~
./include/linux/workqueue.h:252:17: note: in expansion of macro ‘INIT_WORK’
  252 |                 INIT_WORK(&(_work)->work, (_func));                     \
      |                 ^~~~~~~~~
./include/linux/workqueue.h:267:9: note: in expansion of macro ‘__INIT_DELAYED_WORK’
  267 |         __INIT_DELAYED_WORK(_work, _func, 0)
      |         ^~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nwfermi/0.7.0.1/build/nw-fermi.c:567:25: note: in expansion of macro ‘INIT_DELAYED_WORK’
  567 |                         INIT_DELAYED_WORK(&dev->bulk_reset_work, bulk_reset);
      |                         ^~~~~~~~~~~~~~~~~
./include/linux/workqueue.h:240:31: error: assignment to ‘work_func_t’ {aka ‘void (*)(struct work_struct *)’} from incompatible pointer type ‘void (*)(struct delayed_work *)’ [-Werror=incompatible-pointer-types]
  240 |                 (_work)->func = (_func);                                \
      |                               ^
./include/linux/workqueue.h:245:9: note: in expansion of macro ‘__INIT_WORK’
  245 |         __INIT_WORK((_work), (_func), 0)
      |         ^~~~~~~~~~~
./include/linux/workqueue.h:252:17: note: in expansion of macro ‘INIT_WORK’
  252 |                 INIT_WORK(&(_work)->work, (_func));                     \
      |                 ^~~~~~~~~
./include/linux/workqueue.h:267:9: note: in expansion of macro ‘__INIT_DELAYED_WORK’
  267 |         __INIT_DELAYED_WORK(_work, _func, 0)
      |         ^~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nwfermi/0.7.0.1/build/nw-fermi.c:609:17: note: in expansion of macro ‘INIT_DELAYED_WORK’
  609 |                 INIT_DELAYED_WORK(&dev->bulk_free_urb_work, bulk_free_urb);
      |                 ^~~~~~~~~~~~~~~~~

cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /var/lib/dkms/nwfermi/0.7.0.1/build/nw-fermi.o] Error 1
make[1]: *** [Makefile:1903: /var/lib/dkms/nwfermi/0.7.0.1/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-56-generic'
make: *** [Makefile:11: module] Error 2

nw-fermi-0.7.0.1.zip

glorang commented 1 year ago

I've fixed the build errors and quickly drafted a new procedure at https://github.com/glorang/nwfermi/tree/master/v7

Can you give it a try? If you manage to get it running, can you provide the output of journalctl -u fwprod-1926-1846.service ?

bselack commented 1 year ago

Thanks for all your work.. getting a bit farther. When building xf86 (the make command) getting this...

-nextwindow-0.3.4$ sudo make
make  all-recursive
make[1]: Entering directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4'
Making all in src
make[2]: Entering directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4/src'
  CC       nextwindow.lo
  CC       touchhelp.lo
In file included from /usr/include/xorg/misc.h:119,
                 from /usr/include/xorg/xf86str.h:37,
                 from /usr/include/xorg/xf86.h:44,
                 from touchhelp.c:24:
/usr/include/xorg/os.h:602:1: warning: redundant redeclaration of ‘strndup’ [-Wredundant-decls]
  602 | strndup(const char *str, size_t n);
      | ^~~~~~~
In file included from /usr/include/xorg/os.h:53,
                 from /usr/include/xorg/misc.h:119,
                 from /usr/include/xorg/xf86str.h:37,
                 from /usr/include/xorg/xf86.h:44,
                 from touchhelp.c:24:
/usr/include/string.h:195:14: note: previous declaration of ‘strndup’ with type ‘char *(const char *, size_t)’ {aka ‘char *(const char *, long unsigned int)’}
  195 | extern char *strndup (const char *__string, size_t __n)
      |              ^~~~~~~
touchhelp.c:37:5: warning: redundant redeclaration of ‘abs’ [-Wredundant-decls]
   37 | int abs(int a);
      |     ^~~
In file included from /usr/include/xorg/misc.h:141,
                 from /usr/include/xorg/xf86str.h:37,
                 from /usr/include/xorg/xf86.h:44,
                 from touchhelp.c:24:
/usr/include/stdlib.h:848:12: note: previous declaration of ‘abs’ with type ‘int(int)’
  848 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
  CCLD     nextwindow_drv.la
make[2]: Leaving directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4/src'
Making all in man
make[2]: Entering directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4/man'
sed -e 's|__vendorversion__|"xf86-input-nextwindow 0.3.4" "X Version 11"|' -e 's|__xorgversion__|"xf86-input-nextwindow 0.3.4" "X Version 11"|' -e 's|__xservername__|Xorg|g' -e 's|__xconfigfile__|xorg.conf|g' -e 's|__projectroot__|/usr/local|g' -e 's|__appmansuffix__|1|g' -e 's|__drivermansuffix__|4|g' -e 's|__adminmansuffix__|8|g' -e 's|__miscmansuffix__|7|g' -e 's|__filemansuffix__|5|g' < nextwindow.man > nextwindow.4
make[2]: Leaving directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4/man'
make[2]: Entering directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4'
make[2]: Leaving directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4'
make[1]: Leaving directory '/home/bselack/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4'
bselack@studio-linux:~/Downloads/xf86-input-nextwindow_0.3.4~precise1/xf86-input

I finished the process anyway (although unsure if I needed to remove something I built the other day or not)

No touch working. Ran journalctl -u fwprod-1926-1846.service


Jan 06 21:06:21 studio-linux systemd[1]: Started Exec fwprod (Next Window Touchscreen).
Jan 06 21:15:52 studio-linux systemd[1]: Stopping Exec fwprod (Next Window Touchscreen)...
Jan 06 21:15:52 studio-linux systemd[1]: fwprod-1926-1846.service: Deactivated successfully.
Jan 06 21:15:52 studio-linux systemd[1]: Stopped Exec fwprod (Next Window Touchscreen).
Jan 06 21:15:52 studio-linux systemd[1]: fwprod-1926-1846.service: Consumed 1.152s CPU time.
-- Boot ac376424706644fd82ae6c36ed6f0ae1 --
Jan 06 21:16:18 studio-linux systemd[1]: Starting Exec fwprod (Next Window Touchscreen)...
Jan 06 21:16:18 studio-linux systemd[1]: Started Exec fwprod (Next Window Touchscreen).```

A side note I had to install systemd

sudo apt-get install systemd
glorang commented 1 year ago

If you post here, please put logs and console output in a code block (triple backtick), it reads a lot easier (https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code)

What distro did you install that it didn't come with systemd?!

Just to be sure, did you update the nwfermi driver from the v7 subfolder and rebuild it ?

To debug, use following steps:

bselack commented 1 year ago

I installed from ubuntu-22.04.1-desktop-amd64.iso

And I did checkout the repo, and did everything from the V7 folder.

I'll check the debug steps you suggested. I may even try to install CentOS on another drive and see if the HP rpms work, if a I can't make any more progress. Thanks!

bselack commented 1 year ago

Still no go. I started with a fresh Ubuntu install (just in case) make.txt and make-install.txt attached. Did not appear to be clean.

sudo apt-get install git
cd Documents/
sudo apt-get install git
git clone https://github.com/glorang/nwfermi.git
sudo apt-get install dkms build-essential autoconf xutils-dev libtool xserver-xorg-dev libc6-i386 pkg-config systemd
cd nwfermi/v7/
sudo apt-get install libudev1:i386
sudo ln -s /usr/lib/i386-linux-gnu/libudev.so.1 /usr/lib/i386-linux-gnu/libudev.so.0
dkms build nwfermi/0.7.0.1

sudo cp -p -r usr/src/nwfermi-0.7.0.1/ /usr/src/

(above missing from instrustions)

sudo dkms build nwfermi/0.7.0.1
sudo cp etc/X11/xorg.conf.d/10-nwfermi.conf /etc/X11/xorg.conf.d/
sudo cp usr/sbin/nwfermi_daemon /usr/sbin
sudo cp etc/udev/rules.d/40-nw-fermi.rules /etc/udev/rules.d/
sudo cp etc/systemd/system/nwfermi@.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo cp usr/sbin/fwprod /usr/sbin
sudo cp etc/systemd/system/fwprod-1926-1846.service /etc/systemd/system/
sudo systemctl daemon-reload

(downloaded xf86-input-nextwindow_0.3.4~precise1.tar.gz)

cd xf86-input-nextwindow_0.3.4~precise1/
cd xf86-input-nextwindow-0.3.4/
sudo chmod +x autogen.sh ; ./autogen.sh
sudo make

(had issues here as attached)

sudo make install

(as attached)

sudo cp /usr/local/lib/xorg/modules/input/nextwindow_drv.* /usr/lib/xorg/modules/input/
sudo usermod -a -G input gdm
sudo usermod -a -G input bselack
sudo reboot

sudo lsmod |grep -i fermi

(returned nothing)

Start nwfermi daemon manually /usr/sbin/nwfermi_daemon /daemon /instanceId 1
Start fwproc manually /usr/sbin/fwprod /product_id 0x1846 /message 004302F300 /padding_size 65 /timeout 300 /daemon

Had to install evtest

sudo apt install evtest

Run evtest and select "Nextwindow Fermi Touchscreen" and touch your screen, you should see it generate events

No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:  Power Button
/dev/input/event1:  Power Button
/dev/input/event2:  Chicony HP USB Keyboard
/dev/input/event3:  Chicony HP USB Keyboard Consumer Control
/dev/input/event4:  Dell Dell USB Mouse
/dev/input/event5:  HP WMI hotkeys
/dev/input/event6:  UVC Camera (0603:8b03): 
/dev/input/event7:  HDA Intel PCH Mic
/dev/input/event8:  HDA Intel PCH Line Out
/dev/input/event9:  HDA Intel PCH Headphone
/dev/input/event10: HDA Intel PCH HDMI/DP,pcm=3

make.txt make-install.txt

glorang commented 1 year ago

You forgot to execute the step dkms install nwfermi/0.7.0.1 which is in the instructions, due to this the kernel module is not available, this is also seen in your own debug output:

sudo lsmod |grep -i fermi

(returned nothing)

bselack commented 1 year ago

Yea.. installing would help :-) can't believe I missed that.

Ok.. now getting close...

bselack@studio-hp:~$ sudo lsmod |grep -i fermi
nw_fermi               24576  2
strings: '/dev/nwfermi1': No such file

but

ls -l /dev/n
net/             nvram            nwfermi2         
null             nw-fermi         nw-fermi-device  

so trying strings /dev/nwfermi2 gets the expected behavior you described.

I then ran


also on my system it starts the daemon as id 2

```root         719       1  0 12:03 ?        00:00:00 /usr/sbin/nwfermi_daemon /daemon /instanceid 2

Run evtest and select "Nextwindow Fermi Touchscreen" and touch your screen, you should see it generate events

And saw events...

I don't seem to get any touches in the areas that I touch (e.g. icons to open applications) unless the pointer is over that icon. I would think that the touch would position the cursor, and it does not. Also touching and moving doesn't move the cursor. Maybe I'm hoping for too much :-) or maybe those issue I saw in the make/make install for xf86 are an issue, or there is some other config that is not correct.

Appreciate all your help. If you expect the behavior I am seeing, let me know.

glorang commented 1 year ago

So the touches to open an app work but the pointer doesn't move ? This is probably similar to what other users reported as well (see issue #2). Is that fwprod deamon running? (still not sure what it does)

Can you provide output of grep -i fermi /home/bselack/.local/share/xorg/Xorg.0.log ? (or Xorg.1.log)

bselack commented 1 year ago

fwprod is running

root         705       1  0 12:03 ?        00:00:12 /usr/sbin/fwprod /product_id 0x1846 /message 004302F300 /padding_size 65 /timeout 300 /daemon

I don't have a log file

locate /home/bselack xorg
/home/bselack/Documents/nwfermi/etc/X11/xorg.conf.d
/home/bselack/Documents/nwfermi/etc/X11/xorg.conf.d/10-nwfermi.conf
/home/bselack/Documents/nwfermi/v7/etc/X11/xorg.conf.d
/home/bselack/Documents/nwfermi/v7/etc/X11/xorg.conf.d/10-nwfermi.conf
/home/bselack/Documents/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4/xorg-nextwindow.pc
/home/bselack/Documents/xf86-input-nextwindow_0.3.4~precise1/xf86-input-nextwindow-0.3.4/xorg-nextwindow.pc.in
ls -l /home/bselack/.local/share/
applications/             gnome-settings-daemon/    ibus-table/               nautilus/                 sounds/
evolution/                gnome-shell/              icc/                      recently-used.xbel        
flatpak/                  gvfs-metadata/            keyrings/                 session_migration-ubuntu 

I did find this in /var/log/dist/upgrade

[    3.225901] kernel: nw_fermi: loading out-of-tree module taints kernel.
[    3.231471] kernel: nw_fermi: module verification failed: signature and/or required key missing - tainting kernel
[    3.243571] kernel: nwfermi 2-1.6:1.0: NextWindow Fermi device now attached to nwfermi-2
[    3.243621] kernel: usbcore: registered new interface driver nwfermi
bselack commented 1 year ago

Based on #2 I followed

Make sure you are not using Wayland, set WaylandEnable=false in /etc/gdm3/custom.conf

So I set that, and it's now working!

Attached is my Xorg.0.log (lots of Read error: Resource temporarily unavailable) but seems to work.

Thank you so much! (do you have a tip jar somewhere?)

xorg.log

AND I now have VCV Rack (modular music system running)

glorang commented 1 year ago

Great, awesome! I've merged v7 now into the main repo and removed all references to nwfermi v6.

I've also added the missing steps that came up from this issue: install evtest, install nwfermi into /usr/src, disable wayland. systemd should really be installed by default.

The xf86-input-nextwindow is also licensed under a license I can republish it here, so I'll add it to the repo here and fix the compiler warning at a later time.

Tips are always welcome at https://paypal.me/GeertLorang :-) Thx!

glorang commented 1 year ago

Thx for the tip! Much appreciated.

I've just updated the xf86-input-nextwindow module which fixes the compiler warnings and the many "Read error: Resource temporarily unavailable" errors in the Xorg log.

You would need to download the updates files (git pull or clone again) from the repo and re-execute the "Build xf86-input-nextwindow Xorg module" chapter.