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

Thread: Teensyduino 1.21 Released

  1. #76
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Am I correct that the K20 used in the T3.1 and LC do not have an SDIO interface (such that uSD cards must use SPI)?

  2. #77
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,567
    Quote Originally Posted by mxxx View Post
    Paul -- any chance you'll implement the openNextFile() etc stuff any time soon? looking at dir_t3.cpp, it's quite beyond me.
    Done!

    https://github.com/PaulStoffregen/SD...f112f107a8994c

    Well, I think it's done, but I've only tested with the listfiles example using one small set of files+dirs on a single SD card.

    Please let me know how it works for you? Don't forget to uncomment USE_TEENSY3_OPTIMIZED_CODE...

  3. #78
    Senior Member
    Join Date
    Feb 2013
    Posts
    563
    Quote Originally Posted by PaulStoffregen View Post
    Done!

    https://github.com/PaulStoffregen/SD...f112f107a8994c

    Well, I think it's done, but I've only tested with the listfiles example using one small set of files+dirs on a single SD card.

    Please let me know how it works for you? Don't forget to uncomment USE_TEENSY3_OPTIMIZED_CODE...
    oh, neat, thank you! it compiles fine; no access to hardware at the moment but i'll report asap.

  4. #79
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,567
    I still haven't implemented the path traversal stuff. Will do that soon.

    You can open files in subdirs using openNextFile(). But normal SD.open() still only works for the root dir, because it's not parsing pathnames yet.

  5. #80
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,567
    I've added pathname traversal, so you can now (in theory) use SD.open("/subdir/subdir/filename.txt");

    https://github.com/PaulStoffregen/SD...a94503c85de375

  6. #81
    Senior Member
    Join Date
    Feb 2013
    Posts
    563
    Quote Originally Posted by PaulStoffregen View Post
    Please let me know how it works for you? Don't forget to uncomment USE_TEENSY3_OPTIMIZED_CODE...
    ok, I only got back yesterday, so couldn't try until today -- it almost works for me. i've been testing with play_sd_wav, in which case I get pops every now and again.

    i've also edited sd_play_wav:: play() along the lines suggested (added AudioStopUsingSPI()); kinetis.h by now already seems to come with "volatile("CPSID i":::"memory");" (I'm on 1.6.4 / teensy 1.23-beta). if i comment out USE_TEENSY3_OPTIMIZED_CODE again / go back to regular SD, the pops disappear, so I assume the file is ok. not sure what might be the problem. here's my test code (i'm triggering with an external pulse on pin 0; note the SGTL5000 init code snippet is missing, as I'm using a different codec).


    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SD.h>
    #include <SPI.h>
    
    
    #define CS_MEM 6
    #define CS_SD  10
    #define CLK_L 0 // left clock input
    
    volatile uint8_t LCLK; // left channel clock
    
    void CLK_ISR_L()
    { 
      LCLK = true; 
    }
    
    AudioPlaySdWav     wavL;
    //AudioPlaySdWav     wavR;
    AudioMixer4        mix;
    AudioOutputI2S     codec;
    
    // Create Audio connections between the components
    //
    AudioConnection c1(wavL, 0, mix, 0);
    AudioConnection c2(wavL, 0, mix, 1);
    AudioConnection c3(mix, 0, codec, 0);
    AudioConnection c4(mix, 0, codec, 1);
    
    // using pcm5102a
    // AudioControlSGTL5000 audioShield; 
    
    
    void setup() {
     
      AudioMemory(15);
      pinMode(CS_SD, OUTPUT);
      pinMode(CS_MEM, OUTPUT);
      digitalWrite(CS_MEM, HIGH);
    
      pinMode(CLK_L, INPUT_PULLUP);
      
      attachInterrupt(CLK_L, CLK_ISR_L, FALLING);
    
      SPI.setMOSI(7);
      SPI.setSCK(14);
      if (SD.begin(CS_SD)) Serial.println("ok");
    
    }
    
    void loop() {
    
     while(1) {
       
         if (LCLK) { 
             LCLK = false;
             wavL.play("ATARI.WAV");
      }
     }
    }
    edit. similar behaviour with play_sd_raw. in this case no pops, but the audio file sounds chopped up, as if playing from somewhere in the middle of the file and then wrapping around; it sounds perfectly normal when I revert to regular SD. as it seems to be working for others, I'm beginning to wonder whether I haven't missed something ? -- kinetis.h, play_sd_raw:: play() -- anything else that might need editing?
    Last edited by mxxx; 06-10-2015 at 07:13 PM.

  7. #82
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,567
    Can you send me the files you're playing, like ATARI.WAV? If so, I'll put this on my list of things to test.

  8. #83
    Senior Member
    Join Date
    Feb 2013
    Posts
    563
    Quote Originally Posted by PaulStoffregen View Post
    Can you send me the files you're playing, like ATARI.WAV? If so, I'll put this on my list of things to test.
    ok, where do I send it to? i didn't want to post it because of IP/copyright ... it's a/the official atari "corporate tag" from the early 1980s (suzanne ciani, actually); maddening, but i found voice samples are good for testing.

Posting Permissions

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