Index | Thread | Search

From:
Jan Stary <hans@stare.cz>
Subject:
Re: aucat: Add generic channel mapping in place of -j and -c options.
To:
Alexandre Ratchov <alex@caoua.org>
Cc:
tech@openbsd.org
Date:
Mon, 18 Mar 2024 16:28:36 +0100

Download raw body.

Thread
On Mar 18 15:36:51, alex@caoua.org wrote:
> On Mon, Mar 18, 2024 at 01:30:51PM +0100, Jan Stary wrote:
> > I find the swapped order of A/B in -m A/B for -o files
> > a bit confusing; for example, the manpage example
> > 
> > 	aucat -n -i stereo.wav -c 1
> > 		-m 0:0/0:0 -o left.wav
> > 		-m 0:0/1:1 -o right.wav
> > 
> > creates the right.wav having the (only) 0:0 channel
> > take its data *from* the 1:1 channel of -i stereo.wav;
> > 
> > It is one of the two possibilities of course,
> > but having the meaning of -m A/B uniform of both -i and -o files
> > would be slightly less confusing imho.
> > 
> 
> Well, it's uniform: file channels first, followed by device channels.
> 
> But I get your point: my eyes are also used to see the producer
> followed by the consumer. Indeed, producer and consumer get swapped:
> the file is the producer in the playback case, and consumer in the
> recording case).

Producer and consumer is a better wording for what I had in mind.

> > > +.It Fl m Ar min : Ns Ar max Ns / Ns Ar min : Ns Ar max
> > > +Map the given range of file channels into the given range of
> > > +device channels.
> > 
> > If it stays swapped as in the current diff,
> > the manpage should perhaps say so explicitly.
> 
> The man page is correct (file first, device second).
> But they look swapped if you think in terms of producer vs consumer.

Right, that's exactly my confusion; isn't it one of the big wins
of unix in general to not have to differentiate between "file" and
"device"? Here, the semantics depends on exactly that distinction.

(But this is as fine as the other possibility of course,
just requires to think of them in this way.)

> > Also, with -n, there is no "device", so no "device channels".
> > Would it be clearer to talk about "input channels" and "output channels"
> > instead in the Fl m portion of the manpage?
> 
> Yeah, we should explain what -n does: FWIW, it creates an internal
> pseudo-device that records what it plays. So the concept of device
> channels remains. Or should we say "bus" instead of device?

I like the producer/consumer nomenclature, as it is the closest
to how I think about a signal route - not in terms of files and devices.

	Jan