ProffieOS 7.x pre-alpha discussion

Edit Mode and ProffieOS Workbench already do this, the edits are saved to .ini files on the SD. You can technically edit them hand if you were so inclined but the menu and Workbench make it much easier.

I tryed that. And 6.7 was giving me issues with the menus… I will send my config… maybe I didnt have it set up right.

Start a new thread abd we can look.

1 Like

Been dropping clash threshold back on my sabers lately. Examples: Went from OS5.9 at 3.0 to 7.25 in OS6 and now back to 3.25-3.0. *Put 3.5 in the code just until I’m 100% sure of where to settle at.

See first post. Clash detection has been updated.

:smiley: Yup, saw that and finally got around to testing it.

@profezzorn So what is all this stuff about “atomic” being added…in plain English?

short version: esp32s3 support
long version:

ESP32-S3 is a dual-core processor. There is is a lot of code in ProffieOS that is mean to run “unlocked”, meaning that code that are running in two different contexts are modifying the same variables. On a proffieboard, this usually means that some of the code is meant to run in an interrupt, and some of the code is not. In this case “volatile” is enough to tell the compiler that it can’t keep that particular variable in a register, it must write it back to memory any time it’s modified, and it must read it from memory every time in case it was modified. If you do it right, you can write code which is “async signal safe” which is the technical term for interrupts.

On a multi-core system, that’s not enough, because the value might get stuck in a local cache when you write it back to memory, and then the other core still won’t see it. In this case, we must use std::atomic or similar, which will use memory barriers or special atomic instructions to modify the data. Doing this makes the code “thread safe”, which is similar, but different from “async signal safe”. Note that not all std::atomic implementations are “async signal safe”, which means that in some cases there is literally no way to write code which is both “async signal safe” AND “thread safe”. Fortunately the std::atomic avialable on the ESP32-S3 is signal safe, so we can use it for both kinds of safety.

1 Like

I’m getting a ton of Audio Underflows, but the sound is fine.
If I weren’t looking at Serial Monitor I would think nothing’s awry.
Also strange, it stops if I spam effects. See paste below.
This is after updating to the latest master today.
Now granted, I haven’t synced in a while, so something like 36 merges were done, but I would assume that could be narrowed down to something audio related if it’s caused by an update.
Should I revert to approx Dec 2nd to check if it goes away prior to the updates I applied? I don’t remember how to go to that point in time on GitHub though.

00:22:02.506 -> Scanning sound font: aa_NoSloppy/Crushed done
00:22:02.577 -> Scanning sound font: common done
00:22:02.645 -> Scanning sound font: commonBU done
00:22:02.896 -> Activating polyphonic font.
00:22:02.930 -> Activating SmoothSwing V2
00:22:02.930 -> Accent Swings Enabled.
00:22:02.930 -> Polyphonic swings: 7
00:22:02.930 -> Monophonic swings: 0
00:22:02.930 -> Accent Slashes NOT Detected: 
00:22:02.930 -> Ignition.
00:22:02.930 -> unit = 0 vol = 0.50, Playing aa_NoSloppy/Crushed/preon/preon02.wav
00:22:02.930 -> channels: 1 rate: 44100 bits: 16
00:22:02.930 -> DISPLAY: 
00:22:02.930 -> crushed
00:22:02.930 -> unit = 1 vol = 0.50, Playing aa_NoSloppy/Crushed/font.wav
00:22:02.930 -> channels: 1 rate: 44100 bits: 16
00:22:02.930 -> Audio underflows: 3128
00:22:03.037 -> Audio underflows: 520
00:22:03.138 -> Audio underflows: 560
00:22:03.274 -> Audio underflows: 540
00:22:03.384 -> Audio underflows: 570
00:22:03.488 -> Audio underflows: 520
00:22:03.594 -> Audio underflows: 550
00:22:03.664 -> Playing aa_NoSloppy/Crushed/out/out02.wav
00:22:03.664 -> channels: 1 rate: 44100 bits: 16
00:22:03.699 -> Audio underflows: 530
00:22:03.699 -> unit = 2 vol = 0.00, Playing aa_NoSloppy/Crushed/hum.wav
00:22:03.699 -> channels: 1 rate: 44100 bits: 16
00:22:03.699 -> ****** SB_On() 153063
00:22:03.699 -> humstart set to current time: 153063
00:22:03.699 -> ********************** (has preon) - out.wav length 1969.07
00:22:03.699 -> humstart: 1164
00:22:03.699 -> unit = 3 vol = 0.00, Playing aa_NoSloppy/Crushed/swingl/swingl02.wav
00:22:03.699 -> channels: 1 rate: 44100 bits: 16
00:22:03.699 -> unit = 4 vol = 0.00, Playing aa_NoSloppy/Crushed/swingh/swingh02.wav
00:22:03.733 -> channels: 1 rate: 44100 bits: 16
00:22:03.803 -> Audio underflows: 245
00:22:03.911 -> Audio underflows: 234
00:22:04.049 -> Audio underflows: 242
00:22:04.156 -> Audio underflows: 206
00:22:04.260 -> Audio underflows: 238
00:22:04.365 -> Audio underflows: 228
00:22:04.501 -> Audio underflows: 222
00:22:04.501 -> EVENT: Stab ON millis=153866
00:22:04.501 -> unit = 5 vol = 0.50, Playing aa_NoSloppy/Crushed/bgnmelt.wav
00:22:04.538 -> channels: 1 rate: 44100 bits: 16
00:22:04.575 -> EVENT: Swing ON millis=153913
00:22:04.611 -> Audio underflows: 133
00:22:04.680 -> Audio underflows: 101
00:22:04.824 -> Audio underflows: 115
00:22:04.928 -> Audio underflows: 111
00:22:05.035 -> Audio underflows: 110
00:22:05.139 -> Audio underflows: 101
00:22:05.239 -> Audio underflows: 109
00:22:05.345 -> Audio underflows: 112
00:22:05.449 -> Audio underflows: 107
00:22:05.555 -> Audio underflows: 101
00:22:05.626 -> EVENT: Clash ON millis=154995
00:22:05.626 -> unit = 1 vol = 1.00, Playing aa_NoSloppy/Crushed/swng/swng07.wav
00:22:05.659 -> channels: 1 rate: 44100 bits: 16
00:22:05.659 -> EVENT: Swing ON millis=155010
00:22:05.659 -> Playing aa_NoSloppy/Crushed/melt.wav
00:22:05.659 -> channels: 1 rate: 44100 bits: 16
00:22:05.693 -> Audio underflows: 124
00:22:05.693 -> unit = 3 vol = 0.00, Playing aa_NoSloppy/Crushed/swingl/swingl02.wav
00:22:05.728 -> channels: 1 rate: 44100 bits: 16
00:22:05.728 -> unit = 4 vol = 0.00, Playing aa_NoSloppy/Crushed/swingh/swingh02.wav
00:22:05.728 -> channels: 1 rate: 44100 bits: 16
00:22:05.761 -> unit = 0 vol = 0.50, Playing aa_NoSloppy/Crushed/endmelt/endmelt1.wav
00:22:05.761 -> channels: 1 rate: 44100 bits: 16
00:22:05.795 -> Audio underflows: 142
00:22:05.898 -> Audio underflows: 103
00:22:06.000 -> Audio underflows: 105
00:22:06.000 -> Playing aa_NoSloppy/Crushed/swingl/swingl02.wav
00:22:06.000 -> channels: 1 rate: 44100 bits: 16
00:22:06.103 -> Audio underflows: 109
00:22:06.206 -> Audio underflows: 108
00:22:06.343 -> Audio underflows: 107
00:22:06.451 -> Audio underflows: 105
00:22:06.557 -> Audio underflows: 104
00:22:06.629 -> Audio underflows: 104
00:22:06.734 -> Audio underflows: 103
00:22:06.836 -> EVENT: Clash ON millis=156205
00:22:06.836 -> unit = 5 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh03.wav
00:22:06.869 -> channels: 1 rate: 44100 bits: 16
00:22:06.869 -> Audio underflows: 118
00:22:06.972 -> Audio underflows: 110
00:22:07.075 -> Audio underflows: 109
00:22:07.144 -> Playing aa_NoSloppy/Crushed/swingh/swingh02.wav
00:22:07.144 -> channels: 1 rate: 44100 bits: 16
00:22:07.180 -> Audio underflows: 108
00:22:07.319 -> Audio underflows: 116
00:22:07.423 -> Audio underflows: 103
00:22:07.491 -> Audio underflows: 101
00:22:07.491 -> Playing aa_NoSloppy/Crushed/hum.wav
00:22:07.491 -> channels: 1 rate: 44100 bits: 16
00:22:07.563 -> EVENT: Clash ON millis=156912
00:22:07.563 -> unit = 1 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh01.wav
00:22:07.563 -> channels: 1 rate: 44100 bits: 16
00:22:07.599 -> Audio underflows: 105
00:22:07.673 -> unit = 3 vol = 0.00, Playing aa_NoSloppy/Crushed/swingl/swingl04.wav
00:22:07.673 -> channels: 1 rate: 44100 bits: 16
00:22:07.673 -> unit = 4 vol = 0.00, Playing aa_NoSloppy/Crushed/swingh/swingh04.wav
00:22:07.707 -> channels: 1 rate: 44100 bits: 16
00:22:07.707 -> Audio underflows: 135
00:22:07.819 -> Audio underflows: 102
00:22:07.927 -> Audio underflows: 119
00:22:08.031 -> Audio underflows: 102
00:22:08.067 -> EVENT: Clash ON millis=157448
00:22:08.067 -> MAKING clsh killable.
00:22:08.067 -> unit = 5 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh04.wav
00:22:08.101 -> channels: 1 rate: 44100 bits: 16
00:22:08.135 -> EVENT: Swing ON millis=157501
00:22:08.135 -> Audio underflows: 102
00:22:08.272 -> Audio underflows: 122
00:22:08.383 -> Audio underflows: 106
00:22:08.489 -> Audio underflows: 101
00:22:08.523 -> EVENT: Clash ON millis=157905
00:22:08.523 -> unit = 0 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh05.wav
00:22:08.558 -> channels: 1 rate: 44100 bits: 16
00:22:08.592 -> Audio underflows: 112
00:22:08.694 -> Audio underflows: 103
00:22:08.802 -> Audio underflows: 123
00:22:08.907 -> Audio underflows: 104
00:22:08.980 -> EVENT: Clash ON millis=158348
00:22:08.980 -> unit = 1 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh02.wav
00:22:09.017 -> channels: 1 rate: 44100 bits: 16
00:22:09.053 -> Audio underflows: 129
00:22:09.161 -> Audio underflows: 105
00:22:09.263 -> Audio underflows: 121
00:22:09.369 -> Audio underflows: 110
00:22:09.477 -> Audio underflows: 101
00:22:09.511 -> EVENT: Clash ON millis=158893
00:22:09.511 -> unit = 0 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh05.wav
00:22:09.548 -> channels: 1 rate: 44100 bits: 16
00:22:09.584 -> Audio underflows: 113
00:22:09.653 -> unit = 3 vol = 0.00, Playing aa_NoSloppy/Crushed/swingl/swingl03.wav
00:22:09.690 -> channels: 1 rate: 44100 bits: 16
00:22:09.690 -> unit = 4 vol = 0.00, Playing aa_NoSloppy/Crushed/swingh/swingh03.wav
00:22:09.690 -> channels: 1 rate: 44100 bits: 16
00:22:09.690 -> Audio underflows: 131
00:22:09.799 -> Audio underflows: 104
00:22:09.835 -> EVENT: Clash ON millis=159206
00:22:09.835 -> unit = 5 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh04.wav
00:22:09.835 -> channels: 1 rate: 44100 bits: 16
00:22:09.945 -> Audio underflows: 130
00:22:10.047 -> Audio underflows: 110
00:22:10.150 -> Audio underflows: 110
00:22:10.184 -> EVENT: Clash ON millis=159539
00:22:10.184 -> unit = 6 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh05.wav
00:22:10.184 -> channels: 1 rate: 44100 bits: 16
00:22:10.256 -> Audio underflows: 34
00:22:10.534 -> EVENT: Clash ON millis=159885
00:22:10.534 -> unit = 0 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh04.wav
00:22:10.534 -> channels: 1 rate: 44100 bits: 16
00:22:10.677 -> unit = 4 vol = 0.00, Playing aa_NoSloppy/Crushed/swingl/swingl02.wav
00:22:10.677 -> channels: 1 rate: 44100 bits: 16
00:22:10.677 -> unit = 3 vol = 0.00, Playing aa_NoSloppy/Crushed/swingh/swingh02.wav
00:22:10.714 -> channels: 1 rate: 44100 bits: 16
00:22:10.714 -> Audio underflows: 30
00:22:10.958 -> Playing aa_NoSloppy/Crushed/swingh/swingh02.wav
00:22:10.958 -> channels: 1 rate: 44100 bits: 16
00:22:11.063 -> Battery voltage: 4.00
00:22:11.308 -> Playing aa_NoSloppy/Crushed/hum.wav
00:22:11.308 -> channels: 1 rate: 44100 bits: 16
00:22:13.068 -> Playing aa_NoSloppy/Crushed/swingl/swingl02.wav
00:22:13.068 -> channels: 1 rate: 44100 bits: 16
00:22:14.762 -> Playing aa_NoSloppy/Crushed/swingh/swingh02.wav
00:22:14.762 -> channels: 1 rate: 44100 bits: 16
00:22:15.145 -> Playing aa_NoSloppy/Crushed/hum.wav
00:22:15.145 -> channels: 1 rate: 44100 bits: 16
00:22:16.027 -> EVENT: Clash ON millis=165407
00:22:16.027 -> unit = 0 vol = 0.50, Playing aa_NoSloppy/Crushed/clsh/clsh03.wav
00:22:16.063 -> channels: 1 rate: 44100 bits: 16
00:22:16.063 -> EVENT: Swing ON millis=165434
00:22:16.135 -> unit = 3 vol = 0.00, Playing aa_NoSloppy/Crushed/swingl/swingl02.wav
00:22:16.135 -> channels: 1 rate: 44100 bits: 16
00:22:16.135 -> unit = 4 vol = 0.00, Playing aa_NoSloppy/Crushed/swingh/swingh02.wav
00:22:16.169 -> channels: 1 rate: 44100 bits: 16

You can either to to the github website, go to the history, then browse the repository at that point, then select code → zip.

Or you can use git commands, first do a git log to see the various commits:

commit f7eb6e4e8e26240c3cd16cb53f2e0c32177c4e13 (HEAD -> master, origin/master, origin/HEAD)
Author: Fredrik Hubinette <hubbe@hubbe.net>
Date:   Fri Jan 6 21:22:25 2023 -0800

    make clash/stab commands generate events

commit eaaa3775ec26d517068b835779b86711e08e07b3
Author: fdarosa2663 <fernando_darosa@hotmail.com>
Date:   Fri Jan 6 01:19:02 2023 -0500

    Add TrDoEfffect (#498)

commit c2ede7b2d6c3030404cae3d11e61ddba2490e588
Author: fdarosa2663 <fernando_darosa@hotmail.com>
Date:   Mon Jan 2 17:14:40 2023 -0500

    EFFECT_FAST_OFF Update (#495)

commit 1a6772480f6695bd53f28ee7c82ed8bd69164a3b
Author: fdarosa2663 <fernando_darosa@hotmail.com>
Date:   Mon Jan 2 17:13:53 2023 -0500

    Add FETT263_SPECIAL_ABILITIES (#496)

commit 0e372762ea47b037cbad1bb35d02e3b1d5cef776
Author: Caiwyn <subtlegrace@yahoo.com>
Date:   Mon Jan 2 16:12:12 2023 -0600

    Change Volume Cancel to Volume Reset (#493)git checkout 0e372762ea47b037cbad1bb35d02e3b1d5cef776


Then check out an older version with:

hubbe@gem:~/hack/ProffieOS$ git checkout 0e372762ea47b037cbad1bb35d02e3b1d5cef776
Note: switching to '0e372762ea47b037cbad1bb35d02e3b1d5cef776'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 0e37276 Change Volume Cancel to Volume Reset (#493)

To go back to the latest version, do git checkout master.

Well it’s something from the Dec 11 commit bunch.
Needed to apply the next few fixes (through the 16th Fix Stop) to get things to compile / stop etc… but things were ok up through Dec 5th.
Then the Audio Underflows start happening.

Oh yeah, I’ve also got SD card not found randomly now.
Lastly, I was noticing Motion Timing out at 20 seconds regardless of a 5 minute setting in the config, but that seems to have gone away (?)

The only one that is supposed to make any difference is this one:

Instant Stop() isn’t possible in a multi-threaded environment, so I changed it to stop-and-wait. Not sure why that would cause audio underflows, but I think all the other changes are supposed to be no-ops on proffieboards.

ok so I reverted to just before that commit, point in time just after commit 25e3666 (and applied required bug fixes).

  • no issues except it thinks it’s still playing sounds after retraction.

At some point I need to update the top post with all the new things that have been added.
I just added two new features:

  1. ReverseTime(X)<>, this works like BendTimePow, but makes a transition go backwards. (From B to A instead of A to B.)
  2. I’ve updated TrConcat so that you don’t need intermediate colors anymore.

This means that you can now do things like:

TrConcat<TrFade<1000>, TrFade<1000>, TrFade<1000>>

Which will result in a sawtooth-like fade:

 ^
 |   /  /  /
 |  /  /  /
 | /  /  /
 +---------------> time

Or, a boing-like effect:
TrConcat<TrFade<1000>, TrFade<ReverseTime<1000>>, TrFade<1000>>

 ^
 |   /\    /
 |  /  \  /
 | /    \/
 +---------------> time

You can also mix-and-match:

TrConcat<TrFade<10>, TrFade<10>, TrFade<10>, WHITE, TrFade<TimeBend<1000>>

Note however that the first two TrFade will not fade towards white, but towards the “final” color, so mixing-and-matching might not actually be a good idea, probably better to do it like:

TrConcat<TrConcat<TrFade<10>, TrFade<10>, TrFade<10>>, WHITE, TrFade<TimeBend<1000>>

Super cool.
Some documentation on Bend in general would be appreciated.
Sounds very cool and useful, but no idea how it is applied.

Time bending is easiest to see with TrWipe.
In most cases, the second argument of the time bending functions is the exponent.

TrWipe<1000> takes one second, and it’s linear, so wipe = t
TrWipe<TimeBendPow<1000, 65536>>, means wipe = t^2 (note, t is assumed to be between 0 and 1)
TrWipe<TimeBendPow<1000, 16384>> means wipe = t^{0.5} = \sqrt{t}
TrWipe<ReverseTime<1000>> means wipe = 1 - t
TrWipe<TimeBendPowInv<1000, 65536>> means wipe = 1 - (1 - t)^2
TrWipe<TimeBendPowInv<1000, 16384>> means wipe = 1 - (1 - t)^{0.5}

This is how we’ll do accelerated stuff, right?
Attempting to translate:
Assuming 32768 is 100%
TrWipe<BendTimePow<1000,65536>> would start a wipe at a rate that would normally take 1000ms to complete, then ramps it up to 200% speed by the time it completes? (accelerating)

And 16384 would slow down to 50% speed at time of completion?
The Inv version would do the opposite, where the 65536 example would start at 200% speed and ramp down to 100%?
Not sure how ReverseTime works.

yes

This is almost correct.
The complete transition takes exactly 1000, and it does end at 200%, which of course means it has to start at a slower speed than normal to make everything add up. The chart looks like this:

chart

correct

Close, what it does is that it flips the chart along the X and the Y axis.
That means that the BendTimePowInv with a value of 65536 will have a starting speed of 200%, which makes the chart look like this:

chart (2)

The eagle-eyed might notice that this is the mirror image of the first chart.

Reversing time means that the transition goes backwards, meaning that it starts at 1.0 and ends at 0.0.

Ok glad I was close.
So technically if time is shown left to right →
then wouldn’t BendTimePowInv be this?
BendTimePowInv_flip

The first post shows an ASCII example of this using TrFade. So it would fade FROM the color instead of TO the color. Check, makes sense.
But does it mean it would just make a TrWipe into a TrWipeIn then?
Or swap the beginning and ending RPMs of a TrColorCycle?
What about a TrDelay… no difference, right?
I know these are built to accommodate some new unseen stuff @fett263 has in store for OS7, so I assume that there’s no point is applying these to many transitions, although there’s nothing preventing one from doing so.

Also, as far as syntax goes, it doesn’t seem to like like using non X versions.

Type/value mismatch when trying to compile
TrWipe<BendTimePowInv<600,20000>>
but
TrWipeX<BendTimePowInvX<Int<600>,Int<20000>>> works.