FWCONTROL(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… fwcontrol(8) β€” the FireWire control utility, bestie edition πŸŽ€

okay so real talk, this is fwcontrol from section 8 of the manual (System Manager's Manual), and it's literally your all-access pass to the FreeBSD FireWire subsystem. ✨


🌸 NAME 🌸

fwcontrol β€” FireWire control utility. that's it, that's the vibe. πŸ¦‹


✨ SYNOPSIS ✨

fwcontrol [-u bus_num] [-prt] [-c node] [-d node] [-o node] [-s node]
          [-l file] [-f node] [-g gap_count] [-b pri_req] [-M mode]
          [-R filename] [-S filename] [-m EUI64 | hostname]
🫢 quick heads-up bestie: the synopsis up there says -b pri_req and the description down below says -i pri_req. I am NOT picking sides, I'm just transcribing exactly what the page says. iykyk. πŸ’€

πŸ’– DESCRIPTION πŸ’–

so fwcontrol exists to give you, a normal human user, a way to actually access and control the FreeBSD FireWire subsystem. iconic behavior honestly.

run it with no options at all and it will output a list of devices that are/were connected to the bus. like a little guest list for your FireWire party. πŸŽ‰

The following options are available:

  • -u bus_num β€” pick which FireWire bus you wanna operate on. the default is bus 0. choose your fighter. πŸ‘‘
  • -r β€” initiate bus reset. just. reset the whole bus. go off. πŸ”₯
  • -t β€” show the topology map. see how everybody's wired up. 🌈
  • -p β€” dump PHY registers. raw register soup, mmm. πŸ“
  • -c node β€” show the configuration ROM on the node. ✨
  • -d node β€” hex dump of the configuration ROM. same ROM, but spicy hexadecimal edition. πŸ’œ
  • -o node β€” send a link-on PHY packet to the node. poke it awake. 🫢
  • -s node β€” write to the RESET_START register on the node. 😭
  • -l file β€” load a hex dump file of the configuration ROM and parse it. very demure, very parse-y. πŸŽ€
  • -f node β€” force the specified node to be the root node on the next bus reset by sending a PHY config packet. valid values are 0 - 63. main character energy, assigned by force. πŸ‘‘
  • -g gap_count β€” broadcast a new gap_count by sending a PHY_config packet. by default this value is 63 on all nodes. valid values are 0 - 63. πŸ¦‹
  • -i pri_req β€” set the PRIORITY_BUDGET register on all supported nodes. πŸ’…
  • -M mode β€” explicitly specify either dv or mpeg mode for the incoming stream. only meaningful in case of and must precede the -R option (yes, order matters, don't do it in the wrong order πŸ™ˆ). if not specified, the program will try to guess. in case of β€œformat 0x20” error, try to force the β€œmpeg” mode. ⭐
  • -R filename β€” receive a 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 exists. if it is impossible to get the stream, try the following commands:
sysctl hw.firewire.try_bmr=0
fwcontrol -r

the resulting file contains raw DV data excluding isochronous header and CIP header. it can be handled by libdv in the FreeBSD Ports Collection. the resulting MPEG TS stream can be played and sent over a network using the VideoLAN vlc tool in the FreeBSD Ports Collection. the stream can be piped directly to vlc, see β€œEXAMPLES”. πŸ”₯

  • -S filename β€” send a DV file as isochronous stream. yeet. πŸš€
  • -m EUI64 | hostname β€” set the default fwmem target. hostname will be converted to EUI64 using eui64(5). 🧚

πŸŽ€ FILES πŸŽ€

  • /dev/fw0.0

that's the one file. she's alone and she's thriving. πŸ’–


🌟 EXAMPLES 🌟

each DV frame has a fixed size and it is easy to edit the frame order. slay, determinism. ✨

fwcontrol -R original.dv

receive a DV stream with a DV camera attached. πŸ“Ή

dd if=original.dv of=first.dv bs=120000 count=30

get first 30 frames (NTSC). πŸ“

dd if=original.dv of=second.dv bs=120000 skip=30 count=30

get second 30 frames (NTSC). πŸ“πŸ“

cat second.dv first.dv | fwcontrol -S /dev/stdin

swap first and second 30 frames and send them to a DV recorder. the way that pipe just WORKS. 😭

for PAL, replace β€œbs=120000” with β€œbs=144000”. noted, bestie. πŸ’…

fwcontrol -R file.m2t

receive an MPEG TS stream from a camera producing MPEG transport stream. this has been tested with the SONY HDR-FX1E camera that produces HD MPEG-2 stream at 25 Mbps bandwidth. ngl that's kind of iconic. πŸ”₯

to send the stream from the camera over the network using TCP (which surprisingly works better with vlc), you can use

fwcontrol -R - | nc 192.168.10.11 9000

with netcat from ports, and to receive the stream, use

nc -l -p 9000 | vlc -

to netcast via UDP, you need to use 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

fwcontrol -R - | nc 192.168.10.11 9000

and to receive the stream, use

nc -l -u -p 9000 | buffer -s 10k -b 1000 -m 20m -p 5 | vlc -

for more information on how to work with vlc see its docs. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

mplayer(1), vlc(1), firewire(4), fwe(4), fwip(4), fwohci(4), sbp(4)

go read those too, they're in their flop era of being unread, give them a moment. πŸ’œ


⭐ HISTORY ⭐

the fwcontrol utility first appeared in FreeBSD 5.0. a true OG. πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

  • Hidetoshi Shimokawa <simokawa@FreeBSD.org>
  • Petr Holub <hopet@ics.muni.cz> (MPEG TS mode)

thank you for your service, legends. 🫑


πŸ’€ 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 (the fn field in the CIP header equals 3). so like... don't build your whole production pipeline on it, bestie. πŸ™ˆ


lowkey the funniest thing about this page is that the synopsis and the description disagree on one letter. not me noticing. not me saying anything. okay I said something. πŸ’€

and that's the whole page!! πŸŽ‰ this beauty came to you from Debian, dated September 12, 2008, and it's filed under FWCONTROL(8) β€” mwah, love that for us. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from