[Jack-Devel] Any plans for meta-data API in jack2?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Jack-Devel] Any plans for meta-data API in jack2?

Filipe Coelho
Hi everyone.
JACK1 recently added the meta-data API, which is a very nice feature
I've been waiting for a long time.

Is there any plans to add this to JACK2?
Anyone working or planning to work on this?

I realize it might be a bit of work, although there's JACK1 code for
reference.
If no one is working on it, I can try and get it done myself.

@Stéphane:
If I make a patch for this (github pull request), will it be accepted?

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Any plans for meta-data API in jack2?

Stéphane Letz

Le 15 déc. 2013 à 15:47, Filipe Coelho <[hidden email]> a écrit :

> Hi everyone.
> JACK1 recently added the meta-data API, which is a very nice feature I've been waiting for a long time.
>
> Is there any plans to add this to JACK2?
> Anyone working or planning to work on this?

Nobody I can think of…

>
> I realize it might be a bit of work, although there's JACK1 code for reference.
> If no one is working on it, I can try and get it done myself.
>
> @Stéphane:
> If I make a patch for this (github pull request), will it be accepted?

If done well sure….

Stéphane
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Any plans for meta-data API in jack2?

Christian Schoenebeck
On Sunday 15 December 2013 16:44:37 Stéphane Letz wrote:
> > I realize it might be a bit of work, although there's JACK1 code for
> > reference. If no one is working on it, I can try and get it done myself.
> >
> > @Stéphane:
> > If I make a patch for this (github pull request), will it be accepted?
>
> If done well sure….

Hi Filipe,

you could probably recycle at least a bit from JACK iOS for that. You know,
you have to pass data between clients and server and ATM the protocol of JACK2
(common/JackRequest.h) uses only messages of fixed size (fix at compile time).
In JackRequest.h you will see that each message has its own struct, and they
are simply copied as so called POD ("Plain Old Data") types i.e. with
memcpy(). However that won't work for implementing that meta data API, since
the data you pass around can be of arbitrary size, but is definitely not known
at compile time.

So you could at least have a look at how JACK iOS solves this particular
problem (it was used for the "custom data API" of JACK iOS). I.e. in
JackRequest.h you will see that there is an additional virtual method

        virtual bool IsFlatStruct() { return true; }

which is then overridden by the respective message structs to let the network
code know whether the respective message is a POD type (so it can be simply
memcpy()ied) or a message with dynamic size only known at runtime instead.

"struct JackCustomDataPublishRequest" is an example of such a message with
dynamic size (in the same header file - JackRequest.h).

Then JACKiOS has some tiny helper class "JackChannelIOBuffer"
(ios/JackChannelIOBuffer.h) which simply provides a streaming solution for
those dynamic size messages and in ios/JackMessagePortServerChannel.h and
ios/JackMessagePortClientChannel.h that helper class JackChannelIOBuffer is
used to pass those dynamic size messages between client and server.

About persistence of the meta data API: not sure if that's really necessary.
IIRC Paul made it persistent in JACK1 with a Berkeley DB implementation. You
could probably leave that out for a start and just implement a solution where
the data is kept in RAM by the server with simple STL container(s), and lost
when the server terminates. Keep it simple. ;-)

CU
Christian
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Any plans for meta-data API in jack2?

Paul Davis



On Sun, Dec 15, 2013 at 4:32 PM, Christian Schoenebeck <[hidden email]> wrote:

About persistence of the meta data API: not sure if that's really necessary.
IIRC Paul made it persistent in JACK1 with a Berkeley DB implementation.

it is not persistent. it could be,


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Any plans for meta-data API in jack2?

Filipe Coelho
In reply to this post by Christian Schoenebeck
On 12/15/2013 09:32 PM, Christian Schoenebeck wrote:

> On Sunday 15 December 2013 16:44:37 Stéphane Letz wrote:
>>> I realize it might be a bit of work, although there's JACK1 code for
>>> reference. If no one is working on it, I can try and get it done myself.
>>>
>>> @Stéphane:
>>> If I make a patch for this (github pull request), will it be accepted?
>> If done well sure….
> Hi Filipe,
>
> you could probably recycle at least a bit from JACK iOS for that.
I know, I already made that work with raw JACK2 previously (no iOS code
needed).
see
http://jack-audio.10948.n7.nabble.com/Jack-Devel-JACK-custom-data-API-td17082.html

I believe the meta-data API was quickly added after I posted that
message in fear it would be accepted in JACK2. Paul was really not a fan
of that custom-data version... ;)


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Any plans for meta-data API in jack2?

Christian Schoenebeck
On Sunday 15 December 2013 23:43:42 Filipe Coelho wrote:
> > you could probably recycle at least a bit from JACK iOS for that.
>
> I know, I already made that work with raw JACK2 previously (no iOS code
> needed).

Perfect!

> I believe the meta-data API was quickly added after I posted that
> message in fear it would be accepted in JACK2. Paul was really not a fan
> of that custom-data version... ;)

Oh reeeally, I didn't notice that.. ;-)

The custom data API stuff was a quick shot for iOS anyway. We just needed an
extension for app/client icons. Actually I just wanted to add something like
this:

    /// Defines exactly one pixel (32 bits) with alpha (translucency) channel.
    struct JackRGBA {
        char r; ///< Red component.
        char g; ///< Green component.
        char b; ///< Blue component.
        char a; ///< Alpha (translucency) component.
    } __attribute__ (packed);

    /// A picture in raw format (32 bit RGBA).
    struct JackRGBAImage {
        JackRGBA** data; ///< Accessed like foo.data[y][x];
        int w; ///< Width in pixels.
        int h; ///< Height in pixels.
    };

    /// Get icon of another JACK client, auto scaled to required size.
    JackRGBAImage* jack_get_client_icon(jack_client_t* client,
                                        const char* client_name,
                                        int preferred_icon_width);

    /// Register an icon for own JACK client.
    int jack_publish_icon(jack_client_t* client, const JackRGBAImage* icon);

    ...

But it was immediately rejected by Stephane and Paul with the words "Pictures
in the JACK API??? I think the sky is falling!". :-)

Anyhow, ... guess we soon have the meta data API in JACK2 as well. Looking
forward to your patch Filipe!

CU
Christian
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Any plans for meta-data API in jack2?

Paul Davis



On Mon, Dec 16, 2013 at 7:31 AM, Christian Schoenebeck
But it was immediately rejected by Stephane and Paul with the words "Pictures
in the JACK API??? I think the sky is falling!". :-)

my objection was to the lack of generality.

if you look at the well-known metadata keys defined in the metadata API, you will find that it already includes an image type, modelled on the way CSS handles such things.

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org