SynthstromAudible / DelugeFirmware

https://synthstromaudible.github.io/DelugeFirmware/
GNU General Public License v3.0
552 stars 87 forks source link

Deluge “Freezing” when doubling clip length #2151

Open lmcmulle opened 2 weeks ago

lmcmulle commented 2 weeks ago

Please describe the problem:

updated: doubling clip causes freeze - requiring power cycle - even when sequencer is not playing - various tested scenarios in comment below -

tested with jun 21 nightly -

old version.

scenario: playing an arrangement under moderate cpu load (cpu light not flashing) doubling clip length will cause the machine to freeze requiring a power cycle

consistent problem - happened twice with the jun 19 nightly build- only while playing - but not every time. i will run some tests to see if i can narrow the fault conditions

additional tests performed see comment

L

What is the expected behavior?

clip will duplicate while playing and not freeze the machine

Is there a relevant Pull request?

No response

What hardware did you reproduce it with?

OLED

What firmware did you reproduce it with?

Nightly

What is the firmware name:

jun 19th nightly

If possible provide the steps to reproduce the issue and upload additional media:

playing an arrangement with several tracks placing the machine under moderate to heavy load (no apparent voice stealing ) duplicating a clip of a synth track which is playing caused the machine to freeze

lmcmulle commented 1 week ago

issue persists with Jun-21 nightly -

ps i am darthbuddha on our discord if you want to reach out

lmcmulle commented 1 week ago

Updated: occurs when duplicating a clip when sequencer is not running.

lmcmulle commented 1 week ago

additional testing:

net it out: doubling the clip causes the freeze - somewhere between the 2nd and 4th double - regardless of instrument /track changes or other state of the machine eg playing or not-

m-m-adams commented 1 week ago

I have had this happen so it's definitely a bug. I'm not having luck deliberately reproducing while attached to a debugger so far though.

m-m-adams commented 1 week ago

Most reliable repro - make a couple tracks using large samples (like BoD), add notes, press play, then alternate doubling tracks until a freeze happens

Freeze happens in memcpy in resizeableArray::generateRepeats which appears to clobber everything

Non optimized builds do not freeze

I suspect the compiler upgrade picked up on some UB because this code appears to all be original

wrong memcpy - it's actually in copyBackgroundAroundForeground

m-m-adams commented 1 week ago

This should now pop up either D001 or D002 - if you get the freeze without the error message please post again, I don't see a root cause yet so I want to be sure this is the culprit

lmcmulle commented 6 days ago

i can induce the error -it just freezes - but no code shows - i’m not connected to a debugging environment -

happy to do that if someone points me to how to connect it up to a debugger (i am or used to be be a developer- this feels very memory fault - ish )

m-m-adams commented 5 days ago

You need a hardware debug probe for proper debugging but you can get printouts over midi using dbt (our build tooling). I think the command is dbt sysex logging but the full instructions are in contributing.md

So just to confirm you're on a new nightly build (27th or later) and not getting the error message? It's definitely memory corruption, the error catches an issue between the popup holding <> and the clip doubled message overwriting a parameter that gets used in a later memcpy

It's possible there's another situation where it occurs too

matreve commented 5 days ago

Still freezing with 6/29 nightly. The D0001 and D0002 pop up, but not always, often it goes straight to the „crazy LEDs pattern” screen right away. It’s never possible to restore normal operation, even when codes are displayed. Some kits seem to trigger the freeze sooner than others, meaning it takes only two doubling actions vs. multiple more in other kits.

m-m-adams commented 5 days ago

Oh perfect yeah - if it's getting the freeze screen without the code showing that's catching it. Showing the error is probably inconsistent since the corruption is in the display memory.

The memory is already corrupted at that point so it's not recoverable, it's just freezing before it hits the infinite loop. Hopefully one of the devs that's worked on display code can fix it

matreve commented 5 days ago

Not sure it this is relevant but there’s also a faint high pitch sound when the freeze happens. It sounds a bit like very short cycle granular synthesis. Is anyone else also experiencing it? Infinite loop makes sense. Happens with just a single kit clip. Single sequence page and very few notes.

m-m-adams commented 5 days ago

Yeah the output dac will just loop its 128 sample buffer when it stops getting new input

lmcmulle commented 4 days ago

definitely still happening with the 6/30 nightly - even a single kit/track is causing it (though sometimes you need to double more than once ) have — never - seen a code -

i have had the granular sounding freeze too - especially if the sequencer is playing

m-m-adams commented 4 days ago

Do you get the lights? Or just nothing at all

To be clear its definitely not fixed, it should just be giving the freeze lights and maybe an error message now

lmcmulle commented 1 day ago

sorry for the delay … i really appreciate your efforts - i get “D002 press select… “ and a a light pattern on the grid now (7/4 nightly)

sapphire-arches commented 23 hours ago

this shouldn't crash still.

matreve commented 22 hours ago

Still crashes exactly the same way. Why was this issue closed? Really just trying to understand the logic behind closing this issue.

m-m-adams commented 22 hours ago

Still crashes exactly the same way. Why was this issue closed? Really just trying to understand the logic behind closing this issue.

The author closed it, not any of the devs. All we've done so far is catch it on an error screen

matreve commented 20 hours ago

Still crashes exactly the same way. Why was this issue closed? Really just trying to understand the logic behind closing this issue.

The author closed it, not any of the devs. All we've done so far is catch it on an error screen

I understand it. My point is, this thread is about a common issue that many users experience, not just the author. Author needs to realize it.

m-m-adams commented 20 hours ago

People are allowed to make mistakes. Please respect our code of conduct

matreve commented 19 hours ago

People are allowed to make mistakes. Please respect our code of conduct

Oh, I did not mean to make it sound so serious. Apologies if I did. If anything, trying to learn how to navigate this github environment. I don’t contribute much other than whining. And if the Deluge crashes using this free code, it’s really not that important, really.