LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   /dev/video0 no such device (https://www.linuxquestions.org/questions/programming-9/dev-video0-no-such-device-656014/)

leedude 07-15-2008 07:30 PM

/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.

TB0ne 07-16-2008 12:07 PM

Quote:

Originally Posted by leedude (Post 3215825)

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?

leedude 07-16-2008 02:49 PM

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?

forrestt 07-16-2008 02:59 PM

What does "ls -l /dev/video0" give you?

Forrest

leedude 07-16-2008 05:52 PM

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

resetreset 07-19-2008 07:32 AM

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.

matthewg42 07-19-2008 08:02 AM

Do you have mplayer installed? If so, what happens when you do:
Code:

mplayer tv:// -tv driver=v4l

leedude 07-20-2008 07:59 AM

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

leedude 07-20-2008 08:00 AM

Double Post

matthewg42 07-20-2008 09:29 AM

Maybe try:
Code:

mplayer tv:// -tv driver=v4l2

jiml8 07-20-2008 12:57 PM

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.

leedude 07-20-2008 02:38 PM

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.


All times are GMT -5. The time now is 07:19 AM.