17 Mar
2011
17 Mar
'11
8:39 a.m.
Patrick Lai wrote:
Where can I find user-space code snippet to see how ALSA is configured for IEC958 playback?
Use the ALSA device name "iec958" (or its alias "spdif"). For another than the default sound card, use "iec958:x".
For compressed formats, you have to set the non-audio bit. Thise device has four parameters AES0..3 for the four bytes of S/PDIF metainformation. The non-audio bit can be set by adding the parameter "AES0=6"; the complete device name then looks like "spdif:AES0=6" or "spdif:other=parameters,AES0=6" or "spdif:{ other-parameters ... AES0=6 }".
The try_open_device function of mplayer tries to do this: http://git.mplayerhq.hu/?p=mplayer;a=blob;hb=HEAD;f=libao2/ao_alsa.c
Regards, Clemens