Solved Touchscreen not working after suspend/resume with webcamd driver

Hi there,

Directly cut to the problem.

I have webcamd along with evdev driver for my egalaxy touchscreen. And I have dwm to manage my windows.

Everything works fine when I startx for the first time. The webcamd service is up and running, and webcamd is attached to the touchscreen with command webcamd -d ugen0.2 -N eGalax-Inc--eGalaxTouch-EXC3188-1515-09-00-00 -S unknown -M 0.

When I move my finger on the screen, the cursor follows along, and I can do clicks where I want to. Though scroll function is not viable for now, I am pretty much satisfied with the situation.

The problem comes when I suspend and resume, the touchscreen is dead. I've search for solutions, like in this thread

forums.freebsd.org

Touchscreen Does Not Work After Sleep/Resume

Hi All, Running FreeBSD 11.2-RELEASE-p2 on ThinkPad X1 Yoga. rc.conf: webcamd_enable="YES" webcamd_0_flags="-N Chicony-Electronics-Co--Ltd--Integrated-Camera" webcamd_1_flags="-N Wacom-Co--Ltd--Pen-and-multitouch-sensor" xorg.conf: Section "InputDevice" Identifier...
" href="/index.php?threads/ /">Thread
No luck. The wmt kernel module with either libinput or evdev sadly and oddly won't work on my laptop as expected. So I'm stuck with webcamd.

After suspend and resume, the error I got from Xorg.0.log is
[B][ 636.270] (EE) evdev: Touchscreen0: Unable to open evdev device "/dev/input/event4" (No such file or directory). [ 636.270] [dix] couldn't enable device 6[/B]

My guess is when resume, webcamd is not attached to my touchscreen soon enough, as X is trying to reinitialize my touchscreen device but cannot find the /dev/input/event4 node which is supposed to be created before X resumes.

Hence, I'm also guessing if I can get webcamd attach to my screen before X resumes, everything will be fine. I just cannot find a way to put webcamd before all other resume-scripts. I've read about rcorder, I got lost in all that. Sorry, I am pretty new to FreeBSD.

Any help would be appreciated. Thanks!

This is my first post, please point it out if I'm doing anything wrong. Thanks again!

The settings are as follows.

loader.conf:
Code:
cuse_load="YES"

rc.conf:
Code:
dbus_enable="YES"
hald_enable="YES"
webcamd_enable="YES"

xorg.conf:
Code:
Section "ServerLayout"
    Identifier      "MyLayout"
    InputDevice     "Touchscreen0" "SendCoreEvents"
    Screen          0  "Screen0" 0 0
    InputDevice     "Mouse0" "CorePointer"
EndSection

Section "InputDevice"
    Identifier      "Touchscreen0"
    Driver          "evdev"
    Option          "Device" "/dev/input/event4"
EndSection

Section "Monitor"
        Identifier       "Monitor0"
        VendorName       "egalax"
        ModelName        "egalax-touch"
        Option         "DPMS"
EndSection

Section "Screen"
        Identifier     "Screen0"
        Device         "Card0"
        Monitor        "Monitor0"
        SubSection "Display"
                Viewport   0 0
                Depth    24
                Modes "1366x768"
        EndSubSection
EndSection

Section "Device"
    Identifier     "Card0"
    Driver         "intel"
    Option        "TearFree" "True"
EndSection

Section "InputDevice"
    Identifier      "Mouse0"
    Driver          "mouse"
    Option          "Protocol"      "auto"
    Option          "Device"        "/dev/sysmouse"
    Option          "ZAxisMapping"  "4 5 6 7"
EndSection

/usr/local/etc/devd/webcamd.conf:
Code:
...

notify 100 {
    match "system"        "USB";
    match "subsystem"    "INTERFACE";
    match "type"        "ATTACH";

    match "vendor"        "0x0eef";
    match "product"        "0xc07a";

    action "/usr/local/etc/rc.d/webcamd start $cdev $interface";
};

...

Xorg.0.log with No such file or directory error:
Code:
[   585.919]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[   585.919] X Protocol Version 11, Revision 0
[   585.919] Build Operating System: FreeBSD 12.0-RELEASE-p12 amd64
[   585.919] Current Operating System: FreeBSD fr33 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC amd64
[   585.920] Build Date: 02 January 2020  09:07:34AM
[   585.920] 
[   585.920] Current version of pixman: 0.38.4
[   585.920]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[   585.920] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   585.920] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Feb  7 17:39:25 2020
[   585.924] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[   585.924] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[   585.926] (==) ServerLayout "MyLayout"
[   585.926] (**) |-->Screen "Screen0" (0)
[   585.926] (**) |   |-->Monitor "Monitor0"
[   585.926] (**) |   |-->Device "Card0"
[   585.926] (**) |-->Input Device "Touchscreen0"
[   585.926] (**) |-->Input Device "Mouse0"
[   585.926] (==) Automatically adding devices
[   585.926] (==) Automatically enabling devices
[   585.926] (==) Not automatically adding GPU devices
[   585.928] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   585.935] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/,
    catalogue:/usr/local/etc/X11/fontpath.d
[   585.935] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[   585.935] (II) The server relies on devd to provide the list of input devices.
    If no devices become available, reconfigure devd or disable AutoAddDevices.
[   585.935] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[   585.935] (WW) Disabling Mouse0
[   585.935] (II) Loader magic: 0x421020
[   585.935] (II) Module ABI versions:
[   585.935]     X.Org ANSI C Emulation: 0.4
[   585.935]     X.Org Video Driver: 20.0
[   585.935]     X.Org XInput driver : 22.1
[   585.936]     X.Org Server Extension : 9.0
[   585.936] (--) PCI:*(0:0:2:0) 8086:1916:1071:a133 rev 7, Mem @ 0xb2000000/16777216, 0xa0000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/65536
[   585.936] (II) LoadModule: "glx"
[   585.937] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   585.954] (II) Module glx: vendor="X.Org Foundation"
[   585.954]     compiled for 1.18.4, module version = 1.0.0
[   585.954]     ABI class: X.Org Server Extension, version 9.0
[   585.954] (==) AIGLX enabled
[   585.955] (II) LoadModule: "intel"
[   585.956] (II) Loading /usr/local/lib/xorg/modules/drivers/intel_drv.so
[   585.963] (II) Module intel: vendor="X.Org Foundation"
[   585.963]     compiled for 1.18.4, module version = 2.99.917
[   585.963]     Module class: X.Org Video Driver
[   585.963]     ABI class: X.Org Video Driver, version 20.0
[   585.963] (II) LoadModule: "evdev"
[   585.963] (II) Loading /usr/local/lib/xorg/modules/input/evdev_drv.so
[   585.966] (II) Module evdev: vendor="X.Org Foundation"
[   585.966]     compiled for 1.18.4, module version = 2.10.6
[   585.967]     Module class: X.Org XInput Driver
[   585.967]     ABI class: X.Org XInput driver, version 22.1
[   585.967] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
    i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
    915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
    Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
    GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[   585.968] (II) intel: Driver for Intel(R) HD Graphics
[   585.968] (II) intel: Driver for Intel(R) Iris(TM) Graphics
[   585.968] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics
[   585.968] (--) Using syscons driver with X support (version 2.0)
[   585.968] (--) using VT number 9

