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

.Pp
For more information on how to work with
.Nm vlc
see its docs.
.Sh SEE ALSO
.Xr firewire 4 ,
.Xr fwe 4 ,
.Xr fwip 4 ,
.Xr fwohci 4 ,
.Xr sbp 4 ,
.Xr mplayer 1 ,
.Xr vlc 1
.Sh HISTORY
The
.Nm
utility first appeared in
.Fx 5.0 .
.Sh AUTHORS
.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
.An Petr Holub Aq hopet@ics.muni.cz
- MPEG TS mode.
.Sh BUGS
This utility is still under development and provided for debugging purposes.
Especially MPEG TS reception support is very rudimental and supports only
high-bandwidth MPEG-2 streams (fn field in CIP header equals 3).
OpenPOWER on IntegriCloud