Skip to content

klizas/t2aved

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

t2aved

ci

XPC lifecycle helper for the Apple T2 hardware HEVC encoder. Pairs with the AVE-enabled apple-bce kernel driver on Linux.

The kernel handles the BCE data plane: DMA queues, encoding commands, frame data. t2aved handles the XPC control plane. It opens an IPv6 link-local TCP session to aveserverd on the T2 and exposes /run/aveserverd.sock so the kernel can send startKey (activate) and stopKey (deactivate). Without this, the T2 silently ignores BCE commands.

Requirements

  • apple-bce loaded from klizas/apple-bce-drv. Fork links AVE into apple-bce.ko; upstream t2linux does not.
  • t2_ncm interface up, link-local reachable. Name comes from a udev rule matching the T2-side MAC.

Check apple-bce + AVE:

lsmod | grep '^apple_bce\b'                                      # module loaded
ls /sys/class/video4linux/*/name 2>/dev/null \
    | xargs -r grep -l apple-ave-enc                             # AVE V4L2 node present

If the second check is empty, the stock module is loaded; rebuild from the fork.

Check t2_ncm:

ip -br link show t2_ncm                                          # exists, state UP/UNKNOWN
ip -6 addr show dev t2_ncm scope link                            # link-local fe80::… present
ping -c1 fe80::aede:48ff:fe33:4455%t2_ncm                        # T2 responds

If the interface is missing, it is likely named enp…; pass --interface <name>. If the interface is DOWN, run sudo ip link set t2_ncm up. If no link-local address, apple-bce did not configure the device; check dmesg. If ping fails, the T2 is not responding; check dmesg for apple-bce errors and reboot.

Build

Requires Rust 1.85+ (edition 2024).

cargo build --release
cargo clippy --all-targets --locked -- -D warnings
cargo test --locked

Install

No installer. Packagers and manual installs do the same thing:

install -Dm755 target/release/t2aved /usr/bin/t2aved
install -Dm644 t2aved.service /usr/lib/systemd/system/t2aved.service
systemctl daemon-reload
systemctl enable --now t2aved

The shipped unit hardcodes ExecStart=/usr/bin/t2aved. To install to a different path, edit the unit or add a systemctl edit t2aved override.

Protocol

Newline-terminated ASCII on /run/aveserverd.sock.

Command Success Behavior
start OK\n XPC startKey, fire-and-forget; activates encoder
stop OK\n XPC stopKey, await replyKey; deactivates encoder

Errors: ERR: <reason>\n.

Flags

Flag Default
--interface t2_ncm
--sock /run/aveserverd.sock
--t2-addr fe80::aede:48ff:fe33:4455
--t2-port 59602

T2AVED_LOG=<level> sets log level (default info). stderr goes to journald.

License

GPL-2.0-only. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages