Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 4 FirstFirst ... 2 3 4
Results 76 to 85 of 85

Thread: Teensyduino 1.54 Beta #7

  1. #76
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,740
    @Paul:
    Minor edit to LFSIntegrity to HALT on failed myfs.begin() :: github.com/PaulStoffregen/LittleFS/pull/11

  2. #77
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,886
    @Paul - Not sure if you want to pick this up soon or not... But there is a new update to: https://github.com/greiman/SdFat-beta
    It now supports UTF-8 filenames...

    Plus he update the configuration file where it checks first to see if a define is set and only use default if not set:
    https://github.com/greiman/SdFat-bet...tConfig.h#L218
    The one location in the link is one I wish he defaulted to ON...

  3. #78
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,230
    Perhaps we should review the PAD settings for I2C and use very conserative settings.
    From my experients they work well, even for higher I2C speeds and may cause less problems.


    edit: Perhaps the folks with your I2c tester board can try that?

    Or, we could add a general usable function pinMode(pin, const output, speed, strength, slewRate) something like that..
    Last edited by Frank B; 04-06-2021 at 08:40 PM.

  4. #79
    Audio ladder filter (Richard van Hoesel)

    Oooh tell me more - I can't find it in the audio design tool, presumably because it's still experimental?

  5. #80
    Junior Member
    Join Date
    Mar 2021
    Posts
    8

    AUDIO Library : Ladder filter degrades signal/noise ratio ?

    ... not sure where to post this one which relates to the audio library new ladder filter.

    I am using 16 Waveform oscillators routed to 4 ladder filters.
    When turning on the oscillators (amplitude > 0.f) a fixed frequency noise (NOT the oscillators frequency) is generated to the line output even when input/output mixers are set with a gain of 0.

    This does not happen if no ladder filter is present.

    Teensy 4.0 / Audio Rev D

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthWaveformDc     dc1;            //xy=204.33333206176758,663.0000004768372
    AudioSynthWaveformModulated waveformMod6;   //xy=596.3333320617676,543.0000004768372
    AudioSynthWaveformModulated waveformMod1;   //xy=606.3333320617676,171.00000047683716
    AudioSynthWaveformModulated waveformMod2;   //xy=606.3333320617676,251.00000047683716
    AudioSynthWaveformModulated waveformMod4;   //xy=608.3333320617676,393.00000047683716
    AudioSynthWaveformModulated waveformMod10;  //xy=612.3333320617676,875.0000004768372
    AudioSynthWaveformModulated waveformMod5;   //xy=614.3333320617676,461.00000047683716
    AudioSynthWaveformModulated waveformMod3;   //xy=615.3333320617676,318.00000047683716
    AudioSynthWaveformModulated waveformMod9;   //xy=619.3333320617676,800.0000004768372
    AudioSynthWaveformModulated waveformMod7;   //xy=620.3333320617676,639.0000004768372
    AudioSynthWaveformModulated waveformMod8;   //xy=620.3333320617676,727.0000004768372
    AudioSynthWaveformModulated waveformMod16;  //xy=622.3333320617676,945.0000004768372
    AudioSynthWaveformModulated waveformMod13;  //xy=622.3333320617676,1137.0000004768372
    AudioSynthWaveformModulated waveformMod11;  //xy=624.3333320617676,1008.0000004768372
    AudioSynthWaveformModulated waveformMod14;  //xy=629.3333320617676,1194.0000004768372
    AudioSynthWaveformModulated waveformMod15;  //xy=629.3333320617676,1245.0000004768372
    AudioSynthWaveformModulated waveformMod12;  //xy=641.3333320617676,1069.0000004768372
    AudioMixer4              mixer1;         //xy=867.3333320617676,324.00000047683716
    AudioMixer4              mixer2;         //xy=867.3333320617676,544.0000004768372
    AudioMixer4              mixer3;         //xy=869.3333320617676,944.0000004768372
    AudioMixer4              mixer4;         //xy=869.3333320617676,1147.0000004768372
    AudioFilterLadder        ladder4;        //xy=1022.5000152587891,1160.0001392364502
    AudioFilterLadder        ladder2;        //xy=1029.1666412353516,557.5000095367432
    AudioFilterLadder        ladder1;        //xy=1032.5000762939453,337.500036239624
    AudioFilterLadder        ladder3;        //xy=1048.3333282470703,958.3333225250244
    AudioMixer4              mixer5;         //xy=1533.166763305664,801.1667594909668
    AudioOutputI2S           i2s1;           //xy=1776.8333930969238,787.0000114440918
    AudioConnection          patchCord1(dc1, 0, waveformMod1, 0);
    AudioConnection          patchCord2(dc1, 0, waveformMod2, 0);
    AudioConnection          patchCord3(dc1, 0, waveformMod3, 0);
    AudioConnection          patchCord4(dc1, 0, waveformMod4, 0);
    AudioConnection          patchCord5(dc1, 0, waveformMod5, 0);
    AudioConnection          patchCord6(dc1, 0, waveformMod6, 0);
    AudioConnection          patchCord7(dc1, 0, waveformMod7, 0);
    AudioConnection          patchCord8(dc1, 0, waveformMod8, 0);
    AudioConnection          patchCord9(dc1, 0, waveformMod9, 0);
    AudioConnection          patchCord10(dc1, 0, waveformMod10, 0);
    AudioConnection          patchCord11(dc1, 0, waveformMod16, 0);
    AudioConnection          patchCord12(dc1, 0, waveformMod11, 0);
    AudioConnection          patchCord13(dc1, 0, waveformMod12, 0);
    AudioConnection          patchCord14(dc1, 0, waveformMod13, 0);
    AudioConnection          patchCord15(dc1, 0, waveformMod14, 0);
    AudioConnection          patchCord16(dc1, 0, waveformMod15, 0);
    AudioConnection          patchCord17(waveformMod6, 0, mixer2, 1);
    AudioConnection          patchCord18(waveformMod1, 0, mixer1, 0);
    AudioConnection          patchCord19(waveformMod2, 0, mixer1, 1);
    AudioConnection          patchCord20(waveformMod4, 0, mixer1, 3);
    AudioConnection          patchCord21(waveformMod10, 0, mixer3, 1);
    AudioConnection          patchCord22(waveformMod5, 0, mixer2, 0);
    AudioConnection          patchCord23(waveformMod3, 0, mixer1, 2);
    AudioConnection          patchCord24(waveformMod9, 0, mixer3, 0);
    AudioConnection          patchCord25(waveformMod7, 0, mixer2, 2);
    AudioConnection          patchCord26(waveformMod8, 0, mixer2, 3);
    AudioConnection          patchCord27(waveformMod16, 0, mixer3, 2);
    AudioConnection          patchCord28(waveformMod13, 0, mixer4, 1);
    AudioConnection          patchCord29(waveformMod11, 0, mixer3, 3);
    AudioConnection          patchCord30(waveformMod14, 0, mixer4, 2);
    AudioConnection          patchCord31(waveformMod15, 0, mixer4, 3);
    AudioConnection          patchCord32(waveformMod12, 0, mixer4, 0);
    AudioConnection          patchCord33(mixer1, 0, ladder1, 0);
    AudioConnection          patchCord34(mixer2, 0, ladder2, 0);
    AudioConnection          patchCord35(mixer3, 0, ladder3, 0);
    AudioConnection          patchCord36(mixer4, 0, ladder4, 0);
    AudioConnection          patchCord37(ladder4, 0, mixer5, 3);
    AudioConnection          patchCord38(ladder2, 0, mixer5, 1);
    AudioConnection          patchCord39(ladder1, 0, mixer5, 0);
    AudioConnection          patchCord40(ladder3, 0, mixer5, 2);
    AudioConnection          patchCord41(mixer5, 0, i2s1, 0);
    AudioConnection          patchCord42(mixer5, 0, i2s1, 1);
    AudioControlSGTL5000     sgtl5000_1;     //xy=1008.3333320617676,251.00000047683716
    // GUItool: end automatically generated code
    
    
    struct OSC {
      AudioSynthWaveformModulated *osc;
    } oscillators[16];
    
    void setup() {
     // Serial.begin(115200);
      AudioMemory(80);
    
    
      oscillators[0].osc = &waveformMod1;
      oscillators[1].osc = &waveformMod2;  
      oscillators[2].osc = &waveformMod3;
      oscillators[3].osc = &waveformMod4;
      oscillators[4].osc = &waveformMod5;
      oscillators[5].osc = &waveformMod6;
      oscillators[6].osc = &waveformMod7;
      oscillators[7].osc = &waveformMod8;
      oscillators[8].osc = &waveformMod9;
      oscillators[9].osc = &waveformMod10;
      oscillators[10].osc = &waveformMod11;
      oscillators[11].osc = &waveformMod12;
      oscillators[12].osc = &waveformMod13;
      oscillators[13].osc = &waveformMod14;
      oscillators[14].osc = &waveformMod15;
      oscillators[15].osc = &waveformMod16;
    
    
      // put your setup code here, to run once:
      mixer5.gain(0, 0);
      mixer5.gain(1, 0);
      mixer5.gain(2, 0);
      mixer5.gain(3, 0);
    
      mixer1.gain(0, 0);
      mixer1.gain(1, 0);
      mixer1.gain(2, 0);
      mixer1.gain(3, 0);
    
      mixer2.gain(0, 0);
      mixer2.gain(1, 0);
      mixer2.gain(2, 0);
      mixer2.gain(3, 0);
    
      mixer3.gain(0, 0);
      mixer3.gain(1, 0);
      mixer3.gain(2, 0);
      mixer3.gain(3, 0);
    
      mixer4.gain(0, 0);
      mixer4.gain(1, 0);
      mixer4.gain(2, 0);
      mixer4.gain(3, 0);
    
    
      for (int i = 0; i < 16 ; i++) {
        oscillators[i].osc->begin(0.5f,440.f, WAVEFORM_SINE);
      }
    
      sgtl5000_1.enable();
      sgtl5000_1.lineOutLevel(13);
      sgtl5000_1.autoVolumeDisable();
      sgtl5000_1.audioProcessorDisable();
    
    }
    
    void loop() {
      static bool toggle = false;
      delay(1000);
      toggle = (toggle)?0:1;
      float oscAmp = (toggle)?0.1:0.0;
    
      for (int i=0; i<16 ; i++) {
        oscillators[i].osc->amplitude(oscAmp);
      }
    }
    Click image for larger version. 

