S/PDIF Capture Details

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

 



I'm writing a program to open an ALSA device (USB S/PDIF) and capture
the bitstream. Aside from having to tackle the bits about deciding
whether the stream is PCM versus something else, I first have to
figure out how to *properly* open the device for capture.
Unfortunately, what programs I've seen that do seem to work in this
capacities are littered with all kinds of other crap to serve as a
real reference. Documentation is pitiful, at best, unless I've
completely missed whatever page it's on the internet.

So, assuming I can find the card and open it using snd_pcm_open I need
to then configure the hardware parameters.

My current attempt is to do the following ...

snd_pcm_hw_params_set_access(..., ..., SND_PCM_ACCESS_RW_INTERLEAVED)
snd_pcm_hw_params_set_format(..., ..., SND_PCM_FORMAT_S16)
snd_pcm_hw_params_set_channels(..., ..., 2)
snd_pcm_hw_params_set_rate_near(..., ..., 48000, 0)

However, I'm not entirely clear what I'll get from this device. The
S/PDIF standard talks about 32-bit words (which would be one frame
read from the above configuration) that can be parsed to get the
headers and payload. Will I be reading that, or the "payload" with the
headers stripped off? Also, what if the device to which I am connected
is a CD player outputting data at 44.1 KHz? I've set the sample rate
(do I really need to?) so will that adversely affect how I'm reading
data?

Lots of questions but maybe because I'm the kind of person that deals
with concise examples I haven't figured out the answers yet.


Paul Braman

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux