Strange (almost no) output on a Terrarium guitar PCB board

Hello, I’ll try be as detailed as possible. This is a v1.2 Rev 7 Daisy Seed 65MB.

It’s set into a Terrarium pedal PCB. I’m really wanting to get this working so any expertise on this would be greatly appreciated.

I’ve tried other example projects (built for the Terrarium), but same issue.

Checks

  • :white_check_mark: Blink example
  • :white_check_mark: Able to control switches/LEDs
  • :white_check_mark: Output Oscillator as audio
  • :white_check_mark: Glow LED on input (as a float above a threshold)

Here’s the code, I have audio files for reference but i can’t upload them here as a new user, so please find them on Google Drive (sorry!)

Please listen to these audio examples as they might give you clues

Note : The “banging on guitar” has been normalised, when recording, it was basically no signal at all

Also, note that the oscillator is also probably broken, as this is NOT an A note even though it’s 440hz

https://drive.google.com/drive/folders/1hqY_TT27TKOOEZtGciOPSVlDvUnum0ex?usp=sharing

#include "daisy_petal.h"
#include "daisysp.h"
#include "terrarium.h"
#include <cmath>

using namespace daisy;
using namespace daisysp;
using namespace terrarium;

DaisyPetal hw;

dsy_gpio led1;

Oscillator osc;

void AudioCallback(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size)
{
    hw.ProcessAllControls();
    float threshold = 0.01f;

    for(size_t i = 0; i < size; i++) {
        out[0][i] = osc.Process();

         if (std::abs(in[0][i]) > threshold) {
            dsy_gpio_write(&led1, true);
        } else {
            dsy_gpio_write(&led1, false);
        }

    }
}

int main(void)
{
    hw.Init();
    hw.SetAudioBlockSize(4); // number of samples handled per callback
    hw.SetAudioSampleRate(SaiHandle::Config::SampleRate::SAI_48KHZ);
    hw.StartAdc();
    hw.StartAudio(AudioCallback);

    led1.pin = hw.seed.GetPin(22);
    led1.mode = DSY_GPIO_MODE_OUTPUT_PP;
    led1.pull = DSY_GPIO_NOPULL;
    dsy_gpio_init(&led1);

    osc.Init(hw.AudioSampleRate());
    osc.SetWaveform(osc.WAVE_SIN);
    osc.SetAmp(1.0f);
    osc.SetFreq(440.0f); // A4 note

    while(1) {}
}

I can’t tell what you are trying to test or demonstrate. There are several Terrarium programs posted around this forum. Are you saying they don’t work correctly?

Or is it just a problem in the code you posted? First thing I’d do is comment out all the LED writes in the audio callback, to see if that changes the behavior.

I’ve built two Terrariums; both worked correctly without any tinkering.

Thanks for the reply, sorry if I was vague by perhaps this will help.

As my title states " Strange (almost no) output"

A simple

for(size_t i = 0; i < size; i++) {
out[0][i] = in[0][i];
}

Gives me the result as heard in the file banging-on-guitar.mp3, did you manage to listen to it?

Still not clear, is this a new terrarium build that has never worked?
Yes, I heard the guitar mp3. Agreed, it sounds wrong.

That’s right, first time firing it up. With a blank “output equals input” boilerplate.

Double check all solder joints, check that the op amp is correctly inserted in socket without bent pins.

Alright thanks, will have a look

Checked everything, unfortunately not the problem. Thanks though!

@Takumi_Ogata is this a problem you’ve ever run into before? Listening to the recordings above. Do you have any ideas where is might be failing?

I unfortunately haven’t seen mentions of a problem like this on the forum. The only thing I can suggest is it to make sure the Daisy itself is working by taking it out and doing the oscillator test.