0
mirror of https://github.com/torvalds/GuitarPedal.git synced 2026-07-15 00:44:11 +00:00
Files
Linus Torvalds 49db9df771 Only call the ->init() function when the effect is enabled
I was debugging the slight crackling noise when turning the effect
selector knob wildly around, and realized that it has nothing to do with
the display power changes: it appears that it was just because I had
been testing with a build that was set for 96kHz audio samples, and
calling the init function was simply sometimes enough to overload the
poor CPU even with just a couple of effects enabled.

And turning the effects knob with all the subtlety of an angry
stone-mason on crack - as I was doing for testing - just ended up doing
the more expensive init code for effects that weren't even enabled as I
was scrolling through them all.

So I'll leave the extra caps in the design because they won't hurt, but
the real fix is to (a) not do that 96kHz audio because we really just
don't have the CPU resources for it and (b) be a tiny bit smarter about
calling the effect init function.

Side note: the 96kHz sample rate does work, but right now both the USB
audio interface code and the FFT for the tuner are hardcoded for 48kHZ.

Both of those should be easy to fix: the FFT is easy enough to just
change to do a 8x downsampling, and the USB audio could either
downsample the signal or it would just expose a 96kHz end result.

The "not really enough CPU resources" could be fixed too, by just having
a "High Res" mode that limits the effect selection.  Not that it makes
much sense for any of the current effects to do a higher sampling rate,
but I was looking at some of the more extreme fuzz effects, and it looks
like emulating them might actually benefit from maybe doing it at 96kHz
because otherwise you get nasty digital effects.  Maybe.

Anyway, false alarm on the sound quality just from an experiment I had
forgotten about.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-06-25 17:52:55 -07:00
..
2026-05-13 14:32:42 -07:00
2026-06-12 13:40:39 -07:00
2026-05-13 14:32:42 -07:00
2026-06-10 13:52:01 -07:00
2026-06-10 20:47:30 -07:00