Strange behavior on certain functions

Status
Not open for further replies.

boxxofrobots

Well-known member
I've traced down an unexpected behavior (in this case) to enabling any control of envelope function in the module "sequencer.h." If I uncomment any of the envelope controls, the machine will intermittently lock up and play garbage tones until coming back into synch. This is behavior I have observed in the past, sometimes after just importing a sketch that has one or two small changes, suddenly it "hangs" like this until I revert to the old sketch, even though the changes are simple things like connecting a mixer input to a different output. In this case, everything was working until suddenly it wasn't. I don't have jtag and sophisticated debug tools and I truly do not know how to troubleshoot this bug.
 

Attachments

  • knobby10212020bad.zip
    25.3 KB · Views: 56
Just saw reference to this on another thread?

It seems there have been 13 users that clicked this post - but not seeing enough info or info readily enough presented there were no ideas ... and 6 views of the ZIP.

Packing the code in a zip makes one pause - having to pull, unpack, then open in editor to even see what is involved. Posting the code or a github link making it readily viewable can help with that ... and least as I view posts.

Also missing details like what Teensy, hardware and purpose can matter to folks interest level or understanding if they might help. Reading now sequencer/envelope that says AUDIO which limits the audience to a select few who see the post.

Never good when posts get no feedback ... but when that happens it is good to post results of ongoing efforts or added info that may help readers participate or be intrigued with an idea, or even pop up on a day when somebody visits.

One note might be to print out the Audio Usage notes on CPU% and MEMORY etc that might suggest if something is starving/overwhelming the system - there is an example sketch showing usage.
 
OK I nailed down the problem. In init.h the configuration of the sgtl5000

sgtl5000_1.enable();
sgtl5000_1.adcHighPassFilterDisable();
sgtl5000_1.inputSelect(myInput);
sgtl5000_1.micGain(36);
sgtl5000_1.volume(1.0);

If I comment out sgtl5000_1.adcHighPassFilterDisable(); it works fine. I tried adding that line before enabling and after, it does the same thing: sporadic lockups where it just spits out tones for a few secs then goes back to nominal. Repeats about every ten seconds.
 
Odd - no idea what that does - but the code suggests it modifies a normal feature of the sgtl5000 hardware - nothing else?
Code:
unsigned short AudioControlSGTL5000::adcHighPassFilterDisable(void)
{
	return modify(CHIP_ADCDAC_CTRL, 1, 3);
}

That might suggest it is fixing a symptom of the problem? Not knowing the hardware or actual effect - it seems there is something else triggering that - given it is a standard part of every init using that?

It is mentioned in the Audio ..\hardware\teensy\avr\libraries\Audio\gui\index.html documentation - maybe some clue there?
Completely disable the analog input filter. DC and sub-audible
low frequencies are allowed to enter the digital signal. This
openaudio.blogspot.com/2017/03/teensy-audio-board-self-noise.htmlmay
reduce noise</a> in some cases.
 
Status
Not open for further replies.
Back
Top