mplayer dvb build

本文档详细介绍了如何在 Linux 操作系统下配置和使用 ATI HDTV Wonder 电视调谐卡,包括内核配置、固件安装、DVB 应用程序设置等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

DVB


Introduction

I've been a big fan of tv tuner cards for almost as long as I've been in to computers. As soon as my dad bought an HDTV, I knew I had to have it, and the first chance I had was to buy the ATI HDTV Wonder card for my computer. Sure, the picture can be bad sometimes because you are grabbing the signal out of the air with an unamplified antenna, but it is well worth it. When I finally decided to make the jump to Linux a few months ago, I researched ahead of time if it was possible to use my card in Linux, and to my surprise I could. Let me note that it did take me a few months of on and off work to get it running since I was pretty much learning Linux from scratch along the way. The biggest pitfalls I ran in to was the lack of a complete HOWTO to lead me through the steps from start to finish and the lack of a large DVB/HDTV user community to ask for help when I ran in to trouble. I hope that this tutorial gets rid of those two pitfalls and lets you get your HDTV card working without any trouble.

Kernel Configuration

I'm not sure which kernel exactly began including the necesary modules for the ATI HDTV Wonder card, but I do know that kernel versions 2.6.15 and up have them. In order to use the ATI HDTV Wonder, you need to enable the correct modules in the kernel. You need to enable I2C and the cx88 DVB modules under Device Drivers. If you are new to building your own kernel, see Kernel26Compilation

snipped from my .config

#
# I2C support
#
CONFIG_I2C=m
CONFIG_I2C_CHARDEV=m

#
# I2C Algorithms
#
CONFIG_I2C_ALGOBIT=m

#
# Video For Linux
#

#
# Video Adapters
#
CONFIG_VIDEO_CX88=m
CONFIG_VIDEO_CX88_ALSA=m
CONFIG_VIDEO_CX88_DVB=m
CONFIG_VIDEO_CX88_DVB_ALL_FRONTENDS=n
CONFIG_VIDEO_CX88_VP3054=m
#
# Digital Video Broadcasting Devices
#
CONFIG_DVB=y
CONFIG_DVB_CORE=m

#
# ATSC (North American/Korean Terresterial DTV) frontends
#
CONFIG_DVB_NXT200X=m

If you are a less advanced user, it won't hurt anything if you select everything that might remotely deal with DVB as a Module (hit `M`). When you are done, save the configuration and compile the kernel. Before you reboot, you need to download the firmware for the card.

Firmware

Make sure you are in /usr/src/linux

# pwd
/usr/src/linux

There is a script provided that will download the appropriate firmware driver for you. First, make it executable, then run it.

# chmod +x Documentation/dvb/get_dvb_firmware
# ./Documentation/dvb/get_dvb_firmware nxt2004

Then the firmware file needs to be copied to the directory where hotplug will find it. On Slackware, this directory is /lib/firmware

# cp dvb-fe-nxt2004.fw /lib/firmware

Now you can reboot in to your new kernel, and your card should be automatically recognized. You can check to see if the modules loaded with lsmod

$ lsmod | grep cx88
cx88_dvb                8964  0
cx8802                  8068  1 cx88_dvb
cx88xx                 54180  2 cx88_dvb,cx8802
ir_common               7812  1 cx88xx
btcx_risc               3848  2 cx8802,cx88xx
tveeprom               12304  1 cx88xx
cx88_vp3054_i2c         3456  1 cx88_dvb
i2c_algo_bit            7432  2 cx88xx,cx88_vp3054_i2c
mt352                   5380  1 cx88_dvb
or51132                 8324  1 cx88_dvb
video_buf_dvb           4228  1 cx88_dvb
video_buf              15364  4 cx88_dvb,cx8802,cx88xx,video_buf_dvb
nxt200x                11524  1 cx88_dvb
cx24123                 7684  1 cx88_dvb
lgdt330x                6684  1 cx88_dvb
cx22702                 5252  1 cx88_dvb
i2c_core               15248  15 nvidia,w83627hf,eeprom,i2c_isa,i2c_nforce2,cx88_dvb,cx88xx,tveeprom,i2c_algo_bit,mt352,or51132,nxt200x,cx24123,lgdt330x,cx22702
dvb_pll                 9220  4 cx88_dvb,or51132,nxt200x,cx22702

