1.\" $NetBSD: fwctl.8,v 1.6 2007/11/06 17:02:15 kiyohara Exp $ 2.\" 3.\" Copyright (c) 2005 KIYOHARA Takashi 4.\" All rights reserved. 5.\" 6.\" Copyright (c) 2002 Hidetoshi Shimokawa 7.\" All rights reserved. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 22.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 27.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.\" $FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.8,v 1.21 2007/10/31 05:59:17 brueffer Exp $ 31.\" 32.Dd November 6, 2007 33.Dt FWCTL 8 34.Os 35.Sh NAME 36.Nm fwctl 37.Nd IEEE1394 control utility 38.Sh SYNOPSIS 39.Nm 40.Op Fl prt 41.Op Fl b Ar pri_req 42.Op Fl c Ar node 43.Op Fl d Ar node 44.Op Fl g Ar gap_count 45.Op Fl l Ar file 46.Op Fl M Ar mode 47.Op Fl m Ar EUI64 | hostname 48.Op Fl o Ar node 49.Op Fl R Ar filename 50.Op Fl S Ar filename 51.Op Fl s Ar node 52.Op Fl u Ar bus_num 53.Sh DESCRIPTION 54The 55.Nm 56utility is designed to provide a way for users to access and control 57the 58.Nx 59IEEE1394 subsystem. 60Without options, 61.Nm 62will output a list of devices that are/were connected to the bus. 63.Pp 64The following options are available: 65.Bl -tag -width XmXEUI64XhostnameXX -offset indent 66.It Fl b Ar pri_req 67Set the 68.Dv PRIORITY_BUDGET 69register on all supported nodes. 70.It Fl c Ar node 71Show the configuration ROM on the node. 72.It Fl d Ar node 73Hex dump of the configuration ROM. 74.It Fl g Ar gap_count 75Broadcast 76.Ar gap_count 77by phy_config packet. 78.It Fl l Ar file 79Load hex dump file of the configuration ROM and parse it. 80.It Fl M Ar modeExplicitly specify either 81.Ar dv 82or 83.Ar mpeg 84mode for the incoming stream. 85Only meaningful in case of and must precede the 86.Fl R 87option. If not specified, the program will try to guess. If you get 88an error complaining about "format 0x20", try to force the "mpeg" mode. 89.It Fl m Ar EUI64 | hostname 90Set default fwmem target. 91Hostname will be converted to EUI64. 92.It Fl o Ar node 93Send a link-on PHY packet to the node. 94.It Fl p 95Dump PHY registers. 96.It Fl R Ar filename 97Receive DV or MPEG TS stream and dump it to a file. 98Use Ctrl-C to stop the receiving. 99Some DV cameras seem not to send the stream if a bus manager exits. 100If you cannot get the stream, try the following commands: 101.Bd -literal -offset indent 102sysctl hw.ieee1394if.try_bmr=0 103fwctl -r 104.Ed 105.Pp 106The resulting file contains raw DV data excluding isochronous header 107and CIP header. 108It can be handled by the 109.Pa pkgsrc/multimedia/libdv 110package. 111Resulting MPEG TS stream can be played and sent over a network using 112the VideoLAN 113.Nm vlc 114tool in the 115.Fx 116Ports Collection. The stream can be piped directly to 117.Nm vlc, 118see EXAMPLES. 119.It Fl r 120Initiate bus reset. 121.It Fl S Ar filename 122Send a DV file as isochronous stream. 123.It Fl s Ar node 124Write to the 125.Dv RESET_START 126register on the node. 127.It Fl t 128Show the topology map. 129.It Fl u Ar bus_num 130Specify the IEEE1394 bus number to be operated on. 131.El 132.Sh FILES 133.Bl -tag 134.It Pa /dev/fw0.0 135.El 136.Sh EXAMPLES 137Each DV frame has a fixed size and it is easy to edit the frame order. 138.Pp 139.Dl "fwctl -R original.dv" 140.Pp 141Receive a DV stream with DV camera attached. 142.Pp 143.Dl "dd if=original.dv of=first.dv bs=120000 count=30" 144.Pp 145Get first 30 frames (NTSC). 146.Pp 147.Dl "dd if=original.dv of=second.dv bs=120000 skip=30 count=30" 148.Pp 149Get second 30 frames (NTSC). 150.Pp 151.Dl "cat second.dv first.dv | fwctl -S /dev/stdin" 152.Pp 153Swap first and second 30 frames and send them to DV recorder. 154.Pp 155For PAL, replace 156.Dq Li bs=120000 157with 158.Dq Li bs=144000 . 159.Pp 160.Dl "fwcontrol -R file.m2t 161.Pp 162Receive an MPEG TS stream from a camera producing MPEG transport stream. This 163has been tested with SONY HDR-FX1E camera that produces HD MPEG-2 stream at 16425 Mbps bandwidth. 165.Pp 166To send the stream from the camera over the network using TCP (which 167supprisingly works better with vlc), you can use 168.Dl "fwcontrol -R - | nc 192.168.10.11 9000 169with 170.Nm netcat 171from ports and to receive the stream, use 172.Dl nc -l -p 9000 | vlc - 173.Pp 174To netcast via UDP, you need to use 175.Nm buffer 176program from ports, since vlc is not fast enough to read UDP packets from 177buffers and thus it experiences dropouts when run directly. The sending side 178can use 179.Dl "fwcontrol -R - | nc 192.168.10.11 9000 180and to receive the stream, use 181.Dl nc -l -u -p 9000 | buffer -s 10k -b 1000 -m 20m -p 5 | vlc - 182.Pp 183.Pp 184For more information on how to work with 185.Nm vlc 186see its docs. 187.Sh SEE ALSO 188.Xr mplayer 1 , 189.Xr vlc 1 , 190.Xr fwip 4 , 191.Xr fwohci 4 , 192.Xr ieee1394if 4 , 193.Xr sbp 4 194.Sh HISTORY 195The 196.Nm 197command first appeared in 198.Fx 5.0 , 199as 200.Ic fwcontrol . 201It was added to 202.Nx 4.0 203under its present name. 204.Sh AUTHORS 205.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org 206.An Petr Holub Aq hopet@ics.muni.cz 207- MPEG TS mode. 208.An KIYOHARA Takashi Aq kiyohara@NetBSD.org 209.Sh BUGS 210This utility is still under development and provided for debugging 211purposes. 212Especially MPEG TS reception support is very rudimental and supports only 213high-bandwidth MPEG-2 streams (fn field in CIP header equals 3). 214