[xubuntu-users] USB camera being intercepted?

Peter Flynn peter at silmaril.ie
Sun Nov 29 15:40:54 UTC 2015

On 29/11/15 14:18, Petter Adsen wrote:
> On Sat, 28 Nov 2015 23:00:35 +0000 Peter Flynn <peter at silmaril.ie> wrote:
>> So if I wanted to download whatever is in its memory (old pix which I
>> assume I have elsewhere :-) it looks like I need to find out how to
>> disable gspca_main first. Lots of old web pages about how to do this,
>> none of which work nowadays (like adding it
>> to /etc/modprobe.d/blacklist).
> But that *does* work. Create a file in /etc/modprobe.d with a name like
> 'blacklist-spca.conf' (you need the .conf extension),

The only documentation I could find referred explicitly to
/etc/modprobe.d/blacklist with no mention of .conf

> with the full
> name of the kernel module on a line by itself as the only contents.
> Reboot, and it should no longer be loaded. 

I created /etc/modprobe.d/blacklist-spca.conf containing gspca_main
but when I rebooted, and plugged in the camera, syslog showed it still
fired up gspca_main and grabbed it.

Then I noticed that /etc/modprobe.d/blacklist.conf has a long list of
commented drivers that they don't want loaded, so I added gspca_main,
but when I rebooted and plugged the camera in, it still showed in syslog as

>> Nov 29 15:13:02 noah kernel: [  141.947245] gspca_main:
spca500-2.14.0 probing 040a:0300

So the simple answer is that adding it to the blacklists in this way
does NOT work. Maybe I'm doing it wrong...

Running Digikam got the same "cannot access device" message as before,
but also added this to syslog:

> Nov 29 15:14:04 noah kernel: [ 203.523831] usb 6-1: usbfs: interface 0 claimed by usbfs while 'Digikam::Camera' sets config #0
> Nov 29 15:14:13 noah kernel: [ 212.936122] usb 6-1: USB disconnect, device number 4
> Nov 29 15:14:13 noah colord-sane: io/hpmud/musb.c 2093: Invalid usb_open: Permission denied

It sounds like usbfs simply won't relinquish interface 0 even though
Digikam has requested it.

> Then run 'lsblk' to see if
> it shows up as a block device you can mount.


> You can also use 'rmmod' to remove the module from the running kernel
> to avoid a reboot.

Before doing that I tried

>> # modprobe -r gspca_main
>> libkmod: ERROR ../libkmod/libkmod-config.c:635 kmod_config_parse: /etc/modprobe.d/blacklist-spca.conf line 1: ignoring bad line starting with 'gspca_main'
>> modprobe: FATAL: Module gspca_main is in use.

Looks like it needs the keyword 'blacklist' before the name of the
module, so I added it and rebooted. No effect, gspca_main sill fires up
when I plug in the camera.

In any event, modprobe -r won't remove a module it believes is in use.
Ditto rmmod (ERROR: Module gspca_main is in use by: gspca_spca500).

>> # rmmod -f gspca_main
>> rmmod: ERROR: ../libkmod/libkmod-module.c:793 kmod_module_remove_module() could not remove 'gspca_main': Resource temporarily unavailable
>> rmmod: ERROR: could not remove module gspca_main: Resource temporarily unavailable

This is worse; first it says it's in use, then it says it's not available.

> NOTE: It is entirely possible that this module is the only way for
> Linux to communicate with the camera, 

It must be able to see the camera as a USB device...it used to be able
to, a few generations of Linux ago. There is no good reason why it
should not still be able to, but it seems to be convinced that hijacking
the interface is a good idea, which it's really not.

> so if you blacklist it you might not be able to use it at all. 

At this stage I know how to make it work as a webcam; I'm just curious
to know why the default configuration of Linux thinks this is the only
use for a camera. In the longer term this is moot, but it looks like
some very poor interaction design.

> If that is the case, just remove the file you created above.


On a wider stage, the purpose of kernel modules is to *enable* specific
behaviours, not to sequester devices and make them unusable by other
processes. If this is a deliberate design decision, then it's probably A
Bad Idea and should be reversed.



More information about the xubuntu-users mailing list