[beagleboard] Camera for beagle

If you can get the linux uvc to compile, there quite a few that will work.

If you can get the linux uvc to compile, there quite a few that will work.

the uvc drivers are already present in the angstrom kernel images.

regards,

Koen

So far I've had very poor luck getting capture running with UVC
cameras. Has anyone out there had better luck?

I've tried a two hubs and two different Logitech UVC cameras with two
different 5.0V PSUs. These cameras work fine on my PC with 2.6.27 and
the UVC source looks unchanged.

On the latest Angstrom kernel, luvcview will get the camera to enter
capture mode but no image is returned. Instead I get this error from
the kernel:

uvcvideo: unknown event type 0.

On the latest linux-omap kernel with Mans' USB patches, I can capture
a single frame but then I receive this:

WARNING: at lib/kref.c:43 kref_get+0x2c/0x48()
Modules linked in: ipv6 uvcvideo compat_ioctl32 videodev v4l1_compat
[<c0330430>] (dump_stack+0x0/0x14) from [<c0052ed8>] (warn_on_slowpath
+0x4c/0x8)
[<c0052e8c>] (warn_on_slowpath+0x0/0x84) from [<c017d0c4>] (kref_get
+0x2c/0x48) r6:c7bec74c r5:c7bec740 r4:c6d49400
[<c017d098>] (kref_get+0x0/0x48) from [<c01f6648>] (usb_get_urb+0x1c/
0x24) r4:c6d49400
[<c01f662c>] (usb_get_urb+0x0/0x24) from [<c01f513c>]
(usb_hcd_flush_endpoint+0) r4:c6d49400
[<c01f509c>] (usb_hcd_flush_endpoint+0x0/0xcc) from [<c01f6af4>]
(usb_disable_e) r7:c7bc8400 r6:c79b3424 r5:c7bc8400 r4:c7bec740
[<c01f6a9c>] (usb_disable_endpoint+0x0/0x68) from [<c01f6c28>]
(usb_disable_int) r5:00000028 r4:00000001
[<c01f6bf4>] (usb_disable_interface+0x0/0x4c) from [<c01f7874>]
(usb_set_interf)
r7:c7bc8400 r6:c79b3800 r5:00000001 r4:00000000
[<c01f7788>] (usb_set_interface+0x0/0x1a0) from [<bf014d04>]
(uvc_video_enable+)
r8:c7bb7050 r7:c660fe60 r6:c7bb7094 r5:00000000 r4:c7bb7050
[<bf014cc4>] (uvc_video_enable+0x0/0x78 [uvcvideo]) from [<bf014308>]
(uvc_v4l2)
r6:c6cf9880 r5:c6f2c1e0 r4:40045613
[<bf013664>] (uvc_v4l2_do_ioctl+0x0/0xee0 [uvcvideo]) from
[<bf005c00>] (video_)
[<bf005a0c>] (video_usercopy+0x0/0x320 [videodev]) from [<bf013334>]
(uvc_v4l2_)
[<bf0132e0>] (uvc_v4l2_ioctl+0x0/0x68 [uvcvideo]) from [<c00aea54>]
(vfs_ioctl+)
r7:c6cf9880 r6:bee5eb74 r5:40045613 r4:c6cf9880
[<c00ae9e8>] (vfs_ioctl+0x0/0x7c) from [<c00aecc0>] (do_vfs_ioctl
+0x25c/0x274)
r6:00000006 r5:bee5eb74 r4:c6cf9880
[<c00aea64>] (do_vfs_ioctl+0x0/0x274) from [<c00aed18>] (sys_ioctl
+0x40/0x64)
r6:40045613 r5:bee5eb74 r4:00000006
[<c00aecd8>] (sys_ioctl+0x0/0x64) from [<c0032d00>] (ret_fast_syscall
+0x0/0x2c)
r7:00000036 r6:00027f50 r5:000296b8 r4:0000f84e
---[ end trace 0009d2798d6255df ]---

After this I receive:
uvcvideo: unknown event type 0.

- Nathan

I've been trying but haven't had any luck. Has anyone gotten UVC
cameras to work on the Beagleboard?

The drivers detect my Logitech UVC cameras and command them to enter
capture mode, but give various errors on the first or second frame
captured. I've tried luvcview and mjpg-streamer, and the latest
Angstrom kernel and yesterday's linux-omap kernel. I receive these
errors:

uvcvideo: Failed to submit URB 0 (-90).
uvcvideo: Failed to submit URB 0 (-28).
uvcvideo: unknown event type 0.

The kernel crashes when closing the camera port with this error:

WARNING: at lib/kref.c:43 kref_get+0x2c/
0x48()
Modules linked in: ipv6 uvcvideo compat_ioctl32 videodev
v4l1_compat
[<c0330430>] (dump_stack+0x0/0x14) from [<c0052ed8>] (warn_on_slowpath
+0x4c/0x8)
[<c0052e8c>] (warn_on_slowpath+0x0/0x84) from [<c017d0c4>] (kref_get
+0x2c/0x48) r6:c7bec74c r5:c7bec740 r4:c6d49400
[<c017d098>] (kref_get+0x0/0x48) from [<c01f6648>] (usb_get_urb+0x1c/
0x24) r4:c6d49400
[<c01f662c>] (usb_get_urb+0x0/0x24) from [<c01f513c>]
(usb_hcd_flush_endpoint+0) r4:c6d49400
[<c01f509c>] (usb_hcd_flush_endpoint+0x0/0xcc) from [<c01f6af4>]
(usb_disable_e) r7:c7bc8400 r6:c79b3424 r5:c7bc8400 r4:c7bec740

- Nathan

> > If you can get the linux uvc to compile, there quite a few that will work.

> the uvc drivers are already present in the angstrom kernel images.

I've been trying but haven't had any luck. Has anyone gotten UVC
cameras to work on the Beagleboard?

The drivers detect my Logitech UVC cameras and command them to enter
capture mode, but give various errors on the first or second frame
captured. I've tried luvcview and mjpg-streamer, and the latest
Angstrom kernel and yesterday's linux-omap kernel. I receive these
errors:

uvcvideo: Failed to submit URB 0 (-90).
uvcvideo: Failed to submit URB 0 (-28).
uvcvideo: unknown event type 0.

The kernel crashes when closing the camera port with this error:

WARNING: at lib/kref.c:43 kref_get+0x2c/
0x48()
Modules linked in: ipv6 uvcvideo compat_ioctl32 videodev
v4l1_compat
[<c0330430>] (dump_stack+0x0/0x14) from [<c0052ed8>] (warn_on_slowpath
+0x4c/0x8)
[<c0052e8c>] (warn_on_slowpath+0x0/0x84) from [<c017d0c4>] (kref_get
+0x2c/0x48) r6:c7bec74c r5:c7bec740 r4:c6d49400
[<c017d098>] (kref_get+0x0/0x48) from [<c01f6648>] (usb_get_urb+0x1c/
0x24) r4:c6d49400
[<c01f662c>] (usb_get_urb+0x0/0x24) from [<c01f513c>]
(usb_hcd_flush_endpoint+0) r4:c6d49400
[<c01f509c>] (usb_hcd_flush_endpoint+0x0/0xcc) from [<c01f6af4>]
(usb_disable_e) r7:c7bc8400 r6:c79b3424 r5:c7bc8400 r4:c7bec740

That's a problem in the MUSB driver, there are patches for 2.6.27rcX
to fix it, but I can't get USB to work at all with .27rc :frowning:

regards,

Koen

Thanks Koen. You are right. The hardware and UVC drivers are fine.
The problem is in the MUSB drivers.

Applying the MUSB patches to 2.6.27rcX significantly improved UVC
support. At this point I can capture images from my Quickcam 9000 Pro
without any kernel crashes.

The images tend to lose a few bytes every 20-40KB, causing visible
errors. Still, this is a huge step forward.

Here are the patches I applied to the linux-omap git:
http://git.mansr.com/?p=linux-omap;a=commitdiff;h=1e5bc41773bb981b3a89bd762becf98c72be5e4c
http://dominion.thruhere.net/git/?p=openembedded.git;a=blob_plain;f=packages/linux/linux-omap/musb-dma-iso-in.eml;h=8f0a6c5689335089167dbdd5a6dc64346ee55895;hb=HEAD
http://dominion.thruhere.net/git/?p=openembedded.git;a=blob_plain;f=packages/linux/linux-omap/musb-support-high-bandwidth.patch.eml;h=0054093603da0109c1cf3f1f1f715bb287155687;hb=HEAD

Thanks for the help Koen!

- Nathan

I'm pleased to say that UVC video is working without data loss! This
is using Koen's 2.6.27-rc6+r7 "git kernel with MUSB fixes" posted on
the IRC channel a few hours ago.

But, the kernel hangs in the USB stack when the video stream is
closed. Here is the trace:

BUG: soft lockup - CPU#0 stuck for 61s! [mjpg_streamer:1770]
Modules linked in: ipv6 pegasus uvcvideo compat_ioctl32 videodev
v4l1_compat

Pid: 1770, comm: mjpg_streamer
CPU: 0 Not tainted (2.6.27-rc7-omap1 #4)
PC is at __mutex_lock_slowpath+0x1ec/0x204
LR is at __mutex_lock_slowpath+0x1c4/0x204
pc : [<c0320fa0>] lr : [<c0320f78>] psr: 60000013
sp : c7265ca0 ip : c7265ca0 fp : c7265cd4
r10: c79eb400 r9 : c7128218 r8 : c78a6a08
r7 : c78df9c0 r6 : 60000013 r5 : c0437690 r4 : c7265ca4
r3 : 00000000 r2 : 00000000 r1 : c7264000 r0 : c0437690
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 00c5387f Table: 87348018 DAC: 00000015
[<c0034ca8>] (show_regs+0x0/0x50) from [<c007959c>] (softlockup_tick
+0x100/0x140)
r5:000000bc r4:0000007f
[<c007949c>] (softlockup_tick+0x0/0x140) from [<c005c08c>]
(run_local_timers+0x1c/0x20)
[<c005c070>] (run_local_timers+0x0/0x20) from [<c005c4e8>]
(update_process_times+0x30/0x5c)
[<c005c4b8>] (update_process_times+0x0/0x5c) from [<c006f138>]
(tick_sched_timer+0x8c/0xd8)
r5:c7265c58 r4:c044d630
[<c006f0ac>] (tick_sched_timer+0x0/0xd8) from [<c0069090>]
(__run_hrtimer+0x58/0x94)
r7:c0425e60 r6:c044d630 r5:c0425e60 r4:c044d630
[<c0069038>] (__run_hrtimer+0x0/0x94) from [<c0069c64>]
(hrtimer_interrupt+0x130/0x1a0)
r5:000000b9 r4:183847b0
[<c0069b34>] (hrtimer_interrupt+0x0/0x1a0) from [<c003d248>]
(omap2_gp_timer_interrupt+0x28/0x34)
[<c003d220>] (omap2_gp_timer_interrupt+0x0/0x34) from [<c0079a58>]
(handle_IRQ_event+0x3c/0x74)
[<c0079a1c>] (handle_IRQ_event+0x0/0x74) from [<c007b2a4>]
(handle_level_irq+0xd4/0xf0)
r7:c78df9c0 r6:00000000 r5:0000005f r4:c04279a8
[<c007b1d0>] (handle_level_irq+0x0/0xf0) from [<c0033048>]
(__exception_text_start+0x48/0x64)
r5:c04279a8 r4:0000005f
[<c0033000>] (__exception_text_start+0x0/0x64) from [<c0033830>]
(__irq_svc+0x30/0x80)
Exception stack(0xc7265c58 to 0xc7265ca0)
5c40: c0437690
c7264000
5c60: 00000000 00000000 c7265ca4 c0437690 60000013 c78df9c0 c78a6a08
c7128218
5c80: c79eb400 c7265cd4 c7265ca0 c7265ca0 c0320f78 c0320fa0 60000013
ffffffff
r7:c78df9c0 r6:60000013 r5:d8200000 r4:ffffffff
[<c0320db4>] (__mutex_lock_slowpath+0x0/0x204) from [<c0320fc8>]
(mutex_lock+0x10/0x14)
r7:c7893000 r6:c7170c00 r5:c7170c00 r4:c791c738
[<c0320fb8>] (mutex_lock+0x0/0x14) from [<c01ed760>] (usb_kill_urb
+0x38/0x104)
[<c01ed728>] (usb_kill_urb+0x0/0x104) from [<c01ece30>]
(usb_hcd_flush_endpoint+0xb0/0xcc)
r6:c791c740 r5:c7170c00 r4:c791c738
[<c01ecd80>] (usb_hcd_flush_endpoint+0x0/0xcc) from [<c01ee044>]
(usb_disable_endpoint+0x5c/0x6c)
r7:c7893000 r6:c78a6a40 r5:c7893000 r4:c791c740
[<c01edfe8>] (usb_disable_endpoint+0x0/0x6c) from [<c01ee180>]
(usb_disable_interface+0x34/0x4c)
r5:00000028 r4:00000001
[<c01ee14c>] (usb_disable_interface+0x0/0x4c) from [<c01ef4e0>]
(usb_set_interface+0xec/0x178)
r7:00000001 r6:00000000 r5:c7893000 r4:c78a6e00
[<c01ef3f4>] (usb_set_interface+0x0/0x178) from [<bf014c48>]
(uvc_video_enable+0x3c/0x74 [uvcvideo])
r8:c721c050 r7:c7265e68 r6:c721c094 r5:00000000 r4:c721c050
[<bf014c0c>] (uvc_video_enable+0x0/0x74 [uvcvideo]) from [<bf014308>]
(uvc_v4l2_do_ioctl+0xce4/0xf50 [uvcvideo])
r7:c7265e68 r6:c79f9e00 r5:c78d4760 r4:40045613
[<bf013624>] (uvc_v4l2_do_ioctl+0x0/0xf50 [uvcvideo]) from
[<bf008e20>] (video_usercopy+0x1b8/0x2b8 [videodev])
[<bf008c68>] (video_usercopy+0x0/0x2b8 [videodev]) from [<bf012fdc>]
(uvc_v4l2_ioctl+0x54/0x68 [uvcvideo])
[<bf012f88>] (uvc_v4l2_ioctl+0x0/0x68 [uvcvideo]) from [<c00ace28>]
(vfs_ioctl+0x68/0x78)
r7:c79eb400 r6:00000003 r5:40c78ccc r4:40045613
[<c00acdc0>] (vfs_ioctl+0x0/0x78) from [<c00ad0a8>] (do_vfs_ioctl
+0x270/0x280)
r5:40c78ccc r4:c79eb400
[<c00ace38>] (do_vfs_ioctl+0x0/0x280) from [<c00ad0f8>] (sys_ioctl
+0x40/0x64)
r7:c79eb400 r6:40045613 r5:40c78ccc r4:00000003
[<c00ad0b8>] (sys_ioctl+0x0/0x64) from [<c0033c80>] (ret_fast_syscall
+0x0/0x2c)

- Nathan

That’s a problem in the MUSB driver, there are patches for 2.6.27rcX
to fix it, but I can’t get USB to work at all with .27rc :frowning:

regards,
Koen

I’m pleased to say that UVC video is working without data loss! This
is using Koen’s 2.6.27-rc6+r7 “git kernel with MUSB fixes” posted on
the IRC channel a few hours ago.

Sorry, I dont follow IRC. I just updated openembedded from GIT, are the patches you refer to the following

file://musb-dma-iso-in.eml;patch=1
file://musb-support-high-bandwidth.patch.eml;patch=1
file://musb-mru-otgfix.diff;patch=1 \

(Taken from linux-omap_git.bb)

I.e They are already being distributed with an open embedded build?

John

> > That's a problem in the MUSB driver, there are patches for 2.6.27rcX
> > to fix it, but I can't get USB to work at all with .27rc :frowning:

> > regards,
> > Koen

> I'm pleased to say that UVC video is working without data loss! This
> is using Koen's 2.6.27-rc6+r7 "git kernel with MUSB fixes" posted on
> the IRC channel a few hours ago.

Sorry, I dont follow IRC. I just updated openembedded from GIT, are the
patches you refer to the following

       file://musb\-dma\-iso\-in\.eml;patch=1 \\
       file://musb\-support\-high\-bandwidth\.patch\.eml;patch=1 \\
       file://musb\-mru\-otgfix\.diff;patch=1 \\

Yes, those are the one

(Taken from linux-omap_git.bb)

I.e They are already being distributed with an open embedded build?

Not yet since .27rcX is not working as reliable as .26, so you have to
build linux-omap_git.bb by hand (bitbake linux-omap).

regards,

Koen

Just a quick update for Beagleboard and UVC webcam users:

Koen posted a kernel on IRC earlier today that makes the Beagleboard
stable with two different UVC cameras I've tested. There were no
crashes when starting/stopping streams or plugging/unplugging
devices. Performance is quite good.

Here is the link:
http://ewi546.ewi.utwente.nl/~koen/uImage-2.6.26+2.6.27-rc7+r9+gite1c49d7d22af768188e2a54c167ed79919361e55-r9-beagleboard.bin
http://ewi546.ewi.utwente.nl/~koen/modules-2.6.26+2.6.27-rc7+r9+gite1c49d7d22af768188e2a54c167ed79919361e55-r9-beagleboard.tgz

These fixes will get back to Angstrom, so if you were on the fence
about getting a Beagleboard for webcams, go buy one now. :wink:

- Nathan

Here is the link:http://ewi546.ewi.utwente.nl/~koen/uImage-2.6.26+2.6.27-rc7+r9+gite1c...http://ewi546.ewi.utwente.nl/~koen/modules-2.6.26+2.6.27-rc7+r9+gite1

These fixes will get back to Angstrom, so if you were on the fence
about getting a Beagleboard for webcams, go buy one now. :wink:

I've got a couple years old LCD display connected to the beagleboard
on DVI and with this kernel, the video is running at 51Hz instead of
58Hz with the older Angstrom Demo kernel. Because of this, all I can
see on the display is "Out of Range" so YMMV.

Philip and I are testing .27rc to see how many regressions it has
compared to .26 and currently our usb ethernet dongles disconnect
every 30seconds, so something is still wrong with USB :frowning:

regards,

Koen