Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Webcam works for a while then stops.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Moult
Developer
Developer


Joined: 31 Mar 2008
Posts: 110
Location: Malaysia

PostPosted: Wed Nov 25, 2009 12:16 am    Post subject: Webcam works for a while then stops. Reply with quote

My webcam is built in and listed under lsusb as Bus 003 Device 002: ID 064e:a103 Suyin Corp. Acer/HP Integrated Webcam [CN0314]. It is listed as support on this page http://linux-uvc.berlios.de/ and therefore uses UVC. Running mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video1 -fps 15 will only show the webcam after a fresh boot. After a short while of showing video the screen will freeze (as in the video will stop) and trying to rerun the command will either result in:

1) A green screen
2) This error message:
Code:
MPlayer SVN-r29463-4.3.2 (C) 2000-2009 MPlayer Team

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: Acer Crystal Eye webcam
 Capabilites:  video capture  streaming
 supported norms:
 inputs: 0 = Camera 1;
 Current input: 0
 Current format: MJPEG
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
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: ioctl set mute failed: Invalid argument
Xlib:  extension "XFree86-VidModeExtension" missing on display ":1000.0".
[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run 'xvinfo' to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Unsupported PixelFormat -1
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
FPS forced to be 15.000  (ftime: 0.067).
Starting playback...
v4l2: select timeout ??% ??,?% 0 0
v4l2: select timeout ??% ??,?% 0 0
v4l2: select timeout ??% ??,?% 0 0
V:   0.0   8/  8 ??% ??% ??,?% 0 0

MPlayer interrupted by signal 2 in module: video_read_frame
v4l2: select timeout
v4l2: select timeout  0%  0.0% 0 0
v4l2: ioctl set mute failed: Invalid argument
v4l2: 1 frames successfully processed, 0 frames dropped.

3) This error message (more common):
Code:
MPlayer SVN-r29463-4.3.2 (C) 2000-2009 MPlayer Team

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: unable to open '/dev/video1': No such file or directory
v4l2: ioctl set mute failed: Bad file descriptor
v4l2: 0 frames successfully processed, 0 frames dropped.


