Re: [linux-audio-dev] Laaga "default" audio I/O hooks

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Laaga "default" audio I/O hooks
From: Jarno Seppanen (jams_AT_cs.tut.fi)
Date: Fri Jul 20 2001 - 17:07:30 EEST


Paul Davis <pbd_AT_Op.Net> writes:

> i think the right way is for the user to define the current port that
> is associated with "audio output 1". sort of like port aliases. this
> seems like a nice idea. something like:
>
> int laaga_set_port_alias (const char *alias, laaga_port_t *port);
>
> this would have the semantics that:
>
> laaga_client_t *client = laaga_client_open ("me");
> laaga_port_t *portA = laaga_port_register (client, "foo", ...);
> laaga_port_t *portB = laaga_port_register (client, "bar", ...);
> laaga_set_port_alias (portA, "default audio output 1");
> laaga_port_connect ("me:bar", "default audio output 1");
>
> would connect portB to portA.
>
> what do you think? any design issues to consider? do we need "well
> known names" along the lines of tcp/ip "well know ports" ?

Looks good! One little change though,

int laaga_set_port_alias (const char* alias, laaga_port_t* port, char** out_prev_alias),

where (*out_prev_alias), if (out_prev_alias != NULL), will be put to point to
the port that was the alias before it was changed. This will allow the app to
store the previous alias when it hooks to "audio input 1", and later restore
it when quitting.

Also, if there are clients that are supposed to be used in a cascade
configuration between the "audio output" ports and the sound card, the above
function allows the clients to wire themselves that way:

// initialize alias
laaga_client_t* client1 = laaga_client_open ("me");
laaga_port_t *port1in = laaga_port_register (client1, "baz", INPUT, ...);
laaga_set_port_alias (port1in, "default audio output 1", NULL);

// now client 2 wants to get to the chain
laaga_client_t* client2 = laaga_client_open ("you");
laaga_port_t *port2in = laaga_port_register (client2, "foo", INPUT, ...);
laaga_port_t *port2out = laaga_port_register (client2, "bar", OUTPUT, ...);
char** prev_alias = NULL;
laaga_set_port_alias (port2in, "default audio output 1", prev_alias);
laaga_port_connect (port2out, prev_alias);

// now client 3 connects to the default out
laaga_client_t* client3 = laaga_client_open ("he");
laaga_port_t *port3out = laaga_port_register (client2, "foo", INPUT, ...);
laaga_port_connect ("he:foo", "default audio output 1");

One more thing: should the engine change the graph when the alias is changed?
IMHO, when the "audio output N" alias changes, the wires should follow. For
example, when the subwoofer crossover filter client (see previous mail) is
run, and it takes the audio output 1 and 2 aliases, the system should rewire
all clients previously connected to the soundcard to the inputs of the filter
client.

-- 
-Jarno


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Jul 20 2001 - 17:08:33 EEST