[   586.015] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   586.015] (==) intel(0): Depth 24, (--) framebuffer bpp 32
[   586.015] (==) intel(0): RGB weight 888
[   586.015] (==) intel(0): Default visual is TrueColor
[   586.015] (**) intel(0): Option "TearFree" "True"
[   586.015] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 520
[   586.016] (**) intel(0): Relaxed fencing enabled
[   586.016] (**) intel(0): Wait on SwapBuffers? enabled
[   586.016] (**) intel(0): Triple buffering? enabled
[   586.016] (**) intel(0): Framebuffer tiled
[   586.016] (**) intel(0): Pixmaps tiled
[   586.016] (**) intel(0): 3D buffers tiled
[   586.016] (**) intel(0): SwapBuffers wait enabled
[   586.016] (==) intel(0): video overlay key set to 0x101fe
[   586.018] (II) intel(0): Output eDP1 using monitor section Monitor0
[   586.023] (II) intel(0): Output HDMI1 has no monitor section
[   586.024] (II) intel(0): EDID for output eDP1
[   586.024] (II) intel(0): Manufacturer: AUO  Model: 505c  Serial#: 0
[   586.024] (II) intel(0): Year: 2015  Week: 0
[   586.025] (II) intel(0): EDID Version: 1.4
[   586.025] (II) intel(0): Digital Display Input
[   586.025] (II) intel(0): 6 bits per channel
[   586.025] (II) intel(0): Digital interface is DisplayPort
[   586.025] (II) intel(0): Max Image Size [cm]: horiz.: 26  vert.: 14
[   586.025] (II) intel(0): Gamma: 2.20
[   586.025] (II) intel(0): No DPMS capabilities specified
[   586.025] (II) intel(0): Supported color encodings: RGB 4:4:4
[   586.025] (II) intel(0): First detailed timing is preferred mode
[   586.025] (II) intel(0): Preferred mode is native pixel format and refresh rate
[   586.025] (II) intel(0): redX: 0.584 redY: 0.333   greenX: 0.338 greenY: 0.571
[   586.025] (II) intel(0): blueX: 0.158 blueY: 0.133   whiteX: 0.313 whiteY: 0.329
[   586.025] (II) intel(0): Manufacturer's mask: 0
[   586.025] (II) intel(0): Supported detailed timing:
[   586.025] (II) intel(0): clock: 76.3 MHz   Image Size:  256 x 144 mm
[   586.025] (II) intel(0): h_active: 1366  h_sync: 1414  h_sync_end 1446 h_blank_end 1600 h_border: 0
[   586.025] (II) intel(0): v_active: 768  v_sync: 772  v_sync_end 778 v_blanking: 794 v_border: 0
[   586.026] (II) intel(0): Unknown vendor-specific block f
[   586.027] (II) intel(0):  AUO
[   586.027] (II) intel(0):  B116XAN05.0
[   586.027] (II) intel(0): EDID (in hex):
[   586.027] (II) intel(0):     00ffffffffffff0006af5c5000000000
[   586.027] (II) intel(0):     00190104951a0e780299859555569228
[   586.027] (II) intel(0):     22505400000001010101010101010101
[   586.027] (II) intel(0):     010101010101ce1d56ea50001a303020
[   586.027] (II) intel(0):     46000090100000180000000f00000000
[   586.027] (II) intel(0):     00000000000000000020000000fe0041
[   586.027] (II) intel(0):     554f0a202020202020202020000000fe
[   586.027] (II) intel(0):     004231313658414e30352e30200a0067
[   586.027] (II) intel(0): Not using default mode "320x240" (doublescan mode not supported)
[   586.027] (II) intel(0): Not using default mode "400x300" (doublescan mode not supported)
[   586.027] (II) intel(0): Not using default mode "400x300" (doublescan mode not supported)
[   586.027] (II) intel(0): Not using default mode "512x384" (doublescan mode not supported)
[   586.027] (II) intel(0): Not using default mode "640x480" (doublescan mode not supported)
[   586.027] (II) intel(0): Not using default mode "640x512" (doublescan mode not supported)
[   586.027] (II) intel(0): Not using default mode "800x600" (doublescan mode not supported)
[   586.027] (II) intel(0): Not using default mode "896x672" (doublescan mode not supported)
[   586.028] (II) intel(0): Not using default mode "928x696" (doublescan mode not supported)
[   586.028] (II) intel(0): Not using default mode "960x720" (doublescan mode not supported)
[   586.028] (II) intel(0): Not using default mode "700x525" (doublescan mode not supported)
[   586.028] (II) intel(0): Not using default mode "1024x768" (doublescan mode not supported)
[   586.028] (II) intel(0): Printing probed modes for output eDP1
[   586.028] (II) intel(0): Modeline "1366x768"x60.1   76.30  1366 1414 1446 1600  768 772 778 794 -hsync -vsync (47.7 kHz UeP)
[   586.028] (II) intel(0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz d)
[   586.028] (II) intel(0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz d)
[   586.028] (II) intel(0): Modeline "800x600"x56.2   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz d)
[   586.028] (II) intel(0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz d)
[   586.033] (II) intel(0): EDID for output HDMI1
[   586.033] (II) intel(0): Output eDP1 connected
[   586.033] (II) intel(0): Output HDMI1 disconnected
[   586.033] (II) intel(0): Using user preference for initial modes
[   586.033] (II) intel(0): Output eDP1 using initial mode 1366x768 +0+0
[   586.033] (II) intel(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
[   586.033] (II) intel(0): Kernel page flipping support detected, enabling
[   586.033] (==) intel(0): DPI set to (96, 96)
[   586.033] (II) Loading sub module "fb"
[   586.033] (II) LoadModule: "fb"
[   586.034] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[   586.037] (II) Module fb: vendor="X.Org Foundation"
[   586.037]     compiled for 1.18.4, module version = 1.0.0
[   586.037]     ABI class: X.Org ANSI C Emulation, version 0.4
[   586.037] (II) Loading sub module "dri2"
[   586.037] (II) LoadModule: "dri2"
[   586.037] (II) Module "dri2" already built-in
[   586.037] (==) Depth 24 pixmap format is 32 bpp
[   586.037] (II) intel(0): Allocated new frame buffer 1366x768 stride 5632, tiled
[   586.042] (II) UXA(0): Driver registered support for the following operations:
[   586.042] (II)         solid
[   586.042] (II)         copy
[   586.042] (II)         put_image
[   586.042] (II)         get_image
[   586.043] (II) intel(0): [DRI2] Setup complete
[   586.043] (II) intel(0): [DRI2]   DRI driver: i965
[   586.043] (II) intel(0): [DRI2]   VDPAU driver: va_gl
[   586.043] (==) intel(0): Backing store enabled
[   586.044] (==) intel(0): Silken mouse enabled
[   586.045] (II) intel(0): Initializing HW Cursor
[   586.045] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[   586.046] (**) intel(0): DPMS enabled
[   586.047] (==) intel(0): Intel XvMC decoder enabled
[   586.047] (WW) intel(0): Disabling Xv because no adaptors could be initialized.
[   586.047] (II) intel(0): DRI2: Enabled
[   586.047] (II) intel(0): DRI3: Disabled
[   586.071] (--) RandR disabled
[   586.113] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[   586.113] (II) AIGLX: enabled GLX_ARB_create_context
[   586.113] (II) AIGLX: enabled GLX_ARB_create_context_profile
[   586.113] (II) AIGLX: enabled GLX_EXT_create_context_es{,2}_profile
[   586.113] (II) AIGLX: enabled GLX_INTEL_swap_event
[   586.113] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[   586.113] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[   586.113] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[   586.113] (II) AIGLX: enabled GLX_EXT_fbconfig_packed_float
[   586.113] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[   586.113] (II) AIGLX: enabled GLX_ARB_create_context_robustness
[   586.113] (II) AIGLX: Loaded and initialized i965
[   586.113] (II) GLX: Initialized DRI2 GL provider for screen 0
[   586.114] (II) intel(0): Setting screen physical size to 361 x 203
[   586.218] (II) Using input driver 'evdev' for 'Touchscreen0'
[   586.218] (**) Option "SendCoreEvents"
[   586.218] (**) Touchscreen0: always reports core events
[   586.218] (**) evdev: Touchscreen0: Device: "/dev/input/event4"
[   586.274] (--) evdev: Touchscreen0: Vendor 0xeef Product 0xc07a
[   586.274] (--) evdev: Touchscreen0: Found absolute axes
[   586.274] (--) evdev: Touchscreen0: Found absolute multitouch axes
[   586.274] (II) evdev: Touchscreen0: No buttons found, faking one.
[   586.274] (--) evdev: Touchscreen0: Found x and y absolute axes
[   586.274] (--) evdev: Touchscreen0: Found absolute touchscreen
[   586.274] (II) evdev: Touchscreen0: Configuring as touchscreen
[   586.274] (**) evdev: Touchscreen0: YAxisMapping: buttons 4 and 5
[   586.274] (**) evdev: Touchscreen0: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[   586.274] (II) XINPUT: Adding extended input device "Touchscreen0" (type: TOUCHSCREEN, id 6)
[   586.274] (II) evdev: Touchscreen0: initialized for absolute axes.
[   586.274] (**) Touchscreen0: (accel) keeping acceleration scheme 1
[   586.274] (**) Touchscreen0: (accel) acceleration profile 0
[   586.274] (**) Touchscreen0: (accel) acceleration factor: 2.000
[   586.274] (**) Touchscreen0: (accel) acceleration threshold: 4
[   586.275] (WW) fcntl(9, F_SETOWN): Invalid argument
[   586.275] (II) config/devd: probing input devices...
[   586.275] (II) config/devd: adding input device (null) (/dev/kbdmux)
[   586.275] (II) LoadModule: "kbd"
[   586.275] (II) Loading /usr/local/lib/xorg/modules/input/kbd_drv.so
[   586.275] (II) Module kbd: vendor="X.Org Foundation"
[   586.275]     compiled for 1.18.4, module version = 1.9.0
[   586.275]     Module class: X.Org XInput Driver
[   586.276]     ABI class: X.Org XInput driver, version 22.1
[   586.276] (II) Using input driver 'kbd' for 'kbdmux'
[   586.276] (**) kbdmux: always reports core events
[   586.276] (**) kbdmux: always reports core events
[   586.276] (**) Option "Protocol" "standard"
[   586.276] (**) Option "XkbRules" "base"
[   586.276] (**) Option "XkbModel" "pc105"
[   586.276] (**) Option "XkbLayout" "us"
[   586.276] (**) Option "config_info" "devd:kbdmux"
[   586.276] (II) XINPUT: Adding extended input device "kbdmux" (type: KEYBOARD, id 7)
[   586.341] (II) config/devd: kbdmux is enabled, ignoring device atkbd0
[   586.341] (II) config/devd: adding input device (null) (/dev/sysmouse)
[   586.342] (II) LoadModule: "mouse"
[   586.342] (II) Loading /usr/local/lib/xorg/modules/input/mouse_drv.so
[   586.343] (II) Module mouse: vendor="X.Org Foundation"
[   586.343]     compiled for 1.18.4, module version = 1.9.3
[   586.343]     Module class: X.Org XInput Driver
[   586.343]     ABI class: X.Org XInput driver, version 22.1
[   586.343] (II) Using input driver 'mouse' for 'sysmouse'
[   586.343] (**) sysmouse: always reports core events
[   586.343] (**) Option "Device" "/dev/sysmouse"
[   586.343] (==) sysmouse: Protocol: "Auto"
[   586.343] (**) sysmouse: always reports core events
[   586.343] (==) sysmouse: Emulate3Buttons, Emulate3Timeout: 50
[   586.343] (**) sysmouse: ZAxisMapping: buttons 4 and 5
[   586.343] (**) sysmouse: Buttons: 5
[   586.343] (**) Option "config_info" "devd:sysmouse"
[   586.343] (II) XINPUT: Adding extended input device "sysmouse" (type: MOUSE, id 8)
[   586.343] (**) sysmouse: (accel) keeping acceleration scheme 1
[   586.343] (**) sysmouse: (accel) acceleration profile 0
[   586.343] (**) sysmouse: (accel) acceleration factor: 2.000
[   586.343] (**) sysmouse: (accel) acceleration threshold: 4
[   586.343] (II) sysmouse: SetupAuto: hw.iftype is 4, hw.model is 0
[   586.343] (II) sysmouse: SetupAuto: protocol is SysMouse
[   586.343] (II) config/devd: device /dev/psm0 already opened
[   623.545] (II) AIGLX: Suspending AIGLX clients for VT switch
[   636.205] (II) AIGLX: Resuming AIGLX clients after VT switch
[   636.254] (II) intel(0): EDID vendor "AUO", prod id 20572
[   636.254] (II) intel(0): Printing DDC gathered Modelines:
[   636.254] (II) intel(0): Modeline "1366x768"x0.0   76.30  1366 1414 1446 1600  768 772 778 794 -hsync -vsync (47.7 kHz eP)
[   636.270] (EE) evdev: Touchscreen0: Unable to open evdev device "/dev/input/event4" (No such file or directory).
[   636.270] [dix] couldn't enable device 6
[   636.302] (II) config/devd: ignoring device uhub0
[   637.253] (II) config/devd: ignoring device uhub1
 
I've tries to put webcamd -d command into rc.resume, as the very first line. But still not solving the problem.
 
I just find the solution but I cannot see why. After lots lots of tries, I find that I actually don't have to modify anything, just ctrl + alt + F<n> to switch to any of the vt, and close the lip. When resume back, ctrl + alt + F9 to switch back to X. Touchscreen will still be working... I spend like 5 days trying to figure this out ... 😅
 
Back
Top