在ubuntu9.04中安装电视卡用到的资料

我把老的台式机(p4 2.8e,1G,865pe,nv 5200)淘汰下来,装了ubuntu备用,毕竟是在家里,还是需要一些娱乐功能的,机器上有一个tv baby200的电视卡,要用起来,参考了下面的一些资料,调试成功,复制到这里备查。

现在的linux的2.6内核里,对saa713x和bttv系列的电视卡提供了很不错的支持。
经本人好几天,辛苦捣鼓,终于把我的电视精灵2(芯片:saa7130HL)弄到linux上了。
特将本人心得与大家分享。
我的环境是2.6.16,最新的kernel。
一般的PCI电视卡,在2.6.x系列的kernel上,均可以自己认出。不过你需要就是在insmod的时候,指定card=xxx,tuner=xxx
这很重要的,默认的值都不大对的,需要自己手工调的。
这几个值,可以参照linux内核的Documents/video4linux/CARDLIST.xxxx文档。
假如我们要在开机的时候,自己让系统insmod你的模块,只需在创建/etc/modprobe.d/saa7134文件,把你的设置写进去就可以了。我的saa7134内容:
options saa7134 card=21,21,21,21 tuner=38,38,38,38 video_nr=0,1,2,3 vbi_nr=0,1,2,3 radio_nr=0,1,2,3
install saa7134 /sbin/modprobe --ignore-install saa7134; /sbin/modprobe saa7134-alsa
options saa7134-alsa index=1,2,3,4
这样你的linux重启后,就可以用tvtime来看电视了。这很简单哦,呵呵。
由于遥控器都是厂家自己定制的,所以处理起来比较累。像我的天敏出品的就没有支持的,只好自己动手了。
How to add remote control support to a card (GPIO remotes)

The operation is as follows (at least it is how i did it):

1. you make detinitions of your board to have remote control (in saa7134-cards.c).
2. in saa7134-input.c, you add a case for it into the switch statement, with mask_keycode=0. Use any ir_codes array for the start. Well, you should also determine whenever polling is needed, too.
3. Load saa7134 module with ir_debug=1 parameter.
4. press the keys on your remote control and watch syslog (dmesg). You will see something like

build_key gpio=0x12345 mask=0x0 data=0

in dmesg output after each key press/release.

Pay attention to gpio=0x... stuff. You will see some bits which does not change, and some which do. The ones which changes should be in your mask_keycode and mask_keydown (mask_keycode should contain not more than 8 bits set to 1, others should be set to 0). Mask_keyup and mask_keydown - those are easy to determine if you see some bit is always on when you press a key and off when you release it, or the reverse.

Ie, you will have to determine which bits in gpio value represents the key# pressed/released, and which indicate whenever it is the press or release.

After this, recompile saa7134 module with correct mask_* stuff in your saa7134_input_init1() routine. Now, the dmesg output should look like

build_key gpio=0x12345 mask=0x<mask_value> data=5

Ensure the data= value is different for each key, if not, you'll have to modify mask_keycode again.

Next, build the key table, by writing a file with one line for every of your key, with two fields -- key name and the data=value assotiated with it.

Try to find existing table matching your one. If there's one, use it. If none is found, build your own.

That's basically it.
以上内容来自V4L的Wikihttp://linuxtv.org/v4lwiki/index.php/Remote_controllers,很有帮助的。
主要是调整mask_keycode和mask_keyup这几个值,比较累。没有厂家的资料,我们自己猜,呵呵。
修改好,make modules; make modules_install即可。
吴汝旭 于2006.05.03凌晨

++++++++++++
我用的是天敏的TVBaby2,saa7134,card=3,用tvtime效果不错,而且能在Linux amd64中正常使用,而在Windows XP x64中却没有驱动,真是讽刺。
======================
那天,我得知Linux也可以用电视卡看电视,我本来是绝望的,因为我的电视卡是没有Linux的驱动,后来在社区里看到原来不用找驱动,直接装TVtime就可以,突然就燃起了希望,于是打开终端,输入:
~$ sudo apt-get install tvtime
自动下载安装完毕,在应用程序找到TVtime运行,设置了PAL制式和中国广播,结果是蓝屏,显示“No Signal”怎么可能!
于是上太平洋的Linux系统专区问(去ubuntu社区问大概要一个月才有人回复),ghost0版副(Koradji)很热心地帮助我,最终可以看电视了,十分感谢!
首先,我们确定了电视卡的芯片类型,因为我买的时候就问过,是飞利浦的没错。
~$ lspci
找到“ 0000:02:04.0 ffff: Philips Semiconductors SAA7130 Video Broadcast Decoder (rev f f)”,证明是飞利浦的。
既然可以识别芯片,为什么看不到呢?我又尝试XawTV,结果也是不能看。
ghost0提醒到USB摄像头会占用/dev/video0,不过我并没有安装USB摄像头。
而且我发现,我的设备根本没有/dev/video0,于是我怀疑接触不良,于是关机,拆下主角,用用橡皮擦擦了一下金手指,结果进入系统后可以识别,但还是看不到,不过有所变化,现在TVtime是黑屏,输入设备为default,在设备里也可以找到/dev/video0。
“0000:02:04.0 Multimedia controller: Philips Semiconductors SAA7130 Video Broadca st Decoder (rev 01)”
主角应该没有坏啊,进入WinXP可以看电视啊。
我根本没有搜台的选项,据ghost0说,输入设备一定要把video source设为television才可以,其间也试过其它方法,都没有用。具体看这个帖子:
http://softbbs.pconline.com.cn/topic.jsp?tid=6576864
所以接下来就是要找到方法设置为television。
我翻了ubuntu论坛的旧帖,发现有人有类似的问题,解决的方法是删除模块然后重新挂载,但我不知道card和tuner的值,照抄别人的数值不行。但貌似有好转。
看来是这个方法了,于是我和ghost0朝不同的方向找这两个数值……


ghost0: 你试试card=21 tuner=37,我在天敏论坛看到有人说电视大师3是这样的,不知道你的黄金版是不是也一样
tuner=37是LG,我的朗视P30也是这个,看来国内还是用的蛮多的

我觉得3代和1代的产品应该不同吧,看到电视卡的说明书写着“如果您有问题,可E-mail至本公司技术服务邮箱。”对啊,技术支持应该知道啊!
偶:请问:怎样在Linux设置电视卡?
技:感谢您对天敏的支持与厚爱!由于出现问题给您的使用带来不便,敬请原谅!电视大师黄金版不支持Linux系统!
偶:请问这是一个“标准答案”还是经过调查事实得出的结论?
我知道你们没有Linux的驱动,但Linux的新核心是支持电视卡的
可以告诉我“电视大师黄金版”用什么牌子型号的芯片?什么牌子型号的高频头?
谢谢。
技:感谢您对天敏的支持与厚爱!由于出现问题给您的使用带来不便,敬请原谅!暂时没有支持VISTA系统的驱动!如果驱动不支持,电视卡肯定不能正常使用的!(这鸟人,这么多感叹号!小学语文没学好吗?感叹号可以随便用的吗?其实我看到他的回复,我差点喷血,答非所问,是不是上班时间在泡妞?)
偶:请你看清楚标题。。。
我现在也不是要驱动,我只希望知道
“电视大师黄金版”用什么牌子型号的芯片?什么牌子型号的高频头?
你可以问问技术部门或者负责硬件设计的人,他们应该可以知道,我想这应该不是什么秘密吧,我只是不想拆开电视卡来看,拆开应该可以看到的,我怕搞坏。

到这个时候,我已经对技术支持不抱有任何期望了,我试了Ghost0给的数值。
~$ sudo rmmod saa7134_alsa
~$ sudo rmmod saa7134
~$ sudo modprobe saa7134 card=21 tuner=37

找到TVtime运行,竟然成功了,走弯路了,早知道一开始就试。
出现了“Channel managernent”的项目,进入就可以搜台了。
不过似乎没有声音,其实是要把线路输入的音量调到最大才行。

后来我检查邮件,发现技术支持终于说人话了!!
技:
感谢您对天敏的支持与厚爱!由于出现问题给您的使用带来不便,敬请原谅!
很抱歉,忘了加入信息介绍,电视大师黄金版使用菲利普7130芯片和TCL高频头!

目前暂时解决了问题,但是好像每次重新开机又要重新删除模块/挂载模块,
还有,退出电视程序后,声音还在播放。。。真系“死唔断气”

希望大家可以补充一个完美的解决方案。
+++++++++++++++++++++++++++
1。安装TVTIME软件
“系统--系统管理--新立得软件包管理器”--搜索(输入TITIME)搜索到后按鼠标右键设为安装,接着一步一步安装,安装时有对话框:1选 PAL,2选CHINA***。安装完毕后,可到“应用程序--影音”下点击TVTIME TELEVISION VIEWER启动,启动后能看到有五列的菜单(或点击鼠标右键看到),不可搜台,不可用,关闭。
2。安装驱动,在终端输入下列命令:
sudo apt-get intall mercurial 回车
hg clone http://linuxtv.org/hg/v4l-dvb 回车
可能要等上一段时间来下载安装,来喝口水吧。
3。修改文件saa7134-cards.c
终端下命令
sudo gedit /home/(你的用户名)/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c 回车,在编辑器里查找到 [SAA7134_BOARD_10MOONSTVMASTER]一节,修改为以下代码:
---------------------------此为分隔线----
[SAA7134_BOARD_10MOONSTVMASTER] = {
/* "catinsnow" <catinsnow#gmail.org> */
.name = "10MOONS PCI TV CAPTURE CARD",
.tuner_type = TUNER_LG_PAL_NEW_TAPC,
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.gpiomask = 0x7000,
.inputs = {{
.name = name_tv,
.vmux = 1,
.amux = LINE2,
.gpio = 0x0000,
.tv = 1,
},{
.name = name_comp1,
.vmux = 3,
.amux = LINE1,
.gpio = 0x2000,
},{
.name = name_svideo,
.vmux = 0,
.amux = LINE1,
.gpio = 0x2000,
}},
.mute = {
.name = name_mute,
.amux = LINE2,
.gpio = 0x3000,
},
},

----------------------此为分隔线------
保存,退出即可。一点小说明:上面代码中最后的“.gpio = 0x3000”,如值为 0x8000时,启动
UBUNTU系统后不开TVTIME就会发出电视声音。
4。修改tvtime.xml文件。
作用:关闭TVTIME后,电视声音还在响,声音无法关闭,修改tvtime.xml文件后就解决问题了。
方法:终端里命令
sudo gedit /etc/tvtime/tvtime.xml 回车
在编辑器里查找 <option name=”MuteOnExit”value=”0”/> 把 “0”改为”1”后保存.

