[alsa-devel] SPDIF receiver with dynamically changing sample rate

Clemens Ladisch clemens at ladisch.de
Sat Nov 12 16:36:14 CET 2011

Sam Hawkens wrote:
> I want to do the following: write an application that has its input fed from an
> SPDIF receiver without using sample rate conversion. The sample rate must not be
> set by the application but must be defined by the SPDIF receiver's PLL.

Most S/PDIF inputs do not resample, but this depends on the hardware.

> Is it possible to run the application continously with ALSA even if the sample
> rate changes?

Most drivers ignore the rate requested by the application and return the samples
as they come from the input.  Only the AK411* drivers monitor the rate and stop
the stream on changes.

> If yes, how can the application notice the change in sample rate?

This is usually not possible without measuring the rate at which samples arrive.
However, you could check the declared rate of the sender by monitoring the
channel status bits.


More information about the Alsa-devel mailing list