DVB Apps

All that we are really interested in with DVB Apps is scan and azap. I created a SlackBuild script that will create a package from the dvb apps cvs. To use the SlackBuild script, you will first need to create a temporary directory to house the relevant components and then you will need to get the sources from the dvb apps CVS. If you are new to SlackBuild scripts, check out the SlackBuild_Scripts tutorial. You will log in to the cvs with an empty password.

$ mkdir ~/dvb-apps-build
$ cd ~/dvb-apps-build
$ cvs -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv login
$ cvs -z3 -d :pserver:anonymous@cvs.linuxtv.org:/cvs/linuxtv co dvb-apps

Udev Rules

By default, my udev would not create the correct devices nodes, so I found these rules on a website which fixed the problem. I can not remember what site I found them on at the moment, but I will be sure to give credit to that site when I find it again. You will need to create or edit the file /etc/udev/rules.d/010_local.rules and place this information in it:

#create correct dvb devices
KERNEL=="dvb0.dvr*",        NAME="dvb/adapter0/dvr%n"
KERNEL=="dvb0.demux*",      NAME="dvb/adapter0/demux%n"
KERNEL=="dvb0.frontend*",   NAME="dvb/adapter0/frontend%n"
KERNEL=="dvb0.audio*",      NAME="dvb/adapter0/audio%n"
KERNEL=="dvb0.ca*",         NAME="dvb/adapter0/ca%n"
KERNEL=="dvb0.osd*",        NAME="dvb/adapter0/osd%n"
KERNEL=="dvb0.net*",        NAME="dvb/adapter0/net%n"
KERNEL=="dvb0.video*",      NAME="dvb/adapter0/video%n"

Scanning for Channels

Once dvb-apps is installed, you can see if everything is working correctly. First, you need to create the ~/.azap directory, then you need to create your channels.conf file. Since my ATI HDTVWonder uses an antenna to grab channels, I used the us-NTSC-center-frequencies-8VSB database file.

$ mkdir ~/.azap
$ touch ~/.azap/channels.conf
$ scan /usr/local/share/dvb/scan/atsc/us-NTSC-center-frequencies-8VSB > ~/.azap/channels.conf

This will take some time and it will give you a lot of "tuning failed" messages, but if it is successful, you will see something like this when it is done:

dumping lists (12 services)
WJZ-DT:617000000:8VSB:49:52:1
WNUV High Def:629000000:8VSB:49:52:3
WNUV - The Tube:629000000:8VSB:65:68:4
Same as the Tube:629000000:8VSB:81:84:5
FOX45 HDTV:665000000:8VSB:49:52:3
FOX45 Digital Television:665000000:8VSB:65:68:4
WMAR-Radar SD-3:701000000:8VSB:81:84:5
WMAR-SD2:701000000:8VSB:65:68:4
WMAR-HD:701000000:8VSB:49:52:3
WMAR-TV:701000000:8VSB:0:0:65535
WBALDT:743000000:8VSB:49:52:1
WBALSD:743000000:8VSB:65:68:2
Done.

You can edit that file to remove channels as you please. If you want to use MPlayer for output, copy the channels.conf over to ~/.mplayer, and, likewise, ~/.xine for using Xine. You can substitute symlinks if you are more comfortable with that, too. Once the file is in ~/.azap, you can test the channels by running something similar to:

$ azap -r WBALDT
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
tuning to 743000000 Hz
video pid 0x0031, audio pid 0x0034
status 1f | signal 9fb0 | snr 5c32 | ber 00000000 | unc 0000007f | FE_HAS_LOCK
status 1f | signal fbf0 | snr df58 | ber 00000060 | unc 00000000 | FE_HAS_LOCK
status 1f | signal fc20 | snr de9c | ber 00000008 | unc 00000000 | FE_HAS_LOCK
status 1f | signal fb50 | snr db7c | ber 00000018 | unc 00000000 | FE_HAS_LOCK
status 1f | signal fc70 | snr dc66 | ber 00000028 | unc 00000000 | FE_HAS_LOCK

Hit CTRL+C after a few lines to exit out. Those lines above show that everything is working alright. You can also check that everything is o.k. with dmesg:

$ dmesg
...
nxt2004: Waiting for firmware upload (dvb-fe-nxt2004.fw)...
nxt2004: Waiting for firmware upload(2)...
nxt2004: Firmware upload complete
cx88[0]/2: queue is empty - first active
cx88[0]/2: cx8802_start_dma w: 0, h: 0, f: 2
cx88[0]/2: setting the interrupt mask
cx88[0]/2: [f53b9b80/0] cx8802_buf_queue - first active
cx88[0]/2: cx8802_restart_queue
cx88[0]/2: cx8802_restart_queue: queue is empty

Setting up MPlayer

According to the MPlayer website, the configuration script should detect your DVB card and compile DVB support automatically. That did not work for me. The configure script could not find my dvb include directory, so i had to specify it when I ran configure. I edited Rob Workman's SlackBuild script [[1]] to allow for DVB support to be compiled. Here is the configure options I used, the rest of the script was left untouched:

./configure \
  --prefix=/usr \
  --confdir=/etc/mplayer \
  --enable-gui \
  --enable-menu \
  --enable-dvb \
  --with-dvbincdir=/usr/src/linux/include \
  --enable-xmms \
  --with-codecsdir=$CODECSDIR \
  --with-win32libdir=$CODECSDIR 

Notice the "--enable-dvb" and "--with-dvbincdir" options. Once I specified those, everything ran fine. Once MPlayer is compiled correctly and installed, make sure you place a copy of channels.conf in ~/.mplayer. When you are done that, you can run MPlayer by either specifying the device or by specifying the channel:

$ mplayer /dev/dvb/adapter0/dvr0

or

$ mplayer dvb://WMARHD

GMPlayer is a GTK frontend that gets installed with MPlayer and can also be used for DVB, but I have not figured out how to get a DVB option in the menus yet. When I figure it out, I will update this accordingly. Right now, you can launch gmplayer using the same lines above by simply substituting mplayer with gmplayer.

Setting up Xine

According to everything I have read about Xine, it is supposed to compile automatically with DVB support. However, I still can not get it to view my DVB stream. As soon as I figure out how to make it work, I will update this page accordingly.

Resources

http://www.mythtv.org/wiki/index.php/ATI_HDTV_Wonder

http://www.mythtv.org/wiki/index.php/Adding_QAM_Channels_For_HDTV_Tuner_Cards

http://www.mythtv.org/wiki/index.php/Dvb_Apps

http://www.linuxtv.org/

内容概要:本文档详细介绍了一个基于MATLAB实现的电力负荷预测项目,该项目运用遗传算法(GA)优化支持向量回归(SVR)和支持向量机(SVM)模型的超参数及特征选择。项目旨在解决电力系统调度、发电计划、需求侧响应等多个应用场景中的关键问题,特别是在应对高比例可再生能源接入带来的非线性、非平稳负荷预测挑战。文中涵盖了从数据接入、特征工程、模型训练到部署上线的全流程,包括详细的代码示例和GUI设计,确保方案的可复现性和实用性。 适用人群:具备一定编程基础,尤其是熟悉MATLAB语言和机器学习算法的研发人员;从事电力系统调度、电力市场交易、新能源消纳等相关领域的工程师和技术专家。 使用场景及目标:①通过构建面向小时级别的滚动预测,输出高分辨率负荷轨迹,为日内与日前滚动调度提供边际成本最小化的依据;②在负荷高峰和供给紧张时,通过价格信号或直接负荷控制实施需求侧响应,提升削峰效率并抑制反弹;③为灵活性资源(调峰机组、储能、可中断负荷)提供更清晰的出清路径,降低弃风弃光率,提升系统整体清洁度;④帮助市场主体更准确地评估边际出清价格变化,提高报价成功率与收益稳定性,同时降低由预测偏差带来的风险敞口;⑤在运维与审计场景中,对预测产生的原因进行说明,保障业务侧与监管侧的可追溯性。 阅读建议:此资源不仅提供了完整的代码实现和GUI设计,更注重于理解GA优化过程中涉及到的数据处理、特征构造、模型选择及评估等核心步骤。因此,在学习过程中,建议结合实际案例进行实践,并深入研究每个阶段的具体实现细节,特别是适应度函数的设计、超参数空间的定义以及多样性维护机制的应用。此外,关注项目中关于数据对齐、缺失值处理、特征标准化等方面的最佳实践,有助于提高模型的鲁棒性和泛化能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值