| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A pure Swift implementation of IEEE 1722.1-2021 (ATDECC, formerly AVDECC) and the Milan Vendor Unique extensions, sending and receiving PDUs directly on raw Ethernet.
ATDECCSwift was previously AVDECCSwift, a wrapper around the L-Acoustics la_avdecc C++ library. It no longer depends on la_avdecc, although its wire behaviour (timeouts, retries, tolerance of non-conforming entities, which responses raise notifications) deliberately matches it.
| Surface | Status |
|---|---|
| ADP discovery (§6.2.6) and controller advertising (§6.2.4) | ✓ |
| AEM commands (§7.4) | ✓ acquire/lock, entity/controller available, READ_DESCRIPTOR, configuration, stream format/info, names, association, sampling rate, clock source, controls, start/stop streaming, unsolicited notifications, AVB info, AS path, counters, reboot, audio maps, operations, memory object length, max transit time, WRITE_DESCRIPTOR, GET_DYNAMIC_INFO, stream backup, sampling rate range, path latency, video and sensor formats and maps, signal selectors, mixers and matrices, PTP instance and port commands other than PTP_PORT_INFO |
| AEM descriptors (§7.2) | ✓ entity, configuration, audio unit, stream, jack, AVB interface, clock source, memory object, locale, strings, stream/external/internal port, audio cluster, audio map, control, clock domain, timing, PTP instance, PTP port, video and sensor unit/cluster/map, signal selector, mixer, matrix, matrix signal, signal splitter/combiner/demultiplexer/multiplexer/transcoder, control block |
| Milan MVU commands | ✓ GET_MILAN_INFO, system unique ID, media clock reference info, BIND_STREAM, UNBIND_STREAM, GET_STREAM_INPUT_INFO_EX |
| ACMP controller commands and sniffing (§8.2) | ✓ |
| Unsolicited notifications as events (§7.5.2) | ✓ |
| Raw PDU send | ✓ |
| Serial (UART) transport | ✓ COBS-framed AVTPDUs |
| Not yet | authentication and security, SET/GET_PTP_PORT_INFO, address access, entity responder |
import ATDECC
let endStation = try EndStation(port: EthernetPort(interfaceName: "eth0"))
let controller = try await Controller(
endStation: endStation,
entityID: endStation.makeDynamicEntityID()
)
for await event in await controller.events() {
if case let .entityOnline(id) = event {
let descriptor = try await controller.readEntityDescriptor(id: id)
print(descriptor.entityName)
}
}See Examples/Discovery/Discovery.swift for a complete, runnable example.
The names follow IEEE 1722.1-2021:
Controllers and end stations are generic over their port type, so frames are handled without existential dispatch.
| AVDECCSwift | ATDECC |
|---|---|
| import AVDECCSwift | import ATDECC |
| ProtocolInterface(type: .pCap, interfaceID:) | EndStation(port: EthernetPort(interfaceName:)) |
| ProtocolInterface.getDynamicEID() / releaseDynamicEID(_:) | EndStation.makeDynamicEntityID() / releaseDynamicEntityID(_:) |
| LocalEntity(protocolInterface:entityID:) | Controller(endStation:entityID:) (async) |
| LocalEntityDelegate, LocalEntityEventStream, ProtocolInterfaceObserver | Controller.events() |
| onRemoteEntityOnline(_:entity:) | ControllerEvent.entityOnline and Controller.discoveredEntity(id:) |
| LocalEntityEvent | ControllerEvent |
| LocalEntityAemCommandStatus, LocalEntityControlStatus, LocalEntityMvuCommandStatus | AemStatus, AcmpStatus, MvuStatus |
| setStreamInputInfo(id:streamIndex:info:) and other setters | setStreamInputInfo(id:streamIndex:to:) — setters take the new value as to: |
| acquireEntity(… descriptorType: UInt16 …) | descriptorType: DescriptorType |
| discoverRemoteEntity(id:), enableEntityAdvertising, close() | now async |
| Executor, AVDECCSwift.Logger | removed; pass a swift-log Logger to EndStation or Controller |
Requires Swift 6.2 or later on Linux, with liburing and, for link state monitoring through NetLinkSwift, libnl installed:
apt install liburing-dev pkg-config libnl-3-dev libnl-route-3-dev libnl-nf-3-dev libnl-genl-3-dev \
libmnl-dev libnftnl-devswift build
swift testThe tests run controllers against a simulated entity on a VirtualNetwork and need no network access or privileges. The serial port tests use a pseudo-terminal and io_uring, which Docker's default seccomp profile blocks: run a container with --security-opt seccomp=unconfined.
Sending and receiving raw Ethernet needs CAP_NET_RAW. Either run as root, or grant the capability to the binary:
sudo setcap cap_net_raw+ep .build/debug/avdecc-discovery
.build/debug/avdecc-discovery eth0SerialPort carries ATDECC over a point-to-point UART, as used between a host and an AVB entity's firmware. Each AVTPDU (the AVTP control header and its ADP, AECP or ACMP data, with no Ethernet header or padding) is COBS encoded and sent between zero bytes. The device is set to raw 8N1 at the requested baud rate (115200 by default).
The wire carries no addresses. Every frame goes to the one peer, and received frames appear to come from SerialPortPeerMacAddress. The host end uses SerialPortLocalMacAddress (0A:E9:1B:00:00:00) by default, because the entity firmware sends frames addressed to it, and all multicast frames, to its UART.
.build/debug/avdecc-discovery /dev/ttyAMA0@115200Apache License 2.0; see LICENSE.
| Back | FazBrowse Home | New Git URL |