[linux-audio-dev] XAP: Strings and Raw Data Controls

Steve Harris S.W.Harris at ecs.soton.ac.uk
Wed Dec 18 04:52:00 UTC 2002


On Wed, Dec 18, 2002 at 12:50:00 +0100, David Olofson wrote:
> > I'm leaning towards the "strings in raw data blocks" approach,
> > despite the little strlen() inconveniency for senders. Mostly
> > because it's one control data type less to care about, without loss
> > of real functionality.
> 
> On second thoughts, there might be something more to this: Who *owns* 
> the memory used for data to and from string/raw data Controls? How is 
> it allocated in the first place?

That is a good point.

I think the host needs to own it because only the host knows when it can
be free'd again.

That does require the host to provide malloc functions though, but IIRC
they are in there allready.

Data blocks that will be need in an RT context (eg. bulk parameter pasing)
can be allocated ahead of time.

If an instrument knows that its not going to need to block again it cabn
tell the host to free it, if its going to be sent out then the host can
track it and free it if it consumes it itsself.

This is all quite a lot of work though. The alternative would be some sort
of garbage collection (even just ref. counting would do) I guess.

- Steve



More information about the Linux-audio-dev mailing list