Can't get webcam to work (Pixart, works with VLC on Manjaro)

EDIT: Sorry about the font/formatting, no idea what's going on there!

Camera model

PCLINE P03GWKT09 / 093a:262a Pixart Imaging, Inc.

What is the problem?

The camera works fine plugged directly into my Manjaro laptop and opens in VLC. Plugged into my RPi Zero 2 however, it is detected but doesn't work.

ipadress/webcam/?action=stream and ipadress/webcam/?action=snapshot both give the webpage starting "The webcam server is currently not running".

What did you already try to solve it?

Changed various options in octopi.txt camera_usb_options. The camera doesn't support -f and fails with and without -y. I have tried -r VGA and -r 640x480 (this is the cameras only resolution).

pi@octopi:~ $ lsusb

Bus 001 Device 003: ID 093a:262a Pixart Imaging, Inc.
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@octopi:~ $

pi@octopi:~ $ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture

[0]: 'PJPG' (GSPCA PJPG, compressed)
	Size: Discrete 640x480

pi@octopi:~ $

pi@octopi:~ $ v4l2-ctl --all
Driver Info:
Driver name : gspca_pac7302
Card type : USB Camera (093a:262a)
Bus info : usb-3f980000.usb-1.4
Driver version : 5.10.63
Capabilities : 0x85200001
Video Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05200001
Video Capture
Read/Write
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (gspca_pac7302: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'PJPG' (GSPCA PJPG)
Field : None
Bytes per Line : 640
Size Image : 115790
Colorspace : JPEG
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Streaming Parameters Video Capture:
Frames per second: invalid (0/0)
Read buffers : 2

User Controls
brightness 0x00980900 (int) : min=0 max=32 step=1 default=16 value=16 flags=slider
contrast 0x00980901 (int) : min=0 max=255 step=1 default=127 value=127 flags=slider
saturation 0x00980902 (int) : min=0 max=255 step=1 default=127 value=127 flags=slider
red_balance 0x0098090e (int) : min=0 max=200 step=1 default=100 value=100 flags=slider
blue_balance 0x0098090f (int) : min=0 max=200 step=1 default=100 value=100 flags=slider
exposure 0x00980911 (int) : min=0 max=1023 step=1 default=66 value=66 flags=inactive
gain_automatic 0x00980912 (bool) : default=1 value=1 flags=update
gain 0x00980913 (int) : min=0 max=62 step=1 default=15 value=15 flags=inactive
horizontal_flip 0x00980914 (bool) : default=0 value=0
vertical_flip 0x00980915 (bool) : default=0 value=0
white_balance_temperature 0x0098091a (int) : min=0 max=255 step=1 default=55 value=55
sharpness 0x0098091b (int) : min=0 max=15 step=1 default=8 value=8 flags=slider
pi@octopi:~ $

pi@octopi:~ ps -ax|grep mjpg 10876 pts/0 S+ 0:00 grep --color=auto mjpg pi@octopi:~

pi@octopi:~ ps -ax|grep webcam 11890 pts/0 S+ 0:00 grep --color=auto webcam pi@octopi:~

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)

Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file:      /boot/octopi.txt
camera:        usb
usb options:   -r 640x480
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
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jan  5 13:37:27 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 -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: Could not obtain the requested pixelformat: MJPG , driver gave us: RGB3
    ... will try to handle this by checking against supported formats. 
    ... Falling back to RGB24 mode (consider using -fourcc RGB24 option). Note that this requires much more CPU power
Unable to map buffer: Invalid argument
Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
Done bring up all configured video device

Goodbye...
Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file:      /boot/octopi.txt
camera:        usb
usb options:   -r 640x480 -y
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
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jan  5 13:50:42 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 -y -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: YUYV
 i: JPEG Quality......: 80
 i: TV-Norm...........: DEFAULT
 i: Could not obtain the requested pixelformat: YUYV , driver gave us: RGB3
    ... will try to handle this by checking against supported formats. 
    ... Falling back to RGB24 mode (consider using -fourcc RGB24 option). Note that this requires much more CPU power
Unable to map buffer: Invalid argument
Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
Done bring up all configured video device

Goodbye...
Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file:      /boot/octopi.txt
camera:        usb
usb options:   -r VGA -f 1 -y
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
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jan  6 10:26:59 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 VGA -f 1 -y -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 1
 i: Format............: YUYV
 i: JPEG Quality......: 80
 i: TV-Norm...........: DEFAULT
 i: Could not obtain the requested pixelformat: YUYV , driver gave us: RGB3
    ... will try to handle this by checking against supported formats. 
    ... Falling back to RGB24 mode (consider using -fourcc RGB24 option). Note that this requires much more CPU power
Setting FPS on the capture device is not supported, fallback to software framedropping
: Invalid argument
 i: Frame period time ......: 1000 ms
Unable to map buffer: Invalid argument
Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
Done bring up all configured video device

Goodbye...
Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file:      /boot/octopi.txt
camera:        usb
usb options:   -r VGA
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
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jan  6 11:01:00 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 VGA -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: Could not obtain the requested pixelformat: MJPG , driver gave us: RGB3
    ... will try to handle this by checking against supported formats. 
    ... Falling back to RGB24 mode (consider using -fourcc RGB24 option). Note that this requires much more CPU power
Unable to map buffer: Invalid argument
Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
Done bring up all configured video device

Goodbye...
Starting up webcamDaemon...

--- Configuration: ----------------------------
cfg_file:      /boot/octopi.txt
camera:        usb
usb options:   -y
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
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jan  6 12:36:43 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 -y -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: YUYV
 i: JPEG Quality......: 80
 i: TV-Norm...........: DEFAULT
 i: Could not obtain the requested pixelformat: YUYV , driver gave us: RGB3
    ... will try to handle this by checking against supported formats. 
    ... Falling back to RGB24 mode (consider using -fourcc RGB24 option). Note that this requires much more CPU power
Unable to map buffer: Invalid argument
Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
Done bring up all configured video device

Goodbye...

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

Freshly installed stable version using the Raspberry Pi Imager tool yesterday, OctoPrint 1.7.2, Python 3.7.3, OctoPi 0.18.0

I have also ran sudo apt-get update --fix-missing and sudo apt-get upgrade, rebooted and no change.

My experience with Linux in general is not great so please go easy on me. :slight_smile:

If this is all that was reported by the camera when you ran that command, then it is likely not supported. I can't see anywhere that mjpg streamer supports PJPG mode. This was the only thing I could find that had useful information about trying to hack it into working, through using gstreamer as well.

Issues Β· jacksonliam/mjpg-streamer (github.com)