5.修改电视卡启动参数(这一步很重要,关系于系统能否识别你的电视卡)即修改alsa-base文件.
方法:终端里命令
sudo gedit /etc/modprobe.d/alsa-base 回车
找到 '--ignore-install saa7134 $CMDLINE_OPTS &'一行
saa7134即是你的电视卡芯片型号,把 $CMDLINE_OPTS 改为 card=21 tuner=56 后保存.重启系统运行tvtime看到有六项的菜单,单击第一项,出现下一级菜单(有十项),按第三项scan channels for signal即可搜台看了,搜完台后可用键盘的上下方向键选台,左右方向键为调节声音大小.
Card和tuner的数值是经过下列表查到和试验的.
==================
2.6.16核心的linux支持的电视卡的card类型和tuner类型,如下所示:
card类型:
0 -> UNKNOWN/GENERIC
1 -> Proteus Pro [philips reference design] [1131:2001,1131:2001]
2 -> LifeView FlyVIDEO3000 [5168:0138,4e42:0138]
3 -> LifeView/Typhoon FlyVIDEO2000 [5168:0138,4e42:0138]
4 -> EMPRESS [1131:6752]
5 -> SKNet Monster TV [1131:4e85]
6 -> Tevion MD 9717
7 -> KNC One TV-Station RDS / Typhoon TV Tuner RDS [1131:fe01,1894:fe01]
8 -> Terratec Cinergy 400 TV [153b:1142]
9 -> Medion 5044
10 -> Kworld/KuroutoShikou SAA7130-TVPCI
11 -> Terratec Cinergy 600 TV [153b:1143]
12 -> Medion 7134 [16be:0003]
13 -> Typhoon TV+Radio 90031
14 -> ELSA EX-VISION 300TV [1048:226b]
15 -> ELSA EX-VISION 500TV [1048:226a]
16 -> ASUS TV-FM 7134 [1043:4842,1043:4830,1043:4840]
17 -> AOPEN VA1000 POWER [1131:7133]
18 -> BMK MPEX No Tuner
19 -> Compro VideoMate TV [185b:c100]
20 -> Matrox CronosPlus [102B:48d0]
21 -> 10MOONS PCI TV CAPTURE CARD [1131:2001]
22 -> AverMedia M156 / Medion 2819 [1461:a70b]
23 -> BMK MPEX Tuner
24 -> KNC One TV-Station DVR [1894:a006]
25 -> ASUS TV-FM 7133 [1043:4843]
26 -> Pinnacle PCTV Stereo (saa7134) [11bd:002b]
27 -> Manli MuchTV M-TV002/Behold TV 403 FM
28 -> Manli MuchTV M-TV001/Behold TV 401
29 -> Nagase Sangyo TransGear 3000TV [1461:050c]
30 -> Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM) [1019:4cb4]
31 -> Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM) [1019:4cb5]
32 -> AVACS SmartTV
33 -> AVerMedia DVD EZMaker [1461:10ff]
34 -> Noval Prime TV 7133
35 -> AverMedia AverTV Studio 305 [1461:2115]
36 -> UPMOST PURPLE TV [12ab:0800]
37 -> Items MuchTV Plus / IT-005
38 -> Terratec Cinergy 200 TV [153b:1152]
39 -> LifeView FlyTV Platinum Mini [5168:0212,4e42:0212]
40 -> Compro VideoMate TV PVR/FM [185b:c100]
41 -> Compro VideoMate TV Gold+ [185b:c100]
42 -> Sabrent SBT-TVFM (saa7130)
43 -> :Zolid Xpert TV7134
44 -> Empire PCI TV-Radio LE
45 -> Avermedia AVerTV Studio 307 [1461:9715]
46 -> AVerMedia Cardbus TV/Radio (E500) [1461:d6ee]
47 -> Terratec Cinergy 400 mobile [153b:1162]
48 -> Terratec Cinergy 600 TV MK3 [153b:1158]
49 -> Compro VideoMate Gold+ Pal [185b:c200]
50 -> Pinnacle PCTV 300i DVB-T + PAL [11bd:002d]
51 -> ProVideo PV952 [1540:9524]
52 -> AverMedia AverTV/305 [1461:2108]
53 -> ASUS TV-FM 7135 [1043:4845]
54 -> LifeView FlyTV Platinum FM [5168:0214,1489:0214]
55 -> LifeView FlyDVB-T DUO [5168:0306]
56 -> Avermedia AVerTV 307 [1461:a70a]
57 -> Avermedia AVerTV GO 007 FM [1461:f31f]
58 -> ADS Tech Instant TV (saa7135) [1421:0350,1421:0351,1421:0370,1421:1370]
59 -> Kworld/Tevion V-Stream Xpert TV PVR7134
60 -> LifeView/Typhoon FlyDVB-T Duo Cardbus [5168:0502,4e42:0502]
61 -> Philips TOUGH DVB-T reference design [1131:2004]
62 -> Compro VideoMate TV Gold+II
63 -> Kworld Xpert TV PVR7134
64 -> FlyTV mini Asus Digimatrix [1043:0210]
65 -> V-Stream Studio TV Terminator
66 -> Yuan TUN-900 (saa7135)
67 -> Beholder BeholdTV 409 FM [0000:4091]
68 -> GoTView 7135 PCI [5456:7135]
69 -> Philips EUROPA V3 reference design [1131:2004]
70 -> Compro Videomate DVB-T300 [185b:c900]
71 -> Compro Videomate DVB-T200 [185b:c901]
72 -> RTD Embedded Technologies VFG7350 [1435:7350]
73 -> RTD Embedded Technologies VFG7330 [1435:7330]
74 -> LifeView FlyTV Platinum Mini2 [14c0:1212]
75 -> AVerMedia AVerTVHD MCE A180 [1461:1044]
76 -> SKNet MonsterTV Mobile [1131:4ee9]
77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e]
78 -> ASUSTeK P7131 Dual [1043:4862]
79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B)
80 -> ASUS Digimatrix TV [1043:0210]
81 -> Philips Tiger reference design [1131:2018]
82 -> MSI TV@Anywhere plus [1462:6231]
83 -> Terratec Cinergy 250 PCI TV [153b:1160]
84 -> LifeView FlyDVB Trio [5168:0319]
下面是tuner类型:
tuner=0 - Temic PAL (4002 FH5)
tuner=1 - Philips PAL_I (FI1246 and compatibles)
tuner=2 - Philips NTSC (FI1236,FM1236 and compatibles)
tuner=3 - Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
tuner=4 - NoTuner
tuner=5 - Philips PAL_BG (FI1216 and compatibles)
tuner=6 - Temic NTSC (4032 FY5)
tuner=7 - Temic PAL_I (4062 FY5)
tuner=8 - Temic NTSC (4036 FY5)
tuner=9 - Alps HSBH1
tuner=10 - Alps TSBE1
tuner=11 - Alps TSBB5
tuner=12 - Alps TSBE5
tuner=13 - Alps TSBC5
tuner=14 - Temic PAL_BG (4006FH5)
tuner=15 - Alps TSCH6
tuner=16 - Temic PAL_DK (4016 FY5)
tuner=17 - Philips NTSC_M (MK2)
tuner=18 - Temic PAL_I (4066 FY5)
tuner=19 - Temic PAL* auto (4006 FN5)
tuner=20 - Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
tuner=21 - Temic NTSC (4039 FR5)
tuner=22 - Temic PAL/SECAM multi (4046 FM5)
tuner=23 - Philips PAL_DK (FI1256 and compatibles)
tuner=24 - Philips PAL/SECAM multi (FQ1216ME)
tuner=25 - LG PAL_I+FM (TAPC-I001D)
tuner=26 - LG PAL_I (TAPC-I701D)
tuner=27 - LG NTSC+FM (TPI8NSR01F)
tuner=28 - LG PAL_BG+FM (TPI8PSB01D)
tuner=29 - LG PAL_BG (TPI8PSB11D)
tuner=30 - Temic PAL* auto + FM (4009 FN5)
tuner=31 - SHARP NTSC_JP (2U5JF5540)
tuner=32 - Samsung PAL TCPM9091PD27
tuner=33 - MT20xx universal
tuner=34 - Temic PAL_BG (4106 FH5)
tuner=35 - Temic PAL_DK/SECAM_L (4012 FY5)
tuner=36 - Temic NTSC (4136 FY5)
tuner=37 - LG PAL (newer TAPC series)
tuner=38 - Philips PAL/SECAM multi (FM1216ME MK3)
tuner=39 - LG NTSC (newer TAPC series)
tuner=40 - HITACHI V7-J180AT
tuner=41 - Philips PAL_MK (FI1216 MK)
tuner=42 - Philips 1236D ATSC/NTSC dual in
tuner=43 - Philips NTSC MK3 (FM1236MK3 or FM1236/F)
tuner=44 - Philips 4 in 1 (ATI TV Wonder Pro/Conexant)
tuner=45 - Microtune 4049 FM5
tuner=46 - Panasonic VP27s/ENGE4324D
tuner=47 - LG NTSC (TAPE series)
tuner=48 - Tenna TNF 8831 BGFF)
tuner=49 - Microtune 4042 FI5 ATSC/NTSC dual in
tuner=50 - TCL 2002N
tuner=51 - Philips PAL/SECAM_D (FM 1256 I-H3)
tuner=52 - Thomson DTT 7610 (ATSC/NTSC)
tuner=53 - Philips FQ1286
tuner=54 - tda8290+75
tuner=55 - TCL 2002MB
tuner=56 - Philips PAL/SECAM multi (FQ1216AME MK4)
tuner=57 - Philips FQ1236A MK4
tuner=58 - Ymec TVision TVF-8531MF/8831MF/8731MF
tuner=59 - Ymec TVision TVF-5533MF
tuner=60 - Thomson DTT 761X (ATSC/NTSC)
tuner=61 - Tena TNF9533-D/IF/TNF9533-B/DF
tuner=62 - Philips TEA5767HN FM Radio
tuner=63 - Philips FMD1216ME MK3 Hybrid Tuner
tuner=64 - LG TDVS-H062F/TUA6034
tuner=65 - Ymec TVF66T5-B/DFF
tuner=66 - LG NTSC (TALN mini series)
tuner=67 - Philips TD1316 Hybrid Tuner
tuner=68 - Philips TUV1236D ATSC/NTSC dual in
tuner=69 - Tena TNF 5335 MF
tuner=70 - Samsung TCPN 2121P30A
=====================
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值