xref: /freebsd/usr.sbin/fwcontrol/fwcontrol.8 (revision 1da7f3f6f72b2245e458fc7195733268ae4a1136)
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.Dd September 12, 2008
26.Dt FWCONTROL 8
27.Os
28.Sh NAME
29.Nm fwcontrol
30.Nd FireWire control utility
31.Sh SYNOPSIS
32.Nm
33.Op Fl u Ar bus_num
34.Op Fl prt
35.Op Fl c Ar node
36.Op Fl d Ar node
37.Op Fl o Ar node
38.Op Fl s Ar node
39.Op Fl l Ar file
40.Op Fl f Ar node
41.Op Fl g Ar gap_count
42.Op Fl b Ar pri_req
43.Op Fl M Ar mode
44.Op Fl R Ar filename
45.Op Fl S Ar filename
46.Op Fl m Ar EUI64 | hostname
47.Sh DESCRIPTION
48The
49.Nm
50utility is designed to provide a way for users to access and control the
51.Fx
52FireWire subsystem.
53Without options,
54.Nm
55will output a list of devices that are/were connected to the bus.
56.Pp
57The following options are available:
58.Bl -tag -width indent
59.It Fl u Ar bus_num
60Specify the FireWire bus number to be operated on.
61The default is bus 0.
62.It Fl r
63Initiate bus reset.
64.It Fl t
65Show the topology map.
66.It Fl p
67Dump PHY registers.
68.It Fl c Ar node
69Show the configuration ROM on the node.
70.It Fl d Ar node
71Hex dump of the configuration ROM.
72.It Fl o Ar node
73Send a link-on PHY packet to the node.
74.It Fl s Ar node
75Write to the
76.Dv RESET_START
77register on the node.
78.It Fl l Ar file
79Load hex dump file of the configuration ROM and parse it.
80.It Fl f Ar node
81Force specified
82.Ar node
83to be the root node on the next bus reset by sending a PHY config packet.
84Valid values are 0 - 63.
85.It Fl g Ar gap_count
86Broadcast new
87.Ar gap_count
88by sending a PHY_config packet.
89By default this value is 63 on all nodes.
90Valid values are 0 - 63.
91.It Fl i Ar pri_req
92Set the
93.Dv PRIORITY_BUDGET
94register on all supported nodes.
95.It Fl M Ar mode
96Explicitly specify either
97.Ar dv
98or
99.Ar mpeg
100mode for the incoming stream.
101Only meaningful in case of and must precede the
102.Fl R
103option.
104If not specified, the program will try to guess.
105In case of
106.Dq format 0x20
107error, try to force the
108.Dq mpeg
109mode.
110.It Fl R Ar filename
111Receive DV or MPEG TS stream and dump it to a file.
112Use ^C to stop the receiving.
113Some DV cameras seem not to send the stream if a bus manager exists.
114If it is impossible to get the stream, try the following commands:
115.Bd -literal -offset indent
116sysctl hw.firewire.try_bmr=0
117fwcontrol -r
118.Ed
119.Pp
120The resulting file contains raw DV data excluding isochronous header
121and CIP header.
122It can be handled by
123.Nm libdv
124in the
125.Fx
126Ports Collection.
127Resulting MPEG TS stream can be played and sent over a
128network using the VideoLAN
129.Nm vlc
130tool in the
131.Fx
132Ports Collection.
133The stream can be piped directly to
134.Nm vlc,
135see
136.Sx EXAMPLES .
137.It Fl S Ar filename
138Send a DV file as isochronous stream.
139.It Fl m Ar EUI64 | hostname
140Set default fwmem target.
141Hostname will be converted to EUI64 using
142.Xr eui64 5 .
143.El
144.Sh FILES
145.Bl -tag -width "Pa /dev/fw0.0"
146.It Pa /dev/fw0.0
147.El
148.Sh EXAMPLES
149Each DV frame has a fixed size and it is easy to edit the frame order.
150.Pp
151.Dl "fwcontrol -R original.dv"
152.Pp
153Receive a DV stream with DV camera attached.
154.Pp
155.Dl "dd if=original.dv of=first.dv bs=120000 count=30"
156.Pp
157Get first 30 frames(NTSC).
158.Pp
159.Dl "dd if=original.dv of=second.dv bs=120000 skip=30 count=30"
160.Pp
161Get second 30 frames(NTSC).
162.Pp
163.Dl "cat second.dv first.dv | fwcontrol -S /dev/stdin"
164.Pp
165Swap first and second 30 frames and send them to DV recorder.
166.Pp
167For PAL, replace
168.Dq Li bs=120000
169with
170.Dq Li bs=144000 .
171.Pp
172.Dl "fwcontrol -R file.m2t"
173.Pp
174Receive an MPEG TS stream from a camera producing MPEG transport stream.
175This has been tested with SONY HDR-FX1E camera that produces HD MPEG-2
176stream at 25 Mbps bandwidth.
177.Pp
178To send the stream from the camera over the network using TCP (which
179surprisingly works better with vlc), you can use
180.Dl "fwcontrol -R - | nc 192.168.10.11 9000"
181with
182.Nm netcat
183from ports and to receive the stream, use
184.Dl nc -l -p 9000 | vlc -
185.Pp
186To netcast via UDP, you need to use
187.Nm buffer
188program from ports, since vlc is not fast enough to read UDP packets from
189buffers and thus it experiences dropouts when run directly.
190The sending side can use
191.Dl "fwcontrol -R - | nc 192.168.10.11 9000"
192and to receive the stream, use
193.Dl nc -l -u -p 9000 | buffer -s 10k -b 1000 -m 20m -p 5 | vlc -
194.Pp
195For more information on how to work with
196.Nm vlc
197see its docs.
198.Sh SEE ALSO
199.Xr mplayer 1 ,
200.Xr vlc 1 ,
201.Xr firewire 4 ,
202.Xr fwe 4 ,
203.Xr fwip 4 ,
204.Xr fwohci 4 ,
205.Xr sbp 4
206.Sh HISTORY
207The
208.Nm
209utility first appeared in
210.Fx 5.0 .
211.Sh AUTHORS
212.An Hidetoshi Shimokawa Aq Mt simokawa@FreeBSD.org
213.An Petr Holub Aq Mt hopet@ics.muni.cz
214(MPEG TS mode)
215.Sh BUGS
216This utility is still under development and provided for debugging purposes.
217Especially MPEG TS reception support is very rudimental and supports only
218high-bandwidth MPEG-2 streams (fn field in CIP header equals 3).
219