Hi, Where can I find the code for alsa-lib IEC958 plugin? Thanks. -----Original Message----- From: Takashi Iwai [mailto:tiwai@xxxxxxx] Sent: Wednesday, October 18, 2006 1:34 PM To: Assaf Hoffman Cc: alsa-devel@xxxxxxxxxxxxxxxxxxxxx; Rita Shtern Subject: Re: ALSA PCM data format Importance: Low At Wed, 18 Oct 2006 09:33:23 +0200, Assaf Hoffman wrote: > > Hi, > I'm new to ALSA and I would be happy if anyone can explain the format of > the data the ALSA stack is expecting to find in its buffer. > For example, if I support IEC958 frames that contains 20bit PMC sample > in each sub-frame payload, (total of 40 bits per frame), the HW, which > is capable of striping down the sound sample will DMA to the buffer 40 > bits of sound sample. The following frame containing the next 40bits > will be placed right after the last 40 bits, creating a total of 80 bits > in the DMA buffer. > Is that correct? If the hardware supports the raw SPDIF frames, then yes, you can pass the data embedded in IEC958 subframes, including preamble, channel status and parity bits. More exactly, it consists of: bit 0-3 = preamble 4-7 = AUX (=0) 8-27 = data (12-27 for 16bit, 8-27 for 20bit, and 24bit without AUX) 28 = validity (0 for valid data, else 'in error') 29 = user data (0) 30 = channel status (24 bytes for 192 frames) 31 = parity But, this is optional. The alsa-lib plugin does this conversion if necessary. If the hardware doesn't support the raw SPDIF frames, you pass only the PCM data and set up IEC958 status bits externally. Usually it's packed in either 2-byte, 3-byte or 4-byte samples formats. Takashi ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-devel