Name:	signal_noise_test.png 
Views:	4 
Size:	87.8 KB 
ID:	24456

  6. #81
    Senior Member
    Join Date
    Jul 2020
    Posts
    909
    If all the output mixer gains are set to zero there should be silence. If not perhaps there is a shortage of Audio buffers or CPU time?
    The ladder filter is expensive in CPU time as it has to do rate conversion.

  7. #82
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Quote Originally Posted by MarkT View Post
    If all the output mixer gains are set to zero there should be silence. If not perhaps there is a shortage of Audio buffers or CPU time?
    The ladder filter is expensive in CPU time as it has to do rate conversion.
    Just added audio processor and memory measures :
    Code:
    20:10:11.806 -> | Processor Usage = 16.66 | Memory Buffers Usage = 16 |
    20:10:12.807 -> | Processor Usage = 16.66 | Memory Buffers Usage = 1 |
    20:10:13.840 -> | Processor Usage = 16.66 | Memory Buffers Usage = 16 |
    20:10:14.810 -> | Processor Usage = 16.66 | Memory Buffers Usage = 1 |

  8. #83
    Senior Member
    Join Date
    Jul 2020
    Posts
    909
    If the digital stream is not stuttering and is all zeros, what remains can only be noise on the supply rail getting into
    the analog output. This noise will be pattern sensitive and could conceivably be only audible in some configurations
    of the audio objects.

    The audio shield in particular doesn't have separate analog and digital grounds and supplies.

  9. #84
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Quote Originally Posted by MarkT View Post
    If the digital stream is not stuttering and is all zeros, what remains can only be noise on the supply rail getting into
    the analog output. This noise will be pattern sensitive and could conceivably be only audible in some configurations
    of the audio objects.

    The audio shield in particular doesn't have separate analog and digital grounds and supplies.
    Thanks for the advice... however, this shows an important limit for its use... meanwhile I will try to investigate further (checking the audio stream, reduce the configuration). Any suggestions welcome!

    Lionel

  10. #85
    Junior Member
    Join Date
    Mar 2021
    Posts
    8
    Quote Originally Posted by MarkT View Post
    If the digital stream is not stuttering and is all zeros, what remains can only be noise on the supply rail getting into
    the analog output. This noise will be pattern sensitive and could conceivably be only audible in some configurations
    of the audio objects.

    The audio shield in particular doesn't have separate analog and digital grounds and supplies.
    Just tried with a SINGLE ladder filter with 4 osc. The issue is still alive and the same fixed frequency is still audible - though attenuated -...
    I don't know how to reliably check the contents of the digital stream...

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthWaveformModulated waveformMod1;   //xy=606.3333320617676,171.00000047683716
    AudioSynthWaveformModulated waveformMod2;   //xy=606.3333320617676,251.00000047683716
    AudioSynthWaveformModulated waveformMod4;   //xy=608.3333320617676,393.00000047683716
    AudioSynthWaveformModulated waveformMod3;   //xy=615.3333320617676,318.00000047683716
    AudioMixer4              mixer1;         //xy=867.3333320617676,324.00000047683716
    AudioFilterLadder        ladder1;        //xy=1032.5000762939453,337.500036239624
    AudioOutputI2S           i2s1;           //xy=1235.1666946411133,330.33335399627686
    AudioConnection          patchCord1(waveformMod1, 0, mixer1, 0);
    AudioConnection          patchCord2(waveformMod2, 0, mixer1, 1);
    AudioConnection          patchCord3(waveformMod4, 0, mixer1, 3);
    AudioConnection          patchCord4(waveformMod3, 0, mixer1, 2);
    AudioConnection          patchCord5(mixer1, 0, ladder1, 0);
    AudioConnection          patchCord6(ladder1, 0, i2s1, 0);
    AudioConnection          patchCord7(ladder1, 0, i2s1, 1);
    AudioControlSGTL5000     sgtl5000_1;     //xy=1008.3333320617676,251.00000047683716
    // GUItool: end automatically generated code
    
    
    struct OSC {
      AudioSynthWaveformModulated *osc;
    } oscillators[4];
    
    void setup() {
      Serial.begin(115200);
      AudioMemory(60);
    
    
      oscillators[0].osc = &waveformMod1;
      oscillators[1].osc = &waveformMod2;  
      oscillators[2].osc = &waveformMod3;
      oscillators[3].osc = &waveformMod4;
      
      mixer1.gain(0, 0);
      mixer1.gain(1, 0);
      mixer1.gain(2, 0);
      mixer1.gain(3, 0);
      
      for (int i = 0; i < 4 ; i++) {
        oscillators[i].osc->begin(0.5f,440.f, WAVEFORM_SINE);
      }
    
      sgtl5000_1.enable();
      sgtl5000_1.lineOutLevel(13);
      sgtl5000_1.autoVolumeDisable();
      sgtl5000_1.audioProcessorDisable();
    
    }
    
    void loop() {
      static bool toggle = false;
      delay(1000);
      toggle = (toggle)?0:1;
      float oscAmp = (toggle)?0.1:0.0;
    
      for (int i=0; i< 4 ; i++) {
        oscillators[i].osc->amplitude(oscAmp);
      }
      Serial.println("| Processor Usage = " + String(AudioProcessorUsageMax()) + " | Memory Buffers Usage = " + String(AudioMemoryUsageMax()) + " |");
      AudioMemoryUsageMaxReset();
      AudioProcessorUsageMaxReset();
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •