ALSA: core: selection of audio_tstamp type and accuracy reports
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 13 Feb 2015 21:14:03 +0000 (15:14 -0600)
committerTakashi Iwai <tiwai@suse.de>
Fri, 20 Feb 2015 16:30:03 +0000 (17:30 +0100)
commit229d043096ea8e58829d37d35767afeac15997f5
tree36a7c15f53435696812cd8e616769f373400d027
parent0c8d948565490d2a2db9d9a5aec388342c7d38ce
ALSA: core: selection of audio_tstamp type and accuracy reports

Audio timestamps can be extracted from sample counters, wall clocks,
PHC clocks (Ethernet AVB), on-demand synchronized snapshots. This
patch provides the ability to report timestamping capabilities, select
timestamp types and retrieve timestamp accuracy, if supported.
Details can be found in Documentations/sound/alsa/timestamping.txt

This functionality is introduced by reclaiming the reserved_aligned
field introduced by commit9c7066aef4a5eb8e4063de28f06c508bf6f2963a
in snd_pcm_status to provide userspace with selection/query capabilities.
Additional driver_tstamp and audio_tstamp_accuracy fields are also added.

snd_pcm_mmap_status remains a read-only structure with only
the audio timestamp value accessible from user space. The selection
of audio timestamp type is done through snd_pcm_status only

This commit does not impact ABI and does not impact the default
behavior. By default audio timestamp is aligned with hw_pointer and
reports the DMA position. Backwards compatibility is handled by using
the HDAudio wall clock for playback and the hw_ptr for all other
cases.

For timestamp selection a new STATUS_EXT ioctl is introduced with
read/write parameters. Alsa-lib will be modified to make use of
STATUS_EXT.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Documentation/sound/alsa/timestamping.txt [new file with mode: 0644]
include/sound/pcm.h
include/uapi/sound/asound.h