PDA

View Full Version : Record and playback via IEEE 1394 (a.k.a. Firewire) with linux!


Denbo_33
10-09-06, 06:44 PM
UPDATE 02/13/07
Updated software With attached file "avc_hdtv_record_source.zip"
changes include. No need to find your source device node or channel number, using plugreport. Edited dvcont to send "record" and "stop" commands to avc_hdtv_record, it is now possible to schedule a recording using a script to run dvcont. avc_hdtv_record saves the recorded stream to file named with the date you started the recording. as in Feb_12_2007_09_30_16.

Record and playback via IEEE 1394 (a.k.a. Firewire) with linux .
My system a SAMSUNG DLP HLRxx68w and a 5 year old PC.
This should work under any HDTV or settop cable box with an 1394 interface.

Runs under linux Kernel 2.6.16-1.2133,. Setup was is a snap, if I can do it you can too. just follow the Step by step section below.

Runs under command line terminal.
You will need to know a little about linux commands, but it is not rocket science.

I have been able to record and playback local HD broadcasts with an antenna as the source will excellent sound and picture. Record and playback is hit and miss via cablecard, sound and picture are out of sync. I think I know what the problem is but haven't nailed the root cause, yet. Although I can playback with VLC with no sync problems.


I use the Redhat Linux distribution FC5, will kernel version stated above. FC5 can be found at fedora.redhat.com/docs/fedora-install-guide-en/fc5/ The Libraries can be downloaded and installed via yum (as in "yum install libiec61883"), source files can be found at linux1394.org and or Google it.

You can Record and playback (playback with VLC) 5C protected Digital content, at least up to copy once level, I haven't seen a copy never level of 5C yet.
Also have not tried recording a SD source. But who would want too?

I can't take any credit for getting this to work all I did was edit (cough hack) the avc_vcr.c source found it libavc1394 and hacked through the example source files found in libraw1394, libavc1394, and libiec6183 . Thanks goes to Dan Dennedy and linux1394 crew. Thanks Dan!

Minimum PC hardware:

Pentium II 650 MHz
394 Mb ram
IDE ATA-33
ATA-33 Hard Drive greater that 20G
PCI IEEE1394 card
note: I have a Penguin Gear PG-FW-310 Nec chip and 3 External ports.
Specs found at www.byteccusa.com/product/PCI/PG-FW-310.htm
Cost $15.00 that with a 1394 cable.
see linux1394.org for other Compatible 1394 cards.

Minimum OS:
Redhat FC5 (http://fedora.redhat.com)
Kernel = 2.6.16-1.2133_FC5 (updated via software updater.)
a root password
and user account


Libraries Requirements :
Use yum to install as in "yum install libraw1394-devel"

libraw1394 ver 1.2.1
libraw1394-devel ver 1.2.1
libiec61883 ver 1.0.0.0
libiec61883-utils
libavc1394 ver 0.5.3
libavc1394-devel


Source code Requirements :
found at linux1394.org and or sourceforge.net
tar files

libiec61883-1.0.0

libavc1394-0.5.3



Hacked Source code:
avc_vcr_hdtv.c
mpg1394grab.c
test-mpeg2.c


Setup Install:

1.Install FC5

update kernel to 2.6.16-1.2133
via package updater




2. Download Source code Requirements files and configure and build but do not install.

Make a directory under your user account call it ieee_project.
“mkdir /home/(your user accont)/ieee_project”
Copy all Source code Requirements files to this directory.
Extract using desktop folder thingy.

Open a terminal window

login as root on terminal window
“su”
then password



3 Change directory to /home/(user account)/ieee_project/ libiec61883-1.0.0
"cd /home/(user account)/ieee_project/ libiec61883-1.0.0"
configure make files
"./configure"
build code
"make"

4. Change directory to cd /home/(user account)/ieee_project/ libiec61883-1.0.0/examples
"cd /home/(user account)/ieee_project/ libiec61883-1.0.0/examples"

Copy mpg1394grab.c into this directory.

“cp mpg1393grab.c /home/(user account)/ieee_project/ libiec61883-1.0.0/examples/”

Build mpg1394grab.c

“gcc -lraw1394 /usr/lib/libiec61883.so.0 -o mpg1394grab mpg1394grab.c -D_FILE_OFFSET_BITS=64”

Copy test-mpeg2.c into this directory.

“cp test-mpeg2.c /home/(user account)/ieee_project/ libiec61883-1.0.0/examples/”

answer yes to overwrite

To build test-mpeg2.c remove test-mpeg2.o

"rm /home/(user account)/ieee_project/ libiec61883-1.0.0/examples/ test-mpeg2.o”

then
"make"





5 Change directory to /home/(user account)/ieee_project/ libavc13940-0.5.3
"cd /home/(user account)/ieee_project/ libavc13940-0.5.3"

"./configure"

"make"

Change directory to /home/(user account)/ieee_project/ libavc13940-0.5.3
"cd /home/(user account)/ieee_project/ libavc13940-0.5.3/test"


Copy avc_vcr_hdtv.c into this directory.
"cp avc_vcr_hdtv.c /home/(user account)/ieee_project/ libavc13940-0.5.3/test/"

Copy build_avc_vcr_hdtv.sh into this directory.
"cp build_avc_vcr_hdtv.sh /home/(user account)/ieee_project/ libavc13940-0.5.3/test/"

Build avc_vcr_hdtv.c


Run the scrpt file

"sh build_avc_vcr_hdtv.sh"



output = "creating avc_vcr_hdtv"


Configure 1394 card:
1 Run setrom
"./setrom"
This utility configures the csr rom of the 1394 card so it appears as an avc device.


2. Run avc_vcr_hdtv

"./avc_vcr_hdtv"

output = “Starting AV/C target; press Ctrl+C to quit...”

3 Connect ieee1394 cable between ieee1394 card’s first port and the HDTV.

4. Open a terminal window
Change to the directory of source code libavc1394-0.5.3/test

“cd /home/(user account)/ieee_project/ libavc13940-0.5.3/test "



5. Run romtest
"./romtest"

output similar to

Librom1394 Test Report
=================================================

Node 0:
-------------------------------------------------
bus info block length = 4
bus id = 0x31333934
bus options:
isochronous resource manager capable: 1
cycle master capable : 1
isochronous capable : 1
bus manager capable : 0
cycle master clock accuracy : 100 ppm
maximum asynchronous record size : 2048 bytes
GUID: 0x00004c0100003f1f
directory:
node capabilities : 0x000083c0
vendor id : 0x0000004c
unit spec id : 0x0000a02d
unit software version: 0x00010001
model id : 0x00ae1f08
textual leaves : Kino Rocks!

Node 1:
-------------------------------------------------
bus info block length = 4
bus id = 0x31333934
bus options:
isochronous resource manager capable: 1
cycle master capable : 1
isochronous capable : 1
bus manager capable : 1
cycle master clock accuracy : 100 ppm
maximum asynchronous record size : 2048 bytes
GUID: 0x0000f01000013ad4
directory:
node capabilities : 0x000083c0
vendor id : 0x000000f0
unit spec id : 0x00000989
unit software version: 0x00000100
model id : 0x00010001
textual leaves : SAMSUNG HL-R5067W VL_LIN_Apr282005 16:19:58



Note the node number of the HDTV, node 1 in this example
The node number may change every time you the reset (power down, and or disconnect the cable) on a 1394 device.

6. Run plugreport
“plugreport”


output similar to

Host Adapter 0
==============

Node 0 GUID 0x00004c0100003f1f
------------------------------
oMPR n_plugs=1, data_rate=0, bcast_channel=0
oPCR[0] online=1, bcast_connection=0, n_p2p_connections=0
channel=1, data_rate=2, overhead_id=15, payload=146
iMPR n_plugs=1, data_rate=0
iPCR[0] online=1, bcast_connection=0, n_p2p_connections=0
channel=0

Node 1 GUID 0x0000f01000013ad4
------------------------------
oMPR n_plugs=1, data_rate=2, bcast_channel=0
oPCR[0] online=1, bcast_connection=0, n_p2p_connections=0
channel=0, data_rate=0, overhead_id=0, payload=146
iMPR n_plugs=1, data_rate=2
iPCR[0] online=1, bcast_connection=0, n_p2p_connections=0
channel=1


Note the channel number of the HDTV node 1 iPCR[0] plug, channel=1 in this example.



Recording:

1. Tune to a local HD channel with an antenna as the source.

2. Run avc_vcr_hdtv in a terminal window if not already

3. Open a terminal window

4.. cd to libiec61883-1.0.0/examples/

“cd /home/(user account)/ieee_project/ libiec61883-1.0.0/examples/”

3. run mpg1394grab

“./mpg1394grab –n (node of HDTV) > (a file name)”


Record for at least five minutes.
Quit mpg1394grab

Ctrl + c



4. List files and check length
“ls –l”
the file length should be greater than zero

To Playback:

1. setup HDTV to select the PC ieee1394 device (Kino Rocks) for playback.
2. Run avc_vcr_hdtv in a terminal window if not already.

3.Run test-mpeg2
“./test-mpeg2 -t (node of HDTV) –c (Channel number (iPCR[0]) of the destination device) (file name)”


Notes:



If file length is zero:
1. Try another port on pc 1394 card

2. Run “plugreport” while recording note the n_p2p_connections
On source ( oPCR[0] ) and destinsion (iPCR[0] ) plugs should = 1.

3.If file length is greater than zero but file cannot be played back via VLC or HDTV. Get a hex editor or viewer installed and have a look at the file. The first offset should equal 0x47XXXXXX (X is don’t care) if it is not then the source device is encrypting the stream, you then may want to remove power on all devices, and try again. Else?

You can try to record with test-mpeg2
“./test-mpeg2 –r (node of source) > (file name)”

I have found this is not as reliable as mpg1394grab. Check it out as it might work on your system.

You should have only two devices on the 1394, as the code may cough if it sees more than two devices.


Enjoy!


10/20/06 EDIT

1. Corrected wrong file name avc_hdtv to avc_vcr_hdtv
2. Added a script file to build avc_vcr_hdtv.c build_avc_vcr_hdtv.sh
3. Corrected typos

11/02/06
1. Corrected typos in file bulid_avc_vcr_hdtv.sh
2. Corrected build of test-mpeg2.c

02/12/07

1. Added avc_hdtv_record_source.zip to file list.
2. avc_hdtv_record finds the node and channel of the source device no need to run plugreport. Also saves the ts stream file named with the date you started to record. How to included in zip. edited dvcont to send "record" and "stop" commands to avc_hdtv_record. It is now possible to schedule a recording using a script to run dvcont.

timecop
10-09-06, 07:53 PM
That's pretty cool, but I stopped reading after
"You can Record and playback (playback with VLC) 5C protected Digital content, at least up to copy once level, I haven't seen a copy never level of 5C yet."

HDTVFanAtic
10-09-06, 09:01 PM
Huh? Linux is not going to decrypt 5c copy once content. What is that guy smoking?

Denbo_33
10-10-06, 09:54 PM
The 1394 stream from the source (Samsung HDTV) is NOT Encrypted, so Decryption is not needed. At first I thought this might be a Samsung software bug. But the more I think about it most likely it is not. Avc uses a protocol call Function Control (FCP), FCP issues commands ,responses, and status between the 1394 devices. the unit and subunit INFO command which has a number of responses, Video monitor, disc recorder/playe,tape recorder/player, Tuner, Video camera , all of these devices or units (but the monitor and tuner) have the ability to record. Avc_vcr.c ( Libavc1394 source example, which I hacked and renamed to avc_hdtv.c) responded as a tape recorder/player, which worked fine for 5C copy free content, but transmitted garbage (encrypted) streams with 5C copy once content. I then change the response to this info command to Video monitor, unit and subunit types and bingo 5C copy once content was not encrypted. Sweet! Video monitors are pretty much dumb devices on any interface.

ddennedy
10-11-06, 01:07 AM
you're welcome!

HDTVFanAtic
10-11-06, 07:51 PM
The 1394 stream from the source (Samsung HDTV) is NOT Encrypted, so Decryption is not needed. At first I thought this might be a Samsung software bug. But the more I think about it most likely it is not. Avc uses a protocol call Function Control (FCP), FCP issues commands ,responses, and status between the 1394 devices. the unit and subunit INFO command which has a number of responses, Video monitor, disc recorder/playe,tape recorder/player, Tuner, Video camera , all of these devices or units (but the monitor and tuner) have the ability to record. Avc_vcr.c ( Libavc1394 source example, which I hacked and renamed to avc_hdtv.c) responded as a tape recorder/player, which worked fine for 5C copy free content, but transmitted garbage (encrypted) streams with 5C copy once content. I then change the response to this info command to Video monitor, unit and subunit types and bingo 5C copy once content was not encrypted. Sweet! Video monitors are pretty much dumb devices on any interface.

For the second time, if its not encrypted, its not copy once - its copy freely and about any o/s can capture it.

If its copy once, IT IS 5C ENCRYPTED, and linux, mac or windows isn't going to decode it.

timecop
10-11-06, 08:12 PM
I have been able to record and playback local HD broadcasts with an antenna as the source will excellent sound and picture. Record and playback is hit and miss via cablecard, sound and picture are out of sync.

In the remote chance that Samsung firmware IS wrong and does not enforce 5C when connected to AV/C Monitor, it would result in quick revocation of their DTLA license. But from your comment above, I'm just going to go with "yay, he can record OTA HD using a $3000 TV when I could do the same thing with a USB ATSC tuner box that cost $80 using Windows XP Professional".

HDTVFanAtic
10-11-06, 10:32 PM
If the Samsung had a bug and ignored 5c codes, it would ignore all 5c codes - not copy once and obey copy never.

DaveFi
10-12-06, 12:49 PM
How stable is the recording? PC Firewire to DVHS over XP is notoriously glitchy.

Hmm, nevermind. I see this isn't PC to DVHS at all.:(

HDTVFanAtic
10-12-06, 03:59 PM
considering stb to mac is very stable, one would think linux COULD be very stable depending on the drives. We all know the XP IEEE1394 drivers are not very good.

Denbo_33
10-16-06, 07:31 PM
How stable is the recording? PC Firewire to DVHS over XP is notoriously glitchy.

Hmm, nevermind. I see this isn't PC to DVHS at all.:(
Should work with any Audio/Video Control (av/c) device. Settop box, DVHS, Monitor, Tuner, At least for 5C copy free content.
I connected the Linux machine to a XP machine, Xp found the Linux machine as a Tape recorder, and I was able to capture with CapDVHS.exe 0..3.6, CapDVHS crashed after about 2 minutes, I hear that happens quite often with CapDVHS. Had a look at the received file and looked ok( sync byte and time stamp ).
While testing and debugging I referred to the JVC 1394 Interface Implementation Guideline for D-VHS Version 1.00.
What is your DVHS make and model number? I'll try to help.

thurstonw
10-21-06, 04:52 PM
Should work with any Audio/Video Control (av/c) device. Settop box, DVHS, Monitor, Tuner.


I've been able to compile and run your avc_hdtv tool. (yeah, I caught the _den name issue). I've been using the mac FWSDK20 tools to control it. I noticed the type returned is type 0 (monitor). Whereas Virtual DVHS returns type 4 (VCR). How to I change setrom to set the type to 4? My LG3410A doesn't seem to recognize avc_hdtv as a DVHS deck. I believe it is because the type is wrong.

TW

Denbo_33
10-21-06, 05:43 PM
I've been able to compile and run your avc_hdtv tool. (yeah, I caught the _den name issue). I've been using the mac FWSDK20 tools to control it. I noticed the type returned is type 0 (monitor). Whereas Virtual DVHS returns type 4 (VCR). How to I change setrom to set the type to 4? My LG3410A doesn't seem to recognize avc_hdtv as a DVHS deck. I believe it is because the type is wrong.

TW
Change two lines in avc_vcr_hdtv.c AVC1394_SUBUNIT_VIDEO_MONITOR << 3 ; to AVC1394_SUBUNIT_TAPE_RECORDER << 3 ;

curtvm
10-22-06, 03:55 PM
..My system a SAMSUNG DLP HLRxx68w and a 5 year old PC.

..Also have not tried recording a SD source. But who would want too?

I have an HLR5678w, I've been trying various things for firewire playback- virtual d-vhs,firebus dtv- now I have one more thing to try.

You probably know this already, but the hlr will not put out the sd channels via firewire (I think Toshiba and Mitsubishi tv's do- they must have an encoder built-in).

Couple questions, if I may-

1. Have you been able to get the tv guide interface on the hlr to schedule a recording of a digital channel?

2. Is there any way to get linux to act like a avhdd? I'm mainly interested in playback of r5000 recordings, and with an avhdd type setup, I can use the tv interface to select recordings to watch, instead of having to first 'load' the recording in a d-vhs type setup.

Thanks!

curtvm
10-24-06, 11:19 AM
and question #3-

Any other distribution besides fc5 work as described? The key I assume is a recent kernel and development tools. (looking for a smaller download- something like a minimal slackware install- only what's needed.)

Probably the smart thing to do would be to just get rid of my firewire cables- or put epoxy in all my firewire ports- so I just forget about it and move on to other equally unimportant things. (Maybe I could develop a special firewire connector with 2-part epoxy inside- plug in, squeeze, wait, all firewire problems go away. "Five-minute-Firewire-Fix" (tm) in 6-pin and 4-pin versions)

Denbo_33
10-26-06, 08:39 PM
I have an HLR5678w, I've been trying various things for firewire playback- virtual d-vhs,firebus dtv- now I have one more thing to try.

You probably know this already, but the hlr will not put out the sd channels via firewire (I think Toshiba and Mitsubishi tv's do- they must have an encoder built-in).

Couple questions, if I may-

1. Have you been able to get the tv guide interface on the hlr to schedule a recording of a digital channel?

2. Is there any way to get linux to act like a avhdd? I'm mainly interested in playback of r5000 recordings, and with an avhdd type setup, I can use the tv interface to select recordings to watch, instead of having to first 'load' the recording in a d-vhs type setup.

Thanks!
1. No TV guide did not recognize the 1394 vcr device, I am still having problems with an analog vcr.
There is an example code in libavc1394, panelctl, which controls a Motorola DCT 6200/6400 series settop box. as in navigating through the menu, I have too have a look at the code this weekend.
2. I am sure there is a way, but I don't have the spec for avhdd :-(
3. You are correct sir.

timecop
10-27-06, 09:55 PM
I have all 1394-related specs, contact me if you need them, however I have doubts of you ever coming up with anything that hasnt been done already.

curtvm
11-02-06, 06:35 AM
Well, I tried it even though I don't know what I'm doing. Got Ubuntu 6.10. Installed to hard drive. Installed g++. Got libraw/libiec61883/libavc. Compiled these 3 (don't know if there is easier way for ubuntu). Then followed above instructions. File download- bulid_avc_vcr_hdtv.sh - rename to build_avc_vcr_hdtv.sh (build mispelled). Also "Build test-mpeg2.c" "make" did nothing, so I used same instruction/command as "Build mpg1394grab.c" "gcc ....."

I can capture/playback ok from/to tv. But am unable to play any of my previous ts captures. I get "couldn't find a PCR within 20000 packets; giving up". Tried playing these streams with vlc on same ubuntu pc, but would not play with vlc either. (stream captured from tv wouldn't play with vlc either, so maybe vlc is screwed up in my ubuntu).

If I could get a simple way to play ts streams through firewire, that would be nice (don't care about recording). A stripped down linux with just enough to make it work would be ideal- maybe run in a virtual machine on my xp laptop using vmware or something (would that work?)- then I could use my laptop to record from R5000, and also playback to tv using same laptop.

timecop
11-02-06, 08:45 AM
im guessing if you got streams that are crap after recording those channels are 5C'd.

curtvm
11-02-06, 10:33 AM
im guessing if you got streams that are crap after recording those channels are 5C'd.

Well, these streams are recorded from the R5000 (5C not involved), they play fine on my laptop with WinXP, they just don't want to go out through firewire with the ubuntu setup. They also stream out ok via an imac mini using Virtual-dvhs. So its just a matter of a broken firewire setup on the ubuntu (did I mention I don't know what I'm doing in linux, sort of). The stream I recorded from tv (also no 5C) with ubuntu streamed back out to tv ok, but vlc didn't like it either.

Denbo_33
11-02-06, 12:45 PM
Well, I tried it even though I don't know what I'm doing. Got Ubuntu 6.10. Installed to hard drive. Installed g++. Got libraw/libiec61883/libavc. Compiled these 3 (don't know if there is easier way for ubuntu). Then followed above instructions. File download- bulid_avc_vcr_hdtv.sh - rename to build_avc_vcr_hdtv.sh (build mispelled). Also "Build test-mpeg2.c" "make" did nothing, so I used same instruction/command as "Build mpg1394grab.c" "gcc ....."

I can capture/playback ok from/to tv. But am unable to play any of my previous ts captures. I get "couldn't find a PCR within 20000 packets; giving up". Tried playing these streams with vlc on same ubuntu pc, but would not play with vlc either. (stream captured from tv wouldn't play with vlc either, so maybe vlc is screwed up in my ubuntu).

If I could get a simple way to play ts streams through firewire, that would be nice (don't care about recording). A stripped down linux with just enough to make it work would be ideal- maybe run in a virtual machine on my xp laptop using vmware or something (would that work?)- then I could use my laptop to record from R5000, and also playback to tv using same laptop.
Damn I wish I could find my eye glasses! I'll correct the typos later.

test-mpeg2 complains with "couldn't find a PCR within 20000 packets; giving up" when a Program Clock Reference (PCR) packet , not to be confused with Plug Control Register, is not found within the ts stream file , a PCR packet is used to sync the receiver to the transmitter clock.

Not that it should matter, which RD5000 interface are you using to capture USB or 1394? .

I have downloaded the HD transport stream sample files from RD5000 website (http://www.nextcomwireless.com/r5000/samples.htm) and had no problems with playback to the Samsung HLR.

Use TSReader Lite, there is a link to this free tool on nextcomwireless.com website), to determine what or if there is a PCR packet within your previous ts captures. It will be listed under the "PAT PID" and should have the same value as the video PID.

If there is a PCR packet then you could try reducing PCR_SMOOTH_INTERVAL or increase MAX_PCR_LOOKAHEAD, let me know via pm and I'll help you out.

If there is not a PCR packet then RD5000 might be stripping it out?

Playback via VLC on linux had a lot of jitter but I had no problems with VLC playback on windoz XP.

To build test-mpeg2.c remove test-mpeg2.o as in

"rm /home/(user account)/ieee_project/ libiec61883-1.0.0/examples/ test-mpeg2.o”

then
"make"

curtvm
11-03-06, 02:28 AM
Tried again. Now it won't even playback my captures from the tv- same PCR problem as with my other ts streams. (Unable to find PCR_SMOOTH_INTERVAL or MAX_PCR_LOOKAHEAD- I suspect changing these won't help anyway)

My previous streams have PCR packet, and play fine through anything that will handle ts streams- vlc on winxp,wmp w/purevideo decoder,imac virtual d-vhs via firewire,etc- so its not a problem with my files, but with my linux setup.

I probably just need to get FC5 and then follow your instructions. I suspect my Ubuntu setup is different somewhere -causing problems.

Even if I could get this to work, its not convenient enough (for me) yet- need to get node numbers first, a couple terminal windows open, etc. (I'm sure this could be automated by someone smart, but I don't think I could do it).

I need to get out of the deep end of the pool, stay in the shallow water where its safe.


by the way- I just got a HDHomeRun unit (dual hdtv tuner- stream over ip/udp). This is what tv manufacturers should be doing instead of firewire (since hardly anybody puts firewire on tv anymore) - put a network jack on tv to receive streams over udp. Plenty of hardware engineers/programmers can handle ethernet (I'm guessing only a few dozen in the world that can do firewire stuff properly). HDTV's already have mpeg decoders built in- just need an incoming stream from somewhere- internal tuner/dvd player/computer/remote tuner/etc.

Just a thought.

timecop
11-03-06, 03:19 AM
Name one TV with built in MPEG2 decoder and no firewire.
Oh, right.

curtvm
11-03-06, 04:51 AM
Name one TV with built in MPEG2 decoder and no firewire.
Oh, right.

How about every tv with a atsc tuner built-in?

Maybe I'm incorrect (it happens alot), but every HDTV with built-in hd tuner must have one. How does the mpeg2 hd streams from the tuner get to the screen?

atsc (8vsb or qam) tuner -> ts -> demux? -> mpeg2 stream -> mpeg2 decoder -> super-duper video/audio chips -> screen/speakers ??

So if they would put a "ethernet board" in the tv, which just decodes udp packets and makes a ts stream, and inserts the stream where the tuner "outputs", it should be the same digital "signal".

Denbo_33
11-05-06, 10:03 AM
>>playback my captures from the tv-
You will need to capture at least 100MB file.
>> My previous streams have PCR packet
Would you sent me a captured stream so I can try to play back on my Samsung?


>>Even if I could get this to work,

I agree, I have often recorded a zero length file by entering the wrong node number. But if we can prove that this works on enough systems (set tops, D-vhs, HDTV, etc) it would then generate interest from the Linux folks to help with the code development.

>> need to get out of the deep end of the pool

I don't think you are giving yourself enough credit, you got this working!! Well almost.

curtvm
11-07-06, 07:39 AM
Would you sent me a captured stream so I can try to play back on my Samsung?
I'm not sure how to get a large file to you.

..if we can prove that this works on enough systems (set tops, D-vhs, HDTV, etc) it would then generate interest from the Linux folks to help with the code development.
I think its just you and me. I just ordered a Zensonic Z500. Now its just you :)

Looking at the new tv's, it looks like Samsung is the only one making sets with firewire that I can tell. Although if you get one, what exactly are you supposed to buy to take advantage of these ports? A new d-vhs? An AVHDD? Who makes or sells these (new)? Samsung doesn't. I doesn't look like firewire will be seen on tv's anymore.

I have a schematic for my hlr5678w, and it looks like it would be easier to hack together something to just send out a ts stream through the parallel port of the pc, tapping into one of the ts stream locations on the tv digital board. I'm only half kidding. A ts stream out of (each) tuner-1 data byte, 3 control bits. Actually, I don't think a parallel port would be fast enough, but usb 2.0 would work. Ethernet would work.

A neat thing I did when I had the imac sending ts streams through firewire- put in a dvd movie, play with vlc, stream to a file using mpeg-ts encapsulation, open same file using virtual-dvhs, play to tv. I thought that was pretty cool- streaming a dvd over firewire in real-time. If I knew how to use 'mkpipe' or mkfifo', then I could have just piped from vlc to virtual d-vhs without a real file.

timecop
11-07-06, 11:13 AM
and it looks like it would be easier to hack together something to just send out a ts stream through the parallel port of the pc, tapping into one of the ts stream locations on the tv digital board.

You're going to be about 28mbit short on parallel port bandwidth there buddy.
Also enjoy it when the feds will tap on your door with a DMCA warrant

curtvm
11-07-06, 01:01 PM
You're going to be about 28mbit short on parallel port bandwidth there buddy.
Also enjoy it when the feds will tap on your door with a DMCA warrant
Yes, parallel was just a tongue-in-cheek expression to show how easy it would be compared to figuring out firewire programming. I should have said serial port to make it more obvious. I don't know exactly how fast a parallel port can move data, but 19.2 megabits-per-second is alot of bits moving in a hurry. 19.2/8= 2.4 megabytes-per-second?

I know zero about dmca, except I know what the letters stand for. I'm not worried about anybody coming after me for fiddling with my own tv. I'd probably get electrocuted before I could make my project work anyway (or die of old age). Also, I'm not trying to bypass anything, I would just be moving bits from my pc to my tv- one way - and bits that are 'legal' bits. Just another input using the ts decoding power of the tv. No different than making an 'atsc modulator' and plugging it into the antenna jack (another idea - a channel 3.1 modulator so we can hook up our HD pong video game :) ).

If my Z500 works good, I can forget all about shoving transport streams up and down tiny wires anyway. (ok, they would still be moving over wires, but no complex thought on my part will be needed.)

v1rtu0s1ty
11-08-06, 03:42 PM
Do you think guys this will work with the connections I'm planning to implement? Below is the connection I've tried before with MythTV but didn't capture anything. I didn't modify any .c codes before though.

HDTV<----rgbhvcable<----FC3LINUX<----IEEE1394cable<----DCT6200

v1rtu0s1ty
11-09-06, 12:45 AM
I tried this guys and I can only record and watch local high def channels such as NBC-5, CBS, FOX, WGN, etc.

I tried recording a 5c content channel, and YES, file size wasn't zero but mplayer DID NOT understand the file, neither VLC can play it too.

timecop
11-09-06, 01:37 AM
This surprises you somehow?

curtvm
11-09-06, 04:43 AM
I tried this guys and I can only record and watch local high def channels such as NBC-5, CBS, FOX, WGN, etc.

I tried recording a 5c content channel, and YES, file size wasn't zero but mplayer DID NOT understand the file, neither VLC can play it too.

5 Companies (Hitachi, Intel, Matsushita, Sony, and Toshiba) developed 1394 copy protection scheme- therefore its called 5C. (trivia information)

I am not an expert, and could be wrong, but-

Basically it comes down to this- there is no way on firewire that you will be able to record content that is "5c'd" (at least not on a non-5c compliant device such as your pc). It's encrypted- and unless you get a super-secret decoder ring from the Digital Transmission Licensing Administrator (DTLA) authority (the 5C group)- your are just recording garbage bits.

For now, the 'local' channels are not using 5c (at least over-the-air ones for sure, cable companies seem to do whatever they want). If the fcc decides that locals can 5c, then I'm guessing recording over firewire will be history for the pc. Your only option will be a tuner card- which are currently not required to be 5c compliant.

Hang on to your vcr. In the new digital age of tv, it may end up being the only way to record digital tv :) (that was a joke)

v1rtu0s1ty
11-09-06, 10:38 AM
I was aware about 5C. I just tested because the thread was interesting. :)

curtvm
11-09-06, 01:04 PM
I was aware about 5C. I just tested because the thread was interesting. :)
Then you were hoping a secret wormhole was discovered that would bypass the 5c stuff :)

Anyway, you got further than I did.

Dunnp
01-14-07, 03:01 PM
I am trying this setup but I get this message when running setrom:
couldn't get handle: No such device or address
This probably means that you don't have raw1394 support in the kernel or that you haven't loaded the raw1394 module.

Any idea what is causing this?
I run rpm -qa '*1394*' and it looks like the modules are there:
libraw1394-devel-1.2.1-1.fc5
libavc1394-devel-0.5.1-2.2
libavc1394-0.5.1-2.2
libraw1394-1.2.1-1.fc5

Any ideas where I am going wrong?

Denbo_33
01-15-07, 06:49 PM
I am trying this setup but I get this message when running setrom:
couldn't get handle: No such device or address
This probably means that you don't have raw1394 support in the kernel or that you haven't loaded the raw1394 module.

Any idea what is causing this?
I run rpm -qa '*1394*' and it looks like the modules are there:
libraw1394-devel-1.2.1-1.fc5
libavc1394-devel-0.5.1-2.2
libavc1394-0.5.1-2.2
libraw1394-1.2.1-1.fc5

Any ideas where I am going wrong?
Have a look at this.
http://www.linux1394.org/start_install.php

timecop
01-16-07, 07:20 PM
Last I checked lunix was on kernel 2.6.something, that document talks about 2.2, talk about relevant documentation lol

Denbo_33
02-12-07, 12:56 PM
I had some time over the holidays to make additions to avc_hdtv
The files are attached to the first post. avc_hdtv_record changes include. No need to find your source device node or channel, using plugreport. Edited dvcont to send "record" and "stop" commands to avc_hdtv_record, it is now possible to schedule a recording using a script to run dvcont. avc_hdtv_record saves the recorded stream to file named with the date you started to record.
as in Feb_12_2007_09_30_16.

jvandrew
02-12-07, 02:39 PM
So what's the deal with this? Denbo_33 says this will record 5c Copy Once. Is he correct? He says he got it to work. while v1rtu0s1ty says it doesn't work. Is there an official word on this? Does it only work with Samsung TVs? I do not have a Sumasung TV, just a Motorola 6200 STB.

timecop
02-12-07, 04:49 PM
The official word is it doesn't work, so you can save yourself the trouble of installing lunix.

FoeHammer865
02-12-07, 06:27 PM
The official word is it doesn't work, so you can save yourself the trouble of installing lunix.


First, Timecop sounds like a hater and isn't really contributing to solving the issue here. He seemed skeptical and has been mildly antagonistic in many of his posts. Obviously, Timecop, you don't seem to really care about this, so why are you posting here? :confused:

Second, where is this "official word"? :confused: That's what is being asked for here. Please post the "official word", no matter what authority it comes from. We'll judge for ourselves on the validity of the source.

Thanks

TREVOR

P.S. Once the signal is output from a video card, it will work on whatever Display hardware is being used, assuming the output format (ie. 720p,1080i) is supported by that display. Brand does not matter.

timecop
02-12-07, 07:22 PM
Hello, PC is not a 5C compliant device, regardless of what OS it runs, unless its Windows Vista with some non-existent protected 1394 card and DRM'd up driver/recording software. You are not recording copy-once content to PC unless you have a non-compliant source, which is highly unlikely.

jvandrew
02-13-07, 12:46 AM
Thanks, timecop, that's what I figured. I was wondering if there was just some glitch that was discovered. I spoke to Denbo_33 and he confirmed what you said.

HDTVFanAtic
02-13-07, 03:40 AM
Thanks, timecop, that's what I figured. I was wondering if there was just some glitch that was discovered. I spoke to Denbo_33 and he confirmed what you said.


Exactly as Timecop and I stated 4 months ago:

Huh? Linux is not going to decrypt 5c copy once content. What is that guy smoking?

timecop
02-13-07, 03:41 AM
lol, ya rly.
but maybe he wanted an 'official' word.

hackmeister
02-27-07, 07:53 AM
Glad to see there are some Linux people on these boards. I'm planning on setting up a MythTV box for my new HDTV setup in my mancave. A couple questions.Do you think a 2.4 ghz Intel Celeron is enough horse power for HDTV playback? I've done MythTV using SD Hauppauge capture cards in the past. I'm thinking of using my old workstation. Also if you can record 5c with a capture card which HD card do you recommend? Air2PC or HD5000? FYI, I'm a cable tv subscriber.
Thanks

timecop
02-27-07, 07:34 PM
If you were using windows, you'd be fine with a 1ghz cpu and a nvidia card with purevideo support, which would offload most HD decoding. With lunix, you better get the fastest/hottest chips.

Re 5C, obviously not.

Tokyo_ondo
04-08-07, 08:58 AM
Hello, that is a great job.

I tried to record & playback with my PC and D-VHS deck. Record succeeded and playback failed. If you have some time, could you please give any information about the results below?

OS: Debian Sarge
Kernel: 2.4.27-2-386
D-VHS: JVC HM-DHX1 (Japanese type)

I followed your steps, run "avc_vcr_hdtv" and connect a firewire cable. "avc_vcr" was listed in D_VHS deck at the point.
Then the following texts are repeated in the terminal.

####### START
AvcTarget:: Command_handler::
opcode = 0f
status = 01
subunit_type = 1f
subunit_id = 07 operand[ 0 ] = 00
operand[ 1 ] = ff
operand[ 2 ] = ff
operand[ 3 ] = ff
operand[ 4 ] = ff
operand[ 5 ] = ff
operand[ 6 ] = ff
operand[ 7 ] = ff
operand[ 8 ] = ff
unit status command 0x0f not supported
####### END

Then I run "romtest" and got the following outputs.

####### START
Librom1394 Test Report
=================================================

Node 0:
-------------------------------------------------
bus info block length = 4
bus id = 0x31333934
bus options:
isochronous resource manager capable: 1
cycle master capable : 1
isochronous capable : 1
bus manager capable : 0
cycle master clock accuracy : 0 ppm
maximum asynchronous record size : 2048 bytes
GUID: 0x00110600bb004992
directory:
node capabilities : 0x000083c0
vendor id : 0x00004063
unit spec id : 0x0000a02d
unit software version: 0x00010001
model id : 0x00010061
textual leaves : Kino Rocks! avc_vcr

Node 1:
-------------------------------------------------
bus info block length = 4
bus id = 0x31333934
bus options:
isochronous resource manager capable: 1
cycle master capable : 1
isochronous capable : 1
bus manager capable : 0
cycle master clock accuracy : 100 ppm
maximum asynchronous record size : 256 bytes
GUID: 0x0080880103000d26
directory:
node capabilities : 0x000083c0
vendor id : 0x00008088
unit spec id : 0x0000a02d
unit software version: 0x00010001
model id : 0x00010060
textual leaves : VICTOR HM-DHX1 HM-DHX1
####### END

Then I run "plugreport" and got outputs below.

####### START
Host Adapter 0
==============

Node 0 GUID 0x00110600bb004992
------------------------------
oMPR n_plugs=1, data_rate=0, bcast_channel=0
oPCR[0] online=1, bcast_connection=0, n_p2p_connections=1
channel=32, data_rate=1, overhead_id=15, payload=146
iMPR n_plugs=1, data_rate=0
iPCR[0] online=1, bcast_connection=0, n_p2p_connections=0
channel=0

Node 1 GUID 0x0080880103000d26
------------------------------
oMPR n_plugs=1, data_rate=1, bcast_channel=63
oPCR[0] online=0, bcast_connection=0, n_p2p_connections=0
channel=63, data_rate=1, overhead_id=0, payload=146
iMPR n_plugs=2, data_rate=1
iPCR[0] online=0, bcast_connection=0, n_p2p_connections=0
channel=63
iPCR[1] online=1, bcast_connection=0, n_p2p_connections=1
channel=32
####### END


Then I run "test-mpeg2 -r 1 > XXX(file name)" and got a file. The file was playbacked correctly in Totem Movie player in KDE.

Then I run "test-mpeg2 -t 1 -c 32 XXX(file name)" and got outputs below.

####### START
couldn't find a PCR within 20000 packets; giving up
(try reducing PCR_SMOOTH_INTERVAL or increase MAX_PCR_LOOKAHEAD
couldn't find a PCR within 20000 packets; giving up
(try reducing PCR_SMOOTH_INTERVAL or increase MAX_PCR_LOOKAHEAD
Starting to transmit
####### END

Nothing was shown in D-VHS deck.

xtknight
08-16-07, 07:10 PM
Thank you for this. It works great on Ubuntu Feisty. Here's my notes if they may help anyone else. This is just what works for me, and this is really the only way it works. Playback is fine with mplayer. I think my DVR only lets you record shows that were already recorded on the DVR, so I can just archive my recordings at best, and generally at lower res (1080i turns into 720p?) I had the same results on Windows.

sudo ./setrom
#plug it in (only works on the 1394 port closest to component outputs)
#..romtest should show the actual device on the SECOND node.
sudo ./avc_vcr_hdtv (then quit it)
sudo ./test-mpeg2 -t 0 -r 1 > file (try a couple times till file len>0)

libiec61883 warning: Established connection on channel 0.
You may need to manually set the channel on the receiving node.
Starting to receive

sudo ./romtest

Librom1394 Test Report
=================================================

Node 0:
-------------------------------------------------
bus info block length = 4
bus id = 0x31333934
bus options:
isochronous resource manager capable: 1
cycle master capable : 1
isochronous capable : 1
bus manager capable : 0
cycle master clock accuracy : 100 ppm
maximum asynchronous record size : 2048 bytes
GUID: 0x00004c0107007114
directory:
node capabilities : 0x000083c0
vendor id : 0x0000004c
unit spec id : 0x0000a02d
unit software version: 0x00010001
model id : 0x00000000
textual leaves : Kino Rocks! avc_vcr avc_vcr

Node 1:
-------------------------------------------------
bus info block length = 4
bus id = 0x31333934
bus options:
isochronous resource manager capable: 1
cycle master capable : 1
isochronous capable : 1
bus manager capable : 0
cycle master clock accuracy : 50 ppm
maximum asynchronous record size : 512 bytes
GUID: 0x00159afffe1c92d1
directory:
node capabilities : 0x000083c0
vendor id : 0x0000159a
unit spec id : 0x00005068
unit software version: 0x00010101
model id : 0x000034cb
textual leaves : MOTOROLA DCT-3412 DCT-3412

sudo plugreport


Node 0 GUID 0x00004c0107007114
------------------------------
libiec61883 error: error reading oMPR
libiec61883 error: error reading iMPR

Node 1 GUID 0x00159afffe1c92d1
------------------------------
oMPR n_plugs=1, data_rate=2, bcast_channel=63
oPCR[0] online=1, bcast_connection=0, n_p2p_connections=0
channel=0, data_rate=2, overhead_id=0, payload=376
iMPR n_plugs=0, data_rate=2

Host Adapter 1
==============

Node 0 GUID 0x00023c01510b0abb
------------------------------
libiec61883 error: error reading oMPR
libiec61883 error: error reading iMPR



-- removal

[terminate avc]
[unhook]
sudo rmmod dv1394
sudo rmmod ohci1394
sudo rmmod raw1394
sudo rmmod ieee1394

-- loading

sudo modprobe raw1394
sudo modprobe ohci1394
continue steps at top of page (sudo ./setrom, etc)

gwalborn
12-09-07, 04:13 PM
I have read through this thread and while it has been somewhat helpful, I still have not been able to produce a meaningful result. I have a MythTV system and a number of transport streams on disk. I have the HTPC hooked to a Mitsubishi D-VHS deck. I need at least to be able to move MPEG streams from the hard disk to the D-VHS deck AND back. I have failed miserably at this. Can anyone point me in the right direction to get this done. My eventual goal is to write scripts to easily archive HD material (primarily from PBS, so no 5C issues) to and from D-VHS tape. This IS the reason for the existence of 1394 AVC, right? I don't understand why it seems to be so difficult to accomplish this "simple" task.

Thanks in advance,
Gary Walborn
gwalborn@gmail.com

Denbo_33
12-11-07, 07:51 AM
I have read through this thread and while it has been somewhat helpful, I still have not been able to produce a meaningful result. I have a MythTV system and a number of transport streams on disk. I have the HTPC hooked to a Mitsubishi D-VHS deck. I need at least to be able to move MPEG streams from the hard disk to the D-VHS deck AND back. I have failed miserably at this. Can anyone point me in the right direction to get this done. My eventual goal is to write scripts to easily archive HD material (primarily from PBS, so no 5C issues) to and from D-VHS tape. This IS the reason for the existence of 1394 AVC, right? I don't understand why it seems to be so difficult to accomplish this "simple" task.

Thanks in advance,
Gary Walborn
gwalborn@gmail.com
Please define meaningful result. A capture or playback problem? I too have a Mitsubishi D-VHS HD-2000, and can capture with zero problems.

gwalborn
12-11-07, 08:08 AM
Denbo_33,

I can playback and capture FROM the D-VHS deck just fine. What I have been unable to do is to transfer a file FROM the PC TO the D-VHS deck. I can put the deck into record mode and initiate a transfer with test-mpeg2, but the deck gives an 'error' message. When using a STB, I see the same error message if I press 'Record' when there is no signal present (i.e., no data), so it appears that the deck is not seeing the data from the PC.

If you have the deck, you probably know that there is a firewire setup screen where you can pick your tuner. Of course, with the PC, there is nothing listed on that screen. Is it possible that the deck requires some sort of "pairing" to record? I'm sure this must be possible. I've seen packages for Windows that perform this task (although I've never used them). I see you've had a lot more experience with this than I have and any suggestions would be appreciated.

Thanks again,

Gary Walborn
gwalborn@gmail.com