After one of these errors occur it will never show any video again. Sometimes I can get it to show video again for a short while by changing from /dev/video0 to video1 or video2 (sometimes those files don't even exist) but it quickly goes to showing an error again. I can reboot and it will start working again - for a while until it starts showing errors again.

Note: using v4l doesn't work, only v4l2 does.

My kernel setup:
Code:
Device Drivers  --->
  Multimedia devices  --->
    <*> Video For Linux
    [ ]   Enable Video For Linux API 1 (DEPRECATED)
    [*]   Enable Video For Linux API 1 compatible Layer
    [*] Video capture adapters  --->
      [*]   V4L USB devices  --->
        <*>   USB Video Class (UVC)


Any ideas?
_________________
thinkMoult - blog and stuff
WIPUP - share your works-in-progress for long-term, ambitious projects.


Last edited by Moult on Sun Sep 26, 2010 2:24 am; edited 1 time in total
Back to top
View user's profile Send private message
Moult
Developer
Developer


Joined: 31 Mar 2008
Posts: 110
Location: Malaysia

PostPosted: Sun Dec 27, 2009 9:52 pm    Post subject: Reply with quote

Bumping thread. Don't see the point of making a new one and I've unfortunately made no progress on this one.
_________________
thinkMoult - blog and stuff
WIPUP - share your works-in-progress for long-term, ambitious projects.
Back to top
View user's profile Send private message
Moult
Developer
Developer


Joined: 31 Mar 2008
Posts: 110
Location: Malaysia

PostPosted: Wed Jul 07, 2010 5:22 pm    Post subject: Reply with quote

Bumpity bump.
_________________
thinkMoult - blog and stuff
WIPUP - share your works-in-progress for long-term, ambitious projects.
Back to top
View user's profile Send private message
Moult
Developer
Developer


Joined: 31 Mar 2008
Posts: 110
Location: Malaysia

PostPosted: Tue Aug 24, 2010 10:28 am    Post subject: Reply with quote

BumpbumpbumpbumpbumpBANG.
_________________
thinkMoult - blog and stuff
WIPUP - share your works-in-progress for long-term, ambitious projects.
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 1659
Location: Berlin, Germany

PostPosted: Mon Aug 30, 2010 4:31 pm    Post subject: Reply with quote

Pro tip: If you bump your thread, it will no longer be listed in the special "unanswered threads" search.

Please also post kernel .config.
Do you get the same issue when saving the video with mencoder instead of playback with mplayer?
Back to top
View user's profile Send private message
iss
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2006
Posts: 133
Location: Poland/Bydgoszcz

PostPosted: Mon Aug 30, 2010 7:54 pm    Post subject: Reply with quote

Also paste dmesg after webcam freeze.
Back to top
View user's profile Send private message
Moult
Developer
Developer


Joined: 31 Mar 2008
Posts: 110
Location: Malaysia

PostPosted: Tue Aug 31, 2010 12:54 am    Post subject: Reply with quote

Here is my kernel config: http://e2-productions.com/config.txt

Here is the output from trying to record with mencoder:
Code:
dion@epicbox ~ $ mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -ovc lavc -o test.avi
MEncoder SVN-r29796-4.3.4 (C) 2000-2009 MPlayer Team
success: format: 9  data: 0x0 - 0x0
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: Acer Crystal Eye webcam
 Capabilites:  video capture  streaming
 supported norms:
 inputs: 0 = Camera 1;
 Current input: 0
 Current format: MJPEG
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
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: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 0 frames dropped.
============ Sorry, this file format is not recognized/supported =============
=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===
Cannot open demuxer.

Exiting...


Here is everything webcam related I managed to find in /var/log/dmesg (`dmesg` by itself didn't output anything related), before and after the mplayer/mencoder error messages:
Code:
[    1.842254] usb 1-2: skipped 1 descriptor after configuration
[    1.842282] usb 1-2: skipped 6 descriptors after interface
[    1.842297] usb 1-2: skipped 1 descriptor after endpoint
[    1.842308] usb 1-2: skipped 8 descriptors after interface
[    1.842982] usb 1-2: default language 0x0409
[    1.849485] usb 1-2: udev 3, busnum 1, minor = 2
[    1.849496] usb 1-2: New USB device found, idVendor=064e, idProduct=a103
[    1.849508] usb 1-2: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[    1.849519] usb 1-2: Product: Acer Crystal Eye webcam
[    1.849528] usb 1-2: Manufacturer: SuYin
[    1.849537] usb 1-2: SerialNumber: CN0314-SN30-OV03-VA-R02.03.02
[    1.850044] usb 1-2: usb_probe_device
[    1.850058] usb 1-2: configuration #1 chosen from 1 choice
[    1.850379] usb 1-2: adding 1-2:1.0 (config #1, interface 0)
[    1.853317] uvcvideo 1-2:1.0: usb_probe_interface
[    1.853330] uvcvideo 1-2:1.0: usb_probe_interface - got id
[    1.853398] uvcvideo: Found UVC 1.00 device Acer Crystal Eye webcam (064e:a103)
[    1.869768] Synaptics Touchpad, model: 1, fw: 6.5, id: 0x81a0b1, caps: 0xa04711/0xa04000/0x0
[    1.870544] input: Acer Crystal Eye webcam as /devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/input/input6
[    1.870913] usb 1-2: adding 1-2:1.1 (config #1, interface 1)
[    1.871227] drivers/usb/core/inode.c: creating file '003'
[    1.871394] hub 2-0:1.0: state 7 ports 3 chg 0006 evt 0000
[    1.871422] hub 2-0:1.0: port 1, status 0501, change 0000, 480 Mb/s


... and here's everything webcam-related I found in /var/log/messages just for completeness:
Code:
Nov 29 17:09:59 localhost [  265.871805] usb 1-2: Product: Acer Crystal Eye webcam
Nov 29 17:09:59 localhost [  265.871807] usb 1-2: Manufacturer: SuYin
Nov 29 17:09:59 localhost [  265.871809] usb 1-2: SerialNumber: CN0314-SN30-OV03-VA-R02.03.02
Nov 29 17:09:59 localhost [  265.871814] hub 1-0:1.0: state 7 ports 6 chg 0000 evt 0004

_________________
thinkMoult - blog and stuff
WIPUP - share your works-in-progress for long-term, ambitious projects.
Back to top
View user's profile Send private message
iss
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2006
Posts: 133
Location: Poland/Bydgoszcz

PostPosted: Wed Sep 08, 2010 11:45 am    Post subject: Reply with quote

If your webcam is connected trough a hub try connecting it to port directly on motherboard. Or try different port.
Check if media-video/guvcview hangs too.
If you can check your webcam with other pc.
Back to top
View user's profile Send private message
Moult
Developer
Developer


Joined: 31 Mar 2008
Posts: 110
Location: Malaysia

PostPosted: Wed Sep 08, 2010 1:23 pm    Post subject: Reply with quote

First line, first post says the webcam is built-in. This is a laptop (Acer Aspire 4530).

guvcview just gives me a black screen (and an options window of course but that's unimportant). Here's the terminal output.

Code:
epicbox ~ # guvcview
guvcview 1.2.2
Could not open /root/.guvcviewrc for read,
 will try to create it
write /root/.guvcviewrc OK
video device: /dev/video0
/dev/video0 - device 1
Init. Acer Crystal Eye webcam (location: usb-0000:00:02.0-2)
{ pixelformat = 'MJPG', description = 'MJPEG' }
{ discrete: width = 640, height = 480 }
        Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 352, height = 288 }
        Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 320, height = 240 }
        Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 176, height = 144 }
        Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
{ discrete: width = 160, height = 120 }
        Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5,
vid:064e
pid:a103
driver:uvcvideo
checking format: 1196444237
VIDIOC_G_COMP:: Invalid argument
   compression control not supported
fps is set to 1/25
V4L2_CTRL_FLAG_NEXT_CTRL supported
 Could not grab image (select timeout): Resource temporarily unavailable
 Could not grab image (select timeout): Resource temporarily unavailable
 Could not grab image (select timeout): Resource temporarily unavailable
 Could not grab image (select timeout): Resource temporarily unavailable
 Could not grab image (select timeout): Resource temporarily unavailable
 Could not grab image (select timeout): Resource temporarily unavailable

_________________
thinkMoult - blog and stuff
WIPUP - share your works-in-progress for long-term, ambitious projects.
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 1659
Location: Berlin, Germany

PostPosted: Fri Sep 10, 2010 8:10 am    Post subject: Reply with quote

Something is fishy. If mplayer can play it, then mencoder can capture it. There are only very few exceptions to this (dvdnav:// and the like). The question is whether the problem appears after a short while of capturing or no.
Back to top
View user's profile Send private message
iss
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2006
Posts: 133
Location: Poland/Bydgoszcz

PostPosted: Fri Sep 10, 2010 11:39 am    Post subject: Reply with quote

Moult wrote:
First line, first post says the webcam is built-in. This is a laptop (Acer Aspire 4530).

Sorry, I missed it.

You can try with different versions of Ubuntu Live CD to check if some older combination of drivers will work.
Back to top
View user's profile Send private message
Moult
Developer
Developer


Joined: 31 Mar 2008
Posts: 110
Location: Malaysia

PostPosted: Sun Sep 26, 2010 2:22 am    Post subject: Reply with quote

In the middle of downloading a LiveCD, my internets is rather slow nowadays.

Here's a little progress I have made. Running mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15 now no longer makes it complain about "Xlib: extension "XFree86-VidModeExtension" missing on display ":1000.0".". No idea why, but if it's complaining about one less thing surely that's a good thing. Here's the new full output (this now happens 100% of the time - good, consistency is good):

Code:
MPlayer SVN-r29796-4.4.3 (C) 2000-2009 MPlayer Team

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: Acer Crystal Eye webcam
 Capabilites:  video capture  streaming
 supported norms:
 inputs: 0 = Camera 1;
 Current input: 0
 Current format: MJPEG
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
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: ioctl set mute failed: Invalid argument
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Unsupported PixelFormat -1
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
FPS forced to be 15.000  (ftime: 0.067).
Starting playback...
v4l2: select timeout ??% ??,?% 0 0
v4l2: select timeout ??% ??,?% 0 0
v4l2: select timeout ??% ??,?% 0 0
v4l2: select timeout  0%  0.0% 0 0
V:   0.0  11/ 11  4%  0%  0.0% 0 0

MPlayer interrupted by signal 2 in module: video_read_frame
v4l2: select timeout
v4l2: select timeout  0%  0.0% 0 0
v4l2: ioctl set mute failed: Invalid argument
v4l2: 1 frames successfully processed, 0 frames dropped.

Exiting... (Quit)


Also, the third error message I quoted in the first post which I marked as "more common" now no longer seems to happen. The above message constantly comes up.

I can recreate the green screen I mentioned in the first post by running LD_PRELOAD=/usr/lib64/libv4l/v4l2convert.so mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15. The error message for the green screen is similar to the one I just quoted with the exception of a few errors being rearranged (ie. complaining about one first then another), and having this additional error message:

Code:
libv4l2: error converting / decoding frame data: v4l-convert: error parsing JPEG header: Not a JPG file ?
v4l2: ioctl dequeue buffer failed: Input/output error, idx = 0


Note: running the "green screen fix" as noted here by changing to v4l1compat.so and driver=v4l just plain doesn't work.
_________________
thinkMoult - blog and stuff
WIPUP - share your works-in-progress for long-term, ambitious projects.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum