Crates.io | ta1394-avc-general |
lib.rs | ta1394-avc-general |
version | 0.2.0 |
source | src |
created_at | 2022-07-29 10:45:21.761471 |
updated_at | 2023-04-18 11:21:08.441406 |
description | A pure-Rust small framework for AV/C protocol and command defined by 1394 Trading Association |
homepage | https://alsa-project.github.io/gobject-introspection-docs/ |
repository | https://github.com/alsa-project/snd-firewire-ctl-services |
max_upload_size | |
id | 634935 |
size | 57,039 |
The crate includes Rust elements for the part of protocol defined by 1394 Trading Association (1394 TA).
The implemented protocol is documented in:
1394 TA was formed 1994 and decided to close its official operation 2015. As of 2021, it has been
dissolved and close its web site under URL http://1394ta.org
in the end of year.
The document is itself available at Internet Archive service when seeking
URL http://1394ta.org/specifications/
with enough care of cached date.
The crate consists of three parts; AV/C operations, some AV/C commands, and typical layout of Configuration ROM defined in the documents.
AV/C operation uses "Function Control Protocol (FCP)" defined in IEC 61883-1 to send command frame and receive response frame with two modes of transaction; immediate and deferred (see clause "6 AV/C Operations"). The frame includes command type and response status, address, operation code, and its operands (see clause "5 AV/C frames").
The address refers to unit and subunit described in clause "8 AV/C model".
The Ta1394Avc
trait is good start to use the crate. Ta1394Avc::transaction()
should be
implemented to perform FCP as well as handle the deferred transaction. The trait has default
implementation for methods to perform AV/C control, status, specific_inquiry, and notify operation,
which uses the above implementation.
Unfortunately, actual devices include quirks against the design defined in specification. The default implementation can be rewritten by implementator.
Each of AV/C command is expressed as converter between operands in frame and arbitrary
structure. The AvcOp
, AvcStatus
, AvcControl
, and AvcNotify
traits are used for the
conversion. The crate provides some implementations for documented AV/C commands below:
UnitInfo
(clause "9.2 UNIT INFO command")SubunitInfo
(clause "9.3 SUBUNIT INFO command")VendorDependent
(clause "9.6 VENDOR-DEPENDENT commands")PlugInfo
(clause "10.1 PLUG INFO command")InputPlugSignalFormat
(clause "10.10 INPUT PLUG SIGNAL FORMAT command")OutputPlugSignalFormat
(clause "10.11 OUTPUT PLUG SIGNAL FORMAT command")The generic Ta1394AvcError
enumeration is used to express error of command composing,
communication failure, and response parsing. The implementator of Ta1394Avc
trait should also
decide the type for error in communication failure.
In typical layout defined by 1394 TA, root directory includes below entries in its order.
The unit directory includes below entries in its order:
The value of specifier ID entry is 0x00a02d, and the value of version entry is 0x010001.
To detect these fields, Ta1394ConfigRom
trait is implemented for ConfigRom
structure in
ieee1212-config-rom crate. At present,
VendorData
and UnitData
is available as a result to detect the fields.
Besides, we can see the similar specification with slight differences in the other documents:
Furthermore, some vendors designed specific layout for own purposes.
The crate is released under MIT license.
If finding issue, please file it in https://github.com/alsa-project/snd-firewire-ctl-services/.
If intending for code contribution, I would like the user and developer to take care of some points before working.
It's well-known that the association promoted by several vendors tends to publishes specifications and documentations with over-engineering for several reasons; e.g. rat race in business or market. Beside the risk to include bug is exponentially increased when the code base is larger and larger. It's not preferable for your work just to fulfill whole the specifications and documentations.
The point is that there is actual requirement for the new code. For example, the crate includes some AV/C commands to satisfy requirement of snd-firewire-ctl-services project. It's preferable for you to have actual application using the new code.