免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3541 | 回复: 3
打印 上一主题 下一主题

刚刚搞定天敏电视精灵2电视卡,和大家分享一下 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-06 22:14 |只看该作者 |倒序浏览
我是菜鸟,刚玩linux一个星期,这是我在google搜的一篇文章,我就是看了这篇文章搞定我的电视卡
]b]About

saa7134 is a video4linux module in the linux kernel which provides support for certain PCI TV tuner cards.

This guide covers the basics to detecting your card and loading the correct modules so you can watch and record TV.

For a complete list of cards that are supported by this driver, see
/usr/src/linux/Documentation/video4linux/CARDLIST.saa7134

There are usually a few more cards supported than are listed in the documentation (whether due to deliberate ommission or documentation lag). For the full list, see /usr/src/linux/drivers/media/video/saa7134/saa7134.h and its neighbours.

From 2.6.12 kernel, supported cardlist:

0 -> UNKNOWN/GENERIC
1 -> Proteus Pro [philips reference design]   [1131:2001,1131:2001]
2 -> LifeView FlyVIDEO3000                    [5168:0138,4e42:0138]
3 -> LifeView FlyVIDEO2000                    [5168: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 -> KNC One TV-Station DVR                   [1894:a006]
9 -> Terratec Cinergy 400 TV                  [153B:1142]
10 -> Medion 5044
11 -> Kworld/KuroutoShikou SAA7130-TVPCI
12 -> Terratec Cinergy 600 TV                  [153B:1143]
13 -> Medion 7134                              [16be:0003]
14 -> Typhoon TV+Radio 90031
15 -> ELSA EX-VISION 300TV                     [1048:226b]
16 -> ELSA EX-VISION 500TV                     [1048:226b]
17 -> ASUS TV-FM 7134                          [1043:4842,1043:4830,1043:4840]
18 -> AOPEN VA1000 POWER                       [1131:7133]
19 -> 10MOONS PCI TV CAPTURE CARD              [1131:2001]
20 -> BMK MPEX No Tuner
21 -> Compro VideoMate TV                      [185b:c100]
22 -> Matrox CronosPlus                        [102B:48d0]
23 -> Medion 2819/ AverMedia M156              [1461:a70b,1461:2115]
24 -> BMK MPEX Tuner
25 -> ASUS TV-FM 7133                          [1043:4843]
26 -> Pinnacle PCTV Stereo (saa7134)           [11bd:002b]
27 -> Manli MuchTV M-TV002
28 -> Manli MuchTV M-TV001
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 -> LifeView FlyTV Platinum33 mini           [5168:0212] (in fact it's number 39, see the card 34 note in the box below)

The following is adapted from the 2.6.12 /usr/src/linux/drivers/media/video/saa7134/saa7134.h kernel file:

34 -> NOVAC_PRIMETV7133 (doesn't seem to be the same as in the CARDLIST.saa7134 file, which according to the saa7134.h file, is card number 39; see below)
35 -> AVERMEDIA_STUDIO_305
36 -> UPMOST_PURPLE_TV
37 -> ITEMS_MTV005
38 -> CINERGY200
39 -> FLYTVPLATINUM_MINI
40 -> VIDEOMATE_TV_PVR
41 -> VIDEOMATE_TV_GOLD_PLUS
42 -> SABRENT_SBTTVFM
43 -> ZOLID_XPERT_TV7134
44 -> EMPIRE_PCI_TV_RADIO_LE
45 -> AVERMEDIA_307
46 -> AVERMEDIA_CARDBUS
47 -> CINERGY400_CARDBUS
48 -> CINERGY600_MK3
49 -> VIDEOMATE_GOLD_PLUS
50 -> PINNACLE_300I_DVBT_PAL
51 -> PROVIDEO_PV952
52 -> AVERMEDIA_305
53 -> ASUSTeK_TVFM7135
54 -> FLYTVPLATINUM_FM
55 -> FLYDVBTDUO

It is recommended that you verify the card number in your own kernel files.

For more documenation, see /usr/src/linux/Documentation/video4linux/README.saa7134 and /usr/src/linux/Documentation/video4linux/CARDLIST.tuner.

You will need, later, the card and tuner type. Usually, and once you have compiled the module and loaded it in the kernel, it can be seen using the dmesg command, and can be seen as

...
saa7134[0] subsystem: xxxxxxx board: xxxxxxxxxx (saa7134) [card=yy, insmod option]
...
tuner: type set to zz (xxxxxxxx) by saa7134[0]
...

Where the card number is the one shown as yy and the type one as zz

Setup Modules

You will have to configure your kernel to load the correct modules so that your hardware will work.

# cd /usr/src/linux
# make menuconfig

Video For Linux support can be compiled in your kernel (though you will have to reboot, if you do), or loaded as a module. However, the saa7134 module will need to be added as a module, since you will have to pass options when loading the driver.

Linux Kernel Configuration: Device Drivers

  Multimedia devices  --->
    <M> Video For Linux (config: CONFIG_VIDEO_DEV, module: videodev)
      Video For Linux  --->
        <M> Philips SAA7134 support (config: CONFIG_VIDEO_SAA7134, module: saa7134)

You will also need the i2c_core module loaded in your kernel.

Linux Kernel Configuration: Device Drivers

  I2C support  --->
    <M> I2C support (config: CONFIG_I2C, module: i2c_core)
    < >   I2C device interface

After saving your kernel config, make and install the kernel modules

# make modules modules_install

Warning: Remember not to compile saa7134 support into your kernel. It must be loaded as a module!

论坛徽章:
0
2 [报告]
发表于 2006-01-06 22:15 |只看该作者
Hardware Detection

Please note: In some cases, getting your TV tuner card is not going to be as simple as loading the module and starting up your favorite tv tuner frontend. You will need to do a little hardware detection first before you can watch any TV.

There are two ways to detect the exact card and tuner type. One is using I2C to scan the bus, which may or may not work. The second way is to manually determine the card and tuner numbers.

i2c scan

If you are running a recent kernel, a new option is available, using i2c to scan the card and tuner type.

Ideally, all you need to do is load the module with i2c_scan=1 as an option, and it will be autodetected.

modprobe saa7134 i2c_scan=1

Again, this may or may not work for you. If it does, just make the option the default setting.

echo "options i2c_scan=1" > /etc/modules.d/saa7134
modules-update
modprobe saa7134

If it doesn't work for you, you can always manually find the correct type by passing card and tuner options yourself.

card and tuner

There are two options that need to be passed when loading the modules: card and tuner.

The module will load fine even if you pass the wrong values, so just because it doesn't throw an error doesn't mean it will work correctly. You may need to do some trial and error, but it is worth it -- when setup correctly, the tuner delivers a nice picture.

From the v4l2 driver FAQ

"Unfortunately it is impossible to detect the tuner type directly. For some TV cards it is known how to figure the exact tuner type indirectly, for example by parsing the configuration info within the card's eeprom. For most cards the drivers simply have a hardcoded default value. That catches most cases, but there are a few exceptions where the vendors ship the TV cards with different tuners depending on the region they are sold (PAL tuner in europe, NTSC tuner in the US) and there is no known way to figure what tuner the card actually has."

card

You should be able to determine your card type by running lspci, which is part of the pciutils package.
Code: lspci

# lspci
...
0000:01:07.0 Multimedia controller: Philips Semiconductors SAA7133 Audio+video broadcast decoder (rev 10)
...

See /usr/src/linux/Documentation/video4linux/CARDLIST.saa7134 for the card numbers (or the list above). Once you find it, pass the option card=x where x is the card number when loading the module.

In this example, the card # is 2 from the list above: LifeView FlyVIDEO3000

# modprobe saa7134 card=2

You can also use the dmesg command as explained in the about section
[edit]
tuner

You will also have to select the tuner number from the list of tuners, which can be found in /usr/src/linux/Documentation/video4linux/CARDLIST.tuner or this list below:

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 daul 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 DDT 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 DDT 7611 (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

One way to find out your tuner number if you don't see it in the list is simple trial and error, or you can also use the dmesg command as explained in the about section

# modprobe saa7134 card=2 tuner=1
# tvtime
# rmmod saa7134
# modprobe saa7134 card=2 tuner=2
# tvtime
...

如果配置正确的话,tvtime中会多一个“Channel management”的菜单,
“Change frequency table”选“China”,
然后“Reset all channels..”,在“Scan channel..”
搜索就能出台!!!

Another way could be this:

#/bin/sh
MAXTUNER=46
i=0
while [ $i -lt $MAXTUNER ];
do
           rmmod tuner saa7134
                       modprobe saa7134 card=25 tuner=$i
                       echo "Actual tuner is:" $i
                       tvtime
         i=$(($i+1))
done

write this to probe_tuner.sh and run it as root

If your TV uses NTSC, try the NTSC tuners. If you use PAL, try the PAL ones.

Once you have the card number and the tuner number, you can load the module.

# modprobe saa7134 card=2 tuner=2

Once the modules are loaded, they should create radio0, vbi0 and video0 in /dev/v4l/ These are your video4linux devices that programs like freevo, kdetv, mythtv and tvtime will use.

If you need to remove the module and try again with different options, use rmmod. To do this the kernel must be compliled with the module unload feature enabled.

# rmmod saa7134

Add the module to be loaded on bootup:

# echo "saa7134" >> /etc/modules.autoload.d/kernel-2.6

or emerge coldplug, and add it to your boot init scripts.

# emerge coldplug
# rc-update add coldplug boot

[edit]
More Module Options

There are more options you can pass when loading the module. They are: oss, oss_rate, radio_nr, mixer_nr, dsp_nr, vbi_nr and video_nr.

The options ending in _nr let you pass which device number you want the card to register as in /dev, in case you have conflicting devices. By default you don't need to use these options, since the module will automatically register the next available sequence of numbers.

Example: Load the card and register the device as /dev/video2

# modprobe saa7134 video_nr=2

The oss option will enable both a dsp and mixer device in /dev/sound so that you can record audio using the tuner's audio. Just pass a 1 to enable it.

# modprobe saa7134 oss=1

Once you find your module settings, add them to /etc/modules.d/saa7134 so you don't have to pass the options each time.

# echo "options saa7134 card=2 tuner=2 oss=1" > /etc/modules.d/saa7134
# update-modules
# modprobe saa7134

[edit]
dmesg output

Assuming everything loads fine, you should see your dmesg output to something similar like this:

# modprobe saa7134 card=2 tuner=2 oss=1 dsp_nr=1 mixer_nr=1 video_nr=0
# dmesg

saa7133[0]: found at 0000:02:0c.0, rev: 16, irq: 5, latency: 32, mmio: 0xda800000
saa7133[0]: subsystem: 5169:0138, board: LifeView FlyVIDEO3000 [card=2,insmod option]
saa7133[0]: board init: gpio is 39800
saa7133[0]: there are different flyvideo cards with different tuners
saa7133[0]: out there, you might have to use the tuner=<nr> insmod
saa7133[0]: option to override the default value.
saa7133[0]: registered input device for IR
saa7133[0]: dsp access wait timeout [bit=WRR]
saa7133[0]: dsp access wait timeout [bit=WRR]
saa7133[0]: dsp access wait timeout [bit=WRR]
tuner 1-0061: chip found @ 0xc2 (saa7133[0])
tuner 1-0061: type set to 2 (Philips NTSC (FI1236,FM1236 and compatibles))
saa7133[0]: i2c eeprom 00: 69 51 38 01 10 28 ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 20: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: registered device video0 [v4l2]
saa7133[0]: registered device vbi0
saa7133[0]: registered device radio0
saa7133[0]: registered device dsp1
saa7133[0]: registered device mixer1

[ 本帖最后由 wander1234 于 2006-1-6 22:34 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2006-01-06 22:18 |只看该作者
Audio Settings

There are two ways to record audio with your TV card: using a short audio cable that goes from the card's audio out to your computer's audio in (line or mic), or recording the audio with the board's mixer device.

If you want to use the board's mixer device, make sure you pass oss=1 when loading the module. This will register /dev/dsp1 and /dev/mixer1. You can change the dsp and mixer number by passing dsp_nr=x and mixer_nr=x when loading the module as well.
Note: To be more specific, when passing the oss option, the module will create the next available device numbers for dsp and mixer in dev. Remember that device nodes are created starting with the number 0, not 1.

So, if you have a soundcard using ALSA + OSS emulation or just OSS, those will already be using /dev/dsp and /dev/mixer. Otherwise, if those aren't in use, those are the ones that the module would create. If you have more than one soundcard using ALSA + OSS or OSS, then it will still register the next available device nodes.

If you're not sure, chances are that you are already using OSS (through ALSA or not), and dsp1 and mixer1 will be the new device nodes.

Once its loaded, you will need to use a mixer to change the settings so sound will record. By default, the recording device is not set correctly, so anything you record will be muted.

Aumix is one of the few mixers in portage (emerge: aumix) that can edit mixer settings on more than one mixer device. After you have emerged aumix, run the program passing the option to edit /dev/mixer1.

$ aumix -d /dev/mixer1 -I

The -d argument tells aumix which mixer device to open. By default, it will go to /dev/mixer or /dev/mixer0. The -I means interactive mode, which will bring up the console or X window program.

By default, the "R" (recording) device will be set to Video. Change it to any of the other options (Line 1 or Line 2) to record onboard audio. In console mode for aumix, use the arrow keys to select Line1 or Line2, and then the space bar to select that one as the recording device. In the X window, just select it with your mouse so there is a red box next to it. Save your settings and exit.

You don't need to worry about setting the volume on the tuner's mixer.

If you don't want to manually set your mixer everytime you boot your computer, aumix makes it easy to do so with one command.

This example will set the recording device to Line1 for /dev/mixer1:

$ aumix -d /dev/mixer1 -1 R

You can add that line to /etc/conf.d/local.start to have it automatically set on boot.

# echo "aumix -d /dev/mixer1 -1 R" >> /etc/conf.d/local.start

Note: Using the aumix init script on boot (/etc/init.d/aumix) will not set the TV tuner for you. The runlevel script will only set the mixing settings for the default device -- /dev/mixer

论坛徽章:
0
4 [报告]
发表于 2006-01-06 22:26 |只看该作者
我的电视卡是
modprobe saa7134 card=3
然后在dmesg中自动认出tuner在37

然编辑一个新的modprobe option文件
/etc/modprobe.d/saa7134
内容为
options saa7134 tuner=37

然后用tvtime看电视的时候,关了tvtime后居然还有声音!!!
然后看网上,别人是这么的解决的,我也这样解决了,哈哈:

今天我也彻底解决了自己的电视卡问题,而这个后台出现电视伴音的问题,我前一阵子就找到办法解决了。最简单地办法是在音量控制中将LIne静音,这个需要手动。另外呢,就是写一个脚本,内容如下:
# tvtime.sh
tvtime
amixer set Line mute
用这个来调用tvtime,并且在调用结束自动后将Line静音。方法很简单吧

如果你的电视卡只有图象没有声音,先看看声音面板上的Line-in是不是静音!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP