All of lore.kernel.org
 help / color / mirror / Atom feed
* Digital IO and SPDIF format
@ 2011-02-01 15:03 Torsten Schenk
  2011-02-01 16:32 ` Clemens Ladisch
  0 siblings, 1 reply; 2+ messages in thread
From: Torsten Schenk @ 2011-02-01 15:03 UTC (permalink / raw)
  To: alsa-devel

Hello,

I'm currenty trying to make digital IO working for snd-usb-6fire. I figured out what the card does but I don't know how things (especially input) should be handled in alsa. Unfortunately it is relatively hard to find documentation on that topic so that I decided to ask the pros.

The card can receive the whole spdif subframe with all bits (BMW + at least channel status bit and parity bit, but I guess also the other two).
It also does receive two spdif-frames per frame (making it possible to receive f.ex. 96kHz digital audio if 6fire's sample rate is set to 48kHz)
This also leads to the fact that the 6fire does not drop spdif frames if playback device's sample rate is not very much higher than 6fire's. If the playback device's clock is a bit quicker (up to twice the speed) than the 6fire's one, the 6fire simply captures a frame (when neccesary) that contains two spdif frames.

My question is (concerning capturing):
How should I handle:
- if 6fire's clock and playback device's clock differ, should I use playback device's clock (no interpolation of samples but capturing tool might have invalid sample rate information) or the 6fire's clock (samples need to be interpolated somehow)?
- if the 6fire's clock should be used, are small clock drifts acceptable without interpolation?
- in case of interpolation: how?
- should I receive a whole spdif block (usually 192 spdif frames) and use the information I got from the block (f.ex. left/right channel bits) before copying it to alsa or should I directly copy every frame to alsa?

Concerning (also output):
Am I correct in assuming that SNDRV_PCM_FORMAT_IEC958_SUBFRAME_XX samples are formatted like in the specification (4 bit preamble, 24 bit audio data, VUCP flags)? If you know of any tool that is able to handle this format, please let me know so that I have a basis to test the whole stuff.

Thanks,
Torsten

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

* Re: Digital IO and SPDIF format
  2011-02-01 15:03 Digital IO and SPDIF format Torsten Schenk
@ 2011-02-01 16:32 ` Clemens Ladisch
  0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2011-02-01 16:32 UTC (permalink / raw)
  To: Torsten Schenk; +Cc: alsa-devel

Torsten Schenk wrote:
> - if 6fire's clock and playback device's clock differ, should I use
> playback device's clock (no interpolation of samples but capturing
> tool might have invalid sample rate information) or the 6fire's clock
> (samples need to be interpolated somehow)?

You should never change the captured samples.  A digital frame might
be transporting AC-3/DTS data.

> - should I receive a whole spdif block (usually 192 spdif frames) and
> use the information I got from the block (f.ex. left/right channel
> bits) before copying it to alsa or should I directly copy every frame
> to alsa?

When copying data from the URB buffer to ALSA's buffer, copy only the
frames that are actually present.  Why would you need the whole block
for this?

> Am I correct in assuming that SNDRV_PCM_FORMAT_IEC958_SUBFRAME_XX
> samples are formatted like in the specification?

Er ... the format of these samples is what the old revision of the
CMI8738 chip requires.

> If you know of any tool that is able to handle this format

alsa-lib/src/pcm/pcm_iec958.c


Regards,
Clemens

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

end of thread, other threads:[~2011-02-01 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-01 15:03 Digital IO and SPDIF format Torsten Schenk
2011-02-01 16:32 ` 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.