1

I faced a strange effect as ... when my notebook wakes up from suspend I can start and close my web cam with guvcview 1-3 times; But after while on 3dr or 4th starting attempt (I didn't count for sure) my OS totally hangs so I have to reboot my notebook to make it work :P

As an attempt to find out some more details I tried to switch to non-GUI mode with alt_ctrl+F1 and input : $guvcview

That's what I could find on output :

...

libv4l2 error setting pixformat : device or resource busy

...

The thing is I have just one web cam on my notebook (the native one) which is build-in ; So I don't get it what else it can be busy with? So I think somehow the native cam is running though guvcview is closed (correct me if I am wrong...) :(

EDIT : I tried input as $ps axl | grep 3106 the output is :

0  1000  3106  1208  20   0 544772 68572 poll_s Sl   ?          5:59 guvcview
0  1000  3412  3404  20   0  11916  2288 pipe_w S+   pts/4      0:00 grep --color=tty -d skip 3106

after I close the guvcview I can see this output :

ps axl | grep 3106
0  1000  3797  3404  20   0  11916  2392 pipe_w S+   pts/4      0:00 grep --color=tty -d skip 3106

...so is that means I have two threads using the device? I have usb cam; Not really sure how the ps axl output can help in my case; So please give me a tip pls...

lsusb outputs

...ID 04f2:b404 Chicony Electronics Co., Ltd 

so it is hard to say what model number the cam really has to use the web cam setup instructions for sure...


So my question is how to fix that cause rebooting on each unlucky web cam start is awkward %)

p.s.

Thanks

user390525
  • 187
  • 2
  • 2
  • 14
  • Please issue `sudo kill -9 3106` and then try to use the webcam again. I think what is happening is that `guvcview` is not exiting properly so you are unable to open the camera again – Dylan Mar 20 '15 at 17:17
  • will it un-freeze the os back? I mean the GUI doesn't work when unlucky web cam starting takes place... – user390525 Mar 20 '15 at 17:19
  • Issue the command and report back – Dylan Mar 20 '15 at 17:20
  • If the OS is frozen switch to a terminal `ctrl + F1` and log in. Then find out the process ID of `guvcview` and kill it using `sudo kill -9 PROCESSID` – Dylan Mar 20 '15 at 17:22
  • @Dylan btw how to get usb web cam model number etc? The lsusb outputs too abstract info; I couldn't find the info here https://usb-ids.gowdy.us/read/UD/04f2 – user390525 Mar 20 '15 at 20:10
  • Next time that it freezes switch to the console and paste the output of `cat /var/log/syslog` so we can see if any error messages appear that may help. – Dylan Mar 20 '15 at 20:14
  • @Dylan No, I mean how to get the usb web cam device detailed info (see my question below lines) like a model number and some spec-s? Cause right now the only thing I can get with lsusb is the vendor "Chicony Ltd" name only :( – user390525 Mar 20 '15 at 23:29
  • I'm a rush but lsusb comes to mind. I'll write more later when I get done – Dylan Mar 20 '15 at 23:31
  • Something I found is the command '`lsof -t /dev/video0` which will tell you what process is using the web cam. Next time it freezes you might use that. But yeah `lsusb` will give you details of your device – Dylan Mar 21 '15 at 01:20

1 Answers1

0

This may be a duplicate of this just asked differently.

Anyways, have you tried to find out if another process is using the camera(such as one of your previous attempts to use the camera not exiting properly...)

Try this - (notice you have to take the output of the first line and edit the third line to match your output...

sudo fuser /dev/video0

/dev/video0: 1871m

sudo kill -9 1871
Dylan
  • 1,018
  • 2
  • 10
  • 19
  • I edited my question; Watch it please – user390525 Mar 20 '15 at 17:14
  • I just faced the os hang on web cam start ... I tried the commands; Yes, you are right killing process by its ID really helps to un-hang the os :D Thank you – user390525 Mar 27 '15 at 16:22
  • But how to prevent the os hangs (freeze); Should I use additional configurations as described here https://wiki.archlinux.org/index.php/webcam_setup#linux-uvc ? I am really confused cause I couldn't find my web cam product id here https://usb-ids.gowdy.us/read/UD/04f2 – user390525 Mar 27 '15 at 17:05
  • Hmmm stopping it from hanging is not my area of expertise, but to me it seems you would have to find out why its hanging in order to stop it... This would require doing a strace or something. Maybe someone would have a better idea – Dylan Mar 27 '15 at 18:34
  • I am not sure of how to do the "strace"? Is there a simple way? – user390525 Mar 27 '15 at 20:30