* Complex hw buffer with MMAP_COMPLEX?
@ 2012-10-09 13:17 Adrian Knoth
2012-10-09 13:49 ` Clemens Ladisch
0 siblings, 1 reply; 4+ messages in thread
From: Adrian Knoth @ 2012-10-09 13:17 UTC (permalink / raw)
To: alsa-devel; +Cc: Andre Schramm
Hi!
I'm about to start working on the driver for the new RME MADI FX card
with its 194 input and 196 output channels.
I've noticed that the device has a rather uncommon hw buffer layout.
Let's stick to the input side for the sake of simplicity:
2ch AES, interleaved
8ch MADI 001-008, interleaved
8ch MADI 009-015, interleaved
[..]
8ch MADI 184-192, interleaved
On the output side, there is another stereo pair for headphones.
That is, we're dealing with 25 (or 26 for output) interleaved streams
with two or eight channels each.
How could we represent such a layout in ALSA, that is, how are we
talking to userspace? Would one create subdevices and rejoin them via
plughw? Or use MMAP_COMPLEX and then let every application deal with it
on its own? It's certainly not a problem to special-case the MADI FX in
jackd1 and jackd2, but OTOH, this would require other ALSA apps to do
the same (I'm thinking of proprietary custom code).
I wonder if we could afford to rearrange the buffers in the driver and
expose a single non-interleaved buffer to userspace.
WDYT?
TIA
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Complex hw buffer with MMAP_COMPLEX?
2012-10-09 13:17 Complex hw buffer with MMAP_COMPLEX? Adrian Knoth
@ 2012-10-09 13:49 ` Clemens Ladisch
2012-10-09 14:09 ` Adrian Knoth
0 siblings, 1 reply; 4+ messages in thread
From: Clemens Ladisch @ 2012-10-09 13:49 UTC (permalink / raw)
To: Adrian Knoth; +Cc: alsa-devel, Andre Schramm
Adrian Knoth wrote:
> That is, we're dealing with 25 (or 26 for output) interleaved streams
> with two or eight channels each.
>
> How could we represent such a layout in ALSA, that is, how are we
> talking to userspace? Would one create subdevices and rejoin them via
> plughw?
Is it possible to start/stop the streams independently?
If yes, this might be useful.
(And subdevices are usually used for streams that are mixed together.)
> Or use MMAP_COMPLEX and then let every application deal with it
> on its own?
Alsa-lib can automatically convert this. Applications that insist
on using hw devices have to deal with it (Jack does).
Regards,
Clemens
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Complex hw buffer with MMAP_COMPLEX?
2012-10-09 13:49 ` Clemens Ladisch
@ 2012-10-09 14:09 ` Adrian Knoth
2012-10-09 14:19 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Adrian Knoth @ 2012-10-09 14:09 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel, Andre Schramm
On Tue, Oct 09, 2012 at 03:49:32PM +0200, Clemens Ladisch wrote:
> > That is, we're dealing with 25 (or 26 for output) interleaved streams
> > with two or eight channels each.
> >
> > How could we represent such a layout in ALSA, that is, how are we
> > talking to userspace? Would one create subdevices and rejoin them via
> > plughw?
>
> Is it possible to start/stop the streams independently?
No, there's only a single start/stop call for the entire card.
> > Or use MMAP_COMPLEX and then let every application deal with it
> > on its own?
>
> Alsa-lib can automatically convert this.
The only remaining question is how to tell alsa-lib about the buffer
layout.
AFAIKS, there's not even a single driver that uses MMAP_COMPLEX atm.
Cheers
--
mail: adi@thur.de http://adi.thur.de PGP/GPG: key via keyserver
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Complex hw buffer with MMAP_COMPLEX?
2012-10-09 14:09 ` Adrian Knoth
@ 2012-10-09 14:19 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2012-10-09 14:19 UTC (permalink / raw)
To: Adrian Knoth; +Cc: alsa-devel, Clemens Ladisch, Andre Schramm
At Tue, 9 Oct 2012 16:09:11 +0200,
Adrian Knoth wrote:
>
> On Tue, Oct 09, 2012 at 03:49:32PM +0200, Clemens Ladisch wrote:
>
> > > That is, we're dealing with 25 (or 26 for output) interleaved streams
> > > with two or eight channels each.
> > >
> > > How could we represent such a layout in ALSA, that is, how are we
> > > talking to userspace? Would one create subdevices and rejoin them via
> > > plughw?
> >
> > Is it possible to start/stop the streams independently?
>
> No, there's only a single start/stop call for the entire card.
>
> > > Or use MMAP_COMPLEX and then let every application deal with it
> > > on its own?
> >
> > Alsa-lib can automatically convert this.
>
> The only remaining question is how to tell alsa-lib about the buffer
> layout.
Pass SNDRV_PCM_INFO_COMPLEX to hw.info bit flags.
Then set up the channel_info via PCM ioctl ops.
> AFAIKS, there's not even a single driver that uses MMAP_COMPLEX atm.
Right. So far only in alsa-lib plugins.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-09 14:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 13:17 Complex hw buffer with MMAP_COMPLEX? Adrian Knoth
2012-10-09 13:49 ` Clemens Ladisch
2012-10-09 14:09 ` Adrian Knoth
2012-10-09 14:19 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox