TV Tuner TV 2000 XP - Leadtek on linux

*nix specific usage questions
vsai
Blank Cone
Blank Cone
Posts: 13
Joined: 14 Nov 2007 14:44

TV Tuner TV 2000 XP - Leadtek on linux

Postby vsai » 14 Nov 2007 17:19

Please help me with the following matter:
I have vlc 0.8.6c and a TV tuner TV 2000 XP on linux, kernel 2.6.20.
The driver is cx8800.

I launch the following command: /usr/local/bin/vlc -vvv --color v4l:/dev/video0 '#display' and I receive the following error:
[00000243] v4l demuxer debug: v4l device uses chroma: I420
[00000243] v4l demuxer warning: I420 refused
[00000243] v4l demuxer error: chroma selection failed
No image appers on the screen. There is also no sound, but I don't want sound for the moment.
The device is ok because I can see the image with tvtime.

The full output is this:
VLC media player 0.8.6c Janus
starting VLC root wrapper... using UID 1000 (victor)
[00000001] main private debug: checking builtin modules
[00000001] main private debug: checking plugin modules
[00000001] main private debug: loading plugins cache file /home/victor/.vlc/cache/plugins-04041e.dat
[00000001] main private debug: recursively browsing `modules'
[00000001] main private debug: recursively browsing `/usr/local/lib/vlc'
[00000001] main private debug: recursively browsing `plugins'
[00000001] main private debug: module bank initialized, found 183 modules
[00000001] main private debug: opening config file /home/victor/.vlc/vlcrc
[00000001] main private debug: CPU has capabilities 486 586 MMX 3DNow! MMXEXT SSE SSE2 FPU
[00000001] main private debug: looking for memcpy module: 4 candidates
[00000001] main private debug: using memcpy module "memcpymmxext"
[00000234] main playlist debug: waiting for thread completion
[00000234] main playlist debug: thread 3083561872 (playlist) created at priority 0 (playlist/playlist.c:184)
[00000235] main private debug: waiting for thread completion
[00000235] main private debug: thread 3075169168 (preparser) created at priority 0 (playlist/playlist.c:210)
[00000236] main interface debug: looking for interface module: 1 candidate
[00000236] main interface debug: using interface module "hotkeys"
[00000236] main interface debug: thread 3066751888 (interface) created at priority 0 (interface/interface.c:231)
[00000234] main playlist debug: adding playlist item `#display' ( #display )
[00000234] main playlist debug: adding playlist item `v4l:/dev/video0' ( v4l:/dev/video0 )
[00000238] main interface debug: looking for interface module: 2 candidates
[00000238] main interface debug: using interface module "wxwidgets"
[00000238] main interface debug: thread 3036617616 (manager) created at priority 0 (interface/interface.c:216)
[00000238] wxwidgets interface debug: Using last windows config '(-1,0,0,1024,768)(0,306,61,459,82)(6,0,0,-1,150)'
[00000238] wxwidgets interface debug: id=0 p=(306,61) s=(459,82)
[00000238] wxwidgets interface debug: id=6 p=(0,0) s=(-1,150)
[00000234] main playlist debug: nothing requested, starting
[00000234] main playlist debug: creating new input thread
[00000241] main input debug: waiting for thread completion
[00000241] main input debug: thread 2992700304 (input) created at priority 0 (input/input.c:265)
[00000241] main input debug: creating statistics handler
[00000241] main input debug: `v4l:/dev/video0' gives access `v4l' demux `' path `/dev/video0'
[00000241] main input debug: creating demux: access='v4l' demux='' path='/dev/video0'
[00000243] main demuxer debug: looking for access_demux module: 1 candidate
[00000243] v4l demuxer debug: main device=`/dev/video0'
[00000243] v4l demuxer debug: V4L device UNKNOWN/GENERIC 4 channels 0 audios 48 < w < 768 32 < h < 576
[00000243] v4l demuxer debug: invalid width 0
[00000243] v4l demuxer debug: invalid height 0
[00000243] v4l demuxer debug: setting channel Composite1(0) 0 tuners flags=0x0 type=0x2 norm=0x0
[00000243] v4l demuxer debug: invalid tuner, falling back on tuner 0
[00000243] v4l demuxer debug: will use 320x240
[00000243] v4l demuxer debug: v4l device uses brightness: 32639
[00000243] v4l demuxer debug: v4l device uses colour: 32639
[00000243] v4l demuxer debug: v4l device uses hue: 32639
[00000243] v4l demuxer debug: v4l device uses contrast: 16191
[00000243] v4l demuxer debug: v4l device uses frame size: 115200
[00000243] v4l demuxer debug: v4l device uses chroma: I420
[00000243] v4l demuxer warning: I420 refused
[00000243] v4l demuxer error: chroma selection failed
[00000243] v4l demuxer error: cannot set audio format (16b little endian) (Invalid argument)
[00000243] v4l demuxer error: cannot open device (No such file or directory)
[00000243] v4l demuxer debug: openened adev=`/dev/dsp' stereo 44100Hz
[00000243] v4l demuxer debug: v4l grabbing started
[00000243] v4l demuxer debug: new audio es 2 channels 44100Hz
[00000241] main input debug: selecting program id=0
[00000243] main demuxer debug: using access_demux module "v4l"
[00000245] main decoder debug: looking for decoder module: 18 candidates
[00000245] araw decoder debug: samplerate:44100Hz channels:2 bits/sample:16
[00000245] main decoder debug: using decoder module "araw"
[00000245] main decoder debug: thread 2982189968 (decoder) created at priority 0 (input/decoder.c:159)
[00000241] main input debug: `v4l:/dev/video0' successfully opened
[00000245] main decoder debug: no aout present, spawning one
[00000254] main audio output debug: looking for audio output module: 2 candidates
[00000254] main audio output debug: thread 2973797264 (aout) created at priority 0 (oss.c:520)
[00000254] main audio output debug: using audio output module "oss"
[00000254] main audio output debug: output 's16l' 44100 Hz Stereo frame=1 samples/4 bytes
[00000254] main audio output debug: mixer 'fl32' 44100 Hz Stereo frame=1 samples/8 bytes
[00000254] main audio output debug: filter(s) 'fl32'->'s16l' 44100 Hz->44100 Hz Stereo->Stereo
[00000255] main private debug: looking for audio filter module: 22 candidates
[00000255] main private debug: using audio filter module "float32tos16"
[00000254] main audio output debug: found a filter for the whole conversion
[00000254] main audio output debug: looking for audio mixer module: 3 candidates
[00000254] main audio output debug: using audio mixer module "trivial_mixer"
[00000254] main audio output debug: input 's16l' 44100 Hz Stereo frame=1 samples/4 bytes
[00000254] main audio output debug: filter(s) 's16l'->'fl32' 44100 Hz->44100 Hz Stereo->Stereo
[00000282] main private debug: looking for audio filter module: 22 candidates
[00000282] main private debug: using audio filter module "s16tofloat32"
[00000254] main audio output debug: found a filter for the whole conversion
[00000254] main audio output debug: filter(s) 'fl32'->'fl32' 48510 Hz->44100 Hz Stereo->Stereo
[00000283] main private debug: looking for audio filter module: 22 candidates
[00000283] main private debug: using audio filter module "bandlimited_resampler"
[00000254] main audio output debug: found a filter for the whole conversion
[00000254] main audio output debug: audio output is starving (23241), playing silence

v4l-info returns:

### v4l2 device info [/dev/video0] ###
general info
VIDIOC_QUERYCAP
driver : "cx8800"
card : "UNKNOWN/GENERIC"
bus_info : "PCI:0000:00:0a.0"
version : 0.0.6
capabilities : 0x5000011 [VIDEO_CAPTURE,VBI_CAPTURE,READWRITE,STREAMING]

standards
VIDIOC_ENUMSTD(0)
index : 0
id : 0x1000 [NTSC_M]
name : "NTSC-M"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(1)
index : 1
id : 0x2000 [NTSC_M_JP]
name : "NTSC-JP"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(2)
index : 2
id : 0x7 [PAL_B,PAL_B1,PAL_G]
name : "PAL-BG"
frameperiod.numerator : 1
frameperiod.denominator : 25
framelines : 625
VIDIOC_ENUMSTD(3)
index : 3
id : 0xe0 [PAL_D,PAL_D1,PAL_K]
name : "PAL-DK"
frameperiod.numerator : 1
frameperiod.denominator : 25
framelines : 625
VIDIOC_ENUMSTD(4)
index : 4
id : 0x10 [PAL_I]
name : "PAL-I"
frameperiod.numerator : 1
frameperiod.denominator : 25
framelines : 625
VIDIOC_ENUMSTD(5)
index : 5
id : 0x100 [PAL_M]
name : "PAL-M"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(6)
index : 6
id : 0x200 [PAL_N]
name : "PAL-N"
frameperiod.numerator : 1
frameperiod.denominator : 25
framelines : 625
VIDIOC_ENUMSTD(7)
index : 7
id : 0x400 [PAL_Nc]
name : "PAL-Nc"
frameperiod.numerator : 1
frameperiod.denominator : 25
framelines : 625
VIDIOC_ENUMSTD(8)
index : 8
id : 0x800 [PAL_60]
name : "PAL-60"
frameperiod.numerator : 1001
frameperiod.denominator : 30000
framelines : 525
VIDIOC_ENUMSTD(9)
index : 9
id : 0x400000 [SECAM_L]
name : "SECAM-L"
frameperiod.numerator : 1
frameperiod.denominator : 25
framelines : 625
VIDIOC_ENUMSTD(10)
index : 10
id : 0x320000 [SECAM_D,SECAM_K,SECAM_K1]
name : "SECAM-DK"
frameperiod.numerator : 1
frameperiod.denominator : 25
framelines : 625

inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "Composite1"
type : CAMERA
audioset : 0
tuner : 0
std : 0x723ff7 [PAL_B,PAL_B1,PAL_G,PAL_I,PAL_D,PAL_D1,PAL_K,PAL_M,PAL_N,PAL_Nc,PAL_60,NTSC_M,NTSC_M_JP,SECAM_D,SECAM_K,SECAM_K1,SECAM_L]
status : 0x0 []
VIDIOC_ENUMINPUT(1)
index : 1
name : "Composite2"
type : CAMERA
audioset : 0
tuner : 0
std : 0x723ff7 [PAL_B,PAL_B1,PAL_G,PAL_I,PAL_D,PAL_D1,PAL_K,PAL_M,PAL_N,PAL_Nc,PAL_60,NTSC_M,NTSC_M_JP,SECAM_D,SECAM_K,SECAM_K1,SECAM_L]
status : 0x0 []
VIDIOC_ENUMINPUT(2)
index : 2
name : "Composite3"
type : CAMERA
audioset : 0
tuner : 0
std : 0x723ff7 [PAL_B,PAL_B1,PAL_G,PAL_I,PAL_D,PAL_D1,PAL_K,PAL_M,PAL_N,PAL_Nc,PAL_60,NTSC_M,NTSC_M_JP,SECAM_D,SECAM_K,SECAM_K1,SECAM_L]
status : 0x0 []
VIDIOC_ENUMINPUT(3)
index : 3
name : "Composite4"
type : CAMERA
audioset : 0
tuner : 0
std : 0x723ff7 [PAL_B,PAL_B1,PAL_G,PAL_I,PAL_D,PAL_D1,PAL_K,PAL_M,PAL_N,PAL_Nc,PAL_60,NTSC_M,NTSC_M_JP,SECAM_D,SECAM_K,SECAM_K1,SECAM_L]
status : 0x0 []

video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 0
description : "8 bpp, gray"
pixelformat : 0x59455247 [GREY]
VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
index : 1
type : VIDEO_CAPTURE
flags : 0
description : "15 bpp RGB, le"
pixelformat : 0x4f424752 [RGBO]
VIDIOC_ENUM_FMT(2,VIDEO_CAPTURE)
index : 2
type : VIDEO_CAPTURE
flags : 0
description : "15 bpp RGB, be"
pixelformat : 0x51424752 [RGBQ]
VIDIOC_ENUM_FMT(3,VIDEO_CAPTURE)
index : 3
type : VIDEO_CAPTURE
flags : 0
description : "16 bpp RGB, le"
pixelformat : 0x50424752 [RGBP]
VIDIOC_ENUM_FMT(4,VIDEO_CAPTURE)
index : 4
type : VIDEO_CAPTURE
flags : 0
description : "16 bpp RGB, be"
pixelformat : 0x52424752 [RGBR]
VIDIOC_ENUM_FMT(5,VIDEO_CAPTURE)
index : 5
type : VIDEO_CAPTURE
flags : 0
description : "24 bpp RGB, le"
pixelformat : 0x33524742 [BGR3]
VIDIOC_ENUM_FMT(6,VIDEO_CAPTURE)
index : 6
type : VIDEO_CAPTURE
flags : 0
description : "32 bpp RGB, le"
pixelformat : 0x34524742 [BGR4]
VIDIOC_ENUM_FMT(7,VIDEO_CAPTURE)
index : 7
type : VIDEO_CAPTURE
flags : 0
description : "32 bpp RGB, be"
pixelformat : 0x34424752 [RGB4]
VIDIOC_ENUM_FMT(8,VIDEO_CAPTURE)
index : 8
type : VIDEO_CAPTURE
flags : 0
description : "4:2:2, packed, YUYV"
pixelformat : 0x56595559 [YUYV]
VIDIOC_ENUM_FMT(9,VIDEO_CAPTURE)
index : 9
type : VIDEO_CAPTURE
flags : 0
description : "4:2:2, packed, UYVY"
pixelformat : 0x59565955 [UYVY]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 320
fmt.pix.height : 240
fmt.pix.pixelformat : 0x33524742 [BGR3]
fmt.pix.field : INTERLACED
fmt.pix.bytesperline : 960
fmt.pix.sizeimage : 230400
fmt.pix.colorspace : unknown
fmt.pix.priv : 0

vbi capture
VIDIOC_G_FMT(VBI_CAPTURE)
type : VBI_CAPTURE
fmt.vbi.sampling_rate : 35468950
fmt.vbi.offset : 244
fmt.vbi.samples_per_line: 2048
fmt.vbi.sample_format : 0x59455247 [GREY]
fmt.vbi.start[0] : 6
fmt.vbi.start[1] : 318
fmt.vbi.count[0] : 17
fmt.vbi.count[1] : 17
fmt.vbi.flags : 0

controls
VIDIOC_QUERYCTRL(BASE+0)
id : 9963776
type : INTEGER
name : "Brightness"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 0
VIDIOC_QUERYCTRL(BASE+1)
id : 9963777
type : INTEGER
name : "Contrast"
minimum : 0
maximum : 255
step : 1
default_value : 63
flags : 0
VIDIOC_QUERYCTRL(BASE+2)
id : 9963778
type : INTEGER
name : "Saturation"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 0
VIDIOC_QUERYCTRL(BASE+3)
id : 9963779
type : INTEGER
name : "Hue"
minimum : 0
maximum : 255
step : 1
default_value : 127
flags : 0
VIDIOC_QUERYCTRL(BASE+5)
id : 9963781
type : INTEGER
name : "Volume"
minimum : 0
maximum : 63
step : 1
default_value : 63
flags : 0
VIDIOC_QUERYCTRL(BASE+6)
id : 9963782
type : INTEGER
name : "Balance"
minimum : 0
maximum : 127
step : 1
default_value : 64
flags : 0
VIDIOC_QUERYCTRL(BASE+9)
id : 9963785
type : BOOLEAN
name : "Mute"
minimum : 0
maximum : 1
step : 0
default_value : 1
flags : 0

### video4linux device info [/dev/video0] ###
general info
VIDIOCGCAP
name : "UNKNOWN/GENERIC"
type : 0x5 [CAPTURE,TELETEXT]
channels : 4
audios : 0
maxwidth : 768
maxheight : 576
minwidth : 48
minheight : 32

channels
VIDIOCGCHAN(0)
channel : 0
name : "Composite1"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 0
VIDIOCGCHAN(1)
channel : 1
name : "Composite2"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 0
VIDIOCGCHAN(2)
channel : 2
name : "Composite3"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 0
VIDIOCGCHAN(3)
channel : 3
name : "Composite4"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 0

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
ioctl VIDIOCGAUDIO: Invalid argument

picture
VIDIOCGPICT
brightness : 32639
hue : 32639
colour : 32639
contrast : 16191
whiteness : 0
depth : 24
palette : RGB24

buffer
ioctl VIDIOCGFBUF: Invalid argument

window
VIDIOCGWIN
x : 0
y : 0
width : 320
height : 240
chromakey : 0
flags : 0

chrismacgregor
New Cone
New Cone
Posts: 2
Joined: 17 Feb 2008 08:31

Re: TV Tuner TV 2000 XP - Leadtek on linux

Postby chrismacgregor » 17 Feb 2008 09:38

The problem seems to be that vlc tests for available formats by trying them with ioctl VIDIOCSPICT, but usbvideo.c (the kernel device driver) does not actually pay any attention to the palette field at all in that ioctl. I've just submitted a patch to fix this, but I don't imagine that will help anyone for a while.

However, in the meantime, you can work around the problem by setting the "Video input chroma format" parameter (under advanced options) to the FOURCC corresponding to the format you want to use. You can find the list of formats and FOURCC's in the vlc source in modules/access/v4l/v4l.c (search for v4lchroma_to_fourcc), here (hmm, the file is in a different place in subversion already): http://trac.videolan.org/vlc/browser/tr ... cess/v4l.c

In my case, for a Logitech Quickcam Messenger, setting it to RV24 did the trick. Your mileage may vary. It's not clear how you would find out what format your camera likes without hacking vlc; it might be buried someplace in the v4l-info output, but it's hard to tell and I don't seem to have that here on FC7. Of course, you could just try them all, but that's a pain. So I wrote a little program to print out the answer; source below, source and binary (works on FC6 and later, probably most other distros as well) on the Cybermato Consulting Miscellany page.

Code: Select all

// a little hack by Chris MacGregor (http://www.cybermato.com) to help determine what // format to tell vlc (http://www.videolan.org) to use for a USB webcam on Linux. #include <sys/ioctl.h> #include <linux/videodev.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> // This table was taken from the vlc sources (v4l.c) and restructured // slightly. struct format_to_fourcc { int format; const char * fourcc; }; static struct format_to_fourcc format_to_fourcc[] = { { VIDEO_PALETTE_GREY, "GREY" }, { VIDEO_PALETTE_HI240, "I240" }, { VIDEO_PALETTE_RGB565, "RV16" }, { VIDEO_PALETTE_RGB555, "RV15" }, { VIDEO_PALETTE_RGB24, "RV24" }, { VIDEO_PALETTE_RGB32, "RV32" }, { VIDEO_PALETTE_YUV422, "I422" }, { VIDEO_PALETTE_YUYV, "YUYV" }, { VIDEO_PALETTE_UYVY, "UYVY" }, { VIDEO_PALETTE_YUV420, "I42N" }, { VIDEO_PALETTE_YUV411, "I41N" }, { VIDEO_PALETTE_RAW, "GRAW" }, { VIDEO_PALETTE_YUV422P, "I422" }, { VIDEO_PALETTE_YUV420P, "I420" }, { VIDEO_PALETTE_YUV411P, "I411" }, { 0, 0 } }; int main (int argc, const char * argv []) { const char * usage_message = "Usage: %s /dev/video (or whatever device you wish to query)\n"; if (argc != 2) { printf (usage_message, argv[0]); return 1; } const char * devname = argv[1]; int fd = open (devname, O_RDWR); if (fd < 0) { perror (devname); printf (usage_message, argv[0]); return 1; } struct video_picture vpic; if (ioctl (fd, VIDIOCGPICT, &vpic) < 0) { perror ("ioctl VIDIOCGPICT"); close (fd); return 1; } const char * fourcc = "(unknown)"; struct format_to_fourcc * fptr = format_to_fourcc; while (fptr->fourcc) { if (fptr->format == vpic.palette) { fourcc = fptr->fourcc; break; } ++fptr; } printf ("Current format is %d, fourcc is %s\n", vpic.palette, fourcc); close (fd); return 0; }


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 34 guests