Touch Display driver disables webcam

Camera model
Generic Webcam for Pi with dual IR

What is the problem?
I am a bit of a newbie to the Linux world, so please bear with me if my post is not very technical. I purchased the above webcam for my Pi. The Webcam works great with the default installation of Octopi. But I have a 3.5 LCD touch display. I wanted to install Octodash and thus needed to install the touch display drivers for the screen. But as soon as I install the display drivers it disables the webcam.

I have found that it is for sure that the installation of the drivers that break the webcam stream in octopi as it works as soon as I revert to a fresh installation. so I know that the cam is working.

the URL for on the webcam config is "/webcam/?action=stream"

What did you already try to solve it?
I have tried to update installation and have done a lot of reading online, but nothing that I read actually helped me solve this.

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
here is the Output from the webcamd.log. Seems (at least the way I understand it) like it is working properly.

--- Configuration: ----------------------------
cfg_file: /boot/octopi.txt
camera: auto
usb options: -r 640x480 -f 10
raspi options: -fps 10
http options: -w ./www-octopi -n --listen 127.0.0.1

Explicitly USB device:

Found video devices:
/dev/video0
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
/dev/video18
raspi
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Dec 2 23:56:30 root: Starting USB webcam
Checking for VL805 (Raspberry Pi 4)...

  • It seems that you don't have VL805 (Raspberry Pi 4).
    There should be no problems with USB (a.k.a. select() timeout)
    Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n --listen 127.0.0.1 -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
    MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
    Done bring up all configured video device

Goodbye...

i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 10
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
o: www-folder-path......: ./www-octopi/
o: HTTP TCP port........: 8080
o: HTTP Listen Address..: 127.0.0.1
o: username:password....: disabled
o: commands.............: disabled
Starting up webcamDaemon...

Additional information about your setup (OctoPrint version, OctoPi version, ...)

Octoprint 1.7.3
Python 3.7.7
Octopi 0.18.0

What touchscreen do you have and what is the process for installing the driver?

Hi. Thanks for replying. The touch display is branded "KeDei" 3.5inch touch display.

More details are here where Saper_2 had done a full review of the unit. You can get the pics from there and more technical details are available.

[Review] KeDei 3.5" HDMI display with touch for Raspberry Pi - Raspberry Pi Forums

I installed it via a bash script called "LCD35_hdmi". I have listed content of the bash script also below.

#sudo dpkg -i -B xserver-xorg-input-evdev_2.10.5-1_armhf.deb
sudo apt-get install xserver-xorg-input-evdev

sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf

sudo cp ./boot/35hdmi_config.txt /boot/config.txt

sudo cp -rf ./usr/35hdmi_99-calibration.conf /usr/share/X11/xorg.conf.d/99-calibration.conf

sudo apt-mark hold raspberrypi-bootloader
sudo reboot

And here is the content of my Config.txt file as well in the /boot folder.

For more options and information see

Raspberry Pi Documentation - Configuration

Some settings may impact device functionality. See link above for details

uncomment if you get no picture on HDMI for a default "safe" mode

#hdmi_safe=1

uncomment this if your display has a black border of unused pixels visible

and your display can output without overscan

#disable_overscan=1

uncomment the following to adjust overscan. Use positive numbers if console

goes off screen, and negative if there is too much border

#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

uncomment to force a console size. By default it will be display's size minus

overscan.

#framebuffer_width=1280
#framebuffer_height=720

uncomment if hdmi display is not detected and composite is being output

#hdmi_force_hotplug=1

uncomment to force a specific HDMI mode (this will force VGA)

#hdmi_group=1
#hdmi_mode=1

uncomment to force a HDMI mode rather than DVI. This can make audio work in

DMT (computer monitor) modes

hdmi_drive=2

uncomment to increase signal to HDMI, if you have interference, blanking, or

no display

#config_hdmi_boost=4

uncomment for composite PAL

#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

Uncomment some or all of these to enable the optional hardware interfaces

#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

Uncomment this to enable the lirc-rpi module

#dtoverlay=lirc-rpi

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

dtparam=audio=on

dtoverlay=ads7846,cs=0,penirq=25,penirq_pull=2,speed=10000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=199,xmax=3999,ymin=199,ymax=3999

[all]
#dtoverlay=vc4-fkms-v3d
max_usb_current=1
hdmi_force_hotplug=1
config_hdmi_boost=7
hdmi_drive=2
hdmi_group=2
hdmi_mode=87
hdmi_cvt 480 320 60 6 0 0 0

[pi4]

Enable DRM VC4 V3D driver on top of the dispmanx display stack

#dtoverlay=vc4-fkms-v3d
#max_framebuffers=2
hdmi_timings=600 0 20 28 48 400 0 13 3 32 0 0 0 30 0 25000000 5

Hope this helps.

Thanks again!

You mentioned a 'generic webcam with dual IR' - that sounds like a raspicam, ie one that connects via the ribbon cable.

If so, have you tried running sudo raspi-config and enabling the camera again after installing the 'driver?'

From the looks of it, that installation script is replacing the current config.txt with its own, which is going to overwrite any customizations that were there.

After that, vcgencmd get_camera should return 1 for both supported and detected.

HI, Yes, I did try to re-enable the Webcam, and I think you are correct. it should be the Raspicam with NoIR. The vcgencmd get_camera results in below:

supported=0 detected=0

the command:
raspistill -o Desktop/image.jpeg

results:

mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

Hi,
I just solved this myself. Its a problem with Xorg and the Driver. You have to load the touch drivers generic. The manufactures compilations seem to be not maintained.

I followed this to load the screen resolution and generic drivers. Then had to deviate because the Xorg issues.

https://forums.raspberrypi.com/viewtopic.php?p=1120534#p1120534

I did the screen resolution in SSH then switch to a keyboard plugged into the screen/pi combo.

8.1 You do not need to start with a new image. Especially not Jessie.

8.2/8.3.
I did end-up loading the desktop, you probably don't need to because you will still be missing some Xorg modules. I figured out what they were from error messages and how to install by googling. Something like this thingy couldn't be found. You do an install of that Xorg module. Eventually you'll be able to load the touch driver and calibrate.

First install evdev, google it. I think it was as simple as:
sudo apt-get install xserver-xorg-input-evdev
Then there is a load order problem. Something to do with evdev and libinput.conf load order. Evdev must be a higher number when running.

#run:
cd /usr/share/X11/xorg.conf.d
ls
#Confirm that libinput.conf is 40-, Mine said ..."10-evdev.conf"... ..."40-libinput.conf". if not tweak the command below so that evdev>libinput
#then
sudo mv 10-evdev.conf 45-evdev.conf

To run the calibration from command line:
DISPLAY=:0.0 xinput_calibrator

8.3 Until you get the axis correct, the calibration is useless. You'll get wild huge numbers that aren't close to below. Mine is below, but there is also a InvertX option. There are also transformation matrix out there for rotations. I figured out from touching the screen and watching the response area to determine what was necessary. Then the calibration values became reasonable.

To run the calibration from command line:

DISPLAY=:0.0 xinput_calibrator


Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "127 3967 216 3810"
        Option  "SwapAxes"      "1"
        Option "InvertY"            "1"
EndSection
1 Like

Hi Mate, thanks for the pointers.

Can I check if this was for the screen display drivers or fixing the issue with the webcam not working? steps seem to point to getting the display to work. I will test these out tonight and confirm if they worked.
Thanks!