You are not logged in.

#1 2021-01-22 11:09:09

manouchk
Member
Registered: 2008-07-29
Posts: 306

[solved] webcam logitech Quickcam 4000: missing memory

I made recently an update that coincided with a problem with my webcam that stopped working here. The webcam is a logitech Quickcam 4000 pro The archlinux was old (25th may 2020) before update.

For example xawtv gives this messages and the video is black:

[manu@manulemalin ~]$ LANG=C xawtv

This is xawtv-3.107, running on Linux/x86_64 (5.10.8-arch1-1)
xinerama 0: 1920x1080+0+0
vid-open-auto: using grabber/webcam device /dev/video0
Alsa devices: cap: hw:1,0 (/dev/video0), out: default
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
libv4l2: error turning on stream: No space left on device
ioctl: VIDIOC_STREAMON(int=1): No space left on device
libv4l2: error dequeuing buf: Invalid argument
ioctl: VIDIOC_DQBUF(index=0;type=VIDEO_CAPTURE;bytesused=0;flags=0x0 [];field=ANY;;timecode.type=0;timecode.flags=0;timecode.frames=0;timecode.seconds=0;timecode.minutes=0;timecode.hours=0;timecode.userbits="";sequence=0;memory=MMAP): Invalid argument
libv4l2: error turning on stream: Cannot allocate memory
ioctl: VIDIOC_STREAMON(int=1): Cannot allocate memory

I don't see any missing space:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             3.9G     0  3.9G   0% /dev
run             3.9G  1.2M  3.9G   1% /run
/dev/sda3       450G  398G   29G  94% /
tmpfs           3.9G  136K  3.9G   1% /dev/shm
tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup
tmpfs           3.9G  460K  3.9G   1% /tmp
/dev/sda1       511M  2.2M  509M   1% /boot/efi
tmpfs           785M   32K  785M   1% /run/user/1000
/dev/sdb1       932G  489G  444G  53% /run/media/manu/HDGOFLEX

In the last update, kernel was updated from 5.6.11.arch1-1 -> 5.10.8.arch1-1

I could try to downgrade kernel (https://wiki.archlinux.org/index.php/do … the_kernel) to see if this caused the problem but I find thi quite risky. Any advice?



Webcam also fail in google meet on chromium which what I need for my daily use.

I red https://wiki.archlinux.org/index.php/webcam_setup but could not find anything relevant.

Last edited by manouchk (2021-03-12 19:41:03)

Offline

#2 2021-01-22 11:42:10

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] webcam logitech Quickcam 4000: missing memory

Well, I tried downgrading kernel:

sudo pacman -U linux-5.6.11.arch1-1-x86_64.pkg.tar.zst linux-headers-5.6.11.arch1-1-x86_64.pkg.tar.zst

And it worked. Webcam works fine but I'd like to be able to use the latest kenel.

Offline

#3 2021-02-01 01:44:43

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] webcam logitech Quickcam 4000: missing memory

Is this problem a kernel bug?

It seems that many other users have similar problem:
https://bugs.launchpad.net/ubuntu/+sour … ug/1881413

https://www.google.com/search?q=linux+k … 20&bih=958

Last edited by manouchk (2021-02-01 02:14:47)

Offline

#4 2021-03-12 19:40:21

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: [solved] webcam logitech Quickcam 4000: missing memory

It seems that it was related to a insufficient usb bandwidth. It was mounted on a usb hub. When plugged directly. Problem disappeared. THe error message was not very easy to interpret.

Offline

#5 2021-03-20 12:36:29

benzino_napoloni
Member
Registered: 2021-02-13
Posts: 1

Re: [solved] webcam logitech Quickcam 4000: missing memory

Hello manouchk,

I'm owning a Logitech Quickcam 4000 Pro too and have observed the same problem in the first releases of the Arch-kernel 5.10.x. My camera is not connected via a hub but directly to my PC.

After some research I've found out, that memory allocation for URB (USB request buffer) especially the DMA mapping of the allocated memory produces an error. You can see an entry like "... kernel: pwc: Failed to allocate urb buffer 0" in the system-log when the webcam starts streaming video data.

Meanwhile the problem disappeared in kernel 5.11 and even in the 5.10 release which is now "linux-lts". Maybe there has been a commit in the source-code of the USB-sub-system which has a correlation to the pwc-driver. But I don't know the exact reason!

Also I've created a patch of the file "pwc-if.c" which uses "usb_alloc_coherent" in the function "pwc_alloc_urb_buffer" instead of "kmalloc + dma_map_single" for allocating memory for URB which works well. But it seems that by reason of drawbacks in transfer speed on ARM-platforms kernel developers don't use it ( see https://github.com/torvalds/linux/commi … b1b3fe4347 ).

Anyway if you want to know more about the patch feel free to contact me, but my first advice is using a current version of the Arch-kernel.

Best regards!

Offline

Board footer

Powered by FluxBB