LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   webcams not working (http://www.linuxquestions.org/questions/slackware-14/webcams-not-working-4175471061/)

waddles 07-26-2013 05:38 PM

webcams not working
 
I had a Microdia PC Camera (0c45:60fc) working back under Slackware 11.0 but since could not get it to work. So I purchased a Logitech c270 the other day. Now this one won't work. I have seen numerous statements that it "works out of the box" with Slack which means it must be using SN9C102. I am running 13.37 with Xfce window manager. I read that this command would find if all was well:
mplayer -v tv:// -tv device=/dev/video0:driver=v4l2
I use mplayer to display DVDs etc. So mplayer is working. In the listing below for this command there are several defaults taken and the codec for -vo (which is not specified) seems none the less to be unable video format.
Code:

MPlayer 20101218-4.5.1 (C) 2000-2010 MPlayer Team
CPU vendor name: AuthenticAMD  max cpuid level: 1
CPU: AMD Athlon(tm) XP 2200+ (Family: 6, Model: 8, Stepping: 0)
extended cpuid-level: 8
extended cache-info: 16810304
Detected cache-line size is 64 bytes
Testing OS support for SSE... yes.
Tests of OS support for SSE passed.
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNowExt: 1 SSE: 1 SSE2: 0 SSSE3: 0
Compiled with runtime CPU detection.
get_path('codecs.conf') -> '/home/auser/.mplayer/codecs.conf'
Reading /home/auser/.mplayer/codecs.conf: Can't open '/home/auser/.mplayer/codecs.conf': No such file or directory
Reading /etc/mplayer/codecs.conf: Can't open '/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> '/home/auser/.mplayer/fonts'
Configuration: --prefix=/usr --mandir=/usr/man --confdir=/etc/mplayer --enable-gui --enable-menu --enable-largefiles --disable-arts --codecsdir=/usr/lib/codecs --language=en nl fr de es --enable-runtime-cpudetection --disable-libdvdcss-internal --disable-mp3lame --disable-mp3lame-lavc --disable-faac --disable-faac-lavc --disable-libopencore_amrnb --disable-libopencore_amrwb
CommandLine: '-v' 'tv://' '-tv' 'device=/dev/video0:driver=v4l2'
Using nanosleep() timing
get_path('input.conf') -> '/home/auser/.mplayer/input.conf'
Can't open input config file /home/auser/.mplayer/input.conf: No such file or directory
Can't open input config file /etc/mplayer/input.conf: No such file or directory
Falling back on default (hardcoded) input config
get_path('.conf') -> '/home/auser/.mplayer/.conf'

Playing tv://.
get_path('sub/') -> '/home/auser/.mplayer/sub/'
STREAM: [tv] tv://
STREAM: Description: TV Input
STREAM: Author: Benjamin Zores, Albeu
STREAM: Comment:
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: SN9C1xx PC Camera
 Capabilities:  video capture  read/write  streaming
 supported norms:
 inputs: 0 = Camera;
 Current input: 0
 Format unknown (0x31384142) ( 0 bits, bayer rgb): Unknown 0x31384142
 Format unknown (0x4745504a) ( 0 bits, JPEG): Unknown 0x4745504a
 Current format: unknown (0x31384142)
v4l2: set format: YVU420
v4l2: set input: 0
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
Selected norm : pal
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
==> Found video stream: 0
v4l2: get format: unknown (0x31384142)
v4l2: Cannot get fps
v4l2: get width: 640
v4l2: get height: 480
Using a ring buffer for maximum 2 frames, 0 MB total size.
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
[V] filefmt:9  fourcc:0x31384142  size:640x480  fps:25.000  ftime:=0.0400
get_path('sub/') -> '/home/auser/.mplayer/sub/'
v4l2: going to capture
X11 opening display: :0.0
vo: X11 color mask:  FFFFFF  (R:FF0000 G:FF00 B:FF)
vo: X11 running at 800x600 with depth 24 and 32 bpp (":0.0" => local display)
[x11] Detected wm supports layers.
[x11] Using workaround for Metacity bugs.
[x11] Detected wm supports NetWM.
[x11] Detected wm supports ABOVE state.
[x11] Detected wm supports BELOW state.
[x11] Detected wm supports FULLSCREEN state.
[x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms
[VO_XV] Using Xv Adapter #0 (NV Video Blitter)
[xv common] Drawing no colorkey.
[xv common] Maximum source image dimensions: 2046x2046
==========================================================================
Cannot find codec matching selected -vo and video format 0x31384142.
==========================================================================

v4l2: select timeout
v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 1 frames dropped.
v4l2: up to 0 video frames buffered.
vo: uninit ...

Exiting... (End of file)

Please help! I have spent so much time trying to get any webcam to work.

guanx 07-26-2013 07:04 PM

Can you try a more recent MPlayer version ( e.g. MPlayer-1.1.1 )?

waddles 07-27-2013 02:59 AM

That is a possibility but since others have made the c270 work "out of the box" I see no justification. I may try using cheese first.

Correction: cheese is not working under xfce as I see when I went to check. Apparently it takes a picture(s) then locks up but not so under Gnome.

willysr 07-27-2013 03:43 AM

try using guvcview to test out your webcam under linux

waddles 07-27-2013 04:11 AM

Thnx willysr. I had seen guvcview referenced and will do.
I had considered uvc driver as it specifically supports the c270 but appears to be a pain to install and fiddle with. Will let U know how it goes.

H_TeXMeX_H 07-27-2013 04:46 AM

The Microdia camera is supported by the:
http://mxhaard.free.fr/spca5xx.html
drivers.
The Logitech by the:
http://www.ideasonboard.org/uvc/
drivers.

The uvc driver is by far the easiest to install and use. I use it for all my webcams and it works perfectly. I don't use the gspca drivers, because I don't have old webcams.

waddles 07-27-2013 06:12 AM

Good info!! for Microdia. Please explain if U can why I had been told the driver was sn9c105 but was included in sn9c102 but the former is a bridge (what does that mean?) and the latter is a driver pulled down via modprobe. Where does one get a driver like spca5xx/LE?
U say the uvc driver is easy to download and install. Can U elaborate more (what/where) or point me to where that is described? My reading (UR uvc reference) of it made it seem way convoluted, maybe its too much info. Also I noted that it does not support single pictures.
Is the uvc driver needed for the guvcview program? It would seem so.
I am having a H... of a time trying to download guvcview cuz it always finishes with a low byte count. The action of getting the download (SourceForge) is also questionable as it repeatedly asks for a download, sometimes after I OK the confirmation response. That causes multiple images too, all short.

willysr 07-27-2013 06:43 AM

probably you are using a slow mirror. You might change to another mirror

H_TeXMeX_H 07-27-2013 07:34 AM

You can build uvc within the kernel itself. guvcview does require uvc.

kkady32 07-27-2013 08:10 AM

i have a uvc webcam and mplayer (in current) work for me with this command:
Code:

mplayer tv:// -tv driver=v4l2 :width=352:height=288:device=/dev/video0

waddles 07-28-2013 05:13 PM

For Willysr: tried US, Canadian, and direct with much the same result.
Will try again later.
The mplayer command cannot have a space after v4l2 but with that removed I got this:
Code:

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: SN9C1xx PC Camera
 Capabilities:  video capture  read/write  streaming
 supported norms:
 inputs: 0 = Camera;
 Current input: 0
 Current format: unknown (0x31384142)
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: Cannot get fps
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
==========================================================================
Cannot find codec matching selected -vo and video format 0x31384142.
==========================================================================

v4l2: select timeout
v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 1 frames dropped.

Exiting... (End of file)

Does anyone see what is wrong on my system then?

H_TeXMeX_H 07-29-2013 02:54 AM

Try using the v4l driver instead of v4l2. You can also try Alien Bob's gspca package:
http://www.slackware.com/~alien/slackbuilds/gspcav1/

number22 07-29-2013 11:55 AM

check your files: go to your /usr/lib/libv4l directory (32 bit) or /usr/lib64/libv4l/ looking for v4l2convert.so (part of v4l-utils package).

add LD_PRELOAD before your mplayer command, example:
Code:

LD_PRELOAD=/usr/lib64/libv4l/v4l2convert.so mplayer tv:// -tv driver=v4l2:device=/dev/video0

waddles 07-30-2013 01:47 AM

Number 22 tried the command U suggested. Still nothing affirmative. Output follows:
Code:

Playing tv://.
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: SN9C1xx PC Camera
 Capabilities:  video capture  read/write  streaming
 supported norms:
 inputs: 0 = Camera;
 Current input: 0
 Current format: unknown (0x31384142)
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: Cannot get fps
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
==========================================================================
Cannot find codec matching selected -vo and video format 0x31384142.
==========================================================================

v4l2: select timeout
v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 1 frames dropped.

Exiting... (End of file)

I have found that "Cannot find...video format 0x31384142." in almost every command I have tried. Any idea what it is telling me? I have forgotten where the codecs are stored I vaguely remember tracing codecs thinking I had somehow omitted them an the install but by recall I think I always found them.
H_TeXMeX_H, have tried the v4l before with no better/worse results. I believe the Microdia requires v4l2.
I have the following:/usr/src/linux-2.6.37.6/drivers/media/video/gspca
/usr/src/linux-2.6.37.6/include/config/usb/gspca
/lib/modules/2.6.37.6-smp/kernel/drivers/media/video/gspca
/lib/modules/2.6.37.6/kernel/drivers/media/video/gspca
I recall downloading them awhile back. Again, recall, but think that what I did to test was to remove the sn9c102 (at least) then mod-probed in the gspca and one other module which escapes me at the moment. Those tests were equally dismal.
From version 11.0 and/or 12.0 I had a horrible time until I discovered a way to force a change in device assignments. The BTTV stuff would grab the wrong device and the camera would fail. I cannot find in /proc where the devices are shown and maybe with 13.37 this is unnecessary. I thought I had found it once but cannot find my notes on it.
Have I messed up a dependency by not including the TeX in the install 2 yrs ago? I never use it and have not had a problem (that I knew of) by omitting it that I could not resolve that was attributable to it.
Is there a way to validate dependency omissions within Slackware? That would be a great little script. Or is there a list of dependencies?
When I tried tracking down the Microdia problem last time, my last thinking that there was a problem in the device assignments between it and bttv with video devices 1 & 2 being somehow switched but was not able to confirm it. FWIW

textillis 07-30-2013 02:13 AM

Quote:

Originally Posted by kkady32 (Post 4997816)
i have a uvc webcam and mplayer (in current) work for me with this command:
Code:

mplayer tv:// -tv driver=v4l2 :width=352:height=288:device=/dev/video0

Would this code work if I were to try it with vlc rather than mplayer?
You see, I have the same problem as original poster but I have vlc installed with all codes, not so with mplayer.

Edit: I have a microsoft LifeCam3000. Your code works for me, just as it is; though it wasn't intended for me: i thank you anyway.
But i will still need a program with which to run it for skype and for taking snaps or for piping the video output to a recipient or to a recording file, no? I mean, as it is, the code you shared will get a basic screen with the cam running, but that is it: no menus, no options etc


All times are GMT -5. The time now is 10:41 AM.