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