-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for the metadata API? #40
Comments
TBH, I wasn't aware of this API and therefore it's currently not supported. Before thinking about the implementation, we should think about the potential API on the Python side. |
@mgeier I'm prototyping a way to treat separate jack clients as a group, i.e. create them, create the correct connections and present them to the user as a "stack", similar to how for example Ardour or non-mixer show plugins. To be able to do this I was looking at a way to add some metadata/tags to clients and low and behold there's a metadata API in jack :) The method's as they are available in the Jack API look good enough to me, though it would obviously be nice to have some higher lever/object oriented method's as well, for example to allow adding the metadata when creating a client. |
I don't really understand why some functions take a I also don't really understand how different data types are supposed to be handled, nor do I understand what a "subject" is supposed to be. Can you please provide some concrete (but still hypothetical) examples that could help clarify this? |
Looking at the API docs, apparently getters don't need a
If I understand it correctly the subject is the client you want to set/update the metadata for, identified by its UUID.
I don't have enough knowledge of the Jack API to answer that question. |
Yes, asking the JACK folks is a good idea. I had a quick look at a few usage examples on Github, and I only saw it used for port properties. What kind of data type would you like to use for property values? data = ffi.new('char[]', userdata) |
Any news on this? I'm considering switching jack-matchmaker from using the included "homegrown" ctypes-based JACK bindings to I would be appreciate it, if support for this was added to BTW, support for the meta data API only landed in jack2 in the last release (Dec 2018) and the |
@SpotlightKid I haven't had any need for it recently so didn't spend any time on it. |
Ok. I'm adding support for the meta data API to my Jack bindings now. If this works out, I'll try to submit a PR to |
I've now implemented support for the JACK meta data API in my ctypes-based JACK bindings. If you want to have a look: https://github.com/SpotlightKid/jack-matchmaker/blob/master/jackmatchmaker/jacklib.py#L1649 (Most of the new code concerned with meta data is below this line. A few enum (L206ff.), struct (L275ff.) and callback function type (L319f.) definitions are near the top of the file, as well as some constants for meta data property keys (L82ff.). Cffi-bindings for As to your questions from 2017:
Functions, which only retrieve properties, do not need to pass a
A subject is anything with a UUID, i.e. a client or a port, to which properties can be attached. Properties have a If Here's some info on Jack meta data, which I just recovered from the old (pre Apr 2014) jackaudio.org web site: https://github.com/jackaudio/jackaudio.github.com/wiki/JACK-Metadata-API There's also some discussion going on atm about documenting more standard meta data property key URIs in this jack2 PR: |
Thanks @SpotlightKid! It seems to me that an API based on UUIDs makes sense for the Python bindings. This way, no separate functions for ports and clients have to be provided. However, the strange thing is that port UUIDs seem to be integers, while client UUIDs are strings (see @SpotlightKid Are you using client properties at all? Another thing that's bugging me is the lifetime of the returned data. It seems wasteful to make copies of everything, but OTOH, since the data is given as null-terminated strings, I think it isn't really possible to create a buffer from it with CFFI without copying. Regarding I don't really like to involve any
I think the idea is that non-text data should be stored (for example) in base64 encoding. At least that's suggested in the docs for jack_property_t::type. |
Apparently, you need to call
Yes, I'm pretty sure about that now. Many clients set the |
I've implemented a get_client_properties function now, which uses |
@SpotlightKid I've played around a bit and I don't seem to get anything to work! All port UUIDs are 0,
AFAICT, the last release (1.9.12) was actually in Dec 2017: https://github.com/jackaudio/jack2/releases Are you using a not-yet-released version?
|
Maybe I got it wrong that meta data support on JACK2 is already in a released version. But you can test it with the current Git repo. Or with JACK1. |
I checked and, unfortunately, meta data support has been added to JACK2 only after the latest release (2017-12-13) on 2018-10-08 in jackaudio/jack2@81bddd4 (plus some later fixes). |
Thanks for the info @SpotlightKid! I've tried it with JACK1 and it works fine. I've made a first attempt of implementing this in #64, what do you think about that? |
I left some review comments on #64. |
First of all, thanks for this package! Helps a lot with neatly automating my setup :)
I was wondering if Jack's metadata API can be used through jackclient-python?
I couldn't find any references to it in the the current code, so maybe some work needs to be done to enable it? If so, what would that be? Maybe I can be of help.
The text was updated successfully, but these errors were encountered: