All of lore.kernel.org
 help / color / mirror / Atom feed
* MMAP in ALSA
@ 2010-05-25  0:16 Varadarajan, Srikanth
  2010-05-25  5:35 ` pl bossart
  2010-05-25  8:55 ` Clemens Ladisch
  0 siblings, 2 replies; 3+ messages in thread
From: Varadarajan, Srikanth @ 2010-05-25  0:16 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Hi All,
I am new to the list and ALSA.

For the hardware I am working with, we expose it to ALSA as one card capable of playing one PCM stream.

If we have one application using the hardware through ALSA, other applications are unable to get access to it. So, we want to have PulseAudio on top and use the pulse virtual device to render audio through ALSA. Is this a recommended way of having multiple applications access one audio HW simultaneously? Is there any other way of handling multiple applications get access to the same hardware?

Also, why are mmap and munmap operations required in ALSA?
Right now, we do not have mmap and munmap operations exposed. Though the hardware constraints have "SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID" defined. Looks like, if we have to PulseAudio on top, mmap operations are required in ALSA.

If there is a close enough ALSA implementation in the current Linux kernel that I can lookup, please point me to that.

Any help/suggestions are welcome.

Thanks,
Srikanth

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

* Re: MMAP in ALSA
  2010-05-25  0:16 MMAP in ALSA Varadarajan, Srikanth
@ 2010-05-25  5:35 ` pl bossart
  2010-05-25  8:55 ` Clemens Ladisch
  1 sibling, 0 replies; 3+ messages in thread
From: pl bossart @ 2010-05-25  5:35 UTC (permalink / raw)
  To: Varadarajan, Srikanth; +Cc: alsa-devel@alsa-project.org

> Also, why are mmap and munmap operations required in ALSA?
> Right now, we do not have mmap and munmap operations exposed. Though the hardware constraints have "SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID" defined. Looks like, if we have to PulseAudio on top, mmap operations are required in ALSA.

mmap operations are not required by PulseAudio. Look at
pulseaudio/src/modules/alsa/alsa*.c, there's a mmap_write and a
unix_write.

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

* Re: MMAP in ALSA
  2010-05-25  0:16 MMAP in ALSA Varadarajan, Srikanth
  2010-05-25  5:35 ` pl bossart
@ 2010-05-25  8:55 ` Clemens Ladisch
  1 sibling, 0 replies; 3+ messages in thread
From: Clemens Ladisch @ 2010-05-25  8:55 UTC (permalink / raw)
  To: Varadarajan, Srikanth; +Cc: alsa-devel@alsa-project.org

Varadarajan, Srikanth wrote:
> If we have one application using the hardware through ALSA, other
> applications are unable to get access to it. So, we want to have
> PulseAudio on top and use the pulse virtual device to render audio
> through ALSA. Is this a recommended way of having multiple applications
> access one audio HW simultaneously?

Usually yes.

> Is there any other way of handling multiple applications get access to
> the same hardware?

With ALSA's dmix plugin, but this requires that the hardware supports
mmap, i.e., DMA to/from the main memory.

> Also, why are mmap and munmap operations required in ALSA?

They aren't, except for dmix.

> Right now, we do not have mmap and munmap operations exposed.
> Though the hardware constraints have "SNDRV_PCM_INFO_MMAP |
> SNDRV_PCM_INFO_MMAP_VALID" defined.

In most drivers, the buffer management, including mmap, is automatically
handled by the ALSA framework.

> If there is a close enough ALSA implementation in the current Linux
> kernel that I can lookup, please point me to that.

Close to what?  What kind of buffer does your device use, DMA in main
memory, memory-mapped device memory, or PIO?


Regards,
Clemens

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

end of thread, other threads:[~2010-05-25  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25  0:16 MMAP in ALSA Varadarajan, Srikanth
2010-05-25  5:35 ` pl bossart
2010-05-25  8:55 ` 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.