hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.03k stars 172 forks source link

Duplicating pattern yields "unknown" as name in Song Editor #1827

Closed PatDyn closed 1 year ago

PatDyn commented 1 year ago

Hydrogen version * : 1.2.1-1, installed via pamac Operating system + version : Manjaro and Linux Mint 21 Vanessa Audio driver + version : Jack, 1.9.22


How to reproduce:

Edit: Confirmed also on Linux Mint 21

theGreatWhiteShark commented 1 year ago

Hmm.. That's strange. I can't reproduce it.

Those anything show up in the log when opening Hydrogen from the command line using hydrogen -VDebug? Does this happen with all pattern names you enter or only with a specific set (maybe some non-ASCII UTF-8 characters)?

Is by any chance your hard disk completely full or your /tmp folder not writable by your user account? From taking a quick look at the code it seems that there might be issues in case Hydrogen fails to write new pattern to the temporary folder.

PatDyn commented 1 year ago

My HDD is not full and the /tmp folder is writeable. :)

PatDyn commented 1 year ago

But i found some info in the logs:

(W) XMLDoc::read XML document [/tmp/hydrogen/HouseSet01.EddSly] is not valid with respect to schema [/usr/local/share/hydrogen/data/xsd/drumkit_pattern.xsd], loading may fail
(W) Pattern::loadDoc Pattern [/tmp/hydrogen/HouseSet01.EddSly] does not validate the current pattern schema. Loading might fail.
(W) Legacy::load_drumkit_pattern this code should not be used anymore, it belongs to 0.9.6
(W) XMLNode::read_child_node XML node pattern->pattern_name should exists.
(W) XMLNode::read_child_node XML node pattern->pattern_name should exists.
(W) XMLNode::read_string Using default value unknown for pattern_name

Edit: I could reproduce this also in Linux Mint 21 on another machine where i built from source (build date is 2023-08-07).

theGreatWhiteShark commented 1 year ago

But i found some info in the logs:

Nice. Could you upload one of the bricked patterns from /tmp?

theGreatWhiteShark commented 1 year ago

I could reproduce this also in Linux Mint 21 on another machine where i built from source (build date is 2023-08-07).

I tried on both Devuan Chimaera and a clean Fedora 38 and couldn't reproduce it yet.

PatDyn commented 1 year ago

But i found some info in the logs:

Nice. Could you upload one of the bricked patterns from /tmp?

Here you go :) TechnoSet01.mfSUIP.tar.gz

Funny thing i noticed: The name shows up correctly in the file.

AVLinux commented 1 year ago

This also happens to me on AV Linux 21.3 (based on Debian 11 Bullseye). It only happens sometimes though, as you've noted no guaranteed recipe..

theGreatWhiteShark commented 1 year ago

Here you go :) TechnoSet01.mfSUIP.tar.gz

That's really weird. This pattern looks just fine, validates the corresponding XSD file, and I'm even able to open it.

Could you append .h2pattern to one of the patterns corresponding to a failed duplication and try to open them using Project > Open Pattern?

This also happens to me on AV Linux 21.3 (based on Debian 11 Bullseye). It only happens sometimes though, as you've noted no guaranteed recipe..

Okay. I'll try again on one of those systems (just duplicated the pattern you posted 40 times without an issue).

theGreatWhiteShark commented 1 year ago

I'm afraid I need some more details in order to reproduce this issue.

I run several live Linux OSs and installed AVLinux, compiled the 1.2.1 version of Hydrogen and duplicated various patterns. But I didn't encounter the problem at all.

Do you experience it on fresh installs using new songs too? Does it maybe occur after using Hydrogen quite a lot or just for large song in terms of patterns? What's the frequency of failing duplication?

AVLinux commented 1 year ago

Hi,

This has happened to me working on a new song a couple of weeks ago, I don't have time for beat making this week but next time I do I will screencapture the session and see if this issue pops up while I'm working and perhaps that will give a clue if it's a sequence of operations thing..

PatDyn commented 1 year ago

Could you append .h2pattern to one of the patterns corresponding to a failed duplication and try to open them using Project > Open Pattern?

Alright. I did just that. Attached .h2pattern to the filename. Opened it via Open Pattern. The result is the same - the pattern name is "unknown".

PatDyn commented 1 year ago

Do you experience it on fresh installs using new songs too? Does it maybe occur after using Hydrogen quite a lot or just for large song in terms of patterns? What's the frequency of failing duplication?

I tried with a fresh song, duplicated the pattern and did not experience this problem. Using the project i experienced this in, duplicating always results in "unknown" as a pattern name. That project has 23 patterns in total. I attached the project for further analysis. PercussionSet-02-r.h2song.zip

theGreatWhiteShark commented 1 year ago

That project has 23 patterns in total. I attached the project for further analysis. PercussionSet-02-r.h2song.zip

Thanks a lot! This one did it.

I already located the bug: the pattern has "too much" notes. Whenever there are more than 100 notes in a pattern Qt fails to validate against our XSD schema. But just Qt as the XSD defines a max occurrence of 1000 notes and the pattern is valid.

I'll fix it

theGreatWhiteShark commented 1 year ago

@PatDyn could you compile and install the changes in #1842 and check whether this fixes things at your end?

Alternatively, you could just change line 74 in /usr[/local]/share/hydrogen/data/xsd/drumkit_pattern.xsd from

<xsd:element ref="h2:note" minOccurs="0" maxOccurs="1000"/>

into

<xsd:element ref="h2:note" minOccurs="0" maxOccurs="unbounded"/>
AVLinux commented 1 year ago

Ahhh that makes sense! I think in hindsight it was in pretty busy patterns that this issue popped up.

theGreatWhiteShark commented 1 year ago

Closed with #1842