Re: Playback samples at a specific time on Intel HDA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





I am trying to accomplish synchronized audio playback using ALSA &
gPTP, on an Intel SkyLake platform have Intel HDA.
That's an ambitious goal, I hope you are aware of the technical complexity behind this one-line problem description.

I do understand that, starting with SkyLake platform, there is support
for querying link time.
That's correct.
But, how do I instruct to play the samples at a given (gPTP) time ?
Is this possible ?

Unfortunately this is not possible, the hardware doesn't provide such synchronization capabilities. ALSA provide timestamps, so does gPTP and you need a userspace part to tie them together. The only thing you can do is start a silent stream, query the system/audio synchronized timestamp and based on the information insert the samples at the relevant position. That latter part is unfortunately not very precise and will typically be impacted by the position of the DMA pointer. The timestamps are also only at the link level, and the delays introduced by the analog parts is also not modeled anywhere - and codec vendors usually don't provide this information.

You also want to take the audio timestamps in ns with a grain of salt, it turns out that the conversion uses a nominal value which introduces a bias compared to the actual value. This will be compensated for if your userspace component tracks clock drift.

Can someone please point me to code or doc, relevant to my goal ?
In essence, I would like to play the samples at the stroke of a given
(gPTP) time.

Also, the ALSA page says ...
"The link time can be directly measured if supported in hardware by
sample counters or wallclocks (e.g. with HDAudio 24MHz or PTP clock
for networked solutions)"

What is the connection between PTP clock and sound card here,
are there sound cards that can latch on to a PTP clock on a NIC or what ?
There is no connection on an HDaudio platform. The audio clock is based on the 24 MHz PLL which is independent from any network clock.

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux