All of lore.kernel.org
 help / color / mirror / Atom feed
* SPDIF receiver with dynamically changing sample rate
@ 2011-11-12 12:39 Sam Hawkens
  2011-11-12 15:36 ` Clemens Ladisch
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Hawkens @ 2011-11-12 12:39 UTC (permalink / raw)
  To: alsa-devel

Hi,

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. 

Is it possible to run the application continously with ALSA even if the sample
rate changes? If yes, how can the application notice the change in sample rate?

Regards
Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SPDIF receiver with dynamically changing sample rate
  2011-11-12 12:39 Sam Hawkens
@ 2011-11-12 15:36 ` Clemens Ladisch
       [not found]   ` <4EBEF2C1.2000408@freenet.de>
  0 siblings, 1 reply; 4+ messages in thread
From: Clemens Ladisch @ 2011-11-12 15:36 UTC (permalink / raw)
  To: Sam Hawkens; +Cc: alsa-devel

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.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SPDIF receiver with dynamically changing sample rate
@ 2011-11-13  3:53 Sam Hawkens
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Hawkens @ 2011-11-13  3:53 UTC (permalink / raw)
  To: alsa-devel

Am 12.11.2011 16:36, schrieb Clemens Ladisch:

> 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.
OK, so that should work.

>> 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.
OK, so this could be a solution as long as the SPDIF stream carries correct channel stauts information (which is not alway the case). Still a good idea.
Some SPDIF receivers have an interrupt output that can be configured to be asserted when sample rate changes. With a custom hardware design that's another option in addition to the available ALSA features.

Thanx a lot for the good advice!

Regards,
Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SPDIF receiver with dynamically changing sample rate
       [not found]   ` <4EBEF2C1.2000408@freenet.de>
@ 2011-11-13  6:43     ` Clemens Ladisch
  0 siblings, 0 replies; 4+ messages in thread
From: Clemens Ladisch @ 2011-11-13  6:43 UTC (permalink / raw)
  To: Sam Hawkens, alsa-devel

Sam Hawkens wrote:
>Some SPDIF receivers have an interrupt output that can be configured to
>be asserted when sample rate changes.

If the driver supports this, it will notify you of changes
of the mixer control that contains the status bits.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-13  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-13  3:53 SPDIF receiver with dynamically changing sample rate Sam Hawkens
  -- strict thread matches above, loose matches on Subject: below --
2011-11-12 12:39 Sam Hawkens
2011-11-12 15:36 ` Clemens Ladisch
     [not found]   ` <4EBEF2C1.2000408@freenet.de>
2011-11-13  6:43     ` Clemens Ladisch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.