ENABLE_I2S_OUT no longer wokring with OS6 and Proffieboard 3.6.0 plugin

Just tried the ENABLE_I2S_OUT on a Proffieboard V2.2. We did some testing with I2S output back in sept 2020.
Back then it was running on the OS4.8 pulled from the master branch on github, and probably used the 1.0.0 or 1.1.0 version of the arduino plugin.

However, when I define ENABLE_I2S_OUT on OS6.7, and using plugin 3.6.0, after uploading the board just freezes and need to be put into boot mode (boot+reset button) in order to be able to upload a working configuration.

After some debugging, and reverting back to older version, I got the ENABLE_I2S_OUT to work running on OS5.0 and plugin 1.0.0.

It seems that some of the optimizations done in the 3.6.0 plugin and OS6.7, has introduced some error for the usage of the ENABLE_I2S_OUT.

Well, it’s either the plugin or the OS, not both.
If you have the time, try changing one thing to see what works and what doesn’t.
If not, post your config and I’ll see if I can replicate the problem.

Yes, of course. Sorry for not including my experimental results. I tried several combinations and here’s what I found;

Compiling on Win10
Arduino 1.8.13
OS5.0, using the default_proffieboard_config.h with added #define ENABLE_I2S_OUT
Tested on 2 different V2.2 boards

Plugin V1.0.0
Warnings during compilation;
warning, only when using defualt config.
c:/users/robvd/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes

I2S is working on the expected pins.

V1.1.0
warning during compilation
c:/users/robvd/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/…/lib/gcc/arm-none-eabi/4.8.3/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes

I2S is working on the expected pins.

V2.2.0
Warning during compilation
c:/users/robvd/appdata/local/arduino15/packages/proffieboard_beta/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/proffieboard_beta/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/proffieboard_beta/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/proffieboard_beta/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes
c:/users/robvd/appdata/local/arduino15/packages/proffieboard_beta/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 24 bytes

After upload system immediately hangs
I2S output LRCK and Bitclock present, IS2 datapin has no data, no sound, no serial port,
Hard reset needed to recover (boot+ reset button)

V3.1.0
same warning
Immediatley hangs
I2S output LRCK and Bitclock present, no sound, no serial port,
Hard reset needed to recover


OS6.7, default_proffieboard_config.h with added #define ENABLE_I2S_OUT
Won’t compile with V1.1.0
Error;
In file included from C:\Users\robvd\OneDrive\art-and-tech\Props\3. In progress\1. Dave\customer\4. software\ProffieOS-master_6.7\ProffieOS\ProffieOS.ino:234:0:
C:\Users\robvd\AppData\Local\Temp\arduino_build_749127\sketch\common/common.h:12:24: error: missing binary operator before token “(”
#if __has_cpp_attribute(no_unique_address)
^
V2.2.0
Compiles, LRCK goes high, no sound immediately hangs, no serial port
Hard reset needed to recover

V3.6.0
additional warning
c:/users/robvd/appdata/local/arduino15/packages/proffieboard_beta/tools/arm-none-eabi-gcc/9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe:C:\Users\robvd\AppData\Local\Arduino15\packages\proffieboard_beta\hardware\stm32l4\3.6.0\variants\STM32L433CC-ProffieboardV2/linker_scripts/STM32L433CC_FLASH.ld:224: warning: memory region `SRAM2’ not declared

Compiles, LRCK goes high, no sound immediately hangs, mo serial port
Hard reset needed to recover

It is most likely the plugin looking at these results, but because OS6.7 only compiles with v2.2.0 and higher, can not confirm that the OS6.7 is error free for I2S out.

Will definitely give this a try to see if I can figure out what’s going on.
Might take a few days though. I’m on vacation in Mexico right now. :slight_smile:

1 Like

I ran a quick check, and it definitely hangs/freezes for me too.
Interestingly, ENABLE_SPDIF_OUT does not freeze. ENABLE_SPDIF_OUT and ENABLE_I2S_OUT share a lot of code, so if one works but not the other, the amount of code the problem count be in is fairly small… I’ll take a look and see if I see something obvious, but most likely I’m going to need a debugger to solve this problem and I don’t have one with me here in Mexico.

So, it looks like it hangs here:

Now the question is why…

1 Like

Ok, this is really really weird.
I’ve read the documentation.
I’ve hunted through the code to other locations where SAI2->CR1 might be modified.
I’ve tried lots of different ways to write the code.
SAI1_Block_B just won’t turn off, which makes no sense.

And just to taunt me, we do exactly the same operation for SAI1_Block_A a few lines earlier, and that works just fine.

Time to read the documentation again.

1 Like

What is the diff with OS5.7 ? It seems to work with plugin 1.1.0 and OS5.7.
If its some optimization from the plugin that causes the problem, then is might not be the OS6.x code that is to blame?

Is it suspicious that with plugin3.6.0, we get the ‘warning: memory region `SRAM2’ not declared’ ?

The SRAM2 warning is unrelated.
I’ll poke around a bit with 5.7 and see if I can figure out the difference.

Although, another idea just occurred to me; maybe the problem is actually that it fails to start the I2S output somehow. If the I2S output is not running, then turning it off could be difficult…

It is trying to start the I2S, the LRCK goes high after upload/restart, but the bitclock and data remain low.
So indeed, getting the I2S up and running might be part of the problem

Ok, so I found a bug causing it to use the wrong output pins.
(Apparently I messed it up when I added V3 support at some point.)
I’ve checked in a fix on the master branch on github, and for some reason it seems like it doesn’t hang anymore either, although I’m not quite sure why.
(My guess is that by turning off the A block, the B block freezes because they are driving the same pins.)

Anyways, please give it a try and see if works better for you. If so, I will make a 6.8 release sometime soon which includes this bugfix.

1 Like

Here are my results, using the master branch from github;

Using a default_proffieboard_config.h with 2 blades (neopixel and Cree), with altered NUM_BUTTONS set to 1 and added #define ENABLE_I2S_OUT
(Also commented out the POV style)
After upload;

  • Sound is playing from the speaker, and I2S seems to have the correct signals on fs, sck, and sd.
  • After ignition (either via serial monitor, or using the button, the sound is playing over speaker and I2S, BUT there is NO neopixel data on BladePin (Data1/ID)

Modifying the default_proffieboard_config.h to use 2 neopixel blades (BladePin & Blade2Pin)
After upload;

  • Initial bootsound over speaker and I2S
  • Serial monitor works, but reply to every command is “Whut?”
  • Using button to ignite saber → hangs with horrible 501 Hz tone over speaker, powercycle required to recover.

Modifying the default_proffieboard_config.h to only 1 neopixel blade and 1 button (BladePin and powerButtonPin)
After upload;

  • No boot sound
  • Serial monitor reacts with “Whut” to every command
  • Using button, Neopixel data is working, blade ignites and retracts, fs and sck on I2S pins are working, but no SD in I2S
  • serial monitor shows hum01.wav not found
  • clash is working on blade, but shows clash01.wav not found.

So I2S is starting to work again, but there is more to it make it usable, I am afraid

Well that’s a lot of weird behaviors, but I need more information to figure out if these are problems on my side or some sort of user error.

Like; specifically, what serial monitor command(s) did you try?
Does neopixel data work if you disable I2S?
Does the SD card work if you disable I2S?
Can you post the exact config file you used when you got the squee-of-death?

1 Like

The details you requested:

Win10
Arduino 1.8.13
plugin 3.6.0
OS6.7 from github master branch
Proffieboard V2.2 form the original TRA run

default_proffieboard_config.h, altered blade def, volume reduced

// This is a sample configuration file.
// This saber has:
//   o Proffieboard V1 hardware.
//   o Two buttons
//   o An XP-E2 RGB LED star on LED 4-5-6
//   o A neopixel blade on LED 1-2-3 and neopixel data 1.
// If you have a saber similar to this one, make a copy and use the copy.
// This is also the default configuration file. Pre-programmed boards will
// use this configuration file.

#ifdef CONFIG_TOP
#include "proffieboard_config.h"
#define NUM_BLADES 2
#define NUM_BUTTONS 2
#define VOLUME 200
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define SAVE_STATE
#define ENABLE_ALL_EDIT_OPTIONS
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
  { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
  { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
  { "SmthGrey", "tracks/mercury.wav",
    StyleFirePtr<RED, YELLOW, 0>(),
    StyleFirePtr<RED, YELLOW, 1>(), "fire"},
  { "SmthFuzz", "tracks/uranus.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(),
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
  { "RgueCmdr", "tracks/venus.wav",
    StyleFirePtr<BLUE, CYAN, 0>(),
    StyleFirePtr<BLUE, CYAN, 1>(), "blue fire"},
  { "TthCrstl", "tracks/mars.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
  { "TeensySF", "tracks/mercury.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
  { "SmthJedi", "tracks/uranus.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
  { "SmthGrey", "tracks/venus.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
  { "SmthFuzz", "tracks/mars.wav",
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(), "gradient"},
  { "RgueCmdr", "tracks/mercury.wav",
    StyleRainbowPtr<300, 800>(),
    StyleRainbowPtr<300, 800>(), "rainbow"},
  { "TthCrstl", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"},
  { "TeensySF", "tracks/venus.wav",
    &style_pov,
    StyleNormalPtr<BLACK, BLACK, 300, 800>(), "POV"},
  { "SmthJedi", "tracks/mars.wav",
    &style_charging,
    StyleNormalPtr<BLACK, BLACK, 300, 800>(), "Battery\nLevel"}
};
BladeConfig blades[] = {
 { 0, WS2811BladePtr<128, WS2811_800kHz | WS2811_GRB, bladePin, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
     SimpleBladePtr<CreeXPE2WhiteTemplate<550>,
                    CreeXPE2BlueTemplate<240>,
                    CreeXPE2BlueTemplate<240>, NoLED, bladePowerPin4, bladePowerPin5, bladePowerPin6, -1>(),
     CONFIGARRAY(presets) },
  };
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
Button AuxButton(BUTTON_AUX, auxPin, "aux");
#endif

Everything works as expected


Num buttons 1, 2 blades, I2S

// This is a sample configuration file.
// This saber has:
//   o Proffieboard V1 hardware.
//   o Two buttons
//   o An XP-E2 RGB LED star on LED 4-5-6
//   o A neopixel blade on LED 1-2-3 and neopixel data 1.
// If you have a saber similar to this one, make a copy and use the copy.
// This is also the default configuration file. Pre-programmed boards will
// use this configuration file.

#ifdef CONFIG_TOP
#include "proffieboard_config.h"
#define NUM_BLADES 2
#define NUM_BUTTONS 1
#define VOLUME 200
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define SAVE_STATE
#define ENABLE_ALL_EDIT_OPTIONS
#define ENABLE_I2S_OUT //for I2S to PA/external amplifier
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
  { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), 
	"cyan"},
  { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), 
	"blue"},
  { "SmthGrey", "tracks/mercury.wav",
    StyleFirePtr<RED, YELLOW, 0>(),
    StyleFirePtr<RED, YELLOW, 1>(), 
	"fire"},
  { "SmthFuzz", "tracks/uranus.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(),
    StyleNormalPtr<RED, WHITE, 300, 800>(), 
	"red"},
  { "RgueCmdr", "tracks/venus.wav",
    StyleFirePtr<BLUE, CYAN, 0>(),
    StyleFirePtr<BLUE, CYAN, 1>(), 
	"blue fire"},
  { "TthCrstl", "tracks/mars.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), 
	"green"},
  { "TeensySF", "tracks/mercury.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), 
	"white"},
  { "SmthJedi", "tracks/uranus.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), 
	"yellow"},
  { "SmthGrey", "tracks/venus.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), 
	"magenta"},
  { "SmthFuzz", "tracks/mars.wav",
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(), 
	"gradient"},
  { "RgueCmdr", "tracks/mercury.wav",
    StyleRainbowPtr<300, 800>(),
    StyleRainbowPtr<300, 800>(), 
	"rainbow"},
  { "TthCrstl", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), 
	"strobe"},
//  { "TeensySF", "tracks/venus.wav",
//    &style_pov,
//    //StyleNormalPtr<BLACK, BLACK, 300, 800>(), "POV"},
  { "SmthJedi", "tracks/mars.wav",
    &style_charging,
    StyleNormalPtr<BLACK, BLACK, 300, 800>(), 
	"Battery\nLevel"}
};
BladeConfig blades[] = {
 { 0, WS2811BladePtr<128, WS2811_800kHz | WS2811_GRB, bladePin, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
     SimpleBladePtr<CreeXPE2WhiteTemplate<550>,
                    CreeXPE2BlueTemplate<240>,
                    CreeXPE2BlueTemplate<240>, NoLED, bladePowerPin4, bladePowerPin5, bladePowerPin6, -1>(),
     CONFIGARRAY(presets) },
  };
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

bootsound OK
reacts to all serial commands
Sound via speaker
I2S output OK on fs, sck, and sd
No data on BladePin, blade does not ignite
commenting out I2S → everything works fine again


Num buttons 1, num blades 1, I2S

// This is a sample configuration file.
// This saber has:
//   o Proffieboard V1 hardware.
//   o Two buttons
//   o An XP-E2 RGB LED star on LED 4-5-6
//   o A neopixel blade on LED 1-2-3 and neopixel data 1.
// If you have a saber similar to this one, make a copy and use the copy.
// This is also the default configuration file. Pre-programmed boards will
// use this configuration file.

#ifdef CONFIG_TOP
#include "proffieboard_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 1
#define VOLUME 200
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define SAVE_STATE
#define ENABLE_ALL_EDIT_OPTIONS
#define ENABLE_I2S_OUT //for I2S to PA/external amplifier
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
  { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
	"cyan"},
  { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
	"blue"},
  { "SmthGrey", "tracks/mercury.wav",
    StyleFirePtr<RED, YELLOW, 0>(),
	"fire"},
  { "SmthFuzz", "tracks/uranus.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(),
	"red"},
  { "RgueCmdr", "tracks/venus.wav",
    StyleFirePtr<BLUE, CYAN, 0>(),
	"blue fire"},
  { "TthCrstl", "tracks/mars.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
	"green"},
  { "TeensySF", "tracks/mercury.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
	"white"},
  { "SmthJedi", "tracks/uranus.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
	"yellow"},
  { "SmthGrey", "tracks/venus.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
	"magenta"},
  { "SmthFuzz", "tracks/mars.wav",
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
	"gradient"},
  { "RgueCmdr", "tracks/mercury.wav",
    StyleRainbowPtr<300, 800>(),
	"rainbow"},
  { "TthCrstl", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
	"strobe"},
//  { "TeensySF", "tracks/venus.wav",
//    &style_pov,
//    //StyleNormalPtr<BLACK, BLACK, 300, 800>(), "POV"},
  { "SmthJedi", "tracks/mars.wav",
    &style_charging,
	"Battery\nLevel"}
};
BladeConfig blades[] = {
 { 0, WS2811BladePtr<128, WS2811_800kHz | WS2811_GRB, bladePin, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
     CONFIGARRAY(presets) },
  };
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

No bootsound, very short fs and sck on I2S, no sd on I2S
Serial monitor show correct data, but does not react to any command
on → Whut?
n → Whut
dir → Whut
play /teensysf/hum01.wav → Whut? :play
help → Whut?

Using the button, blade ignites, data on BladePin, very short fs and sck in I2S, no data, no sound via speaker
Serial monitor output;
Ignition.
unit = 0 vol = 0.00, Playing hum01.wav
File hum01.wav not found.
unit = 1 vol = 0.50, Playing out04.wav
File out04.wav not found.

When clash is triggered, blade reacts, very short fs and sck in I2S, no data, no sound via speaker
Serial monitor shows clash and wav files that -should- be playing
EVENT: Clash ON millis=317987
unit = 3 vol = 0.50, Playing clsh04.wav
File clsh04.wav not found.
Amplifier off.

commenting out I2S → everything works fine again


Num buttons 1, num blades 2, neopixels, I2S

// This is a sample configuration file.
// This saber has:
//   o Proffieboard V1 hardware.
//   o Two buttons
//   o An XP-E2 RGB LED star on LED 4-5-6
//   o A neopixel blade on LED 1-2-3 and neopixel data 1.
// If you have a saber similar to this one, make a copy and use the copy.
// This is also the default configuration file. Pre-programmed boards will
// use this configuration file.

#ifdef CONFIG_TOP
#include "proffieboard_config.h"
#define NUM_BLADES 2
#define NUM_BUTTONS 1
#define VOLUME 200
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define SAVE_STATE
#define ENABLE_ALL_EDIT_OPTIONS
//#define ENABLE_I2S_OUT //for I2S to PA/external amplifier
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
  { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), 
	"cyan"},
  { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), 
	"blue"},
  { "SmthGrey", "tracks/mercury.wav",
    StyleFirePtr<RED, YELLOW, 0>(),
    StyleFirePtr<RED, YELLOW, 1>(), 
	"fire"},
  { "SmthFuzz", "tracks/uranus.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(),
    StyleNormalPtr<RED, WHITE, 300, 800>(), 
	"red"},
  { "RgueCmdr", "tracks/venus.wav",
    StyleFirePtr<BLUE, CYAN, 0>(),
    StyleFirePtr<BLUE, CYAN, 1>(), 
	"blue fire"},
  { "TthCrstl", "tracks/mars.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), 
	"green"},
  { "TeensySF", "tracks/mercury.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), 
	"white"},
  { "SmthJedi", "tracks/uranus.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), 
	"yellow"},
  { "SmthGrey", "tracks/venus.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), 
	"magenta"},
  { "SmthFuzz", "tracks/mars.wav",
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(), 
	"gradient"},
  { "RgueCmdr", "tracks/mercury.wav",
    StyleRainbowPtr<300, 800>(),
    StyleRainbowPtr<300, 800>(), 
	"rainbow"},
  { "TthCrstl", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), 
	"strobe"},
//  { "TeensySF", "tracks/venus.wav",
//    &style_pov,
//    //StyleNormalPtr<BLACK, BLACK, 300, 800>(), "POV"},
  { "SmthJedi", "tracks/mars.wav",
    &style_charging,
    StyleNormalPtr<BLACK, BLACK, 300, 800>(), 
	"Battery\nLevel"}
};
BladeConfig blades[] = {
 { 0, WS2811BladePtr<128, WS2811_800kHz | WS2811_GRB, bladePin, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
      WS2811BladePtr<128, WS2811_800kHz | WS2811_GRB, blade2Pin, PowerPINS<bladePowerPin4, bladePowerPin5> >(),
     CONFIGARRAY(presets) },
  };
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

Initial bootsound, on speaker and on I2S

Serial monitor show correct data, but does not react to any command
on → Whut?
n → Whut
dir → Whut
play /teensysf/hum01.wav → Whut? :play
help → Whut?

After ignition using the button, → 501Hz squee-of-death
commenting out I2S → everything works fine again

Note: Tried most of these config on 2 different V2.2 boards, with the same result

I found and fixed another problem.
This time it was a buffer overflow, which can cause all sorts of bad things.
Try the github master branch again and see if it works better now.

I can confirm that with this latest bugfix, everything is working as before.
Tested all the above mentioned configs, all working fine with or without I2S
Tested alle above mentioned configs with added ‘#define ENABLE_SERIAL’ for BT connection, and is also working fine in combination with I2S
Tested 2 buttons (powerButtonPin and aux2Pin, as auxPin is being used for I2S) and also works fine.
Tested “#define LINE_OUT_VOLUME dynamic_mixer.get_volume()” in dac.h and also works perfect.

Thank you so much for taking the time to fix this bug, I’m guessing not many people will ever use this function of ProffieOS.

I have to play around with the Enable pin of my external MAX98357 I2S amplifier, as I am not quite sure if ProffieOS is sending out L+R channels, or just a single L or R I2S signal.

If you have a problem with it, let me know.
ProffieOS is supposed to send out a stereo signal with duplicate data on both left and right channel.