MagicPro ProHDTV Dual USB

From LinuxTVWiki
Revision as of 14:05, 29 November 2009 by Ksngltvwiki (talk | contribs)
Jump to navigation Jump to search

(this page is work in progress)

Introduction

Magicpro proHDTV Dual is a hybrid usb TV adapter supporting analog and DMB-TH digital TV broadcast reception for Hong Kong. The demodulator chip for DMB-TH is LGS8GL5.

Driver installation

The Linux driver for this device was achieved by reverse engineering to mimic the packets sent from the PC to the device as can be seen in the usb sniffer log in Windows. The v4l-dvb driver pack can be downloaded at the following link:

http://www.sendspace.com/file/z2t0il

This driver pack is based on a snapshot of v4l-dvb repository at around early Oct 2009. Currently (as of Nov 2009) it has been tested for kernel versions from 2.6.28 to 2.8.31 under Ubuntu 8.04 and 9.10, also Debian Lenny and Squeeze. Note that it also includes support for ASUS u3100 DMB-TH adapter. Note that this driver is experimental and has not yet been included in the mainstream v4l-dvb.

Driver installation

1. Untar the downloaded file under a <v4l-dvb source directory>;

2. Under <v4l-dvb source directory>,
make distclean
make
make install
-- done! --

Following kernel modules are relevant to this device: lgs8gxx, dib7000p, dvb_usb,_cxusb, dib7000p, dibx000_common, dvb_usb, dib0070, dvb-core, tuner_mpdual.

3. Below is sample 'dmesg' output when the adapter is inserted into a usb port:

 
[10.135102] dvb-usb: found a 'Conexant Magicpro HDTV Dual DMB-TH Stick' in warm state.
[10.651330] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[10.651474] DVB: registering new adapter (Conexant Magicpro HDTV Dual DMB-TH Stick)
[10.907720] DVB: registering adapter 0 frontend 0 (Legend Silicon LGS8913/LGS8GXX DMB-TH)...
[11.696562] MP_HDTV_DUAL tuner: Attached at address 0x61
[11.697958] dvb-usb: Conexant Magicpro HDTV Dual DMB-TH Stick successfully initialized and connected.
[11.698000] usbcore: registered new interface driver dvb_usb_cxusb

Supported Software

  • dvbscan, tzap, dvbsnoop, dvbstream, dvbtraffic have been tested to work.
  • dvbtune works but the adapter is turned off after dvbtune exits. If the software that subsequently runs, e.g. dvbsnoop, does not turn on the adapter, then it would fail.
  • Using vlc for tuning, e.g. "vlc dvb:// :dvb-frequency=482000000 --programs=2", results in chopping video, so is regarded not working.
  • kaffeine as on Ubuntu 9.10 is able to successfully scan for all 11 TV channels (provided signal strength is OK).
  • gXine should be working.

Testing

dvbscan

Using an initial_scan.conf file with following content (actually it is district and even building dependend):

 
T 482000000 8MHz AUTO AUTO QAM64 8k 1/32 NONE
T 586000000 8MHz AUTO AUTO QAM64 8k 1/32 NONE
T 602000000 8MHz AUTO AUTO QAM64 8k 1/32 NONE

A scan can be performed by 'scan initial_scan.conf' and a sample output is as follows:


scanning initial_scan.conf
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 482000000 0 9 9 3 1 0 0
initial transponder 586000000 0 9 9 3 1 0 0
initial transponder 602000000 0 9 9 3 1 0 0
>>> tune to:
482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
0x0000 0x0001: pmt_pid 0x032a TVB -- Jade (running)
0x0000 0x0002: pmt_pid 0x0348 TVB -- Pearl (running)
0x0000 0x000b: pmt_pid 0x006e (null) -- Home (running)
0x0000 0x0010: pmt_pid 0x00a0 (null) -- World (running)
>>> tune to:
586000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
0x0000 0x0052: pmt_pid 0x0334 TVB -- J2 (running)
0x0000 0x0053: pmt_pid 0x033e TVB -- iNews (running)
0x0000 0x0055: pmt_pid 0x0352 TVB -- High Definition Jade (running)
Network Name 'SFN_TVB' >>> tune to:
602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE
0x0000 0x000c: pmt_pid 0x0078 aTV -- HD aTV (running)
0x0000 0x000d: pmt_pid 0x0082 (null) -- TVS (running)
0x0000 0x000e: pmt_pid 0x008c (null) -- CTI - Asia (running)
0x0000 0x000f: pmt_pid 0x0096 (null) -- CCTV 4 (running)
Network Name 'aTV-SFN'
dumping lists (11 services)
Jade:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:811:0:1
Pearl:482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:841:0:2
Home :482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:111:0:11
World :482000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_AUTO:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:161:0:16
J2:586000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:821:0:82
iNews:586000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:831:0:83
High Definition Jade:586000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_2_3:QAM_16:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:851:0:85
HD aTV:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:121:0:12
TVS:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:131:0:13
CTI - Asia:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:141:0:14
CCTV 4:602000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_1_2:FEC_1_2:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_8:HIERARCHY_NONE:151:0:15
Done.

