DTV2000 H Plus issues
I have 2 TV Cards. The DTV2000 H Plus and a Technisat. The Technisat works very well. I am trying to get the DVT working for other video input devices such as VCR to make copies of old Videos and an inteface for my N95 video out.
I do not seem to be able to get it to find a tuner. Seems to be problem finding the card. Any suggestions wold be greatly appreciated.
Here is part of an mplayer -verbose output
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <[email protected]>
comment: first try, more to come ;-)
Selected device: UNKNOWN/GENERIC
Capabilites: video capture VBI capture device read/write streaming
supported norms: 0 = NTSC-M; 1 = NTSC-M-JP; 2 = NTSC-443; 3 = PAL-BG;
4 = PAL-I; 5 = PAL-DK; 6 = PAL-M; 7 = PAL-N; 8 = PAL-Nc; 9 = PAL-60; 10 = SECAM-B; 11 = SECAM-G; 12 = SECAM-H; 13 = SECAM-DK; 14 = SECAM-L;
inputs: 0 = Composite1; 1 = Composite2; 2 = Composite3; 3 = Composite4;
I am running Kubuntu Karmic 2.6.31-16-generic on AMD64 quadcore. I have latest mercurial of v4l installed.
Here is the Lspci info and dmesg etc
5:05.0 Network controller [0280]: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card [13d0:2103] (rev 02)
Subsystem: Techsan Electronics Co Ltd B2C2 FlexCopII DVB chip /
Technisat SkyStar2 DVB card [13d0:2103]
Flags: bus master, slow devsel, latency 64, IRQ 20
Memory at fbff0000 (32-bit, non-prefetchable) [size=64K]
I/O ports at ec00 [size=32]
Kernel driver in use: b2c2_flexcop_pci
Kernel modules: b2c2-flexcop-pci
05:06.0 Multimedia video controller [0400]: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [14f1:8800] (rev 05)
Subsystem: LeadTek Research Inc. Device [107d:6f42]
Flags: bus master, medium devsel, latency 64, IRQ 21
Memory at f8000000 (32-bit, non-prefetchable) [size=16M]
Capabilities: <access denied>
Kernel driver in use: cx8800
Kernel modules: cx8800
05:06.1 Multimedia controller [0480]: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] [14f1:8801] (rev 05)
Subsystem: LeadTek Research Inc. Device [107d:6f42]
Flags: bus master, medium devsel, latency 64, IRQ 21
Memory at f9000000 (32-bit, non-prefetchable) [size=16M]
Capabilities: <access denied>
Kernel driver in use: cx88_audio
Kernel modules: cx88-alsa
05:06.2 Multimedia controller [0480]: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] [14f1:8802] (rev 05)
Subsystem: LeadTek Research Inc. Device [107d:6f42]
Flags: bus master, medium devsel, latency 64, IRQ 10
Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
Capabilities: <access denied>
Kernel modules: cx8802
dmesg in part here:
[snip]
[ 20.387650] b2c2-flexcop: B2C2 FlexcopII/II(b)/III digital TV receiver chip loaded successfully [ 20.390596] EDAC MC: Ver: 2.1.0 Dec 8 2009
[ 20.392347] flexcop-pci: will use the HW PID filter.
[ 20.392351] flexcop-pci: card revision 2
[ 20.392359] alloc irq_desc for 20 on node 0
[ 20.392361] alloc kstat_irqs on node 0
[ 20.392366] b2c2_flexcop_pci 0000:05:05.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20 [ 20.403400] EDAC amd64_edac: Ver: 3.2.0 Dec 8 2009
[ 20.404070] EDAC amd64: This node reports that Memory ECC is currently disabled. [ 20.404073] EDAC amd64: bit 0x400000 in register F3x44 of the MISC_CONTROL device (0000:00:18.3) should be enabled [ 20.404076] EDAC amd64: WARNING: ECC is NOT currently enabled by the BIOS. Module will NOT be loaded. [ 20.404077] Either Enable ECC in the BIOS, or use the 'ecc_enable_override' parameter. [ 20.404078] Might be a BIOS bug, if BIOS says ECC is enabled
[ 20.404078] Use of the override can cause unknown side effects.
[ 20.404541] amd64_edac: probe of 0000:00:18.2 failed with error -22
[ 20.425278] HDA Intel 0000:00:14.2: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 20.430203] DVB: registering new adapter (FlexCop Digital TV device)
[ 20.431702] b2c2-flexcop: MAC address = 00:d0:d7:16:5d:8f
[ 20.432308] CX24123: cx24123_i2c_readreg: reg=0x0 (error=-121)
[ 20.432311] CX24123: wrong demod revision: 87
[ 20.547542] Linux video capture interface: v2.00
[ 20.555291] HDA Intel 0000:01:00.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19 [ 20.555310] HDA Intel 0000:01:00.1: setting latency timer to 64
[ 20.608776] EXT3 FS on sda1, internal journal
[ 20.857754] cx88/0: cx2388x v4l2 driver version 0.0.7 loaded
[ 20.859425] cx88/2: cx2388x MPEG-TS Driver Manager version 0.0.7 loaded [ 20.859959] b2c2-flexcop: found 'Zarlink MT352 DVB-T' .
[ 20.859963] DVB: registering adapter 0 frontend 0 (Zarlink MT352 DVB-T)... [ 20.860017] b2c2-flexcop: initialization of 'Air2PC/AirStar 2 DVB-T' at the 'PCI' bus controlled by a 'FlexCopIIb' complete [ 20.861717] cx2388x alsa driver version 0.0.7 loaded
[ 20.862371] alloc irq_desc for 21 on node 0
[ 20.862373] alloc kstat_irqs on node 0
[ 20.862379] cx8800 0000:05:06.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21 [ 20.862549] cx88[0]: Your board isn't known (yet) to the driver. You can [ 20.862550] cx88[0]: try to pick one of the existing card configs via
[ 20.862551] cx88[0]: card=<n> insmod option. Updating to the latest
[ 20.862552] cx88[0]: version might help as well.
[ 20.862554] cx88[0]: Here is a list of valid choices for the card=<n> insmod option: [ 20.862556] cx88[0]: card=0 -> UNKNOWN/GENERIC
[ 20.862558] cx88[0]: card=1 -> Hauppauge WinTV 34xxx models
[ 20.862559] cx88[0]: card=2 -> GDI Black Gold
[ 20.862561] cx88[0]: card=3 -> PixelView
[ 20.862562] cx88[0]: card=4 -> ATI TV Wonder Pro
[ 20.862563] cx88[0]: card=5 -> Leadtek Winfast 2000XP Expert
[ 20.862565] cx88[0]: card=6 -> AverTV Studio 303 (M126)
[ 20.862566] cx88[0]: card=7 -> MSI TV-@nywhere Master
[ 20.862568] cx88[0]: card=8 -> Leadtek Winfast DV2000
[ 20.862569] cx88[0]: card=9 -> Leadtek PVR 2000
[ 20.862571] cx88[0]: card=10 -> IODATA GV-VCP3/PCI
[ 20.862572] cx88[0]: card=11 -> Prolink PlayTV PVR
[ 20.862574] cx88[0]: card=12 -> ASUS PVR-416
[ 20.862575] cx88[0]: card=13 -> MSI TV-@nywhere
[ 20.862577] cx88[0]: card=14 -> KWorld/VStream XPert DVB-T
[ 20.862578] cx88[0]: card=15 -> DViCO FusionHDTV DVB-T1
[ 20.862580] cx88[0]: card=16 -> KWorld LTV883RF
[ 20.862581] cx88[0]: card=17 -> DViCO FusionHDTV 3 Gold-Q
[ 20.862583] cx88[0]: card=18 -> Hauppauge Nova-T DVB-T
[ 20.862584] cx88[0]: card=19 -> Conexant DVB-T reference design
[ 20.862586] cx88[0]: card=20 -> Provideo PV259
[ 20.862587] cx88[0]: card=21 -> DViCO FusionHDTV DVB-T Plus
[ 20.862589] cx88[0]: card=22 -> pcHDTV HD3000 HDTV
[ 20.862590] cx88[0]: card=23 -> digitalnow DNTV Live! DVB-T
[ 20.862592] cx88[0]: card=24 -> Hauppauge WinTV 28xxx (Roslyn) models [ 20.862593] cx88[0]: card=25 -> Digital-Logic MICROSPACE Entertainment Center (MEC) [ 20.862595] cx88[0]: card=26 -> IODATA GV/BCTV7E
[ 20.862597] cx88[0]: card=27 -> PixelView PlayTV Ultra Pro (Stereo) [ 20.862598] cx88[0]: card=28 -> DViCO FusionHDTV 3 Gold-T
[ 20.862600] cx88[0]: card=29 -> ADS Tech Instant TV DVB-T PCI
[ 20.862601] cx88[0]: card=30 -> TerraTec Cinergy 1400 DVB-T
[ 20.862603] cx88[0]: card=31 -> DViCO FusionHDTV 5 Gold
[ 20.862604] cx88[0]: card=32 -> AverMedia UltraTV Media Center PCI 550 [ 20.862606] cx88[0]: card=33 -> Kworld V-Stream Xpert DVD
[ 20.862607] cx88[0]: card=34 -> ATI HDTV Wonder
[ 20.862609] cx88[0]: card=35 -> WinFast DTV1000-T
[ 20.862610] cx88[0]: card=36 -> AVerTV 303 (M126)
[ 20.862611] cx88[0]: card=37 -> Hauppauge Nova-S-Plus DVB-S
[ 20.862613] cx88[0]: card=38 -> Hauppauge Nova-SE2 DVB-S
[ 20.862614] cx88[0]: card=39 -> KWorld DVB-S 100
[ 20.862616] cx88[0]: card=40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [ 20.862618] cx88[0]: card=41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [ 20.862619] cx88[0]: card=42 -> digitalnow DNTV Live! DVB-T Pro
[ 20.862621] cx88[0]: card=43 -> KWorld/VStream XPert DVB-T with cx22702 [ 20.862623] cx88[0]: card=44 -> DViCO FusionHDTV DVB-T Dual Digital [ 20.862624] cx88[0]: card=45 -> KWorld HardwareMpegTV XPert
[ 20.862626] cx88[0]: card=46 -> DViCO FusionHDTV DVB-T Hybrid
[ 20.862627] cx88[0]: card=47 -> pcHDTV HD5500 HDTV
[ 20.862628] cx88[0]: card=48 -> Kworld MCE 200 Deluxe
[ 20.862630] cx88[0]: card=49 -> PixelView PlayTV P7000
[ 20.862631] cx88[0]: card=50 -> NPG Tech Real TV FM Top 10
[ 20.862633] cx88[0]: card=51 -> WinFast DTV2000 H
[ 20.862634] cx88[0]: card=52 -> Geniatech DVB-S
[ 20.862636] cx88[0]: card=53 -> Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T [ 20.862637] cx88[0]: card=54 -> Norwood Micro TV Tuner
[ 20.862639] cx88[0]: card=55 -> Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM [ 20.862641] cx88[0]: card=56 -> Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder [ 20.862643] cx88[0]: card=57 -> ADS Tech Instant Video PCI
[ 20.862644] cx88[0]: card=58 -> Pinnacle PCTV HD 800i
[ 20.862645] cx88[0]: card=59 -> DViCO FusionHDTV 5 PCI nano
[ 20.862647] cx88[0]: card=60 -> Pinnacle Hybrid PCTV
[ 20.862648] cx88[0]: card=61 -> Leadtek TV2000 XP Global
[ 20.862650] cx88[0]: card=62 -> PowerColor RA330
[ 20.862651] cx88[0]: card=63 -> Geniatech X8000-MT DVBT
[ 20.862653] cx88[0]: card=64 -> DViCO FusionHDTV DVB-T PRO
[ 20.862654] cx88[0]: card=65 -> DViCO FusionHDTV 7 Gold
[ 20.862656] cx88[0]: card=66 -> Prolink Pixelview MPEG 8000GT
[ 20.862657] cx88[0]: card=67 -> Kworld PlusTV HD PCI 120 (ATSC 120) [ 20.862659] cx88[0]: card=68 -> Hauppauge WinTV-HVR4000 DVB-S/S2/T/Hybrid [ 20.862661] cx88[0]: card=69 -> Hauppauge WinTV-HVR4000(Lite) DVB-S/S2 [ 20.862662] cx88[0]: card=70 -> TeVii S460 DVB-S/S2
[ 20.862664] cx88[0]: card=71 -> Omicom SS4 DVB-S/S2 PCI
[ 20.862665] cx88[0]: card=72 -> TBS 8920 DVB-S/S2
[ 20.862666] cx88[0]: card=73 -> TeVii S420 DVB-S
[ 20.862668] cx88[0]: card=74 -> Prolink Pixelview Global Extreme
[ 20.862669] cx88[0]: card=75 -> PROF 7300 DVB-S/S2
[ 20.862671] cx88[0]: card=76 -> SATTRADE ST4200 DVB-S/S2
[ 20.862672] cx88[0]: card=77 -> TBS 8910 DVB-S
[ 20.862674] cx88[0]: card=78 -> Prof 6200 DVB-S
[ 20.862675] cx88[0]: card=79 -> Terratec Cinergy HT PCI MKII
[ 20.862677] cx88[0]: card=80 -> Hauppauge WinTV-IR Only
[ 20.862678] cx88[0]: card=81 -> Leadtek WinFast DTV1800 Hybrid
[ 20.862680] cx88[0]: card=82 -> WinFast DTV2000 H rev. J
[ 20.862681] cx88[0]: card=83 -> Prof 7301 DVB-S/S2
[ 20.862683] cx88[0]: subsystem: 107d:6f42, board: UNKNOWN/GENERIC [card=0,autodetected], frontend(s): 0 [ 20.862685] cx88[0]: TV tuner type -1, Radio tuner type -1
[ 21.020478] tuner 3-0061: chip found @ 0xc2 (cx88[0])
[ 21.065392] cx88[0]/0: found at 0000:05:06.0, rev: 5, irq: 21, latency: 64, mmio: 0xf8000000 [ 21.065403] IRQ 21/cx88[0]: IRQF_DISABLED is not guaranteed on shared IRQs [ 21.065461] cx88[0]/0: registered device video0 [v4l2]
[ 21.065480] cx88[0]/0: registered device vbi0
[ 21.065489] tuner 3-0061: tuner type not set
[ 21.074373] cx88[0]/2: cx2388x 8802 Driver Manager
[ 21.074759] cx88_audio 0000:05:06.1: PCI INT A -> GSI 21 (level, low) -> IRQ 21 [ 21.074767] IRQ 21/cx88[0]: IRQF_DISABLED is not guaranteed on shared IRQs [ 21.074786] cx88[0]/1: CX88x/0: ALSA support for cx2388x boards
23.773910] tun: Universal TUN/TAP device driver, 1.6
[ 23.773912] tun: (C) 1999-2004 Max Krasnyansky <[email protected]> [ 23.774358] tun0: Disabled Privacy Extensions
[snip]
162.841498] tuner 3-0061: tuner type not set
Quoted 7 lines · Raena Lea-Shannon
I have 2 TV Cards. The DTV2000 H Plus and a Technisat. The Technisat works very well. I am trying to get the DVT working for other video input devices such as VCR to make copies of old Videos and an inteface for my N95 video out.
I do not seem to be able to get it to find a tuner. Seems to be problem finding the card. Any suggestions wold be greatly appreciated.
This card uses an Xceive XC4000 tuner, which is not supported yet. However, a driver for the tuner chip is being developed at kernellabs.com, so the card may become supported in the future.
Quoted 7 lines · [email protected] wrote:
Quoted 5 lines · Raena Lea-Shannon
I have 2 TV Cards. The DTV2000 H Plus and a Technisat. The Technisat works very well. I am trying to get the DVT working for other video input devices such as VCR to make copies of old Videos and an inteface for my N95 video out.
Quoted 7 lines
Quoted 2 lines
I do not seem to be able to get it to find a tuner. Seems to be problem finding the card. Any suggestions wold be greatly appreciated.
This card uses an Xceive XC4000 tuner, which is not supported yet. However, a driver for the tuner chip is being developed at kernellabs.com, so the card may become supported in the future. --
[snip]
That seems odd. This patch on the LinuxTv site
http://www.linuxtv.org/pipermail/linux-dvb/2008-June/026379.html
seems to be using the cx88 drivers?
Has anyone tried this patch?
Ta
Raena
# HG changeset patch
# User plr.vincent at gmail.com
# Date 1212398724 -7200
# Node ID 78a011dfba127b593b6d01ea6a0010fcc29c94ad # Parent 398b07fdfe79ff66a8c1bf2874de424ce29b9c78 WinFast DTV2000 H: add support for missing analog inputs
From: Vincent Pelletier <plr.vincent at gmail.com>
Add support for the following inputs:
- radio tuner
- composite 1 & 2 (only 1 is physicaly available, but composite 2 is also advertised by windows driver)
- svideo
linux/drivers/media/video/cx88/cx88-cards.c Mon Jun 02 11:25:24 2008 +0200 renamed from linux/drivers/media/video/cx88/cx88-cards.c Wed May 28 17:55:13 2008 -0300 +28 -0
@@ -1297,7 +1297,35 @@ .gpio1 = 0x00008203, .gpio2 = 0x00017304, .gpio3 = 0x02000000, + },{ + .type = CX88_VMUX_COMPOSITE1, + .vmux = 1, + .gpio0 = 0x0001D701, + .gpio1 = 0x0000B207, + .gpio2 = 0x0001D701, + .gpio3 = 0x02000000, + },{ + .type = CX88_VMUX_COMPOSITE2, + .vmux = 2, + .gpio0 = 0x0001D503, + .gpio1 = 0x0000B207, + .gpio2 = 0x0001D503, + .gpio3 = 0x02000000, + },{ + .type = CX88_VMUX_SVIDEO, + .vmux = 3, + .gpio0 = 0x0001D701, + .gpio1 = 0x0000B207, + .gpio2 = 0x0001D701, + .gpio3 = 0x02000000, }}, + .radio = { + .type = CX88_RADIO, + .gpio0 = 0x00015702, + .gpio1 = 0x0000F207, + .gpio2 = 0x00015702, + .gpio3 = 0x02000000, + }, .mpeg = CX88_MPEG_DVB, }, [CX88_BOARD_GENIATECH_DVBS] = {
Quoted 1 line
Quoted 16 lines · Raena Lea-Shannon
Quoted 7 lines · [email protected] wrote:
Quoted 5 lines · Raena Lea-Shannon
I have 2 TV Cards. The DTV2000 H Plus and a Technisat. The Technisat works very well. I am trying to get the DVT working for other video input devices such as VCR to make copies of old Videos and an inteface for my N95 video out.
Quoted 6 lines
Quoted 2 lines
I do not seem to be able to get it to find a tuner. Seems to be problem finding the card. Any suggestions wold be greatly appreciated.
This card uses an Xceive XC4000 tuner, which is not supported yet.
However, a driver for the tuner chip is being developed at kernellabs.com, so the card may become supported in the future. --
Quoted 5 lines
[snip]
That seems odd. This patch on the LinuxTv site
http://www.linuxtv.org/pipermail/linux-dvb/2008-June/026379.html
seems to be using the cx88 drivers?
[...]
Hi,
I'm not a developer, but I think that your device uses both of these chips. cx88 is the bridge chip, while the Xceive is the tuner chip. So, both of them needs to be supported in order for a device to work properly.
Please see the following link for reference:
http://www.kernellabs.com/blog/?p=1045
Regards
Quoted 26 lines · Samuel Rakitnican
Quoted 21 lines · Raena Lea-Shannon
Quoted 7 lines · [email protected] wrote:
Quoted 5 lines · Raena Lea-Shannon
I have 2 TV Cards. The DTV2000 H Plus and a Technisat. The Technisat works very well. I am trying to get the DVT working for other video input devices such as VCR to make copies of old Videos and an inteface for my N95 video out.
Quoted 6 lines
Quoted 2 lines
I do not seem to be able to get it to find a tuner. Seems to be problem finding the card. Any suggestions wold be greatly appreciated.
This card uses an Xceive XC4000 tuner, which is not supported yet.
However, a driver for the tuner chip is being developed at kernellabs.com, so the card may become supported in the future.[snip]
That seems odd. This patch on the LinuxTv site
http://www.linuxtv.org/pipermail/linux-dvb/2008-June/026379.html
seems to be using the cx88 drivers?[...]
Quoted 13 lines
Hi,
I'm not a developer, but I think that your device uses both of these chips. cx88 is the bridge chip, while the Xceive is the tuner chip. So, both of them needs to be supported in order for a device to work properly.
Please see the following link for reference:
http://www.kernellabs.com/blog/?p=1045Regards
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks
Quoted 3 lines · Raena Lea-Shannon
That seems odd. This patch on the LinuxTv site
http://www.linuxtv.org/pipermail/linux-dvb/2008-June/026379.html
seems to be using the cx88 drivers?
Unfortunately, this patch is for the older DTV 2000H (not Plus) card, which uses a Philips FMD1216 tuner. The main change on the "Plus" card is the replacement of the tuner with the XC4000, and that is why it is not supported yet. However, an XC4000 driver is already under development, and - compiling V4L from source - you could get the card working in the near future. In fact, code that implements support for this card already exists, but it is only for development/testing at the moment.
Quoted 6 lines · [email protected] wrote:
Quoted 3 lines · Raena Lea-Shannon
That seems odd. This patch on the LinuxTv site
http://www.linuxtv.org/pipermail/linux-dvb/2008-June/026379.html
seems to be using the cx88 drivers?
Quoted 13 lines
Unfortunately, this patch is for the older DTV 2000H (not Plus) card, which uses a Philips FMD1216 tuner. The main change on the "Plus" card is the replacement of the tuner with the XC4000, and that is why it is not supported yet. However, an XC4000 driver is already under development, and - compiling V4L from source - you could get the card working in the near future. In fact, code that implements support for this card already exists, but it is only for development/testing at the moment.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks. Will try again later.
Quoted 1 line · Raena Lea-Shannon
Thanks. Will try again later.
By the way, for those who would like to test it, here is a patch based on Devin Heitmueller's XC4000 driver and Mirek Slugen's older patch, that adds support for this card:
http://www.sharemation.com/IstvanV/v4l/dtv2000h+.patch
It can be applied to this version of the v4l-dvb code:
http://linuxtv.org/hg/v4l-dvb/archive/75c97b2d1a2a.tar.bz2
This is experimental code, so use it at your own risk. The analogue parts (TV and FM radio) basically work, although there are some minor issues to be fixed. Digital TV is not tested yet, but is theoretically implemented; reports on whether it actually works are welcome. The XC4000 driver also requires a firmware file:
http://www.sharemation.com/IstvanV/v4l/dvb-fe-xc4000-1.4.1.fw
Quoted 4 lines · On Thu, Jan 7, 2010 at 2:49 PM, [email protected] <[email protected]> wrote:
Quoted 1 line · Raena Lea-Shannon
Thanks. Will try again later.
Quoted 17 lines
By the way, for those who would like to test it, here is a patch based on Devin Heitmueller's XC4000 driver and Mirek Slugen's older patch, that adds support for this card:
http://www.sharemation.com/IstvanV/v4l/dtv2000h+.patch
It can be applied to this version of the v4l-dvb code:
http://linuxtv.org/hg/v4l-dvb/archive/75c97b2d1a2a.tar.bz2
This is experimental code, so use it at your own risk. The analogue parts (TV and FM radio) basically work, although there are some minor issues to be fixed. Digital TV is not tested yet, but is theoretically implemented; reports on whether it actually works are welcome. The XC4000 driver also requires a firmware file:
http://www.sharemation.com/IstvanV/v4l/dvb-fe-xc4000-1.4.1.fw
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Istan_v,
Could you please do me a favor and rename your firmware file, both in the patch and the file you are redistributing (perhaps as dvb-fe-xc4000-1.4.1-istanv.fw)? I worry that by redistributing a file with the exact same name as the "official" release, people are going to get confused and it will make it harder for me to debug problems given my assumptions about what firmware image they are using is incorrect.
Thanks,
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Quoted 7 lines · Devin Heitmueller
Could you please do me a favor and rename your firmware file, both in the patch and the file you are redistributing (perhaps as dvb-fe-xc4000-1.4.1-istanv.fw)? I worry that by redistributing a file with the exact same name as the "official" release, people are going to get confused and it will make it harder for me to debug problems given my assumptions about what firmware image they are using is incorrect.
OK, I have renamed the firmware file. The download links are now:
http://www.sharemation.com/IstvanV/v4l/dtv2000h+.patch
http://www.sharemation.com/IstvanV/v4l/xc4000-dtv2000hp-1.4.1.fw
I have an updated version now, with these changes:
- the firmware file name can be specified with the "firmware_name" module parameter; it defaults to "xc4000.fw"
- there is another new module parameter ("audio_std") for configuring the audio standard (NICAM, A2, etc.), and switching FM radio to using input 1 (i.e. cable TV instead of FM antenna). This is an integer value which can be the sum of:
1: use NICAM/B or A2/B instead of NICAM/A or A2/A
2: use A2 instead of NICAM or BTSC
4: use SECAM K3 instead of K1
8: in SECAM D/K mode, set the IF frequency and audio mode as for
SECAM-L (this hack fixed the one SECAM channel I can receive)
16: use FM radio input 1 instead of input 2
32: mono TV audio (does not seem to work, so it is useless)
- "struct xc4000_config" has a new member ("card_type") for specifying the card type
- some code changes to allow for loading the new firmware files below
In addition to analog TV and FM radio, I have tested the IR as well, and it apparently works. DVB-T is still untested, however.
There are two separate patches for v4l-dvb revision 28f5eca12bb0: the first one adds the XC4000 driver, while the second one adds support for the Leadtek WinFast DTV2000H Plus card in the CX88 driver.
http://www.sharemation.com/IstvanV/v4l/xc4000-28f5eca12bb0.patch
http://www.sharemation.com/IstvanV/v4l/cx88-dtv2000h+-28f5eca12bb0.patch
These new firmware files are more complete than the previous ones, but are not compatible with the original driver. Both version 1.2 and 1.4 are available:
http://www.sharemation.com/IstvanV/v4l/xc4000-1.2.fw
http://www.sharemation.com/IstvanV/v4l/xc4000-1.4.fw
Note that the 1.4 firmware could have two different versions of DTV6, which only differ in the audio mode register: 0x8002 (as in v1.2) vs. 0x8003. However, the above file includes only the latter one.
The following simple utility was used for creating the firmware files. It can extract the firmware data from a Windows driver file (e.g. hcw85bda.sys from Hauppauge, wfeaglxt.sys from Leadtek, etc.; dvb7700all.sys from Pinnacle will not work, however), and supports both v1.2 and v1.4 firmware. The tables at the beginning of the code are not necessarily fully correct, though, and may need some fixing.
http://www.sharemation.com/IstvanV/v4l/xc4000fw.c
Quoted 14 lines · On 01/07/2010 08:49 PM, [email protected] wrote:
Quoted 1 line · Raena Lea-Shannon
Thanks. Will try again later.
By the way, for those who would like to test it, here is a patch based on Devin Heitmueller's XC4000 driver and Mirek Slugen's older patch, that adds support for this card:
http://www.sharemation.com/IstvanV/v4l/dtv2000h+.patch
It can be applied to this version of the v4l-dvb code:
http://linuxtv.org/hg/v4l-dvb/archive/75c97b2d1a2a.tar.bz2
This is experimental code, so use it at your own risk. The analogue parts (TV and FM radio) basically work, although there are some minor issues to be fixed. Digital TV is not tested yet, but is theoretically implemented; reports on whether it actually works are welcome.
Update: the following patch, which should be applied after the previous ones, makes a few additional changes to the XC4000 driver:
- adds support for DTV7
- implements power management
- adds a mutex and locking for tuner operations
- some unused or unneeded code has been removed
Quoted 11 lines · On 02/09/2010 06:35 PM, [email protected] wrote:
There are two separate patches for v4l-dvb revision
28f5eca12bb0: the first one adds the XC4000 driver, while the second one adds support for the Leadtek WinFast DTV2000H Plus card in the CX88 driver.http://www.sharemation.com/IstvanV/v4l/xc4000-28f5eca12bb0.patch
http://www.sharemation.com/IstvanV/v4l/cx88-dtv2000h+-28f5eca12bb0.patchThese new firmware files are more complete than the previous ones, but are not compatible with the original driver. Both version 1.2 and 1.4 are available:
Quoted 6 lines
http://www.sharemation.com/IstvanV/v4l/xc4000-1.2.fw
http://www.sharemation.com/IstvanV/v4l/xc4000-1.4.fwThe following simple utility was used for creating the firmware files.
linux/drivers/media/common/tuners/xc4000.c +117 -138
@@ -27,8 +27,9 @@#include <linux/videodev2.h> #include <linux/delay.h> #include <linux/dvb/frontend.h> #include <linux/i2c.h> +#include <linux/mutex.h> #include <asm/unaligned.h> #include "dvb_frontend.h"
@@ -61,9 +62,9 @@"The valid values are a sum of:\n" " 1: use NICAM/B and A2/B instead of NICAM/A and A2/A\n" " 2: use A2 instead of NICAM or BTSC\n" " 4: use SECAM/K3 instead of K1\n" -" 8: force SECAM-L audio\n" +" 8: use PAL-D/K audio for SECAM-D/K\n" "16: use FM radio input 1 instead of input 2\n" "32: use mono audio (the lower three bits are ignored)\n");#define XC4000_DEFAULT_FIRMWARE "xc4000.fw"
@@ -108,18 +109,20 @@u32 bandwidth;u8 video_standard;u8 rf_mode;u8 card_type; +u8 ignore_i2c_write_errors;/* struct xc2028_ctrl ctrl; */ struct firmware_properties cur_fw;__u16 hwmodel;__u16 hwvers; -u8 ignore_i2c_write_errors; +struct mutex lock; };/* Misc Defines */ #define MAX_TV_STANDARD 24#define XC_MAX_I2C_WRITE_LENGTH 64 +#define XC_POWERED_DOWN 0x80000000U/* Signal Types */ #define XC_RF_MODE_AIR 0#define XC_RF_MODE_CABLE 1
@@ -240,9 +243,9 @@ {"D/K-PAL-MONO", 0x0078, 0x8049, 6500}, {"D/K-SECAM-A2 DK1", 0x0000, 0x8049, 6340}, {"D/K-SECAM-A2 L/DK3", 0x0000, 0x8049, 6000}, {"D/K-SECAM-A2 MONO", 0x0078, 0x8049, 6500}, - {"D/K-SECAM-NICAM", 0x8080, 0x8049, 6200}, + {"D/K-SECAM-NICAM", 0x0080, 0x8049, 6200}, {"L-SECAM-NICAM", 0x8080, 0x0009, 6200}, {"L'-SECAM-NICAM", 0x8080, 0x4009, 6200}, {"DTV6", 0x00C0, 0x8002, 0}, {"DTV8", 0x00C0, 0x800B, 0},
@@ -251,11 +254,8 @@ {"FM Radio-INPUT2", 0x0008, 0x9800,10700}, {"FM Radio-INPUT1", 0x0008, 0x9000,10700} }; -#if 0 -static int xc4000_is_firmware_loaded (struct dvb_frontend *fe); -#endif static int xc4000_readreg (struct xc4000_priv *priv,u16 reg,u16 *val);static int xc4000_TunerReset (struct dvb_frontend *fe);static int xc_send_i2c_data (struct xc4000_priv *priv,u8 *buf,int len)
@@ -275,25 +275,8 @@ }return XC_RESULT_SUCCESS ; } -/* This routine is never used because the only time we read data from the -i2c bus is when we read registers, and we want that to be an atomic i2c -transaction in case we are on a multi-master bus */ -#if 0 -static int xc_read_i2c_data (struct xc4000_priv *priv,u8 *buf,int len) -{ -struct i2c_msg msg = { .addr = priv->i2c_props.addr, - .flags =I2C_M_RD , .buf = buf, .len = len }; - -if (i2c_transfer (priv->i2c_props.adap, &msg,1 ) !=1 ) { -printk (KERN_ERR "xc4000 I2C read failed (len=%i)\n" , len); -return -EREMOTEIO ; - } -return 0 ; -} -#endif -static void xc_wait (int wait_ms) {msleep (wait_ms); }
@@ -444,17 +427,8 @@only be used for fast scanning for channel lock) */ return xc_write_reg (priv,XREG_RF_FREQ , freq_code);/* WAS: XREG_FINERFREQ */ } -#if 0 -/* We'll probably need these for analog support */ -static int xc_set_Xtal_frequency (struct xc4000_priv *priv,u32 xtalFreqInKHz) -{ -u16 xtalRatio = (32000 *0x8000 )/xtalFreqInKHz; -return xc_write_reg (priv,XREG_XTALFREQ , xtalRatio); -} -#endif -static int xc_get_ADC_Envelope (struct xc4000_priv *priv,u16 *adc_envelope) {return xc4000_readreg (priv,XREG_ADC_ENV , adc_envelope); }
@@ -1134,8 +1108,11 @@u16 quality;u8 hw_majorversion =0 , hw_minorversion =0 ;u8 fw_majorversion =0 , fw_minorversion =0 ; +if (!(priv->cur_fw.type &BASE )) +return ; +/* Wait for stats to stabilize. * Frame Lines needs two frame times after initial lock * before it is valid. */
@@ -1174,12 +1151,14 @@ struct dvb_frontend_parameters *params) {struct xc4000_priv *priv = fe->tuner_priv;unsigned int type; -int ret; +int ret = -EREMOTEIO ;dprintk (1 ,"%s() frequency=%d (Hz)\n" , __func__, params->frequency); +mutex_lock (&priv->lock); +if (fe->ops.info.type ==FE_ATSC ) {dprintk (1 ,"%s() ATSC\n" , __func__);switch (params->u.vsb.modulation) {case VSB_8 :
@@ -1201,9 +1180,10 @@ priv->video_standard =XC4000_DTV6 ; type =DTV6 ;break ;default : -return -EINVAL ; + ret = -EINVAL ; + goto fail; } }else if (fe->ops.info.type ==FE_OFDM ) {dprintk (1 ,"%s() OFDM\n" , __func__);switch (params->u.ofdm.bandwidth) {
@@ -1213,44 +1193,56 @@ priv->freq_hz = params->frequency -1750000 ; type =DTV6 ;break ;case BANDWIDTH_7_MHZ : -printk (KERN_ERR "xc4000 bandwidth 7MHz not supported\n" ); + priv->bandwidth =BANDWIDTH_7_MHZ ; + priv->video_standard =XC4000_DTV7 ; + priv->freq_hz = params->frequency -2250000 ; type =DTV7 ; -return -EINVAL ; +break ;case BANDWIDTH_8_MHZ : priv->bandwidth =BANDWIDTH_8_MHZ ; priv->video_standard =XC4000_DTV8 ; priv->freq_hz = params->frequency -2750000 ; type =DTV8 ;break ; +case BANDWIDTH_AUTO : +if (params->frequency <400000000 ) { + priv->bandwidth =BANDWIDTH_7_MHZ ; + priv->freq_hz = params->frequency -2250000 ; + }else { + priv->bandwidth =BANDWIDTH_8_MHZ ; + priv->freq_hz = params->frequency -2750000 ; + } + priv->video_standard =XC4000_DTV7_8 ; + type =DTV78 ; +break ;default :printk (KERN_ERR "xc4000 bandwidth not set!\n" ); -return -EINVAL ; + ret = -EINVAL ; + goto fail; } priv->rf_mode =XC_RF_MODE_AIR ; }else {printk (KERN_ERR "xc4000 modulation type not supported!\n" ); -return -EINVAL ; + ret = -EINVAL ; + goto fail; }dprintk (1 ,"%s() frequency=%d (compensated)\n" , __func__, priv->freq_hz);/* Make sure the correct firmware type is loaded */ -if (check_firmware (fe, type,0 , priv->if_khz) !=XC_RESULT_SUCCESS ) { -return -EREMOTEIO ; - } +if (check_firmware (fe, type,0 , priv->if_khz) !=XC_RESULT_SUCCESS ) + goto fail; ret =xc_SetSignalSource (priv, priv->rf_mode);if (ret !=XC_RESULT_SUCCESS ) {printk (KERN_ERR -"xc4000: xc_SetSignalSource(%d) failed\n" , - priv->rf_mode); -return -EREMOTEIO ; - } - - { +"xc4000: xc_SetSignalSource(%d) failed\n" , + priv->rf_mode); + goto fail; + }else {u16 video_mode, audio_mode; video_mode = XC4000_Standard[priv->video_standard].VideoMode; audio_mode = XC4000_Standard[priv->video_standard].AudioMode;if (type ==DTV6 && priv->firm_version !=0x0102 )
@@ -1258,79 +1250,52 @@ ret =xc_SetTVStandard (priv, video_mode, audio_mode);if (ret !=XC_RESULT_SUCCESS ) {printk (KERN_ERR "xc4000: xc_SetTVStandard failed\n" );/* DJH - do not return when it fails... */ -/* return -EREMOTEIO; */ +/* goto fail; */ } }if (priv->card_type ==XC4000_CARD_DTV2000H_PLUS ) { - ret =0 ; -if (xc_write_reg (priv,XREG_D_CODE ,0 ) !=0 ) - ret = -EREMOTEIO ; +if (xc_write_reg (priv,XREG_D_CODE ,0 ) ==0 ) + ret =0 ;if (xc_write_reg (priv,XREG_AMPLITUDE , (priv->firm_version ==0x0102 ?132 :134 )) !=0 ) ret = -EREMOTEIO ;if (xc_write_reg (priv,XREG_SMOOTHEDCVBS ,1 ) !=0 ) ret = -EREMOTEIO ;if (ret !=0 ) {printk (KERN_ERR "xc4000: setting registers failed\n" ); -/* return ret; */ +/* goto fail; */ } } -#ifdef DJH_DEBUG - ret =xc_set_IF_frequency (priv, priv->if_khz); -if (ret !=XC_RESULT_SUCCESS ) { -printk (KERN_ERR "xc4000: xc_Set_IF_frequency(%d) failed\n" , - priv->if_khz); -return -EIO ; - } -#endif xc_tune_channel (priv, priv->freq_hz,XC_TUNE_DIGITAL );if (debug)xc_debug_dump (priv); + ret =0 ; -return 0 ; -} - -#if 0 -static int xc4000_is_firmware_loaded (struct dvb_frontend *fe) -{ -struct xc4000_priv *priv = fe->tuner_priv; -int ret; -u16 id; - - ret =xc4000_readreg (priv,XREG_PRODUCT_ID , &id); -if (ret ==XC_RESULT_SUCCESS ) { -if (id ==XC_PRODUCT_ID_FW_NOT_LOADED ) - ret =XC_RESULT_RESET_FAILURE ; -else - ret =XC_RESULT_SUCCESS ; - } +fail: +mutex_unlock (&priv->lock); -dprintk (1 ,"%s() returns %s id = 0x%x\n" , __func__, - ret ==XC_RESULT_SUCCESS ?"True" :"False" , id);return ret; } -#endif static int xc4000_set_analog_params (struct dvb_frontend *fe,struct analog_parameters *params) {struct xc4000_priv *priv = fe->tuner_priv;unsigned int type =0 ; -int ret; - -/* Fix me: it could be air. */ - priv->rf_mode =XC_RF_MODE_CABLE ; +int ret = -EREMOTEIO ;if (params->mode ==V4L2_TUNER_RADIO ) {dprintk (1 ,"%s() frequency=%d (in units of 62.5Hz)\n" , __func__, params->frequency); +mutex_lock (&priv->lock); + params->std =0 ; priv->freq_hz = params->frequency *125L /2 ;if (audio_std &XC4000_AUDIO_STD_INPUT1 ) {
@@ -1346,8 +1311,10 @@dprintk (1 ,"%s() frequency=%d (in units of 62.5khz)\n" , __func__, params->frequency); +mutex_lock (&priv->lock); +/* params->frequency is in units of 62.5khz */ priv->freq_hz = params->frequency *62500 ;/* if std is not defined, choose one */
@@ -1454,24 +1421,24 @@ goto tune_channel; } tune_channel: +/* Fix me: it could be air. */ + priv->rf_mode =XC_RF_MODE_CABLE ;if (check_firmware (fe, type, params->std, XC4000_Standard[priv->video_standard].int_freq) !=XC_RESULT_SUCCESS ) { -return -EREMOTEIO ; + goto fail; } ret =xc_SetSignalSource (priv, priv->rf_mode);if (ret !=XC_RESULT_SUCCESS ) {printk (KERN_ERR "xc4000: xc_SetSignalSource(%d) failed\n" , priv->rf_mode); -return -EREMOTEIO ; - } - - { + goto fail; + }else {u16 video_mode, audio_mode; video_mode = XC4000_Standard[priv->video_standard].VideoMode; audio_mode = XC4000_Standard[priv->video_standard].AudioMode;if (priv->video_standard <XC4000_BG_PAL_A2 ) {
@@ -1486,49 +1453,58 @@ } ret =xc_SetTVStandard (priv, video_mode, audio_mode);if (ret !=XC_RESULT_SUCCESS ) {printk (KERN_ERR "xc4000: xc_SetTVStandard failed\n" ); -return -EREMOTEIO ; + goto fail; } }if (priv->card_type ==XC4000_CARD_DTV2000H_PLUS ) { - ret =0 ; -if (xc_write_reg (priv,XREG_D_CODE ,0 ) !=0 ) - ret = -EREMOTEIO ; +if (xc_write_reg (priv,XREG_D_CODE ,0 ) ==0 ) + ret =0 ;if (xc_write_reg (priv,XREG_AMPLITUDE ,1 ) !=0 ) ret = -EREMOTEIO ;if (xc_write_reg (priv,XREG_SMOOTHEDCVBS ,1 ) !=0 ) ret = -EREMOTEIO ;if (ret !=0 ) {printk (KERN_ERR "xc4000: setting registers failed\n" ); -return ret; + goto fail; } }xc_tune_channel (priv, priv->freq_hz,XC_TUNE_ANALOG );if (debug)xc_debug_dump (priv); + ret =0 ; -return 0 ; +fail: +mutex_unlock (&priv->lock); + +return ret; }static int xc4000_get_frequency (struct dvb_frontend *fe,u32 *freq) {struct xc4000_priv *priv = fe->tuner_priv; *freq = priv->freq_hz; -if (debug && (priv->cur_fw.type - & (BASE |FM |DTV6 |DTV7 |DTV78 |DTV8 )) ==BASE ) { -u16 snr =0 ; -if (xc4000_readreg (priv,XREG_SNR , &snr) ==0 ) { -dprintk (1 ,"%s() freq = %u, SNR = %d\n" , - __func__, *freq, snr); -return 0 ; +if (debug) { +mutex_lock (&priv->lock); +if ((priv->cur_fw.type + & (BASE |FM |DTV6 |DTV7 |DTV78 |DTV8 )) ==BASE ) { +u16 snr =0 ; +if (xc4000_readreg (priv,XREG_SNR , &snr) ==0 ) { +mutex_unlock (&priv->lock); +dprintk (1 ,"%s() freq = %u, SNR = %d\n" , + __func__, *freq, snr); +return 0 ; + } } +mutex_unlock (&priv->lock); } +dprintk (1 ,"%s()\n" , __func__);return 0 ; }
@@ -1546,58 +1522,57 @@ {struct xc4000_priv *priv = fe->tuner_priv;u16 lock_status =0 ; -xc_get_lock_status (priv, &lock_status); +mutex_lock (&priv->lock); -dprintk (2 ,"%s() lock_status = %d\n" , __func__, lock_status); +if (priv->cur_fw.type &BASE ) +xc_get_lock_status (priv, &lock_status); *status = (lock_status ==1 ?TUNER_STATUS_LOCKED |TUNER_STATUS_STEREO :0 ); +if (priv->cur_fw.type & (DTV6 |DTV7 |DTV78 |DTV8 )) + *status &= (~TUNER_STATUS_STEREO ); + +mutex_unlock (&priv->lock); + +dprintk (2 ,"%s() lock_status = %d\n" , __func__, lock_status);return 0 ; }static int xc4000_sleep (struct dvb_frontend *fe) { -/* FIXME: djh disable this for now... */ -return XC_RESULT_SUCCESS ; -#if 0 -int ret; +struct xc4000_priv *priv = fe->tuner_priv; +int ret =XC_RESULT_SUCCESS ;dprintk (1 ,"%s()\n" , __func__); +mutex_lock (&priv->lock); +/* Avoid firmware reload on slow devices */ -if (no_poweroff) -return 0 ; +if (!no_poweroff && priv->cur_fw.type !=XC_POWERED_DOWN ) { +/* force reset and firmware reload */ + priv->cur_fw.type =XC_POWERED_DOWN ; -/* According to Xceive technical support, the "powerdown" register -was removed in newer versions of the firmware. The "supported" -way to sleep the tuner is to pull the reset pin low for 10ms */ - ret =xc4000_TunerReset (fe); -if (ret !=XC_RESULT_SUCCESS ) { -printk (KERN_ERR -"xc4000: %s() unable to shutdown tuner\n" , - __func__); -return -EREMOTEIO ; - }else -return XC_RESULT_SUCCESS ; -#endif +if (xc_write_reg (priv,XREG_POWER_DOWN ,0 ) + !=XC_RESULT_SUCCESS ) { +printk (KERN_ERR +"xc4000: %s() unable to shutdown tuner\n" , + __func__); + ret = -EREMOTEIO ; + } + } + +mutex_unlock (&priv->lock); + +return ret; }static int xc4000_init (struct dvb_frontend *fe) { -struct xc4000_priv *priv = fe->tuner_priv;dprintk (1 ,"%s()\n" , __func__); -if (check_firmware (fe,DTV8 ,0 , priv->if_khz) !=XC_RESULT_SUCCESS ) { -printk (KERN_ERR "xc4000: Unable to initialise tuner\n" ); -return -EREMOTEIO ; - } - -if (debug) -xc_debug_dump (priv); -return 0 ; }static int xc4000_release (struct dvb_frontend *fe)
@@ -1641,10 +1616,10 @@struct i2c_adapter *i2c, struct xc4000_config *cfg) { struct xc4000_priv *priv = NULL; -int instance; -u16 id =0 ; +int instance; +u16 id =0 ;if (cfg->card_type !=XC4000_CARD_GENERIC ) {if (cfg->card_type ==XC4000_CARD_DTV2000H_PLUS ) { cfg->i2c_address =0x61 ;
@@ -1671,8 +1646,9 @@break ;case 1 :/* new tuner instance */ priv->bandwidth =BANDWIDTH_6_MHZ ; +mutex_init (&priv->lock); fe->tuner_priv = priv;break ;default :/* existing tuner instance */
@@ -1690,10 +1666,17 @@/* Check if firmware has been loaded. It is possible that another instance of the driver has loaded the firmware. */ -if (xc4000_readreg (priv,XREG_PRODUCT_ID , &id) !=XC_RESULT_SUCCESS ) +if (instance ==1 ) { +if (xc4000_readreg (priv,XREG_PRODUCT_ID , &id) + !=XC_RESULT_SUCCESS ) goto fail; + } +else { + id = ((priv->cur_fw.type &BASE ) ==0 ? +XC_PRODUCT_ID_FW_NOT_LOADED :XC_PRODUCT_ID_FW_LOADED ); + }switch (id) {case XC_PRODUCT_ID_FW_LOADED : printk(KERN_INFO
@@ -1720,12 +1703,8 @@memcpy (&fe->ops.tuner_ops, &xc4000_tuner_ops,sizeof (struct dvb_tuner_ops )); -/* FIXME: For now, load the firmware at startup. We will remove this -before the code goes to production... */ -check_firmware (fe,DTV8 ,0 , priv->if_khz); -return fe; fail:mutex_unlock (&xc4000_list_mutex);
Hi Istanv,
Quoted 6 lines · On Thu, Feb 11, 2010 at 2:16 PM, [email protected] <[email protected]>…
Update: the following patch, which should be applied after the previous ones, makes a few additional changes to the XC4000 driver:
- adds support for DTV7
- implements power management
- adds a mutex and locking for tuner operations
- some unused or unneeded code has been removed
Is the DTV7 support actually tested? Or are you just blindly adding the code in the hope that it works? I'm just asking because the last time I spoke to you, you actually didn't have access to a DVB-T signal source.
Also, I'm not sure I'm comfortable with the way the mutex is implemented here. Is this logic copied from some other driver (and if so, which one), or did you come up with it yourself?
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Quoted 4 lines · Devin Heitmueller
Is the DTV7 support actually tested? Or are you just blindly adding the code in the hope that it works? I'm just asking because the last time I spoke to you, you actually didn't have access to a DVB-T signal source.
Hi! It is indeed not tested yet, and the other DTV modes are not either. Is there anything that needs to be done additionally to make the DTV7 mode work, other than the already added different frequency offset ((-7000000/2)+1250000=-2250000), firmware type (DTV7), and video standard (XC4000_DTV7) ?
Quoted 3 lines
Also, I'm not sure I'm comfortable with the way the mutex is implemented here. Is this logic copied from some other driver (and if so, which one), or did you come up with it yourself?
The mutex idea is from the XC3028 driver. Since the code is organized differently there, it is not implemented exactly the same way, but it is similar.
Here is another patch, with a few minor changes. It depends on the previously posted patches, so those should be applied first.
linux/drivers/media/common/tuners/xc4000.c +36 -33
@@ -256,8 +256,9 @@ };static int xc4000_readreg (struct xc4000_priv *priv,u16 reg,u16 *val);static int xc4000_TunerReset (struct dvb_frontend *fe); +static void xc_debug_dump (struct xc4000_priv *priv);static int xc_send_i2c_data (struct xc4000_priv *priv,u8 *buf,int len) {struct i2c_msg msg = { .addr = priv->i2c_props.addr,
@@ -332,12 +333,14 @@ (i2c_sequence[index + 1] != 0xFF)) { len = i2c_sequence[index] *256 + i2c_sequence[index+1 ];if (len ==0x0000 ) {/* RESET command */ - result =xc4000_TunerReset (fe); index +=2 ; +#if 0 /* not needed, as already called by check_firmware() */ + result =xc4000_TunerReset (fe);if (result !=XC_RESULT_SUCCESS )return result; +#endif }else if (len &0x8000 ) {/* WAIT command */ xc_wait (len &0x7FFF ); index +=2 ;
@@ -472,14 +475,8 @@return 0 ; } -/* WAS THERE -static int xc_get_buildversion(struct xc4000_priv *priv, u16 *buildrev) -{ -return xc4000_readreg(priv, XREG_BUILD, buildrev); -}*/ -static int xc_get_hsync_freq (struct xc4000_priv *priv,u32 *hsync_freq_hz) {u16 regData;int result;
@@ -516,14 +513,12 @@ }return lockState; } -#define XC_TUNE_ANALOG 0 -#define XC_TUNE_DIGITAL 1 -static int xc_tune_channel (struct xc4000_priv *priv,u32 freq_hz,int mode) +static int xc_tune_channel (struct xc4000_priv *priv,u32 freq_hz) { -int found =0 ; -int result =0 ; +int found =1 ; +int result;dprintk (1 ,"%s(%u)\n" , __func__, freq_hz);/* Don't complain when the request fails because of i2c stretching */
@@ -533,13 +528,23 @@if (result !=XC_RESULT_SUCCESS )return 0 ; -if (mode ==XC_TUNE_ANALOG ) { -if (WaitForLock (priv) ==1 ) - found =1 ; +/* wait for lock only in analog TV mode */ +if ((priv->cur_fw.type & (FM |DTV6 |DTV7 |DTV78 |DTV8 )) ==0 ) { +if (WaitForLock (priv) ==0 ) + found =0 ; } +/* Wait for stats to stabilize. +* Frame Lines needs two frame times after initial lock +* before it is valid. +*/ +xc_wait (debug ?100 :10 ); + +if (debug) +xc_debug_dump (priv); +return found; }static int xc4000_readreg (struct xc4000_priv *priv,u16 reg,u16 *val)
@@ -1108,17 +1113,8 @@u16 quality;u8 hw_majorversion =0 , hw_minorversion =0 ;u8 fw_majorversion =0 , fw_minorversion =0 ; -if (!(priv->cur_fw.type &BASE )) -return ; - -/* Wait for stats to stabilize. -* Frame Lines needs two frame times after initial lock -* before it is valid. -*/ -xc_wait (100 ); -xc_get_ADC_Envelope (priv, &adc_envelope);dprintk (1 ,"*** ADC envelope (0-1023) = %d\n" , adc_envelope);xc_get_frequency_error (priv, &freq_error_hz);
@@ -1269,12 +1265,10 @@/* goto fail; */ } } -xc_tune_channel (priv, priv->freq_hz,XC_TUNE_DIGITAL ); +xc_tune_channel (priv, priv->freq_hz); -if (debug) -xc_debug_dump (priv); ret =0 ; fail:mutex_unlock (&priv->lock);
@@ -1470,12 +1464,10 @@ goto fail; } } -xc_tune_channel (priv, priv->freq_hz,XC_TUNE_ANALOG ); +xc_tune_channel (priv, priv->freq_hz); -if (debug) -xc_debug_dump (priv); ret =0 ; fail:mutex_unlock (&priv->lock);
@@ -1549,9 +1541,9 @@mutex_lock (&priv->lock);/* Avoid firmware reload on slow devices */ -if (!no_poweroff && priv->cur_fw.type !=XC_POWERED_DOWN ) { +if (!no_poweroff && (priv->cur_fw.type &BASE ) !=0 ) {/* force reset and firmware reload */ priv->cur_fw.type =XC_POWERED_DOWN ; if (xc_write_reg(priv, XREG_POWER_DOWN, 0)
@@ -1560,8 +1552,9 @@"xc4000: %s() unable to shutdown tuner\n" , __func__); ret = -EREMOTEIO ; } +xc_wait (20 ); }mutex_unlock (&priv->lock);
@@ -1638,9 +1631,10 @@ instance = hybrid_tuner_request_state(struct xc4000_priv, priv, hybrid_tuner_instance_list, i2c, cfg->i2c_address,"xc4000" ); - priv->card_type = cfg->card_type; +if (cfg->card_type !=XC4000_CARD_GENERIC ) + priv->card_type = cfg->card_type;switch (instance) {case 0 : goto fail;break ;
@@ -1703,12 +1697,21 @@memcpy (&fe->ops.tuner_ops, &xc4000_tuner_ops,sizeof (struct dvb_tuner_ops )); +if (instance ==1 ) { +int ret; +mutex_lock (&priv->lock); + ret =xc4000_fwupload (fe); +mutex_unlock (&priv->lock); +if (ret !=XC_RESULT_SUCCESS ) + goto fail2; + } +return fe; fail:mutex_unlock (&xc4000_list_mutex); - +fail2:xc4000_release (fe);return NULL ; }EXPORT_SYMBOL (xc4000_attach);
linux/drivers/media/video/tuner-core.c +1 -0
@@ -441,8 +441,9 @@break ; }case TUNER_XC4000 : { + xc4000_cfg.card_type = XC4000_CARD_GENERIC; xc4000_cfg.i2c_address = t->i2c->addr; /* if_khz will be set when the digital dvb_attach() occurs */ xc4000_cfg.if_khz = 0; if (!dvb_attach(xc4000_attach,
A correction to the previous post: this line:
if (WaitForLock(priv) == 0) should actually be: if (WaitForLock(priv) != 1)
It does not have an effect on the operation of the driver, though, since the value set depending on this line is not used.
The attached new patches contain all the previous changes merged, and are against the latest v4l-dvb revision.
By the way, someone on a forum reported having a DTV1800 H card with a PCI ID of 107d:6f38. This seems to differ from the already supported DTV1800 H version (107d:6654) by having an XC4000 tuner instead of XC3028. From the Windows INF files it seems this card is very similar to the DTV2000 H Plus, but there is no GPIO for selecting antenna/cable input.
Quoted 7 lines · On 02/11/2010 08:16 PM, [email protected] wrote:
Update: the following patch, which should be applied after the previous ones, makes a few additional changes to the XC4000 driver:
- adds support for DTV7
- implements power management
- adds a mutex and locking for tuner operations
- some unused or unneeded code has been removed
Quoted 19 lines
Quoted 17 lines · On 02/09/2010 06:35 PM, [email protected] wrote:
There are two separate patches for v4l-dvb revision
28f5eca12bb0: the first one adds the XC4000 driver, while the second one adds support for the Leadtek WinFast DTV2000H Plus card in the CX88 driver.http://www.sharemation.com/IstvanV/v4l/xc4000-28f5eca12bb0.patch
http://www.sharemation.com/IstvanV/v4l/cx88-dtv2000h+-28f5eca12bb0.patchThese new firmware files are more complete than the previous ones, but are not compatible with the original driver. Both version 1.2 and 1.4 are available:
http://www.sharemation.com/IstvanV/v4l/xc4000-1.2.fw
http://www.sharemation.com/IstvanV/v4l/xc4000-1.4.fwThe following simple utility was used for creating the firmware files.
linux/drivers/media/common/tuners/Kconfig +10 -0
@@ -22,8 +22,9 @@ default VIDEO_MEDIA && I2C depends on VIDEO_MEDIA && I2C select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMISE + select MEDIA_TUNER_XC4000 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMISE
@@ -150,8 +151,17 @@ A driver for the silicon tuner XC5000 from Xceive. This device is only used inside a SiP called together with a demodulator for now. +config MEDIA_TUNER_XC4000 + tristate "Xceive XC4000 silicon tuner" + depends on VIDEO_MEDIA && I2C + default m if MEDIA_TUNER_CUSTOMISE + help + A driver for the silicon tuner XC4000 from Xceive. + This device is only used inside a SiP called together with a + demodulator for now. + config MEDIA_TUNER_MXL5005S tristate "MaxLinear MSL5005S silicon tuner" depends on VIDEO_MEDIA && I2C default m if MEDIA_TUNER_CUSTOMISE
linux/drivers/media/common/tuners/Makefile +1 -0
@@ -15,8 +15,9 @@ obj-$(CONFIG_MEDIA_TUNER_TDA9887) += tda9887.o obj-$(CONFIG_MEDIA_TUNER_TDA827X) += tda827x.o obj-$(CONFIG_MEDIA_TUNER_TDA18271) += tda18271.o obj-$(CONFIG_MEDIA_TUNER_XC5000) += xc5000.o +obj-$(CONFIG_MEDIA_TUNER_XC4000) += xc4000.o obj-$(CONFIG_MEDIA_TUNER_MT2060) += mt2060.o obj-$(CONFIG_MEDIA_TUNER_MT2266) += mt2266.o obj-$(CONFIG_MEDIA_TUNER_QT1010) += qt1010.o obj-$(CONFIG_MEDIA_TUNER_MT2131) += mt2131.o
linux/drivers/media/common/tuners/tuner-types.c +4 -0
@@ -1762,8 +1762,12 @@ [TUNER_XC5000] = { /* Xceive 5000 */ .name = "Xceive 5000 tuner", /* see xc5000.c for details */ }, + [TUNER_XC4000] = { /* Xceive 4000 */ + .name = "Xceive 4000 tuner", + /* see xc4000.c for details */ + }, [TUNER_TCL_MF02GIP_5N] = { /* TCL tuner MF02GIP-5N-E */ .name = "TCL tuner MF02GIP-5N-E", .params = tuner_tcl_mf02gip_5n_params, .count = ARRAY_SIZE(tuner_tcl_mf02gip_5n_params),
linux/drivers/media/common/tuners/xc4000.c +1721 -0
1,721 lines not on this page · raw message
linux/drivers/media/common/tuners/xc4000.h +66 -0
66 lines not on this page · raw message
linux/drivers/media/video/tuner-core.c +14 -0
@@ -29,8 +29,9 @@#include "tuner-xc2028.h" #include "tuner-simple.h" #include "tda9887.h" #include "xc5000.h" +#include "xc4000.h" #include "tda18271.h" #define UNSET (-1U)
@@ -324,8 +325,9 @@ } }static struct xc5000_config xc5000_cfg; +static struct xc4000_config xc4000_cfg;static void set_type (struct i2c_client *c,unsigned int type,unsigned int new_mode_mask,unsigned int new_config,int (*tuner_callback) (void *dev,int component,int cmd,int arg))
@@ -437,8 +439,20 @@ goto attach_failed; tune_now =0 ;break ; } +case TUNER_XC4000 : + { + xc4000_cfg.card_type =XC4000_CARD_GENERIC ; + xc4000_cfg.i2c_address = t->i2c->addr; +/* if_khz will be set when the digital dvb_attach() occurs */ + xc4000_cfg.if_khz =0 ; +if (!dvb_attach (xc4000_attach, + &t->fe, t->i2c->adapter, &xc4000_cfg)) + goto attach_failed; + tune_now =0 ; +break ; + }case TUNER_NXP_TDA18271 : {struct tda18271_config cfg = { .config = t->config,
linux/include/media/tuner.h +1 -0
@@ -128,8 +128,9 @@#define TUNER_PHILIPS_FQ1216LME_MK3 80/* Active loopthrough, no FM */ #define TUNER_PARTSNIC_PTI_5NF05 81#define TUNER_PHILIPS_CU1216L 82#define TUNER_NXP_TDA18271 83 +#define TUNER_XC4000 84/* Xceive Silicon Tuner */ /* tv card specific */ #define TDA9887_PRESENT (1<<0)#define TDA9887_PORT1_INACTIVE (1<<1)
linux/drivers/media/video/cx88/cx88-cards.c +91 -1
148 lines not on this page · raw message
linux/drivers/media/video/cx88/cx88-dvb.c +53 -3
96 lines not on this page · raw message
linux/drivers/media/video/cx88/cx88.h +1 -0
@@ -239,8 +239,9 @@#define CX88_BOARD_HAUPPAUGE_IRONLY 80#define CX88_BOARD_WINFAST_DTV1800H 81#define CX88_BOARD_WINFAST_DTV2000H_J 82#define CX88_BOARD_PROF_7301 83 +#define CX88_BOARD_WINFAST_DTV2000H_PLUS 84enum cx88_itype {CX88_VMUX_COMPOSITE1 =1 ,CX88_VMUX_COMPOSITE2 ,
linux/drivers/media/video/cx88/cx88-input.c +2 -0
@@ -92,8 +92,9 @@ gpio=(gpio &0x7fd ) + (auxgpio &0xef );break ;case CX88_BOARD_WINFAST_DTV1000 :case CX88_BOARD_WINFAST_DTV1800H : +case CX88_BOARD_WINFAST_DTV2000H_PLUS :case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL : gpio = (gpio &0x6ff ) | ((cx_read (MO_GP1_IO ) <<8 ) &0x900 ); auxgpio = gpio;break ;
@@ -236,8 +237,9 @@break ;case CX88_BOARD_WINFAST_DTV2000H :case CX88_BOARD_WINFAST_DTV2000H_J :case CX88_BOARD_WINFAST_DTV1800H : +case CX88_BOARD_WINFAST_DTV2000H_PLUS : ir_codes = &ir_codes_winfast_table; ir->gpio_addr =MO_GP0_IO ; ir->mask_keycode =0x8f8 ; ir->mask_keyup =0x100 ;
Hi Istvan,
Quoted 2 lines · [email protected] wrote:
The attached new patches contain all the previous changes merged, and are against the latest v4l-dvb revision.
Please provide your Signed-off-by. This is a basic requirement for your driver to be accepted. Please read:
http://linuxtv.org/hg/v4l-dvb/raw-file/tip/README.patches
for instructions on how to submit a patch.
Cheers,
Mauro.
Quoted 36 lines
By the way, someone on a forum reported having a DTV1800 H card with a PCI ID of 107d:6f38. This seems to differ from the already supported DTV1800 H version (107d:6654) by having an XC4000 tuner instead of XC3028. From the Windows INF files it seems this card is very similar to the DTV2000 H Plus, but there is no GPIO for selecting antenna/cable input.
Quoted 26 lines · On 02/11/2010 08:16 PM, [email protected] wrote:
Update: the following patch, which should be applied after the previous ones, makes a few additional changes to the XC4000 driver:
- adds support for DTV7
- implements power management
- adds a mutex and locking for tuner operations
- some unused or unneeded code has been removedQuoted 17 lines · On 02/09/2010 06:35 PM, [email protected] wrote:
There are two separate patches for v4l-dvb revision
28f5eca12bb0: the first one adds the XC4000 driver, while the second one adds support for the Leadtek WinFast DTV2000H Plus card in the CX88 driver.http://www.sharemation.com/IstvanV/v4l/xc4000-28f5eca12bb0.patch
http://www.sharemation.com/IstvanV/v4l/cx88-dtv2000h+-28f5eca12bb0.patchThese new firmware files are more complete than the previous ones, but are not compatible with the original driver. Both version 1.2 and 1.4 are available:
http://www.sharemation.com/IstvanV/v4l/xc4000-1.2.fw
http://www.sharemation.com/IstvanV/v4l/xc4000-1.4.fwThe following simple utility was used for creating the firmware files.
Signature · 2 lines
Cheers, Mauro
Quoted 11 lines · Mauro Carvalho Chehab
Hi Istvan,
Quoted 2 lines · [email protected] wrote:
The attached new patches contain all the previous changes merged, and are against the latest v4l-dvb revision.
Please provide your Signed-off-by. This is a basic requirement for your driver to be accepted. Please read:
http://linuxtv.org/hg/v4l-dvb/raw-file/tip/README.patchesfor instructions on how to submit a patch.
Hi Mauro,
I would hate to come across as a jerk here, but he cannot provide his SOB for this patch, as I wrote about 95% of the code here. It's derived from a tree I have been working on for the PCTV 340e:
http://kernellabs.com/hg/~dheitmueller/pctv-340e-2/
I know that istvan wants to see the support merged, but he is going to have to wait a bit longer since he is not the author or maintainer of the driver in question.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Quoted 19 lines · Devin Heitmueller
Quoted 10 lines · Mauro Carvalho Chehab
Hi Istvan,
Quoted 2 lines · [email protected] wrote:
The attached new patches contain all the previous changes merged, and are against the latest v4l-dvb revision.
Please provide your Signed-off-by. This is a basic requirement for your driver to be accepted. Please read:
http://linuxtv.org/hg/v4l-dvb/raw-file/tip/README.patchesfor instructions on how to submit a patch.
Hi Mauro,
I would hate to come across as a jerk here, but he cannot provide his SOB for this patch, as I wrote about 95% of the code here. It's derived from a tree I have been working on for the PCTV 340e:
Quoted 5 lines
http://kernellabs.com/hg/~dheitmueller/pctv-340e-2/
I know that istvan wants to see the support merged, but he is going to have to wait a bit longer since he is not the author or maintainer of the driver in question.
OK. Then, I need your SOB for the 95% of the code, and his SOB for the remaining ;)
Signature · 2 lines
Cheers, Mauro
Quoted 2 lines · Mauro Carvalho Chehab
OK. Then, I need your SOB for the 95% of the code, and his SOB for the remaining ;)
Yeah, my plan at this point was to submit a PULL request once I felt the driver is stable (and I had already offered to apply his incremental patches onto my tree before said pull request).
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Quoted 2 lines · Devin Heitmueller
Yeah, my plan at this point was to submit a PULL request once I felt the driver is stable
For those particular cards that my patch adds support for, it seems to be stable, and I have been using it for months. Perhaps stability issues in xc4000.c are specific to the PCTV 340e and its dib0700 I2C problems ?
Quoted 8 lines · On Sun, Mar 14, 2010 at 1:58 PM, [email protected] <[email protected]>…
Quoted 2 lines · Devin Heitmueller
Yeah, my plan at this point was to submit a PULL request once I felt the driver is stable
For those particular cards that my patch adds support for, it seems to be stable, and I have been using it for months. Perhaps stability issues in
xc4000.care specific to the PCTV 340e and its dib0700 I2C problems ?
Different people have different standards of quality. For example, I've done essentially no analysis into the tuning performance of the current driver - validating different frequency ranges and modulation types or bandwidths. I've done no testing of tuning lock time, minimal application validation, and no effort toward making sure the power management works.
Sure, I can just throw the driver upstream as-is, but I've been hesitant to merge something with questionable quality, as it reflects poorly on my reputation. Right now it's in a development tree because it's what I would consider "alpha quality", where only advanced users will install it and they know to "proceed at your own risk".
And none of the above is related to the problem with the dib0700 i2c master.
All that said, the situation hasn't been helped by the fact that I'm working on five different projects currently (as102, drx-d, xc4000, em28xx, and now ngene), nor the fact that I'm also the maintainer for a variety of other tuner products (and the significant support burden that creates).
Bear in mind that I am aware of the frustration that when someone has patches and cannot get the maintainer to find the time to review/comment/merge. I've been in that situation myself more than once.
I'll try to go through my tree and see if I can get something upstream this week which you could build on. Once that is done, you will need to break up your huge patch into a series of small incremental patches (with proper descriptions for the changes), since there is no way a single patch is going to be accepted upstream which has all of your changes.
Also, you should *not* be submitting board profiles that are completely unvalidated. I saw your email on Feb 19th, where you dumped out a list of tuners that you think might *possibly* work. You should only submit board definitions for devices that either you have tested or you have gotten a user to test. It is far worse to have broken code in there (creating the illusion of a product being supported), then for there to be no support at all. When users complain about a particular board not working, you can work with them to get it supported.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Quoted 4 lines · Devin Heitmueller
I've done essentially no analysis into the tuning performance of the current driver - validating different frequency ranges and modulation types or bandwidths. I've done no testing of tuning lock time, minimal application validation
Well, so far it definitely seems usable and not apparently worse than on Windows. If more developers can test and review it, then it is more likely that any issues can be found and fixed or improved.
Quoted 1 line
and no effort toward making sure the power management works.
I did implement power management (by writing to register 8, and setting a flag that forces resetting the tuner and reloading all firmware data on the next use), although it is disabled by default for the cards that I added support for (it is apparently not used on Windows, either).
Quoted 2 lines
I'll try to go through my tree and see if I can get something upstream this week which you could build on.
I think adding xc4000.c/h and the few changes shown at the end of this post to incorporate XC4000 as a tuner type should be enough. Did you review the changes I made to the XC4000 driver ? Is there something that is unneeded or should be done differently ? Do you have a fixed firmware file, or are the ones I created usable ?
Quoted 4 lines
Once that is done, you will need to break up your huge patch into a series of small incremental patches (with proper descriptions for the changes), since there is no way a single patch is going to be accepted upstream which has all of your changes.
OK. Should I also create patches for any of the unrelated cx88 fixes/changes ?
Quoted 9 lines
Also, you should *not* be submitting board profiles that are completely unvalidated. I saw your email on Feb 19th, where you dumped out a list of tuners that you think might *possibly* work. You should only submit board definitions for devices that either you have tested or you have gotten a user to test. It is far worse to have broken code in there (creating the illusion of a product being supported), then for there to be no support at all. When users complain about a particular board not working, you can work with them to get it supported.
Of the additional boards, 107d:6f38 (WinFast DTV1800 H with XC4000 tuner instead of XC3028) has been reported by one user to work in analog mode, while DVB was untested. Is that enough to keep the board profile ? I have 107d:6f42 (DTV2000 H Plus), and tested it extensively in analog and FM radio mode; another user tested DVB-T, and reported it to work well (I have got no information about details like bandwidth used, though). As far as I know, the only difference between the above two cards that is relevant to drivers is that the latter has an additional GPIO for selecting the antenna/cable RF input.
I have no problems with removing the various TV2000 XP Global revisions from the patches, as I do not even know if anyone actually has one of those cards.
------------------------------------------------------------------------
diff -r -d -N -U4 v4l-dvb-7a58d924fb04.old/linux/drivers/media/common/tuners/Kconfig v4l-dvb-7a58d924fb04/linux/drivers/media/common/tuners/Kconfig --- v4l-dvb-7a58d924fb04.old/linux/drivers/media/common/tuners/Kconfig
2010-03-10 03:00:59.000000000 +0100 +++ v4l-dvb-7a58d924fb04/linux/drivers/media/common/tuners/Kconfig 2010-03-10 17:12:02.000000000 +0100
@@ -22,8 +22,9 @@
default VIDEO_MEDIA && I2C
depends on VIDEO_MEDIA && I2C
select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMISE
+ select MEDIA_TUNER_XC4000 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMISE
@@ -150,8 +151,17 @@
A driver for the silicon tuner XC5000 from Xceive. This device is only used inside a SiP called together with a demodulator for now.
+config MEDIA_TUNER_XC4000
+ tristate "Xceive XC4000 silicon tuner"
+ depends on VIDEO_MEDIA && I2C
+ default m if MEDIA_TUNER_CUSTOMISE
+ help
+ A driver for the silicon tuner XC4000 from Xceive. + This device is only used inside a SiP called together with a + demodulator for now.
+
config MEDIA_TUNER_MXL5005S
tristate "MaxLinear MSL5005S silicon tuner"
depends on VIDEO_MEDIA && I2C
default m if MEDIA_TUNER_CUSTOMISE
diff -r -d -N -U4 v4l-dvb-7a58d924fb04.old/linux/drivers/media/common/tuners/Makefile v4l-dvb-7a58d924fb04/linux/drivers/media/common/tuners/Makefile --- v4l-dvb-7a58d924fb04.old/linux/drivers/media/common/tuners/Makefile
2010-03-10 03:00:59.000000000 +0100 +++ v4l-dvb-7a58d924fb04/linux/drivers/media/common/tuners/Makefile 2010-03-10 17:12:02.000000000 +0100
@@ -15,8 +15,9 @@
obj-$(CONFIG_MEDIA_TUNER_TDA9887) += tda9887.o obj-$(CONFIG_MEDIA_TUNER_TDA827X) += tda827x.o obj-$(CONFIG_MEDIA_TUNER_TDA18271) += tda18271.o obj-$(CONFIG_MEDIA_TUNER_XC5000) += xc5000.o
+obj-$(CONFIG_MEDIA_TUNER_XC4000) += xc4000.o
obj-$(CONFIG_MEDIA_TUNER_MT2060) += mt2060.o obj-$(CONFIG_MEDIA_TUNER_MT2266) += mt2266.o obj-$(CONFIG_MEDIA_TUNER_QT1010) += qt1010.o obj-$(CONFIG_MEDIA_TUNER_MT2131) += mt2131.o
diff -r -d -N -U4 v4l-dvb-7a58d924fb04.old/linux/drivers/media/common/tuners/tuner-types.c v4l-dvb-7a58d924fb04/linux/drivers/media/common/tuners/tuner-types.c
---v4l-dvb-7a58d924fb04.old/linux/drivers/media/common/tuners/tuner-types.c 2010-03-10
03:00:59.000000000 +0100
+++v4l-dvb-7a58d924fb04/linux/drivers/media/common/tuners/tuner-types.c
2010-03-10 17:12:02.000000000 +0100
@@ -1778,8 +1778,12 @@
[TUNER_XC5000] = { /* Xceive 5000 */
.name = "Xceive 5000 tuner",
/* see xc5000.c for details */
},
+ [TUNER_XC4000] = { /* Xceive 4000 */
+ .name = "Xceive 4000 tuner",
+ /* see xc4000.c for details */
+ },
[TUNER_TCL_MF02GIP_5N] = { /* TCL tuner MF02GIP-5N-E */
.name = "TCL tuner MF02GIP-5N-E",
.params = tuner_tcl_mf02gip_5n_params, .count = ARRAY_SIZE(tuner_tcl_mf02gip_5n_params),
diff -r -d -N -U4 v4l-dvb-7a58d924fb04.old/linux/drivers/media/video/tuner-core.c v4l-dvb-7a58d924fb04/linux/drivers/media/video/tuner-core.c --- v4l-dvb-7a58d924fb04.old/linux/drivers/media/video/tuner-core.c
2010-03-10 03:00:59.000000000 +0100 +++ v4l-dvb-7a58d924fb04/linux/drivers/media/video/tuner-core.c 2010-03-10 17:12:02.000000000 +0100
@@ -29,8 +29,9 @@
#include "tuner-xc2028.h"
#include "tuner-simple.h"
#include "tda9887.h"
#include "xc5000.h"
+#include "xc4000.h"
#include "tda18271.h"
#define UNSET (-1U)
@@ -324,8 +325,9 @@
}
}
static struct xc5000_config xc5000_cfg;
+static struct xc4000_config xc4000_cfg;
static void set_type(struct i2c_client *c, unsigned int type,
unsigned int new_mode_mask, unsigned int new_config, int (*tuner_callback) (void *dev, int component, int cmd, int arg))
@@ -437,8 +439,21 @@
goto attach_failed;
tune_now = 0;
break;
}
+ case TUNER_XC4000:
+ {
+ /* card_type and if_khz will be set when the digital
+ dvb_attach() occurs */
+ xc4000_cfg.card_type = XC4000_CARD_WINFAST_CX88;
+ xc4000_cfg.i2c_address = t->i2c->addr;
+ xc4000_cfg.if_khz = 0;
+ if (!dvb_attach(xc4000_attach,
+ &t->fe, t->i2c->adapter, &xc4000_cfg))
+ goto attach_failed;
+ tune_now = 0;
+ break;
+ }
case TUNER_NXP_TDA18271:
{
struct tda18271_config cfg = {
.config = t->config,
diff -r -d -N -U4 v4l-dvb-7a58d924fb04.old/linux/include/media/tuner.h v4l-dvb-7a58d924fb04/linux/include/media/tuner.h
--- v4l-dvb-7a58d924fb04.old/linux/include/media/tuner.h 2010-03-10
03:00:59.000000000 +0100
+++ v4l-dvb-7a58d924fb04/linux/include/media/tuner.h 2010-03-10
17:12:02.000000000 +0100
@@ -129,8 +129,9 @@
#define TUNER_PARTSNIC_PTI_5NF05 81
#define TUNER_PHILIPS_CU1216L 82
#define TUNER_NXP_TDA18271 83
#define TUNER_SONY_BTF_PXN01Z 84
+#define TUNER_XC4000 85 /* Xceive Silicon Tuner */
/* tv card specific */
#define TDA9887_PRESENT (1<<0)
#define TDA9887_PORT1_INACTIVE (1<<1)
Quoted 2 lines · Devin Heitmueller
I'll try to go through my tree and see if I can get something upstream this week which you could build on.
Are there any news on this ?
By the way, I have just received this mail from Mirek Slugen, with a patch for PxDVR3200 with XC4000 tuner. Should that patch also be submitted ?
Quoted 8 lines · Mirek Slugeň
First I would like to thank you for your work on XC4000 Leadtek tuners, analog TV, analog FM and DVB-T works great.
I created patch for new revision of Leadtek DVR3200 (xc4000) based on your patch and it works also (patch is included).
After long testing I found only one small bug, signal strength is not working on DVB-T XC4000 based tuners, so i will try to fix it.
An updated patch that includes the PxDVR3200 H (107d:6f39) support is now available at http://istvanv.users.sourceforge.net/v4l/xc4000.html.
Quoted 21 lines · On 03/22/2010 07:33 PM, [email protected] wrote:
Quoted 2 lines · Devin Heitmueller
I'll try to go through my tree and see if I can get something upstream this week which you could build on.
Are there any news on this ?
By the way, I have just received this mail from Mirek Slugen, with a patch for PxDVR3200 with XC4000 tuner. Should that patch also be submitted ?
Quoted 8 lines · Mirek Slugeň
First I would like to thank you for your work on XC4000 Leadtek tuners, analog TV, analog FM and DVB-T works great.
I created patch for new revision of Leadtek DVR3200 (xc4000) based on your patch and it works also (patch is included).
After long testing I found only one small bug, signal strength is not working on DVB-T XC4000 based tuners, so i will try to fix it.
OK, so should I write a new xc4000.c/h from scratch and sign that off ?
Quoted 28 lines · Mauro Carvalho Chehab
Quoted 19 lines · Devin Heitmueller
Quoted 10 lines · Mauro Carvalho Chehab
Hi Istvan,
Quoted 2 lines · [email protected] wrote:
The attached new patches contain all the previous changes merged, and are against the latest v4l-dvb revision.
Please provide your Signed-off-by. This is a basic requirement for your driver to be accepted. Please read:
http://linuxtv.org/hg/v4l-dvb/raw-file/tip/README.patchesfor instructions on how to submit a patch.
Hi Mauro,
I would hate to come across as a jerk here, but he cannot provide his SOB for this patch, as I wrote about 95% of the code here. It's derived from a tree I have been working on for the PCTV 340e:
Quoted 5 lines
http://kernellabs.com/hg/~dheitmueller/pctv-340e-2/
I know that istvan wants to see the support merged, but he is going to have to wait a bit longer since he is not the author or maintainer of the driver in question.
OK. Then, I need your SOB for the 95% of the code, and his SOB for the remaining ;)
Well, it is not really a problem, if it is not merged, so this updated version is only for those who want to test it:
http://www.sharemation.com/IstvanV/v4l/xc4000-winfast-14021dfc00f3.patch
- in xc4000.c, power management may default to on or off depending on the card type
- autodetects and (hopefully) supports cards with the following PCI
IDs, based on Windows INF files:
107D:6619 WinFast TV2000 XP Global (this is actually the same as
6618 and 6F18)
107D:6F36 WinFast TV2000 XP Global with XC4100 (analog-only
XC4000 ?) tuner
107D:6F38 WinFast DTV1800 H with XC4000 tuner
107D:6F42 WinFast DTV2000 H Plus
107D:6F43 WinFast TV2000 XP Global with XC4100 tuner and
different GPIOs
Not all of these card versions may actually exist in practice,
though, only 6F38 and 6F42 are confirmed so far.- added a new "sharpness" control to the CX88 driver
Quoted 3 lines · Devin Heitmueller
I would hate to come across as a jerk here, but he cannot provide his SOB for this patch, as I wrote about 95% of the code here. It's derived from a tree I have been working on for the PCTV 340e:
I have finally received some feedback on DVB-T, and it reportedly works, although with a minor bug: it was necessary to use the "cable" connector instead of the "antenna" one. There is an updated patch at the web page
http://www.sharemation.com/IstvanV/v4l/xc4000.html that attempts to correct this problem. It also includes a few CX88 changes that are not related to adding support for XC4000 based cards, and could possibly be released as separate patches:
- implements a "sharpness" control using the CX2388x peaking filter and changing the notch filter
- in two places (cx88-core.c and cx88-video.c) code that checked for CX88_VMUX_TELEVISION did not also check for CX88_VMUX_CABLE; this was the reason why selecting the audio standard did not work for the cable input
- in cx88-mpeg.c, there was code that set core->input to CX88_VMUX_DVB; this does not seem to make sense, since core->input is an index to an array (core->board.input), while the CX88_VMUX_* values are not intended to be used as indexes, but rather values of the 'type' member of struct cx88_input. But it is also not obvious if this has any actual effect other than what is reported as the current input when queried by an application. In any case, I changed the code to search for an input of type CX88_VMUX_DVB, or set the input to 0 if it is not found