From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Assaf Hoffman" Subject: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 15:07:23 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1415330122==" Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: alsa-devel@lists.sourceforge.net Cc: Rita Shtern List-Id: alsa-devel@alsa-project.org This is a multi-part message in MIME format. --===============1415330122== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6ED36.413285B0" This is a multi-part message in MIME format. ------_=_NextPart_001_01C6ED36.413285B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I'm mew to sound and ALSA. My project deals with PCM in standard (I2S) mode and IEC958 (SPDIF) mode.=20 Can anyone tell me how the ALSA stack expects to "see" the data received form the sound device? I mean, what is the format of the data DMA'ed from the sound device to DRAM that the ALSA stack expects?=20 Is this raw sound data? SPDIF frame includes non sound data as well. Does the sound card HW strip the sound payload from the IEC958 frame to deliver the raw sound data to the ALSA buffer?=20 Please shed some light... Many thanks.=20 =20 =20 =20 =20 =20 =20 MOVING FORWARD FASTER =20 =20 Assaf Hoffman - Senior SW engineer Marvell Semiconductor Israel Ltd 6 Hamada Street=20 Mordot HaCarmel Industrial Park Yokneam 20692, ISRAEL Email - hoffman@marvell.com Tel - + 972 4 9091203=20 Fax - + 972 4 9091565 WWW Page: http://www.marvell.com=20 This message may contain confidential, proprietary or legally privileged information. The information is intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone or by e-mail and delete the message from your computer. =20 =20 =20 ------_=_NextPart_001_01C6ED36.413285B0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

I’m mew to sound and = ALSA.

My project deals with PCM in standard (I2S) mode and = IEC958 (SPDIF) mode.

Can anyone tell me how the ALSA stack expects to = “see” the data received form the sound device? I mean, what is the format of = the data DMA’ed from the sound device to DRAM that the ALSA stack expects? =

Is this raw sound data? SPDIF frame includes non = sound data as well. Does the sound card HW strip the sound payload from the IEC958 = frame to deliver the raw sound data to the ALSA buffer? =

Please shed some = light…

Many thanks.

 

 

 

 

MOVING FORWARD = FASTER

=

 

Assaf Hoffman – Senior SW engineer
Marvell Semiconductor Israel Ltd
6 Hamada Street
Mordot HaCarmel Industrial Park
Yokneam 20692, ISRAEL
Email - hoffman@marvell.com
Tel - + 972 4 9091203
Fax - + 972 4 9091565
WWW Page: http://www.marvell.com

This message may contain confidential, proprietary or legally privileged information. The information is intended only for the = use of the individual or entity named above. If the reader of this = message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in = error, please notify us immediately by telephone or by e-mail and = delete the message from your computer.

 

 

 

------_=_NextPart_001_01C6ED36.413285B0-- --===============1415330122== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --===============1415330122== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Alsa-devel mailing list Alsa-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/alsa-devel --===============1415330122==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Courtier-Dutton Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 14:53:30 +0100 Message-ID: <452CF75A.5060706@superbug.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Assaf Hoffman Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Assaf Hoffman wrote: > Hi, > > I'm mew to sound and ALSA. > > My project deals with PCM in standard (I2S) mode and IEC958 (SPDIF) > mode. > > Can anyone tell me how the ALSA stack expects to "see" the data received > form the sound device? I mean, what is the format of the data DMA'ed > from the sound device to DRAM that the ALSA stack expects? > > Is this raw sound data? SPDIF frame includes non sound data as well. > Does the sound card HW strip the sound payload from the IEC958 frame to > deliver the raw sound data to the ALSA buffer? > > Please shed some light... > > Many thanks. > > ALSA can deal with all the different formats that the sound device might deliver. The low level sound driver simply tells the upper layers what formats are available. ALSA then handles those formats and all format conversion required to reach the user space application. It depends what your device does as to which format ALSA will see. James ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Assaf Hoffman" Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 16:08:43 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: James Courtier-Dutton Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Thank you for your reply. Please let me clarify. What you say is that my device can deliver a raw ICE958 data from the capture channel to the DMA buffer and the ALSA stack will know how to deal with it? No need for the device to strip down the payload and only then transfer it to the DMA buffer? In case the sound card can strip down the IEC958 frames into raw sound data + ch status + user data, how would the ALSA stack expect the data? Is there an API for that? Thanks again. -----Original Message----- From: James Courtier-Dutton [mailto:James@superbug.co.uk] Sent: Wednesday, October 11, 2006 3:54 PM To: Assaf Hoffman Cc: alsa-devel@lists.sourceforge.net; Rita Shtern Subject: Re: [Alsa-devel] ALSA snd_xferi_t buffer arrangment Assaf Hoffman wrote: > Hi, > > I'm mew to sound and ALSA. > > My project deals with PCM in standard (I2S) mode and IEC958 (SPDIF) > mode. > > Can anyone tell me how the ALSA stack expects to "see" the data received > form the sound device? I mean, what is the format of the data DMA'ed > from the sound device to DRAM that the ALSA stack expects? > > Is this raw sound data? SPDIF frame includes non sound data as well. > Does the sound card HW strip the sound payload from the IEC958 frame to > deliver the raw sound data to the ALSA buffer? > > Please shed some light... > > Many thanks. > > ALSA can deal with all the different formats that the sound device might deliver. The low level sound driver simply tells the upper layers what formats are available. ALSA then handles those formats and all format conversion required to reach the user space application. It depends what your device does as to which format ALSA will see. James ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Courtier-Dutton Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 15:22:56 +0100 Message-ID: <452CFE40.2020705@superbug.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Assaf Hoffman Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Assaf Hoffman wrote: > Thank you for your reply. > Please let me clarify. What you say is that my device can deliver a raw > ICE958 data from the capture channel to the DMA buffer and the ALSA > stack will know how to deal with it? No need for the device to strip > down the payload and only then transfer it to the DMA buffer? > In case the sound card can strip down the IEC958 frames into raw sound > data + ch status + user data, how would the ALSA stack expect the data? > Is there an API for that? > Thanks again. > If you don't strip the IEC958 frames, tell ALSA the format is: SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE If you do strip the IEC958 frames, tell ALSA the format is: SNDRV_PCM_FMTBIT_S24_LE or SNDRV_PCM_FMTBIT_S16_LE Or whatever format your hardware decides to send. The API for this is contained in the following structure in the sound driver: This example is from the snd-emu10k1 driver. static struct snd_pcm_hardware snd_emu10k1_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID), .formats = SNDRV_PCM_FMTBIT_S16_LE, .rates = SNDRV_PCM_RATE_8000_48000, .rate_min = 8000, .rate_max = 48000, .channels_min = 1, .channels_max = 2, .buffer_bytes_max = (64*1024), .period_bytes_min = 384, .period_bytes_max = (64*1024), .periods_min = 2, .periods_max = 2, .fifo_size = 0, }; As you can see, it tells use that this device can do only SNDRV_PCM_FMTBIT_S16_LE format. James ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Assaf Hoffman" Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 16:52:30 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: James Courtier-Dutton Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Hi, Thanks again for clear answers. In case the HW strip the IEC958 frames, where the ALSA stack expect to find the various frame data fields such as perr, valid bit, audio sample, user data and channel status? Is there a data structure the HW should follow when DMAing the striped data to the DRAM buffer? What do you think of such acceleration? Does this saves a significant CPU time processing the ICE958 frames? Many thanks. P.S. I was looking into the ASLA stack and I could find SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_XX only in snd_pcm_hardware structure initialization. I could not see where it is used to tell the ALSA to process the data as IEC958 frames. -----Original Message----- From: James Courtier-Dutton [mailto:James@superbug.co.uk] Sent: Wednesday, October 11, 2006 4:23 PM To: Assaf Hoffman Cc: alsa-devel@lists.sourceforge.net; Rita Shtern Subject: Re: [Alsa-devel] ALSA snd_xferi_t buffer arrangment Assaf Hoffman wrote: > Thank you for your reply. > Please let me clarify. What you say is that my device can deliver a raw > ICE958 data from the capture channel to the DMA buffer and the ALSA > stack will know how to deal with it? No need for the device to strip > down the payload and only then transfer it to the DMA buffer? > In case the sound card can strip down the IEC958 frames into raw sound > data + ch status + user data, how would the ALSA stack expect the data? > Is there an API for that? > Thanks again. > If you don't strip the IEC958 frames, tell ALSA the format is: SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE If you do strip the IEC958 frames, tell ALSA the format is: SNDRV_PCM_FMTBIT_S24_LE or SNDRV_PCM_FMTBIT_S16_LE Or whatever format your hardware decides to send. The API for this is contained in the following structure in the sound driver: This example is from the snd-emu10k1 driver. static struct snd_pcm_hardware snd_emu10k1_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID), .formats = SNDRV_PCM_FMTBIT_S16_LE, .rates = SNDRV_PCM_RATE_8000_48000, .rate_min = 8000, .rate_max = 48000, .channels_min = 1, .channels_max = 2, .buffer_bytes_max = (64*1024), .period_bytes_min = 384, .period_bytes_max = (64*1024), .periods_min = 2, .periods_max = 2, .fifo_size = 0, }; As you can see, it tells use that this device can do only SNDRV_PCM_FMTBIT_S16_LE format. James ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Courtier-Dutton Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 16:00:54 +0100 Message-ID: <452D0726.9090604@superbug.co.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Assaf Hoffman Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Assaf Hoffman wrote: > Hi, > Thanks again for clear answers. > In case the HW strip the IEC958 frames, where the ALSA stack expect to > find the various frame data fields such as perr, valid bit, audio > sample, user data and channel status? Is there a data structure the HW > should follow when DMAing the striped data to the DRAM buffer? > What do you think of such acceleration? Does this saves a significant > CPU time processing the ICE958 frames? > Many thanks. > P.S. > I was looking into the ASLA stack and I could find > SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_XX only in snd_pcm_hardware structure > initialization. I could not see where it is used to tell the ALSA to > process the data as IEC958 frames. > A majority of sound cards strip the frame, and only put the audio samples in the DMA buffer. The sound card then stores the valid bits, non-audio bit, user data etc. in a separate register on the sound card. The processing of the IEC958 frames is done in alsa-lib. ALSA has two parts, and kernel part, and a user space lib. The kernel part does as little as possible, with the user space part doing all the format conversion etc. I have not looked closely, but I don't know if the alsa-lib decodes the IEC958 frames or not yet. James ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 17:17:34 +0200 Message-ID: References: <452D0726.9090604@superbug.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <452D0726.9090604@superbug.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: James Courtier-Dutton Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 11 Oct 2006 16:00:54 +0100, James Courtier-Dutton wrote: > > Assaf Hoffman wrote: > > Hi, > > Thanks again for clear answers. > > In case the HW strip the IEC958 frames, where the ALSA stack expect to > > find the various frame data fields such as perr, valid bit, audio > > sample, user data and channel status? Is there a data structure the HW > > should follow when DMAing the striped data to the DRAM buffer? > > What do you think of such acceleration? Does this saves a significant > > CPU time processing the ICE958 frames? > > Many thanks. > > P.S. > > I was looking into the ASLA stack and I could find > > SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_XX only in snd_pcm_hardware structure > > initialization. I could not see where it is used to tell the ALSA to > > process the data as IEC958 frames. > > > > A majority of sound cards strip the frame, and only put the audio > samples in the DMA buffer. The sound card then stores the valid bits, > non-audio bit, user data etc. in a separate register on the sound card. > > The processing of the IEC958 frames is done in alsa-lib. > ALSA has two parts, and kernel part, and a user space lib. > The kernel part does as little as possible, with the user space part > doing all the format conversion etc. > > I have not looked closely, but I don't know if the alsa-lib decodes the > IEC958 frames or not yet. It can. iec958 plugin does encode/decode IEC958 frames. 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 17:22:01 +0200 Message-ID: References: <452D0726.9090604@superbug.co.uk> <452D0B90.4050407@superbug.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <452D0B90.4050407@superbug.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: James Courtier-Dutton Cc: alsa-devel@lists.sourceforge.net, Rita Shtern List-Id: alsa-devel@alsa-project.org At Wed, 11 Oct 2006 16:19:44 +0100, James Courtier-Dutton wrote: > > Takashi Iwai wrote: > > At Wed, 11 Oct 2006 16:00:54 +0100, > > James Courtier-Dutton wrote: > >> Assaf Hoffman wrote: > >>> Hi, > >>> Thanks again for clear answers. > >>> In case the HW strip the IEC958 frames, where the ALSA stack expect to > >>> find the various frame data fields such as perr, valid bit, audio > >>> sample, user data and channel status? Is there a data structure the HW > >>> should follow when DMAing the striped data to the DRAM buffer? > >>> What do you think of such acceleration? Does this saves a significant > >>> CPU time processing the ICE958 frames? > >>> Many thanks. > >>> P.S. > >>> I was looking into the ASLA stack and I could find > >>> SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_XX only in snd_pcm_hardware structure > >>> initialization. I could not see where it is used to tell the ALSA to > >>> process the data as IEC958 frames. > >>> > >> A majority of sound cards strip the frame, and only put the audio > >> samples in the DMA buffer. The sound card then stores the valid bits, > >> non-audio bit, user data etc. in a separate register on the sound card. > >> > >> The processing of the IEC958 frames is done in alsa-lib. > >> ALSA has two parts, and kernel part, and a user space lib. > >> The kernel part does as little as possible, with the user space part > >> doing all the format conversion etc. > >> > >> I have not looked closely, but I don't know if the alsa-lib decodes the > >> IEC958 frames or not yet. > > > > It can. iec958 plugin does encode/decode IEC958 frames. > > > > > > Takashi > > Does it let the user app set the valid, non-audio etc. bits? Yes, it takes arguments. 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Courtier-Dutton Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 16:19:44 +0100 Message-ID: <452D0B90.4050407@superbug.co.uk> References: <452D0726.9090604@superbug.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Takashi Iwai Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Takashi Iwai wrote: > At Wed, 11 Oct 2006 16:00:54 +0100, > James Courtier-Dutton wrote: >> Assaf Hoffman wrote: >>> Hi, >>> Thanks again for clear answers. >>> In case the HW strip the IEC958 frames, where the ALSA stack expect to >>> find the various frame data fields such as perr, valid bit, audio >>> sample, user data and channel status? Is there a data structure the HW >>> should follow when DMAing the striped data to the DRAM buffer? >>> What do you think of such acceleration? Does this saves a significant >>> CPU time processing the ICE958 frames? >>> Many thanks. >>> P.S. >>> I was looking into the ASLA stack and I could find >>> SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_XX only in snd_pcm_hardware structure >>> initialization. I could not see where it is used to tell the ALSA to >>> process the data as IEC958 frames. >>> >> A majority of sound cards strip the frame, and only put the audio >> samples in the DMA buffer. The sound card then stores the valid bits, >> non-audio bit, user data etc. in a separate register on the sound card. >> >> The processing of the IEC958 frames is done in alsa-lib. >> ALSA has two parts, and kernel part, and a user space lib. >> The kernel part does as little as possible, with the user space part >> doing all the format conversion etc. >> >> I have not looked closely, but I don't know if the alsa-lib decodes the >> IEC958 frames or not yet. > > It can. iec958 plugin does encode/decode IEC958 frames. > > > Takashi Does it let the user app set the valid, non-audio etc. bits? ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Assaf Hoffman" Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 11 Oct 2006 17:40:49 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: James Courtier-Dutton Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Hi, Thank you for your reply. I would be happy if you kindly reply to the following questions: 1) According to your experience, is it correct to assume that once a PCM instance for playback/capture is prepared and triggered, the user data and channel status are constants during data transmit/receive? 2) In the case HW saves the user data and channel status in its internal registers, how would the ALSA stack know of any of them changed? 3) Is there a bridge application in the ALSA stack (kerne)? I mean, in case I would like to capture ICE958 frames and route them to ICE958 playback channel. Thanks. -----Original Message----- From: James Courtier-Dutton [mailto:James@superbug.co.uk] Sent: Wednesday, October 11, 2006 5:01 PM To: Assaf Hoffman Cc: alsa-devel@lists.sourceforge.net; Rita Shtern Subject: Re: [Alsa-devel] ALSA snd_xferi_t buffer arrangment Assaf Hoffman wrote: > Hi, > Thanks again for clear answers. > In case the HW strip the IEC958 frames, where the ALSA stack expect to > find the various frame data fields such as perr, valid bit, audio > sample, user data and channel status? Is there a data structure the HW > should follow when DMAing the striped data to the DRAM buffer? > What do you think of such acceleration? Does this saves a significant > CPU time processing the ICE958 frames? > Many thanks. > P.S. > I was looking into the ASLA stack and I could find > SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_XX only in snd_pcm_hardware structure > initialization. I could not see where it is used to tell the ALSA to > process the data as IEC958 frames. > A majority of sound cards strip the frame, and only put the audio samples in the DMA buffer. The sound card then stores the valid bits, non-audio bit, user data etc. in a separate register on the sound card. The processing of the IEC958 frames is done in alsa-lib. ALSA has two parts, and kernel part, and a user space lib. The kernel part does as little as possible, with the user space part doing all the format conversion etc. I have not looked closely, but I don't know if the alsa-lib decodes the IEC958 frames or not yet. James ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Assaf Hoffman" Subject: Re: ALSA snd_xferi_t buffer arrangment Date: Wed, 18 Oct 2006 08:31:56 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: James Courtier-Dutton Cc: Rita Shtern , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Hi, The ALSA PCM supported formats are located in pcm.h file. Where can I find the specification (bit fields) of those PCM formats? Many thanks. -----Original Message----- From: James Courtier-Dutton [mailto:James@superbug.co.uk] Sent: Wednesday, October 11, 2006 3:54 PM To: Assaf Hoffman Cc: alsa-devel@lists.sourceforge.net; Rita Shtern Subject: Re: [Alsa-devel] ALSA snd_xferi_t buffer arrangment Assaf Hoffman wrote: > Hi, > > I'm mew to sound and ALSA. > > My project deals with PCM in standard (I2S) mode and IEC958 (SPDIF) > mode. > > Can anyone tell me how the ALSA stack expects to "see" the data received > form the sound device? I mean, what is the format of the data DMA'ed > from the sound device to DRAM that the ALSA stack expects? > > Is this raw sound data? SPDIF frame includes non sound data as well. > Does the sound card HW strip the sound payload from the IEC958 frame to > deliver the raw sound data to the ALSA buffer? > > Please shed some light... > > Many thanks. > > ALSA can deal with all the different formats that the sound device might deliver. The low level sound driver simply tells the upper layers what formats are available. ALSA then handles those formats and all format conversion required to reach the user space application. It depends what your device does as to which format ALSA will see. James ------------------------------------------------------------------------- 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