All of lore.kernel.org
 help / color / mirror / Atom feed
* question for the snd_pcm_mmap_writen.
@ 2011-10-11 12:06 Anders Gnistrup
  2011-10-11 14:23 ` Clemens Ladisch
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Gnistrup @ 2011-10-11 12:06 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Hi

First post to the mail list.
I have been reading through the Alsa API and tutorials and it all seems fairly simple.
But I still have some questions for the sample format possible to send using the mmap method.

First a short description of my problem.
I have a embedded device with a 8 channel audio chip.
I only have to use 5 of these channels
My goal is not to use any cpu cycles on the 3 unused channels

I have decided to use the non-interleaved method (application specific, streams comes from different sources in a correct hardware specific format).

For this, the function snd_pcm_mmap_writen could be used.
When sending data to the device the format should/could be done using a 5 seperate buffers.

snd_pcm_sframes_t snd_pcm_mmap_writen 	(snd_pcm_t *  	pcm,
                                                                 void **  	bufs,
                                                                 snd_pcm_uframes_t  	size)

where *bufs[0] equal to first channel *bufs[1] equals to next etc.
Q1)
Should/must the **bufs be continuations -> bufs[0][size]==bufs[1][0]???

Q2)
Is is possible the set bufs[2] == NULL, to signal that the channel is unused?

I think I know the answers.
Yes, it should be continues, No data can be set to NULL.

Q3)
I have tried to find some information about the SND_PCM_ACCESS_MMAP_COMPLEX. What is this??? 
My best gees is that it is some entirely hardware specific access format?


Regards Anders Gnistrup  

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

* Re: question for the snd_pcm_mmap_writen.
  2011-10-11 12:06 question for the snd_pcm_mmap_writen Anders Gnistrup
@ 2011-10-11 14:23 ` Clemens Ladisch
  0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2011-10-11 14:23 UTC (permalink / raw)
  To: Anders Gnistrup; +Cc: alsa-devel@alsa-project.org

On 10/11/2011 02:06 PM, Anders Gnistrup wrote:
> I have a embedded device with a 8 channel audio chip.
> I only have to use 5 of these channels
> My goal is not to use any cpu cycles on the 3 unused channels
>
> I have decided to use the non-interleaved method

This helps only if your device actually supports non-interleaved data.
Otherwise, the samples of all eight channels will have to be converted.

> For this, the function snd_pcm_mmap_writen could be used.

Please note that using mmap makes sense only if you write the data
directly into the device's buffer.  If you only use snd_pcm_mmap_write*,
you could just as well use snd_pcm_write* without mmap.

> Q1)
> Should/must the **bufs be continuations -> bufs[0][size]==bufs[1][0]???

No.

> Q2)
> Is is possible the set bufs[2] == NULL, to signal that the channel is unused?

No, all channels must have data.

> Q3)
> I have tried to find some information about the SND_PCM_ACCESS_MMAP_COMPLEX. What is this???

Typically, it's used for devices that are constructed by mergng multiple
interleaved streams.  Each channel is described by the address of its
first sample and the distance between two consecutive samples.


Regards,
Clemens

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

end of thread, other threads:[~2011-10-11 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-11 12:06 question for the snd_pcm_mmap_writen Anders Gnistrup
2011-10-11 14:23 ` 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.