]> git.alsa-project.org Git - alsa-plugins.git/commit
aaf: AVTPDU transmission periodicity
authorAndre Guedes <andre.guedes@intel.com>
Sat, 8 Dec 2018 01:55:50 +0000 (17:55 -0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 10 Dec 2018 08:42:32 +0000 (09:42 +0100)
commit027046166694448c3bf2bfc2697221c2c2dcb796
tree0b8c94fd03dae5b1cb325c03829b6830a0172a71
parent5981b26afb64c562673436e2d199108bab109946
aaf: AVTPDU transmission periodicity

When operating in playback mode (i.e. AVTP talker) the plugin is
expected to transmit the AVTPDUs in a periodical manner. The AVTPDU
period is defined by the number of audio frames per AVTPDU and the
sampling rate (see section 7.7 from AVTP spec [1] for further
information).

To enforce the AVTPDU periodicity, this patch leverages the SO_TXTIME
sockopt recently added to socket interface which enables the userspace
to specify when a given packet should be transmitted. The plugin
configures the transmission time from each AVTPDU so the expected
transmission interval is maintained.

The SO_TXTIME feature works in conjunction with the Earliest TxTime
First (ETF) qdisc. The ETF qdisc sorts packets from multiple sockets by
the earliest transmission time and sends them to the network controller.
It also enables offloading packet transmission to hardware in case the
NIC supports it, providing more time accuracy. For further information
about ETF qdisc, see tc-etf(8). The qdisc can be configured many ways,
in doc/aaf.txt we provide an example.

Below follows some implementation highlights:

The packet transmission time is configured through socket control
message interface so we now use sendmsg() to transmit AVTPDUs, instead
of sendto().

sendmsg() API requires a msghdr struct which is initialized during
device setup time. Strictly speaking, that struct is only required when
operating in playback mode but we initialize it always, no matter if
running in playback or capture mode. This makes hw_params() and
hw_free() callbacks implementation way more simpler, specially on
handling error cases.

[1] 1722-2016 - IEEE Standard for a Transport Protocol for Time-Sensitive
    Applications in Bridged Local Area Networks

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
aaf/pcm_aaf.c
configure.ac
doc/aaf.txt