Skip to content
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

Recreating LV2 presets deletes sym-linked files #37

Closed
x42 opened this issue Jun 24, 2020 · 3 comments
Closed

Recreating LV2 presets deletes sym-linked files #37

x42 opened this issue Jun 24, 2020 · 3 comments

Comments

@x42
Copy link
Contributor

x42 commented Jun 24, 2020

In Ardour, saving a preset first deletes the current presets, and then re-creates it.

lilv_world_unload_resource();
lilv_state_delete();
// [..]
lilv_state_new_from_instance();
lilv_state_save();

This worked fine before c9a54e0, however recent liblilv unlinks all the external resource in lilv_state_delete(), and for some reason they are not re-created.

Since creating presets works correctly, it looks as if the files are still assumed to be mapped and hence the symlinks not re-created.

Related to lsp-plugins/lsp-plugins#119 (comment)

pauldavisthefirst pushed a commit to Ardour/ardour that referenced this issue Jun 24, 2020
Previously the GUI explicitly called remove_preset() before
saving a plugin-preset. This functionality is now moved
into the backend.

This fixes a case when a user tries to save/replace factory presets
and works around lv2/lilv#37
@sadko4u
Copy link

sadko4u commented Jun 25, 2020

Also may be related: lsp-plugins/lsp-plugins#120

pauldavisthefirst pushed a commit to Ardour/ardour that referenced this issue Jun 29, 2020
Previously the GUI explicitly called remove_preset() before
saving a plugin-preset. This functionality is now moved
into the backend.

This fixes a case when a user tries to save/replace factory presets
and works around lv2/lilv#37
@drobilla drobilla changed the title re-crating LV2 presets deletes sym-linked files Recreating LV2 presets deletes sym-linked files Jul 4, 2020
@drobilla
Copy link
Collaborator

drobilla commented Nov 30, 2020

I don't think the linked commit (which only removes fewer files) is the root of this, or that it's related to the above LSP issue.

Deleting state then saving it again like this can not work, because plugins can save files when their state is saved (which happens at lilv_state_new_from_instance() or similar, not lilv_state_save(). So, what Ardour is doing is (potentially) deleting state (real, actual files that the plugin may be using, not just links to external things), then trying to save that state again. That saved state is garbage because files are completely gone.

It may also be true that linked things get weird, but it doesn't matter. I'm not yet sure what the correct way to do this is yet, though.

@drobilla
Copy link
Collaborator

Closing this as a PEBKAC, since, as explained above, there is no way lilv could possibly make what Ardour was doing work. It only happened to work before, sometimes, if plugins didn't save files.

Please open any follow-up state bugs clearly, for example:

From a clean state, I do this and this, and get this:

/whatever/state.lv2/somefile => sometarget

and I expect this:

/whatever/state.lv2/somethingelse => someothertarget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants