I was previously able to scan barcodes with zbarcam, but a recent kernel upgrade broke it. It now returns the following:
WARNING: no compatible input to output format
...trying again with output disabled
ERROR: zbar processor in zbar_processor_init():
unsupported request: no compatible image format
Passing it --verbose=32 returns some more info:
_zbar_video_open: opened camera device /dev/video0 (fd=5)
_zbar_v4l2_probe: Microsoft® LifeCam Cinema(TM) on usb-0000:00:1a.7-1.2 driver uvcvideo (version 3.7.1)
_zbar_v4l2_probe: capabilities: CAPTURE STREAMING
v4l2_reset_crop: crop bounds: 640 x 480 @ (0, 0)
v4l2_reset_crop: current crop win: 640 x 480 @ (0, 0) aspect 1 / 1
v4l2_probe_formats: enumerating supported formats:
v4l2_probe_formats: [0] YUYV : YUV 4:2:2 (YUYV)
v4l2_probe_formats: [1] MJPG : MJPEG COMPRESSED
v4l2_probe_formats: current format: YUYV(56595559) 640 x 480 (line=0x500 size=0x96000)
_zbar_v4l2_probe: using I/O mode: USERPTR
add_poll: [1] fd=6 handler=0x7fe987ab1150
_zbar_window_probe_xv: XVideo extension version 2.2
_zbar_window_probe_xv: WARNING: no XVideo adaptor supporting XvImages found
_zbar_window_attach: falling back to XImage
_zbar_window_probe_ximage: [0] depth=1 bpp=1: not supported
_zbar_window_probe_ximage: [1] depth=4 bpp=8: not supported
ximage_probe_format: bits=8 r=000000e0 g=0000001c b=00000003: n=0 visuals=(nil)
ximage_probe_format: bits=8 r=00000007 g=00000038 b=000000c0: n=0 visuals=(nil)
_zbar_window_probe_ximage: [2] depth=8 bpp=8: no visuals
_zbar_window_probe_ximage: [3] depth=15 bpp=16: not supported
ximage_probe_format: bits=16 r=0000f800 g=000007e0 b=0000001f: n=0 visuals=(nil)
ximage_probe_format: bits=16 r=00007c00 g=000003e0 b=0000001f: n=0 visuals=(nil)
ximage_probe_format: bits=16 r=000000f8 g=0007e000 b=00001f00: n=0 visuals=(nil)
ximage_probe_format: bits=16 r=0000007c g=0003e000 b=00001f00: n=0 visuals=(nil)
_zbar_window_probe_ximage: [4] depth=16 bpp=16: no visuals
ximage_probe_format: bits=24 r=000000ff g=0000ff00 b=00ff0000: n=0 visuals=(nil)
ximage_probe_format: bits=24 r=00ff0000 g=0000ff00 b=000000ff: n=4 visuals=0x2503590
_zbar_window_probe_ximage: [5] depth=24 bpp=32: BGR3(33524742)
ximage_probe_format: bits=32 r=0000ff00 g=00ff0000 b=ffffffffff000000: n=0 visuals=(nil)
ximage_probe_format: bits=32 r=00ff0000 g=0000ff00 b=000000ff: n=0 visuals=(nil)
_zbar_window_probe_ximage: [6] depth=32 bpp=32: no visuals
proc_input_thread: spawned input thread
_zbar_best_format: from YUYV(56595559) to BGR3(33524742)=144
zbar_negotiate_format: YUYV(56595559) -> BGR3(33524742) (144)
_zbar_best_format: from MJPG(47504a4d) to BGR3(33524742)=256
zbar_negotiate_format: MJPG(47504a4d) -> BGR3(33524742) (256)
zbar_negotiate_format: setting best format YUYV(56595559) (144)
v4l2_set_format: VIDIOC_S_FMT returned -1(16), trying interlaced...
ERROR: zbar video in v4l2_set_format():
system error: setting format 56595559 (VIDIOC_S_FMT): Device or resource busy (16)
WARNING: no compatible input to output format
...trying again with output disabled
_zbar_best_format: from YUYV(56595559) to Y800(30303859)=24
zbar_negotiate_format: YUYV(56595559) -> Y800(30303859) (24)
_zbar_best_format: from MJPG(47504a4d) to Y800(30303859)=96
zbar_negotiate_format: MJPG(47504a4d) -> Y800(30303859) (96)
zbar_negotiate_format: setting best format YUYV(56595559) (24)
v4l2_set_format: VIDIOC_S_FMT returned -1(16), trying interlaced...
ERROR: zbar video in v4l2_set_format():
system error: setting format 56595559 (VIDIOC_S_FMT): Device or resource busy (16)
zbar_processor_init: ERROR: no compatible video input format
ERROR: zbar processor in zbar_processor_init():
unsupported request: no compatible image format
ERROR: zbar processor in zbar_processor_init():
unsupported request: no compatible image format
proc_kick_handler: kicking 2 fds
This is on Gentoo, using the media-gfx/zbar ebuild in Portage. uname -a returns the following:
Linux janeway 3.7.1-gentoo #1 SMP PREEMPT Thu Jan 3 12:05:15 PST 2013 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
v4l-info:
### v4l2 device info [/dev/video0] ###
general info
VIDIOC_QUERYCAP
driver : "uvcvideo"
card : "Microsoft® LifeCam Cinema(TM)"
bus_info : "usb-0000:00:1a.7-1.2"
version : 3.7.1
capabilities : 0x4000001 [VIDEO_CAPTURE,STREAMING]
standards
inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "Camera 1"
type : CAMERA
audioset : 0
tuner : 0
std : 0x0 []
status : 0x0 []
video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 0
description : "YUV 4:2:2 (YUYV)"
pixelformat : 0x56595559 [YUYV]
VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
index : 1
type : VIDEO_CAPTURE
flags : 1
description : "MJPEG"
pixelformat : 0x47504a4d [MJPG]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 640
fmt.pix.height : 480
fmt.pix.pixelformat : 0x56595559 [YUYV]
fmt.pix.field : NONE
fmt.pix.bytesperline : 1280
fmt.pix.sizeimage : 614400
fmt.pix.colorspace : SRGB
fmt.pix.priv : 0
controls
VIDIOC_QUERYCTRL(BASE+0)
id : 9963776
type : INTEGER
name : "Brightness"
minimum : 30
maximum : 255
step : 1
default_value : 133
flags : 0
VIDIOC_QUERYCTRL(BASE+1)
id : 9963777
type : INTEGER
name : "Contrast"
minimum : 0
maximum : 10
step : 1
default_value : 5
flags : 0
VIDIOC_QUERYCTRL(BASE+2)
id : 9963778
type : INTEGER
name : "Saturation"
minimum : 0
maximum : 200
step : 1
default_value : 83
flags : 0
xdpyinfo:
name of display: :2141
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 60900000
X.Org version: 6.9.0
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7
supported pixmap formats:
depth 1, bits_per_pixel 1, scanline_pad 32
depth 4, bits_per_pixel 8, scanline_pad 32
depth 8, bits_per_pixel 8, scanline_pad 32
depth 15, bits_per_pixel 16, scanline_pad 32
depth 16, bits_per_pixel 16, scanline_pad 32
depth 24, bits_per_pixel 32, scanline_pad 32
depth 32, bits_per_pixel 32, scanline_pad 32
keycode range: minimum 8, maximum 255
focus: window 0x1a0014d, revert to PointerRoot
number of extensions: 26
BIG-REQUESTS
DAMAGE
DEC-XTRAP
DOUBLE-BUFFER
DPMS
Extended-Visual-Information
GLX
MIT-SHM
MIT-SUNDRY-NONSTANDARD
RANDR
RECORD
RENDER
SECURITY
SGI-GLX
SHAPE
SYNC
TOG-CUP
X-Resource
XC-APPGROUP
XC-MISC
XFIXES
XFree86-Bigfont
XInputExtension
XKEYBOARD
XTEST
XVideo
default screen number: 0
number of screens: 1
screen #0:
dimensions: 1674x997 pixels (567x338 millimeters)
resolution: 75x75 dots per inch
depths (7): 24, 1, 4, 8, 15, 16, 32
root window id: 0x57
depth of root window: 24 planes
number of colormaps: minimum 1, maximum 1
default colormap: 0x3d
default number of colormap cells: 256
preallocated pixels: black 0, white 16777215
options: backing-store YES, save-unders YES
largest cursor: 1674x997
current input event mask: 0xf8c031
KeyPressMask EnterWindowMask LeaveWindowMask
KeymapStateMask ExposureMask SubstructureNotifyMask
SubstructureRedirectMask FocusChangeMask PropertyChangeMask
ColormapChangeMask
number of visuals: 4
default visual id: 0x39
visual:
visual id: 0x39
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0x3a
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0x3b
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0x3c
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
Other apps are still able to use the camera...for instance, VLC will display live video from it.