USB webcam on Pogoplug

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

USB webcam on Pogoplug

Postby permitivity » Tue May 07, 2013 5:10 pm

Hi,
I'm using a Logitech C310 wecam on a Pogoplug E02, running Arch. I'm using Motion as the webcam streaming server.

A weird thing happens - about 40% of the time, it works fine. I can start Motion, and it connects to the webcam just fine. I can shut down motion and restart motion and it always works.

However, if I reboot the Pogo, there's a 60% chance that Motion will not work. I get the error below. I need to reboot. There's a 40% chance each reboot fixes it.

Interesting, if I run "fswebcam" before I run Motion, it seems to work every time. It's like "fswebcam" seems to prime the system to run Motion correctly. Without fswebcam, I have a 60% failure rate for Motion.

Here's the error I get from Motion.

$this->bbcode_second_pass_quote('', '
')[root@alarm ~]# motion
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3489124 LIBAVFORMAT_BUILD 3481700
[0] Thread 1 is from /etc/motion/motion.conf
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Thread 1 started
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:081b)"
[1] cap.bus_info: "usb-orion-ehci.0-1.3"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 6 (YUYV) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error <<<---------
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument
[1] Could not fetch initial image from camera

[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 7081
[1] Retrying until successful connection with camera
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:081b)"
[1] cap.bus_info: "usb-orion-ehci.0-1.3"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Config palette index 6 (YUYV) doesn't work.
[1] Supported palettes:
[1] 0: YUYV (YUV 4:2:2 (YUYV))
[1] 1: MJPG (MJPEG)
[1] Selected palette YUYV
[1] VIDIOC_TRY_FMT failed for format YUYV: Input/output error
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Invalid argument




If I run fswebcam first using this command, then I ctrl-C to cancel out, and then run Motion, it works. This is how I run fswebcam.
$this->bbcode_second_pass_quote('', '
')fswebcam -r 1280X720 -S 15 --flip h --jpeg 95 --shadow --title "eric webcam" --subtitle "Home" --info "Monitor: Active @ 1 fpm" --save /media/FLASHDRIVE/webcam.jpg -l 20 --device /dev/video0
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am

Re: USB webcam on Pogoplug

Postby grayman4hire » Tue May 07, 2013 6:27 pm

Other users have reported this issue. The simple solution as you discovered is to run fswebcam before launching motion. Not ideal, but it works.

fswebcam -r 320x240 -d /dev/video0 -v /dev/null
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: USB webcam on Pogoplug

Postby permitivity » Wed May 08, 2013 2:27 am

No way! Other people have this exact same issue?

I have no idea why fswebcam somehow primes the system to work with the Motion app.

The problem is, I want Motion to run on start-up, so this bug for specific webcams is kind of a bummer. Is there a way to start fswebcam first on start-up, then automatically shut down fswebcam, and then start up Motion?
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am

Re: USB webcam on Pogoplug

Postby grayman4hire » Wed May 08, 2013 5:30 pm

Yup, it was mentioned in this thread - viewtopic.php?f=31&t=3149&hilit=motion+fswebcam

I'm sure you can launch fswebcam before starting motion. Maybe it's simple as chaining the fswebcam command with the motion command in a systemd service file.

fswebcam blah blah && motion
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: USB webcam on Pogoplug

Postby makuab » Thu May 09, 2013 9:16 pm

I got motion + fswebcam fix working at startup

1. Go to /etc/systemd/system
2. nano yourmotionservicename.service
3. put this in there $this->bbcode_second_pass_code('', '[Unit]
Description=Your Description

[Service]
ExecStartPre=/usr/bin/fswebcam -r 320x240 -d /dev/video0 -v /dev/null
ExecStart=/usr/bin/motion -c /path/to/your/config

[Install]
WantedBy=multi-user.target
')
4. Test it with systemctl start yourmotionservicename.service
5. Enable it at start with systemctl enable yourmotionservicename.service

Also a question for you, have you gotten the MJPEG pallet to work in your motion.conf? Mine gives a gray stream and throws errors about extraneous bits.
makuab
 
Posts: 60
Joined: Fri Mar 01, 2013 11:49 pm

Re: USB webcam on Pogoplug

Postby permitivity » Fri May 10, 2013 2:14 am

makuab,
I have that directory </etc/systemd>. But I don't have yourmotionservicename.service, I don't have any files in there with *.service. Where did this file come from?

As for getting MJPEG pallet to work - no. I'm not sure what the Palette function does, but the only one that works for me is #6, YUYV. At least with the cameras I have (Microsoft lifecam cinema and Logitech C310).
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am

Re: USB webcam on Pogoplug

Postby makuab » Fri May 10, 2013 3:33 am

$this->bbcode_second_pass_quote('permitivity', 'm')akuab,
I have that directory </etc/systemd>. But I don't have yourmotionservicename.service, I don't have any files in there with *.service. Where did this file come from?

As for getting MJPEG pallet to work - no. I'm not sure what the Palette function does, but the only one that works for me is #6, YUYV. At least with the cameras I have (Microsoft lifecam cinema and Logitech C310).


That was just an example name for what you want the service name to be. You have to create it with nano, or another text editor.

The directory is also /etc/systemd/system
makuab
 
Posts: 60
Joined: Fri Mar 01, 2013 11:49 pm
Top

Re: USB webcam on Pogoplug

Postby permitivity » Mon Jun 10, 2013 3:22 am

makuab, thanks for this info. I'm running into the same issue as the other poster - trying to understand how the *.service works. I'll dig into it more later.

Thanks.
permitivity
 
Posts: 141
Joined: Mon Feb 18, 2013 3:08 am


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 4 guests