live TV watching and recording example

  • On one terminal, run


tzap -c /etc/dvb/channels.conf "home"


It should produce output similar to:

 $ tzap -c /etc/dvb/channels.conf "home"
 
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
reading channels from file '/etc/dvb/channels.conf'
tuning to 482000000 Hz
video pid 0x006f, audio pid 0x0000
status 1f | signal 0000 | snr 0000 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 0000 | snr b800 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 0000 | snr b600 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
status 1f | signal 0000 | snr b700 | ber 00000000 | unc 00000000 | FE_HAS_LOCK
. . . keep on repeating . . .

Keep it running and do not terminate it.

  • On another terminal, run one of followings for TV watching:
 
dvbsnoop -s ts -tsraw -b | mplayer -vo x11 -
or
dvbsnoop -s ts -tsraw -b | xine -
or
dvbsnoop -s ts -tsraw -b | vlc fd://0
  • Or on another terminal, run following for recording:
 dvbsnoop -s ts -tsraw -b | vlc fd://0 --programs=11 -I dummy --sout file/ts:test.ts


where test.ts is the output file for recording.

Streaming and Recording scripts for HK Digital TV

Other than using the media like applications such as MythTV, gXine, Kaffeine, etc to watch TV, inspect EPG and perform recordings, an option is to use the set of perl scripts for streaming and recording which can be downloaded from:

http://www.sendspace.com/file/h24uo7

Installation is in the readme.txt file. Currently the installation procedure is a bit complicated and involves manual work. Hopefully a setup script will be written in the future to ease installation. Please regard the set of scripts as experimental.

The scope of usage is as shown on the following diagram:

Digital tv scripts.png

Main functions and features of the scripts are as follows:

* One or more DMB-TH adapters are connected to the 'streaming and recording PC'. More than one adapters allows watching/recording of TV programs from more than one carrier frequency.
* If there's more than one DMB-TH adapters, allocation of adapter when there's a TV watching or recording request is done automatically by the scripts and is transparent to the users.
* There're background scripts running on the streaming and recording PC, and are started on machine startup. There's one perl-tk script on each client PC for watching live TV via streaming. Watching of live TV is by a GUI interface started by clicking an icon on the desktop.
* Playing of live TV is by an external media player software capable of streaming as input, kicked off by the script. For Linux, available media player software include vlc, xine, mplayer etc. Whis media player software to use is configurable, and it can be configured such that different TV channels are played by different media player software. This is useful as no single media player is suited to all TV channels.
* While the streaming and recording PC is running Linux, a client PC can be a Linux or Windows PC.
* Multiple TV channels can be played and recorded simultaneously. For example the client PCs can be watching different TV channels, while the streaming and recording PC is recording more than one TV channels, all happening at the same time. Of course this is subject to the limitation that the number of different carriers frequencies for the TV channels being watched/recorded cannot exceed the number of DMB-TH adapters connected to the streaming and recording PC. Hence if there're 3 adapters connected, all 11 TV channels can be watched and recorded at the same time, provided that the streaming and recording PC is capable enough. In a test, 2 adapters are connected and 7 TV channels are recorded, plus 1 TV channel being streamed at the same time, and the CPU usage is 20 ~ 25% for a streaming and recording PC with an AMD X2 4800+ CPU and 2GB main memory.


Related Topics

  • Below is a useful forum thread on setting up vdpau for h264 acceleration on Nvidia display card, and gXine for DVB related functions:


http://www.hkepc.com/forum/viewthread.php?tid=1375459&extra=page%3D1