LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-15-2008, 07:30 PM   #1
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Rep: Reputation: 15
/dev/video0 no such device


hi, i just got myself an eeepc, and think its great.

i want to do some image recognition/AI programming with the webcam.

the webcam's dev node is /dev/video0.
i assume this is just a bitmap which(like everything in unix) can be read like a file.
the problem is, i can't even dump a frame to a file:
Code:
asus-852305267:/home/user> cat /dev/video0 > vid.raw
cat: /dev/video0: No such device
BUT IT'S RIGHT THERE??!!! how can there be no such device???
i also tried doing it with dd, but same result.

is there something i need to do to enable the webcam first? maybe something which also activates the little LED next to it to tell the user it is active.

i tried this:
Code:
echo 1 >  /proc/acpi/asus/camera
it did change the number from 0 to 1, but the problem persists, and the LED remains off.

thanks for any replies.
 
Old 07-16-2008, 12:07 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,622

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by leedude View Post

the webcam's dev node is /dev/video0.
Code:
asus-852305267:/home/user> cat /dev/video0 > vid.raw
cat: /dev/video0: No such device
BUT IT'S RIGHT THERE??!!! how can there be no such device???
i also tried doing it with dd, but same result.

is there something i need to do to enable the webcam first?
You don't say what distribution you're using, so it's hard to be more specific.

This link http://gentoo-wiki.com/Asus_Eee_PC_701#Webcam gives you more info. Looks like you need the uvcvideo module loaded, so the camera will be enabled. Have you loaded this module, or checked for it? Do an "lsmod | grep uvcvideo", and see if it's there. If not, try doing a "modprobe uvcvideo" and see if it loads (need to be root to do this). If it's there, have you looked in /dev, to see if the video0 node is there?
 
Old 07-16-2008, 02:49 PM   #3
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
sorry, i should have said.
im using the stock eee Xandros.
its an eeepc 900.
it's not that the camera doesn't work - it does in skype etc..
i just need to write a program in C to interface it. i assumed the device node would be the easiest way.

i just wanna grab a frame, why cant i?
 
Old 07-16-2008, 02:59 PM   #4
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
What does "ls -l /dev/video0" give you?

Forrest
 
Old 07-16-2008, 05:52 PM   #5
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
it gives:
Code:
crw-rw---- 1 root video 81, 0 2008-07-16 23:49 /dev/video0
also, disabling the camera with:
Code:
echo 0 > /proc/acpi/asus/camera
makes the node disappear so that
cat /dev/video0 says no such file or directory

would it be completely wrong to say that the driver is producing that message "no such device"(it uses the word 'device')?
Lee

Last edited by leedude; 07-17-2008 at 03:53 AM.
 
Old 07-19-2008, 07:32 AM   #6
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
no I think you may be wrong, i read a post on this site which gave me the impression that you read streaming video from the file, not a frame. that could be your problem.
 
Old 07-19-2008, 08:02 AM   #7
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Do you have mplayer installed? If so, what happens when you do:
Code:
mplayer tv:// -tv driver=v4l
 
Old 07-20-2008, 07:59 AM   #8
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
I get:
Code:
MPlayer 1.0rc1-4.1.2-DFSG-free (C) 2000-2006 MPlayer Team
CPU: Intel(R) Celeron(R) M processor          900MHz (Family: 6, Model: 13, Stepping: 8)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Warning unknown option ao_driver at line 12
Warning unknown option ao_alsa_mixer_channel at line 13
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing tv://.
TV file format detected.
Selected driver: v4l
 name: Video 4 Linux input
 author: Alex Beregszaszi
 comment: under development
=================================================================
 WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!
 As the V4L1 compatibility layer is broken, this may not work.
 If you encounter any problems, use driver=v4l2 instead.
 Bugreports on driver=v4l with v4l2 drivers will be ignored.
=================================================================
Selected device: CNF7129
 Capabilites: capture
 Device type: 1
 Supported sizes: 48x32 => 1280x1024
 Inputs: 1
ioctl get channel failed: Invalid argument
ioctl get mbuf failed: Invalid argument


MPlayer interrupted by signal 11 in module: demux_open
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
/home/user>


EDIT: OOPS Double post

Last edited by leedude; 07-20-2008 at 09:18 AM.
 
Old 07-20-2008, 08:00 AM   #9
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
Double Post

Last edited by leedude; 07-20-2008 at 09:18 AM.
 
Old 07-20-2008, 09:29 AM   #10
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Maybe try:
Code:
mplayer tv:// -tv driver=v4l2
 
Old 07-20-2008, 12:57 PM   #11
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
As root, try chmod 664 /dev/video0 in order to give read access to everyone and not merely members of the video group.

Either that, or add yourself to the video group.
 
Old 07-20-2008, 02:38 PM   #12
leedude
Member
 
Registered: Jan 2007
Location: Scotland
Distribution: Fedora, Debian
Posts: 81

Original Poster
Rep: Reputation: 15
matthewg42:

That gives:
Code:
MPlayer 1.0rc1-4.1.2-DFSG-free (C) 2000-2006 MPlayer Team
CPU: Intel(R) Celeron(R) M processor          900MHz (Family: 6, Model: 13, Stepping: 8)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Warning unknown option ao_driver at line 12
Warning unknown option ao_alsa_mixer_channel at line 13
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

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: ioctl get standard failed: Invalid argument
Selected device: CNF7129
 Capabilites:  video capture  streaming
 supported norms:
 inputs: 0 = Camera 1;
 Current input: 0
 Current format: YUYV
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
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
FPS not specified in the header or invalid, use the -fps option.
No stream found.

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

Exiting... (End of file)

jiml8, i tried it, no difference.
i tried everything as root anyway, doesnt work.


I tried it on my larger laptop - acer aspire 4xxx.
it has a webcam in the lid, and is behaving exactly the same.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pci Tv card, need help with, /dev/video0: No such device lizard_king825 Linux - Hardware 1 10-13-2006 03:49 PM
Hauppauge-250 card gives ' cannot open capture device /dev/video0 ' message thouze Linux - Hardware 1 07-17-2006 07:57 AM
ivtv - can't open capture device - /dev/video0 rrrssssss Linux - Hardware 7 02-02-2006 09:39 AM
/dev/video0: No such device meranto Linux - Hardware 5 11-12-2005 10:38 AM
cannot open tv card and /dev/video0 device on suse 9.3 gros777 Linux - Hardware 1 08-05-2005 12:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration